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()
/** /**
......
<template>
<div>
<div>
<el-form ref="form" :model="form" label-width="80px">
<el-row>
<!-- <el-col :span="8" v-if="form.parentId !== 0">
<el-form-item label="上级部门" prop="parentId">
<el-input v-model="test" placeholder="" size="normal" clearable></el-input>
</el-form-item>
</el-col> -->
<el-col :span="8">
<el-button type="primary" v-print="printObj" >打印</el-button>
</el-col>
</el-row>
</el-form>
</div>
<body>
<div class="toptip c-red">模板样式仅供参考,不可用于实际开票依据!</div>
<div class="invoicMain" id="printDiv">
<!-- head start -->
<div class="invoiceHeader">
<div class="headerLeft">
<div>
<img src="qrcode.png" width="83" height="83" alt="">
</div>
<div>
<p class="c-red">3700194130</p>
<p class="c"><label>机器编号:</label><br><span>499098532085</span></p>
</div>
</div>
<div class="headerMiddle">
<h1>增值税专用发票</h1>
<div class="line"></div>
</div>
<div class="headerRight">
<p><strong></strong><span class="c-red">35891172</span></p>
<p>3700194130</p>
<p>35891172</p>
<p><label>开票日期:</label><span> 2021年06月07日</span></p>
</div>
</div>
<!-- head end -->
<!-- invoice body start -->
<div class="invoiceBody">
<div class="userInfo">
<div class="buy">购买方</div>
<ul>
<li>
<label>&nbsp;&nbsp;&nbsp;&nbsp;称:</label><span>山东济南网络信息技术有限公司</span>
</li>
<li>
<label>纳税人识别号:</label><span class="f-big">913564523096023930</span>
</li>
<li>
<label>地址、&nbsp;电话:</label><span class="f-small">济南市槐荫区经十路4214209号
0531-85094547</span>
</li>
<li>
<label>开户行及账号:</label><span class="f-small">中国银行股份有限公司济南大学科技园支行
6225885410839945</span>
</li>
</ul>
<div class="password">密码区</div>
<div class="pwdInfo"><span class="f-big">0357+39177127583965+0*13>3>0<>
<22908-+<+03*<-84>40>
<3<64-076746-2+2082*9112+057188 /07-228<135701+4 />039*1630-817</span>></div>
</div>
<div>
<table class="GoodsTable" cellpadding="0" cellspacing="0">
<thead>
<tr>
<td style="width: 24%">货物或应税劳务、服务名称</td>
<td style="width: 10%">规格型号</td>
<td style="width: 7%">单位</td>
<td style="width: 10%">数 量</td>
<td style="width: 10%">单 价</td>
<td style="width: 16%">金 额</td>
<td style="width: 7%">税率</td>
<td style="width: 16%; border-right: none;">税 额</td>
</tr>
</thead>
<tbody class="invoice-list" style="height: 126px;">
<tr>
<td><span>*乳制品*新希望天香透明</span></td>
<td><span>180ML</span></td>
<td><span></span></td>
<td><span>5</span></td>
<td><span>2.364</span></td>
<td><span>11.82</span></td>
<td><span>1%</span></td>
<td><span>1.18</span></td>
</tr>
<tr>
<td><span>新希望天香透明袋纯牛奶</span></td>
<td><span>180ML</span></td>
<td><span></span></td>
<td><span>5</span></td>
<td><span>2.364</span></td>
<td><span>11.82</span></td>
<td><span>1%</span></td>
<td><span>1.18</span></td>
</tr>
<tr>
<td><span>新希望天香透明袋纯牛奶</span></td>
<td><span>180ML</span></td>
<td><span></span></td>
<td><span>5</span></td>
<td><span>2.364</span></td>
<td><span>11.82</span></td>
<td><span>1%</span></td>
<td><span>1.18</span></td>
</tr>
<tr>
<td><span>新希望天香透明袋纯牛奶</span></td>
<td><span>180ML</span></td>
<td><span></span></td>
<td><span>5</span></td>
<td><span>2.364</span></td>
<td><span>11.82</span></td>
<td><span>1%</span></td>
<td><span>1.18</span></td>
</tr>
<tr>
<td><span>新希望天香透明袋纯牛奶</span></td>
<td><span>180ML</span></td>
<td><span></span></td>
<td><span>5</span></td>
<td><span>2.364</span></td>
<td><span>11.82</span></td>
<td><span>1%</span></td>
<td><span>1.18</span></td>
</tr>
<tr>
<td><span>新希望天香透明袋纯牛奶</span></td>
<td><span>180ML</span></td>
<td><span></span></td>
<td><span>5</span></td>
<td><span>2.364</span></td>
<td><span>11.82</span></td>
<td><span>1%</span></td>
<td><span>1.18</span></td>
</tr>
</tbody>
<tfoot>
<tr class="total">
<td>&nbsp;&nbsp;&nbsp;</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><span class="rmb"></span>1425.00</td>
<td></td>
<td><span class="rmb"></span>1425.00</td>
</tr>
<tr class="GoodsTotal">
<td>价税合计(大写)</td>
<td colspan="7">
<div style="width: 100%;display:flex">
<div type="text" style="width: 60%"><span class='c-black'>ⓧ壹万叁仟元整</span></div>
<div type="text" style="width: 30%"> (小写) <span class='c-black'><span
class="rmb"></span>1425.00</span></div>
</div>
</td>
</tr>
</tfoot>
</table>
<div class="userInfo">
<div class="buy">销售方</div>
<ul>
<li>
<label>&nbsp;&nbsp;&nbsp;&nbsp;称:</label><span>山东济南网络信息技术有限公司</span>
</li>
<li>
<label>纳税人识别号:</label><span class="f-big">913564523596023930</span>
</li>
<li>
<label>地址、&nbsp;电话:</label><span class="f-small2">山东省济南市槐荫区经十路28988号乐梦公寓3号楼1单元605号
0531-87527787</span>
</li>
<li>
<label>开户行及账号:</label><span class="f-small">中国银行股份有限公司济南大学科技园支行
6225885410839945</span>
</li>
</ul>
<div class="password">备注</div>
<div class="pwdInfo">aaa</div>
</div>
</div>
</div>
<!-- invoice body start -->
<ul class="invoicetFooter">
<li>
<label>收款人:</label><span>张莫某</span>
</li>
<li>
<label>复核:</label><span>张莫某</span>
</li>
<li>
<label>开票人:</label><span>张莫某</span>
</li>
<li>
<label>销售方:(章)</label>
</li>
</ul>
</div>
</body>
</div>
</template>
<script>
export default {
components: {},
data() {
return {
test: "",
form: {},
printObj: {
id: "printDiv",
popTitle: "发票打印",
},
};
},
//监听属性 类似于data概念
computed: {},
//监控data中的数据变化
watch: {},
//方法集合
methods: {
prints() {
var prints = document.getElementById("printDiv");
prints.title = "打印的标题";
},
},
//生命周期 - 创建完成(可以访问当前this实例)
created() {},
//生命周期 - 挂载完成(可以访问DOM元素)
mounted() {},
beforeCreate() {}, //生命周期 - 创建之前
beforeMount() {}, //生命周期 - 挂载之前
beforeUpdate() {}, //生命周期 - 更新之前
updated() {}, //生命周期 - 更新之后
beforeDestroy() {}, //生命周期 - 销毁之前
destroyed() {}, //生命周期 - 销毁完成
activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
};
</script>
<style scoped>
* {
padding: 0;
margin: 0;
}
ul,
ul li {
list-style: none;
margin: 0;
padding: 0;
}
body {
font-family: "simsun";
}
label {
color: #008000;
}
.rmb {
font-family: Arial, Helvetica, sans-serif;
}
.c-red {
color: #ff3133;
}
.c-black {
color: #000;
}
.f-big {
font-size: 20px;
}
.f-small {
font-size: 12px;
}
.f-small2 {
font-size: 10px;
}
.invoicMain {
width: 920px;
margin: 0 auto;
font-size: 14px;
color: #000;
padding: 20px;
border: 1px dotted #000;
}
.toptip {
text-align: center;
padding-top: 4px;
height: 20px;
}
.invoiceHeader {
height: 126px;
display: flex;
/* justify-content: space-between; */
align-items: center;
}
.headerLeft {
width: 300px;
display: flex;
}
.headerLeft div:nth-child(1) {
width: 85px;
line-height: 26px;
}
.headerLeft div p {
line-height: 26px;
}
.headerLeft div:nth-child(2) p.c-red {
width: 170px;
height: 46px;
text-align: center;
line-height: 42px;
font-size: 24px;
letter-spacing: 2px;
}
.headerLeft div p.c span {
font-size: 18px;
letter-spacing: 1px;
}
.headerRight {
padding-left: 28px;
width: 316px;
}
.headerRight p:nth-child(1) {
font-size: 24px;
}
.headerRight p:nth-child(1) strong {
font-family: "LiSu";
font-size: 30px;
padding-right: 20px;
}
.headerRight p:nth-child(2) {
text-align: right;
margin-top: -5px;
}
.headerRight p:nth-child(3) {
text-align: right;
font-size: 18px;
letter-spacing: 1px;
}
.headerRight p:nth-child(4) {
text-align: center;
letter-spacing: 1px;
}
.headerMiddle {
text-align: center;
width: 300px;
}
.headerMiddle h1 {
font-size: 32px;
color: #008000;
padding-bottom: 22px;
}
.total .rmb {
font-size: 16px;
}
.line {
height: 2px;
border-top: #008000 1px solid;
border-bottom: #008000 1px solid;
margin-bottom: 30px;
}
.headerRight li {
line-height: 24px;
}
.invoiceBody {
border: 1px solid #008000;
}
.userInfo {
width: 100%;
display: flex;
align-items: center;
height: 96px;
border-bottom: 1px solid #008000;
}
.userInfo ul {
width: 50%;
margin: 0 5px;
padding: 0;
}
.userInfo ul li {
line-height: 24px;
}
.userInfo ul li:nth-child(2) .f-big {
padding-left: 24px;
letter-spacing: 2px;
}
.userInfo ul li:nth-child(3) {
position: relative;
}
.userInfo ul li .f-small2 {
position: absolute;
width: 120%;
transform: scale(0.8);
left: 44px;
}
.buy {
width: 20px;
border-right: 1px solid #008000;
/* padding: 0 10px; */
text-align: center;
height: 100%;
display: flex;
align-items: center;
color: #008000;
line-height: 20px;
}
.password {
width: 20px;
/* padding: 0 10px; */
border-right: 1px solid #008000;
border-left: 1px solid #008000;
text-align: center;
height: 100%;
display: flex;
align-items: center;
color: #008000;
line-height: 20px;
}
.pwdInfo {
flex: 1;
padding: 0 15px;
height: 88px;
overflow: hidden;
word-break: break-all;
letter-spacing: 2px;
}
.goodsInfo {
height: 210px;
margin: 0;
padding: 0;
}
.goodsInfo li {
display: flex;
color: #008000;
text-align: center;
}
.name {
width: 260px;
border-right: 1px solid #008000;
}
.spec {
width: 140px;
border-right: 1px solid #008000;
}
.qty {
width: 108px;
border-right: 1px solid #008000;
}
.unit,
.taxRate {
width: 65px;
border-right: 1px solid #008000;
}
.qty,
.price {
width: 160px;
border-right: 1px solid #008000;
}
.money {
flex: 1;
border-right: 1px solid #008000;
}
.taxAmount {
flex: 1;
}
.GoodsTable {
height: 210px;
width: 100%;
border-collapse: collapse;
table-layout: fixed;
}
.GoodsTable td {
border-right: 1px solid #008000;
color: #008000;
padding: 0 4px;
}
.invoice-list td {
color: #000;
vertical-align: middle;
}
.invoice-list td:nth-child(5),
.invoice-list td:nth-child(6),
.invoice-list td:nth-child(7),
.invoice-list td:nth-child(8),
.total td:nth-child(5),
.total td:nth-child(6),
.total td:nth-child(7),
.total td:nth-child(8) {
text-align: right;
}
.invoice-list {
height: 126px;
overflow: hidden;
}
.invoice-list tr td {
height: 21px;
}
.GoodsTable thead tr {
height: 24px;
text-align: center;
}
.GoodsTotal {
height: 34px;
}
.GoodsTotal {
border-top: 1px solid #008000;
border-bottom: 1px solid #008000;
}
.total td {
color: #000;
}
.total td:nth-child(1) {
text-align: center;
color: #008000;
}
.total td:nth-child(6),
.total td:nth-child(8) {
font-size: 18px;
}
.invoicetFooter {
padding-top: 2px;
display: flex;
justify-content: space-between;
}
.invoicetFooter li {
width: 25%;
}
.invoiceHeader-left {
width: 67%;
display: flex;
align-items: center;
justify-content: space-between;
}
</style>
\ No newline at end of file
<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