parent
8080c40d15
commit
8b093c1634
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="jnpf.mapper.AccountingMapper">
|
||||
|
||||
|
||||
|
||||
</mapper>
|
@ -0,0 +1,104 @@
|
||||
<template>
|
||||
<el-dialog title="详情"
|
||||
:close-on-click-modal="false" append-to-body
|
||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||
width="600px">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" >
|
||||
<template v-if="!loading">
|
||||
<el-col :span="24" >
|
||||
<el-form-item label="会计年度 2023 "
|
||||
prop="fiscalYear" >
|
||||
<p>{{dataForm.fiscalYear}}</p>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" >
|
||||
<el-form-item label="会计区间 05"
|
||||
prop="intervals" >
|
||||
<p>{{dataForm.intervals}}</p>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" >
|
||||
<el-form-item label="开始日期 2023-05-01"
|
||||
prop="startDate" >
|
||||
<p>{{jnpf.dateFormat(dataForm.startDate)}}</p>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" >
|
||||
<el-form-item label="结束日期 2023-05-30"
|
||||
prop="endDate" >
|
||||
<p>{{jnpf.dateFormat(dataForm.endDate)}}</p>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" >
|
||||
<el-form-item label="0未关账"
|
||||
prop="status" >
|
||||
<p>{{ dataForm.status | dynamicText(statusOptions) }} </p>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false"> 取 消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import PrintBrowse from '@/components/PrintBrowse'
|
||||
import jnpf from '@/utils/jnpf'
|
||||
export default {
|
||||
components: {PrintBrowse},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
loading: false,
|
||||
printBrowseVisible: false,
|
||||
printId: '',
|
||||
dataForm: {
|
||||
id :'',
|
||||
fiscalYear : '',
|
||||
intervals : '',
|
||||
startDate : '',
|
||||
endDate : '',
|
||||
status : "",
|
||||
},
|
||||
statusOptions:[{"fullName":" 未关账","id":" 0"},{"fullName":"已关账","id":"1"},{"fullName":"未核算","id":"2"},{"fullName":"已核算","id":"3"},{"fullName":"已核算","id":"4"},{"fullName":"已结账","id":"5"}],
|
||||
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
dataInfo(dataAll){
|
||||
let _dataAll =dataAll
|
||||
this.dataForm = _dataAll
|
||||
},
|
||||
|
||||
init(id) {
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
if(this.dataForm.id){
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/example/Accounting/detail/'+this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
@ -0,0 +1,68 @@
|
||||
<template>
|
||||
<el-dialog title="导出数据" :close-on-click-modal="false" :visible.sync="visible"
|
||||
class="JNPF-dialog JNPF-dialog_center" lock-scroll width="600px">
|
||||
<el-form label-position="top" label-width="80px">
|
||||
<el-form-item label="数据选择">
|
||||
<el-radio-group v-model="type">
|
||||
<el-radio :label="0">当前页面数据</el-radio>
|
||||
<el-radio :label="1">全部页面数据</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="导出字段">
|
||||
<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll"
|
||||
@change="handleCheckAllChange">全选</el-checkbox>
|
||||
<el-checkbox-group v-model="columns" @change="handleCheckedChange">
|
||||
<el-checkbox v-for="item in columnList" :label="item.prop" :key="item.prop">
|
||||
{{item.label}}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible=false">取 消</el-button>
|
||||
<el-button type="primary" @click="downLoad">导 出</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
btnLoading: false,
|
||||
type: 0,
|
||||
columns: [],
|
||||
checkAll: true,
|
||||
isIndeterminate: false,
|
||||
columnList: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init(columnList) {
|
||||
this.visible = true
|
||||
this.checkAll = true
|
||||
this.isIndeterminate = false
|
||||
this.columnList = columnList
|
||||
this.columns = columnList.map(o => o.prop)
|
||||
},
|
||||
handleCheckAllChange(val) {
|
||||
this.columns = val ? this.columnList.map(o => o.prop) : [];
|
||||
this.isIndeterminate = false;
|
||||
},
|
||||
handleCheckedChange(value) {
|
||||
let checkedCount = value.length;
|
||||
this.checkAll = checkedCount === this.columnList.length;
|
||||
this.isIndeterminate = checkedCount > 0 && checkedCount < this.columnList.length;
|
||||
},
|
||||
downLoad() {
|
||||
this.$emit('download', { dataType: this.type, selectKey: this.columns.join(',') })
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
>>> .el-dialog__body {
|
||||
padding: 20px !important;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,253 @@
|
||||
<template>
|
||||
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
|
||||
:close-on-click-modal="false" append-to-body
|
||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||
width="800px">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right">
|
||||
<template v-if="!loading">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="会计年度"
|
||||
prop="fiscalYear">
|
||||
<el-input v-model="dataForm.fiscalYear" @change="grossChange" :precision="6" :min="0"
|
||||
placeholder="请输入会计年度" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="24">-->
|
||||
<!-- <el-form-item label="会计区间"-->
|
||||
<!-- prop="intervals">-->
|
||||
<!-- <el-input v-model="dataForm.intervals"-->
|
||||
<!-- placeholder="请输入" clearable :style='{"width":"100%"}'>-->
|
||||
|
||||
<!-- </el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="会计区间"
|
||||
prop="intervals">
|
||||
<el-select v-model="dataForm.intervals" @change="grossChange" :precision="6" :min="0"
|
||||
placeholder="请选择会计区间" clearable :style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in intervalsOptions" :key="index" :label="item.fullName" :value="item.id"
|
||||
:disabled="item.disabled"></el-option>
|
||||
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="开始日期"
|
||||
prop="startDate">
|
||||
<el-date-picker v-model="dataForm.startDate"
|
||||
placeholder="请选择" readonly clearable :style='{"width":"100%"}' type="date"
|
||||
format="yyyy-MM-dd" value-format="timestamp">
|
||||
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="结束日期"
|
||||
prop="endDate">
|
||||
<el-date-picker v-model="dataForm.endDate"
|
||||
placeholder="请选择" readonly clearable :style='{"width":"100%"}' type="date"
|
||||
format="yyyy-MM-dd" value-format="timestamp">
|
||||
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="24">-->
|
||||
<!-- <el-form-item label="0未关账"-->
|
||||
<!-- prop="status">-->
|
||||
<!-- <el-select v-model="dataForm.status"-->
|
||||
<!-- placeholder="请选择" clearable :style='{"width":"100%"}'>-->
|
||||
<!-- <el-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName" :value="item.id"-->
|
||||
<!-- :disabled="item.disabled"></el-option>-->
|
||||
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
</template>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false"> 取 消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> 确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
|
||||
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
|
||||
var dayjs = require('dayjs')
|
||||
export default {
|
||||
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
loading: false,
|
||||
isDetail: false,
|
||||
dataForm: {
|
||||
fiscalYear: '',
|
||||
intervals: '',
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
status: "",
|
||||
},
|
||||
rules:
|
||||
{
|
||||
fiscalYear: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入会计年度',
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
intervals: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入会计期间',
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
},
|
||||
intervalsOptions: [
|
||||
{"fullName": "01", "id": "01"},
|
||||
{"fullName": "02", "id": "02"},
|
||||
{"fullName": "03", "id": "03"},
|
||||
{"fullName": "04", "id": "04"},
|
||||
{"fullName": "05", "id": "05"},
|
||||
{"fullName": "06", "id": "06"},
|
||||
{"fullName": "07", "id": "07"},
|
||||
{"fullName": "08", "id": "08"},
|
||||
{"fullName": "09", "id": "09"},
|
||||
{"fullName": "10", "id": "10"},
|
||||
{"fullName": "11", "id": "11"},
|
||||
{"fullName": "12", "id": "12"}
|
||||
],
|
||||
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
grossChange(e, f) {
|
||||
var e = this.dataForm.fiscalYear +"-"+ this.dataForm.intervals + "-01" + " 22:15:01"
|
||||
// console.log(this.dataForm.fiscalYear + "-" + this.dataForm.intervals + "-01" +" 22:15:01" )
|
||||
// var C = dayjs(b).add(1, dataForm.intervals).subtract(1, 'year').year(dataForm.fiscalYear).toString()
|
||||
this.dataForm.startDate=dayjs(e).startOf('month')
|
||||
this.dataForm.endDate= dayjs(e).endOf('month')
|
||||
},
|
||||
|
||||
clearData(data) {
|
||||
for (let key in data) {
|
||||
if (data[key] instanceof Array) {
|
||||
data[key] = [];
|
||||
} else if (data[key] instanceof Object) {
|
||||
this.clearData(data[key]);
|
||||
} else {
|
||||
data[key] = "";
|
||||
}
|
||||
}
|
||||
},
|
||||
init(id, isDetail) {
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.isDetail = isDetail || false;
|
||||
this.$nextTick(() => {
|
||||
this.$refs['elForm'].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/example/Accounting/' + this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
});
|
||||
} else {
|
||||
this.clearData(this.dataForm)
|
||||
}
|
||||
});
|
||||
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
var fiscalYear1 = parseInt(this.dataForm.fiscalYear);
|
||||
let date = new Date();
|
||||
let year = date.getFullYear();
|
||||
let year1 =parseInt(year)+1;
|
||||
if (fiscalYear1 <2000 || fiscalYear1 > year1 || fiscalYear1 == year1) {
|
||||
this.$message({
|
||||
message: '会计年度不能小于2000年和大于当前年份',
|
||||
type: 'warning',
|
||||
duration: 2500
|
||||
})
|
||||
return
|
||||
}else {
|
||||
this.$refs['elForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
request() {
|
||||
var _data = this.dataList()
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/example/Accounting',
|
||||
method: 'post',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
} else {
|
||||
request({
|
||||
url: '/api/example/Accounting/' + this.dataForm.id,
|
||||
method: 'PUT',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
dataList() {
|
||||
var _data = JSON.parse(JSON.stringify(this.dataForm));
|
||||
return _data;
|
||||
},
|
||||
dataInfo(dataAll) {
|
||||
let _dataAll = dataAll
|
||||
this.dataForm = _dataAll
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
@ -0,0 +1,349 @@
|
||||
<template>
|
||||
<div class="JNPF-common-layout">
|
||||
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="会计年度">
|
||||
<el-input v-model="query.fiscalYear" placeholder="请输入会计年度" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="会计区间">
|
||||
<el-input v-model="query.intervals" placeholder="请输入会计区间" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="未关账">
|
||||
<el-select v-model="query.status" placeholder="请选择状态"
|
||||
clearable>
|
||||
<el-option v-for="(item, index) in statusOptions" :key="index"
|
||||
:label="item.fullName" :value="item.id"
|
||||
:disabled="item.disabled"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" v-has="'btn_add'" @click="addOrUpdateHandle()">新增
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="exportData()" v-has="'btn_download'">导出
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" v-has="'btn_batchRemove'">批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="reset()"/>
|
||||
</el-tooltip>
|
||||
<screenfull isContainer/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c
|
||||
@selection-change="handleSelectionChange"
|
||||
border
|
||||
>
|
||||
<el-table-column prop="fiscalYear" label="会计年度" width="100px" align="center"
|
||||
/>
|
||||
<el-table-column prop="intervals" label="会计区间" width="0" align="center"
|
||||
/>
|
||||
<el-table-column prop="startDate" label="开始日期" width="0" align="center"
|
||||
/>
|
||||
<el-table-column prop="endDate" label="结束日期" width="0" align="center"
|
||||
/>
|
||||
<!-- <el-table-column label="未关账" width="0" prop="status" algin="center">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- {{ scope.row.status | dynamicText(statusOptions) }}-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
|
||||
<el-table-column label="状态" width="0" prop="status" align="center">
|
||||
|
||||
<template slot-scope="scope">
|
||||
<el-tag type="success" v-if="scope.row.status == 0"
|
||||
>未关账</el-tag
|
||||
>
|
||||
<el-tag type="info" v-else-if="scope.row.status == 1"
|
||||
>已关账</el-tag
|
||||
>
|
||||
<el-tag type="warning" v-else-if="scope.row.status == 2"
|
||||
>未核算</el-tag
|
||||
>
|
||||
<el-tag type="danger" v-else-if="scope.row.status == 3">已核算</el-tag>
|
||||
<el-tag type="primary" v-else-if="scope.row.status == 4">未结账</el-tag>
|
||||
<el-tag type="" v-else-if="scope.row.status == 5">已结账</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" fixed="right"
|
||||
width="150"
|
||||
align="center">
|
||||
<template slot-scope="scope">
|
||||
<!-- <el-button type="text"-->
|
||||
<!-- @click="addOrUpdateHandle(scope.row.id)" v-has="'btn_edit'">编辑-->
|
||||
<!-- </el-button>-->
|
||||
<el-button type="text"
|
||||
@click="addends(scope.row.id)" v-has="'btn_ends'">关账
|
||||
</el-button>
|
||||
<el-button type="text"
|
||||
@click="addOstarts(scope.row.id)" v-has="'btn_starts'">开启
|
||||
</el-button>
|
||||
<el-button type="text" class="JNPF-table-delBtn" v-has="'btn_remove'" @click="handleDel(scope.row.id)">删除
|
||||
</el-button>
|
||||
<!-- <el-button type="text" v-has="'btn_detail'"-->
|
||||
<!-- @click="goDetail(scope.row.id)">详情-->
|
||||
<!-- </el-button>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
|
||||
@pagination="initData"/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
|
||||
import JNPFForm from './Form'
|
||||
import ExportBox from './ExportBox'
|
||||
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
|
||||
import Detail from './Detail'
|
||||
|
||||
export default {
|
||||
components: {JNPFForm, ExportBox, Detail},
|
||||
data() {
|
||||
return {
|
||||
detailVisible: false,
|
||||
query: {
|
||||
fiscalYear: undefined,
|
||||
intervals: undefined,
|
||||
status: undefined,
|
||||
},
|
||||
treeProps: {
|
||||
children: 'children',
|
||||
label: 'fullName',
|
||||
value: 'id'
|
||||
},
|
||||
list: [],
|
||||
listLoading: true,
|
||||
multipleSelection: [], total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "creatorTime",
|
||||
},
|
||||
formVisible: false,
|
||||
exportBoxVisible: false,
|
||||
columnList: [
|
||||
{prop: 'fiscalYear', label: '会计年度'},
|
||||
{prop: 'intervals', label: '会计区间'},
|
||||
{prop: 'startDate', label: '开始日期'},
|
||||
{prop: 'endDate', label: '结束日期'},
|
||||
{prop: 'status', label: '未关账'},
|
||||
],
|
||||
statusOptions: [
|
||||
{"fullName": "未关账", "id": "0"},
|
||||
{"fullName": "已关账", "id": "1"},
|
||||
{"fullName": "未核算", "id": "2"},
|
||||
{"fullName": "已核算", "id": "3"},
|
||||
{"fullName": "已核算", "id": "4"},
|
||||
{"fullName": "已结账", "id": "5"}],
|
||||
statusProps: {"label": "fullName", "value": "id"},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
},
|
||||
methods: {
|
||||
goDetail(id) {
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id)
|
||||
})
|
||||
},
|
||||
sortChange({column, prop, order}) {
|
||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||
this.listQuery.sidx = !order ? '' : prop
|
||||
this.initData()
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true;
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId: this.menuId
|
||||
};
|
||||
request({
|
||||
url: `/api/example/Accounting/getList`,
|
||||
method: 'post',
|
||||
data: _query
|
||||
}).then(res => {
|
||||
var _list = [];
|
||||
for (let i = 0; i < res.data.list.length; i++) {
|
||||
let _data = res.data.list[i];
|
||||
_list.push(_data)
|
||||
}
|
||||
this.list = _list
|
||||
this.total = res.data.pagination.total
|
||||
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/example/Accounting/${id}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
addends(id) {
|
||||
this.$confirm('此操作将关账, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/example/Accounting/closestatus/${id}`,
|
||||
method: 'Post'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
addOstarts(id) {
|
||||
this.$confirm('此操作将开启, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/example/Accounting/openstatus/${id}`,
|
||||
method: 'Post'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
const res = val.map(item => item.id)
|
||||
this.multipleSelection = res
|
||||
},
|
||||
handleBatchRemoveDel() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500,
|
||||
})
|
||||
return
|
||||
}
|
||||
const ids = this.multipleSelection.join()
|
||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/example/Accounting/batchRemove/${ids}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
addOrUpdateHandle(id, isDetail) {
|
||||
this.formVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id, isDetail)
|
||||
})
|
||||
},
|
||||
exportData() {
|
||||
this.exportBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(this.columnList)
|
||||
})
|
||||
},
|
||||
download(data) {
|
||||
let query = {...data, ...this.listQuery, ...this.query, menuId: this.menuId}
|
||||
request({
|
||||
url: `/api/example/Accounting/Actions/Export`,
|
||||
method: 'GET',
|
||||
data: query
|
||||
}).then(res => {
|
||||
if (!res.data.url) return
|
||||
this.jnpf.downloadFile(res.data.url)
|
||||
this.$refs.ExportBox.visible = false
|
||||
this.exportBoxVisible = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.listQuery = {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "creatorTime",
|
||||
}
|
||||
this.initData()
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false
|
||||
if (isrRefresh) this.reset()
|
||||
},
|
||||
reset() {
|
||||
for (let key in this.query) {
|
||||
this.query[key] = undefined
|
||||
}
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
Loading…
Reference in new issue