Commit c6498645 authored by jianglingfeng's avatar jianglingfeng

发票

parent b5da42f0
...@@ -25,6 +25,7 @@ import javax.servlet.http.HttpServletResponse; ...@@ -25,6 +25,7 @@ import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Objects;
/** /**
* 科目类别Controller * 科目类别Controller
...@@ -70,15 +71,15 @@ public class FncSubjectTypeController extends BaseController { ...@@ -70,15 +71,15 @@ public class FncSubjectTypeController extends BaseController {
if (item.getSubjectTypeId().equals(id)) { if (item.getSubjectTypeId().equals(id)) {
return; return;
} else { } else {
list.stream().filter(child -> child.getParentId() == item.getSubjectTypeId()).forEach(child -> { ids.add(item.getSubjectTypeId());
ids.add(child.getSubjectTypeId()); list.stream().filter(child -> Objects.equals(child.getParentId(), item.getSubjectTypeId())).forEach(child -> {
excludeChild(list,child,id,ids); excludeChild(list,child,id,ids);
}); });
} }
}); });
} }
list.removeIf(d -> d.getSubjectTypeId().intValue() == id || ids.contains(d.getSubjectTypeId())); list.removeIf(d -> d.getSubjectTypeId().intValue() == id || !ids.contains(d.getSubjectTypeId()));
return success(list); return success(list);
} }
...@@ -88,8 +89,9 @@ public class FncSubjectTypeController extends BaseController { ...@@ -88,8 +89,9 @@ public class FncSubjectTypeController extends BaseController {
if (entity.getSubjectTypeId().equals(id)) { if (entity.getSubjectTypeId().equals(id)) {
return; return;
} else { } else {
list.stream().filter(item -> item.getParentId() == entity.getSubjectTypeId()).forEach(child -> { ids.add(entity.getSubjectTypeId());
ids.add(child.getSubjectTypeId()); list.stream().filter(item -> Objects.equals(item.getParentId(), entity.getSubjectTypeId())).forEach(child -> {
excludeChild(list,child,id,ids); excludeChild(list,child,id,ids);
}); });
} }
......
...@@ -6,7 +6,7 @@ spring: ...@@ -6,7 +6,7 @@ spring:
druid: druid:
# 主库数据源 # 主库数据源
master: master:
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 url: jdbc:mysql://192.168.182.130:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root username: root
password: root password: root
# 从库数据源 # 从库数据源
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<if test="entity.subjectTypeName != null and entity.subjectTypeName != ''"> <if test="entity.subjectTypeName != null and entity.subjectTypeName != ''">
and A.subject_type_name like concat('%', #{entity.subjectTypeName}, '%') and A.subject_type_name like concat('%', #{entity.subjectTypeName}, '%')
</if> </if>
order by A.create_time desc order by A.order_num asc
</select> </select>
<select id="queryById" resultType="com.ruoyi.system.domain.vo.FncSubjectTypeVo"> <select id="queryById" resultType="com.ruoyi.system.domain.vo.FncSubjectTypeVo">
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "ruoyi", "name": "ruoyi",
"version": "3.8.4", "version": "3.8.4",
"description": "DBR财务中心", "description": "DBR财务中心",
"author": "若依", "author": "DBR财务中心",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"dev": "vue-cli-service serve", "dev": "vue-cli-service serve",
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
"vue-count-to": "1.0.13", "vue-count-to": "1.0.13",
"vue-cropper": "0.5.5", "vue-cropper": "0.5.5",
"vue-meta": "2.4.0", "vue-meta": "2.4.0",
"vue-print-nb": "^1.7.5",
"vue-router": "3.4.9", "vue-router": "3.4.9",
"vuedraggable": "2.24.3", "vuedraggable": "2.24.3",
"vuex": "3.6.0" "vuex": "3.6.0"
......
...@@ -13,7 +13,7 @@ import router from './router' ...@@ -13,7 +13,7 @@ import router from './router'
import directive from './directive' // directive import directive from './directive' // directive
import plugins from './plugins' // plugins import plugins from './plugins' // plugins
import { download } from '@/utils/request' import { download } from '@/utils/request'
import Print from 'vue-print-nb'
import './assets/icons' // icon import './assets/icons' // icon
import './permission' // permission control import './permission' // permission control
import { getDicts } from "@/api/system/dict/data"; import { getDicts } from "@/api/system/dict/data";
...@@ -61,6 +61,7 @@ Vue.component('ImagePreview', ImagePreview) ...@@ -61,6 +61,7 @@ Vue.component('ImagePreview', ImagePreview)
Vue.use(directive) Vue.use(directive)
Vue.use(plugins) Vue.use(plugins)
Vue.use(VueMeta) Vue.use(VueMeta)
Vue.use(Print)
DictData.install() DictData.install()
/** /**
......
This diff is collapsed.
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
label-width="68px">
<el-form-item label="科目类别名称" prop="subjectTypeName"> <el-form-item label="科目类别名称" prop="subjectTypeName">
<el-input v-model="queryParams.subjectTypeName" placeholder="请输入科目类别名称" clearable <el-input v-model="queryParams.subjectTypeName" placeholder="请输入科目类别名称" clearable
@keyup.enter.native="handleQuery" /> @keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索
</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -17,13 +19,9 @@ ...@@ -17,13 +19,9 @@
v-hasPermi="['finance:subjectType:add']">新增</el-button> v-hasPermi="['finance:subjectType:add']">新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" <el-button type="info" plain icon="el-icon-sort" size="mini" @click="toggleExpandAll">展开/折叠</el-button>
v-hasPermi="['finance:subjectType:edit']">修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
v-hasPermi="['finance:subjectType:remove']">删除</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
v-hasPermi="['finance:subjectType:export']">导出</el-button> v-hasPermi="['finance:subjectType:export']">导出</el-button>
...@@ -31,23 +29,24 @@ ...@@ -31,23 +29,24 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-if="refreshTable" v-loading="loading" row-key="subjectTypeId" :data="subjectTypeList" <el-table v-if="refreshTable" v-loading="loading" row-key="subjectTypeId"
:default-expand-all="isExpandAll" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"> :data="subjectTypeList" :default-expand-all="isExpandAll"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
<el-table-column label="科目类别名称" align="center" prop="subjectTypeName" /> <el-table-column label="科目类别名称" align="left" prop="subjectTypeName" />
<el-table-column label="显示顺序" align="center" prop="orderNum" /> <el-table-column label="显示顺序" align="left" prop="orderNum" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="left" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['finance:subjectType:edit']">修改</el-button> v-hasPermi="['finance:subjectType:edit']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-plus" @click="handleAdd(scope.row)"
v-hasPermi="['system:dept:add']">新增</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['finance:subjectType:remove']">删除</el-button> v-hasPermi="['finance:subjectType:remove']">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 添加或修改科目类别对话框 --> <!-- 添加或修改科目类别对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
...@@ -71,7 +70,14 @@ ...@@ -71,7 +70,14 @@
</template> </template>
<script> <script>
import { listAllSubjectType, getSubjectType, delSubjectType, addSubjectType, updateSubjectType ,listExcludeChild} from "@/api/finance/subjectType"; import {
listAllSubjectType,
getSubjectType,
delSubjectType,
addSubjectType,
updateSubjectType,
listExcludeChild,
} from "@/api/finance/subjectType";
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
...@@ -113,9 +119,9 @@ export default { ...@@ -113,9 +119,9 @@ export default {
// 表单校验 // 表单校验
rules: { rules: {
parentId: [ parentId: [
{ required: true, message: "上级id不能为空", trigger: "blur" } { required: true, message: "上级id不能为空", trigger: "blur" },
], ],
} },
}; };
}, },
created() { created() {
...@@ -125,7 +131,7 @@ export default { ...@@ -125,7 +131,7 @@ export default {
/** 查询科目类别列表 */ /** 查询科目类别列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listAllSubjectType(this.queryParams).then(response => { listAllSubjectType(this.queryParams).then((response) => {
// this.subjectTypeList = response.rows; // this.subjectTypeList = response.rows;
this.subjectTypeList = this.handleTree(response.data, "subjectTypeId"); this.subjectTypeList = this.handleTree(response.data, "subjectTypeId");
this.loading = false; this.loading = false;
...@@ -139,7 +145,7 @@ export default { ...@@ -139,7 +145,7 @@ export default {
return { return {
id: node.subjectTypeId, id: node.subjectTypeId,
label: node.subjectTypeName, label: node.subjectTypeName,
children: node.children children: node.children,
}; };
}, },
// 取消按钮 // 取消按钮
...@@ -157,7 +163,7 @@ export default { ...@@ -157,7 +163,7 @@ export default {
createBy: null, createBy: null,
createTime: null, createTime: null,
updateBy: null, updateBy: null,
updateTime: null updateTime: null,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
...@@ -178,13 +184,19 @@ export default { ...@@ -178,13 +184,19 @@ export default {
} }
this.open = true; this.open = true;
this.title = "添加科目类别"; this.title = "添加科目类别";
listAllSubjectType().then(response => { listAllSubjectType().then((response) => {
this.subjectTypeOptions = this.handleTree(response.data, "subjectTypeId"); this.subjectTypeOptions = this.handleTree(
response.data,
"subjectTypeId"
);
if (this.subjectTypeOptions.length == 0) { if (this.subjectTypeOptions.length == 0) {
} }
const noResultsOptions = { subjectTypeId: this.form.parentId || 0, subjectTypeName: this.form.parentName || "根节点", children: [] }; const noResultsOptions = {
this.subjectTypeOptions.push(noResultsOptions); subjectTypeId: this.form.parentId || 0,
subjectTypeName: this.form.parentName || "根节点",
children: this.subjectTypeOptions,
};
this.subjectTypeOptions = [noResultsOptions];
}); });
}, },
/** 展开/折叠操作 */ /** 展开/折叠操作 */
...@@ -198,33 +210,39 @@ export default { ...@@ -198,33 +210,39 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const subjectTypeId = row.subjectTypeId const subjectTypeId = row.subjectTypeId;
getSubjectType(subjectTypeId).then(response => { getSubjectType(subjectTypeId).then((response) => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改科目类别"; this.title = "修改科目类别";
listExcludeChild(row.subjectTypeId).then(response => { listExcludeChild(row.subjectTypeId).then((response) => {
this.subjectTypeOptions = this.handleTree(response.data, "subjectTypeId"); this.subjectTypeOptions = this.handleTree(
response.data,
"subjectTypeId"
);
if (this.subjectTypeOptions.length == 0) { if (this.subjectTypeOptions.length == 0) {
} }
const noResultsOptions = { subjectTypeId: this.form.parentId || 0, subjectTypeName: this.form.parentName || "根节点", children: [] }; const noResultsOptions = {
this.subjectTypeOptions.push(noResultsOptions); subjectTypeId: this.form.parentId || 0,
subjectTypeName: this.form.parentName || "根节点",
children: this.subjectTypeOptions,
};
this.subjectTypeOptions = [noResultsOptions];
}); });
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if (this.form.subjectTypeId != null) { if (this.form.subjectTypeId != null) {
updateSubjectType(this.form).then(response => { updateSubjectType(this.form).then((response) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
} else { } else {
addSubjectType(this.form).then(response => { addSubjectType(this.form).then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
...@@ -236,19 +254,27 @@ export default { ...@@ -236,19 +254,27 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const subjectTypeIds = row.subjectTypeId || this.ids; const subjectTypeIds = row.subjectTypeId || this.ids;
this.$modal.confirm('是否确认删除科目类别编号为"' + subjectTypeIds + '"的数据项?').then(function () { this.$modal
.confirm('是否确认删除科目类别编号为"' + subjectTypeIds + '"的数据项?')
.then(function () {
return delSubjectType(subjectTypeIds); return delSubjectType(subjectTypeIds);
}).then(() => { })
.then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => { }); })
.catch(() => {});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('finance/subjectType/export', { this.download(
...this.queryParams "finance/subjectType/export",
}, `subjectType_${new Date().getTime()}.xlsx`) {
} ...this.queryParams,
} },
`subjectType_${new Date().getTime()}.xlsx`
);
},
},
}; };
</script> </script>
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :sm="24" :lg="12" style="padding-left: 20px"> <el-col :sm="24" :lg="12" style="padding-left: 20px">
<h2>若依后台管理框架</h2> <h2>DBR财务中心后台管理框架</h2>
<p> <p>
一直想做一款后台管理系统,看了很多优秀的开源项目但是发现没有合适自己的。于是利用空闲休息时间开始自己写一套后台系统。如此有了DBR财务中心,她可以用于所有的Web应用程序,如网站管理后台,网站会员中心,CMS,CRM,OA等等,当然,您也可以对她进行深度定制,以做出更强系统。所有前端后台代码封装过后十分精简易上手,出错概率低。同时支持移动客户端访问。系统会陆续更新一些实用功能。 一直想做一款后台管理系统,看了很多优秀的开源项目但是发现没有合适自己的。于是利用空闲休息时间开始自己写一套后台系统。如此有了DBR财务中心,她可以用于所有的Web应用程序,如网站管理后台,网站会员中心,CMS,CRM,OA等等,当然,您也可以对她进行深度定制,以做出更强系统。所有前端后台代码封装过后十分精简易上手,出错概率低。同时支持移动客户端访问。系统会陆续更新一些实用功能。
</p> </p>
...@@ -128,14 +128,14 @@ ...@@ -128,14 +128,14 @@
<p> <p>
<i class="el-icon-chat-dot-round"></i> 微信:<a <i class="el-icon-chat-dot-round"></i> 微信:<a
href="javascript:;" href="javascript:;"
>/ *若依</a >/ *DBR财务中心</a
> >
</p> </p>
<p> <p>
<i class="el-icon-money"></i> 支付宝:<a <i class="el-icon-money"></i> 支付宝:<a
href="javascript:;" href="javascript:;"
class="支付宝信息" class="支付宝信息"
>/ *若依</a >/ *DBR财务中心</a
> >
</p> </p>
</div> </div>
...@@ -838,7 +838,7 @@ ...@@ -838,7 +838,7 @@
</el-collapse-item> </el-collapse-item>
<el-collapse-item title="v1.0.0 - 2019-10-08"> <el-collapse-item title="v1.0.0 - 2019-10-08">
<ol> <ol>
<li>若依前后端分离系统正式发布</li> <li>DBR财务中心前后端分离系统正式发布</li>
</ol> </ol>
</el-collapse-item> </el-collapse-item>
</el-collapse> </el-collapse>
......
<template> <template>
<div class="login"> <div class="login">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form"> <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<h3 class="title">若依后台管理系统</h3> <h3 class="title">DBR财务中心后台管理系统</h3>
<el-form-item prop="username"> <el-form-item prop="username">
<el-input <el-input
v-model="loginForm.username" v-model="loginForm.username"
......
<template> <template>
<div class="register"> <div class="register">
<el-form ref="registerForm" :model="registerForm" :rules="registerRules" class="register-form"> <el-form ref="registerForm" :model="registerForm" :rules="registerRules" class="register-form">
<h3 class="title">若依后台管理系统</h3> <h3 class="title">DBR财务中心后台管理系统</h3>
<el-form-item prop="username"> <el-form-item prop="username">
<el-input v-model="registerForm.username" type="text" auto-complete="off" placeholder="账号"> <el-input v-model="registerForm.username" type="text" auto-complete="off" placeholder="账号">
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" /> <svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment