Commit c6498645 authored by jianglingfeng's avatar jianglingfeng

发票

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