页面开发

main
xuechunyuan 3 years ago
parent 616bfd55d8
commit 8cd62f2d58
  1. 1
      .gitignore
  2. 13
      package-lock.json
  3. 2
      package.json
  4. 6
      src/config/website.js
  5. 2
      src/lang/zh.js
  6. 4
      src/page/login/userlogin.vue
  7. 228
      src/views/blacklist/index.vue
  8. 272
      src/views/noticelist/index.vue
  9. 614
      src/views/system/dept.vue
  10. 92
      src/views/system/user.vue
  11. 2
      vue.config.js

1
.gitignore vendored

@ -1,6 +1,7 @@
.DS_Store
node_modules
/dist
package-lock.json
/tests/e2e/videos/
/tests/e2e/screenshots/

13
package-lock.json generated

@ -10252,11 +10252,6 @@
"renderkid": "^2.0.4"
}
},
"print-js": {
"version": "1.6.0",
"resolved": "https://registry.npmmirror.com/print-js/-/print-js-1.6.0.tgz",
"integrity": "sha512-BfnOIzSKbqGRtO4o0rnj/K3681BSd2QUrsIZy/+WdCIugjIswjmx3lDEZpXB2ruGf9d4b3YNINri81+J0FsBWg=="
},
"process": {
"version": "0.11.10",
"resolved": "https://registry.npmmirror.com/process/-/process-0.11.10.tgz",
@ -13152,6 +13147,14 @@
}
}
},
"vue-print-nb": {
"version": "1.7.5",
"resolved": "https://registry.npmmirror.com/vue-print-nb/-/vue-print-nb-1.7.5.tgz",
"integrity": "sha512-iNbNyUVRWz0Ha1UTiCKxMPtHLUDGgNI8e8xmD3xqm9RlXIUeX9bT7DgNAfY8vPzqyFRHqGjxLI1rycKH366ziQ==",
"requires": {
"vue": "^2.6.11"
}
},
"vue-router": {
"version": "3.6.5",
"resolved": "https://registry.npmmirror.com/vue-router/-/vue-router-3.6.5.tgz",

@ -24,11 +24,11 @@
"node-gyp": "^5.0.6",
"nprogress": "^0.2.0",
"portfinder": "^1.0.23",
"print-js": "^1.6.0",
"script-loader": "^0.7.2",
"vue": "^2.6.10",
"vue-axios": "^2.1.2",
"vue-i18n": "^8.7.0",
"vue-print-nb": "^1.7.5",
"vue-router": "^3.0.1",
"vuex": "^3.1.1"
},

@ -2,10 +2,10 @@
* 全局配置文件
*/
export default {
title: "saber",
logo: "S",
title: "车管所体检预约",
logo: "C",
key: 'saber',//配置主键,目前用于存储
indexTitle: 'Saber Admin',
indexTitle: '车管所体检预约 管理',
clientId: 'saber', // 客户端id
clientSecret: 'saber_secret', // 客户端密钥
tenantMode: true, // 是否开启租户模式

@ -1,5 +1,5 @@
export default {
title: 'Saber企业管理平台',
title: '车管所体检预约管理平台',
logoutTip: '退出系统, 是否继续?',
submitText: '确定',
cancelText: '取消',

@ -5,7 +5,7 @@
ref="loginForm"
:model="loginForm"
label-width="0">
<el-form-item v-if="tenantMode" prop="tenantId">
<!-- <el-form-item v-if="tenantMode" prop="tenantId">
<el-input size="small"
@keyup.enter.native="handleLogin"
v-model="loginForm.tenantId"
@ -13,7 +13,7 @@
:placeholder="$t('login.tenantId')">
<i slot="prefix" class="icon-quanxian"/>
</el-input>
</el-form-item>
</el-form-item> -->
<el-form-item prop="username">
<el-input size="small"
@keyup.enter.native="handleLogin"

@ -0,0 +1,228 @@
<template>
<basic-container>
<avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen"
@search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
@current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
<template slot-scope="{row}" slot="menu">
<el-button type="text" icon="el-icon-circle-plus-outline" size="small" @click="handleDelete">取消黑名单
</el-button>
</template>
<template slot-scope="{row}" slot="status">
<el-tag>{{ row.status == 1 ? '已拉黑' : '已取消' }}</el-tag>
</template>
</avue-crud>
</basic-container>
</template>
<script>
import { getList, remove, update, add, getNotice } from "@/api/desk/notice";
import { mapGetters } from "vuex";
export default {
data() {
return {
form: {},
query: {},
loading: true,
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
selectionList: [],
option: {
height: 'auto',
calcHeight: 30,
tip: false,
searchShow: true,
searchMenuSpan: 6,
border: true,
index: true,
addBtn: false,
viewBtn: false,
editBtn: false,
delBtn: false,
column: [
{
label: "体检人姓名",
prop: "title",
},
{
label: "身份证号码",
prop: "releaseTimeRange",
},
{
label: "联系方式",
prop: "content",
},
{
label: "预约时间",
prop: "releaseTime",
type: "date",
format: "yyyy-MM-dd hh:mm:ss",
valueFormat: "yyyy-MM-dd hh:mm:ss",
search: true
},
{
label: "状态",
prop: "status",
slot: true,
},
]
},
data: []
};
},
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
addBtn: this.vaildData(this.permission.notice_add, false),
viewBtn: this.vaildData(this.permission.notice_view, false),
delBtn: this.vaildData(this.permission.notice_delete, false),
editBtn: this.vaildData(this.permission.notice_edit, false)
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
},
methods: {
//
publish(row, done, loading) {
console.log(row, done, loading)
},
rowSave(row, done, loading) {
add(row).then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
done();
}, error => {
window.console.log(error);
loading();
});
},
rowUpdate(row, index, done, loading) {
update(row).then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
done();
}, error => {
window.console.log(error);
loading();
});
},
rowDel(row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
searchReset() {
this.query = {};
this.onLoad(this.page);
},
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
},
selectionChange(list) {
this.selectionList = list;
},
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getNotice(this.form.id).then(res => {
this.form = res.data.data;
});
}
done();
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
},
refreshChange() {
this.onLoad(this.page, this.query);
},
onLoad(page, params = {}) {
const { releaseTimeRange } = this.query;
let values = {
...params,
...this.query
};
if (releaseTimeRange) {
values = {
...values,
releaseTime_datege: releaseTimeRange[0],
releaseTime_datelt: releaseTimeRange[1],
};
values.releaseTimeRange = null;
}
this.loading = true;
getList(page.currentPage, page.pageSize, values).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
this.loading = false;
this.selectionClear();
});
}
}
};
</script>
<style>
</style>

@ -0,0 +1,272 @@
<template>
<basic-container>
<avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen"
@search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
@current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
<template slot-scope="{row}" slot="menu">
<el-button type="text" icon="el-icon-circle-plus-outline" size="small" @click="handleDelete">取消发布
</el-button>
</template>
<template slot-scope="{row}" slot="status">
<el-tag>{{ row.status == 1 ? '已发布' : '已取消' }}</el-tag>
</template>
<!-- 自定义弹窗按钮 -->
<template slot-scope="{row,index,type}" slot="menuForm">
<el-button icon="el-icon-circle-plus-outline" size="small" v-if="type == 'add'" @click="$refs.crud.rowSave()">保存</el-button>
<el-button icon="el-icon-edit" size="small" v-if="type == 'edit'" @click="$refs.crud.rowUpdate()">修改</el-button>
<el-button type="primary" icon="el-icon-check" size="small" @click="$refs.crud.publish()">发布</el-button>
</template>
</avue-crud>
</basic-container>
</template>
<script>
import { getList, remove, update, add, getNotice } from "@/api/desk/notice";
import { mapGetters } from "vuex";
export default {
data() {
return {
form: {},
query: {},
loading: true,
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
selectionList: [],
option: {
height: 'auto',
calcHeight: 30,
tip: false,
searchShow: true,
searchMenuSpan: 6,
border: true,
index: true,
viewBtn: false,
selection: true,
saveBtn:false,
updateBtn:false,
cancelBtn:false,
dialogType: 'drawer',
dialogClickModal: false,
column: [
{
label: "注意事项标题",
labelWidth:120,
prop: "title",
span: 24,
row: true,
search: true,
searchLabelWidth:100,
rules: [{
required: true,
message: "请输入注意事项标题",
trigger: "blur"
}]
},
{
label: "通知时间",
prop: "releaseTimeRange",
type: "datetime",
format: "yyyy-MM-dd hh:mm:ss",
valueFormat: "yyyy-MM-dd hh:mm:ss",
searchRange: true,
hide: true,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
search: true,
},
{
label: "内容",
labelWidth:120,
prop: "content",
component: 'AvueUeditor',
options: {
action: '/api/blade-resource/oss/endpoint/put-file',
props: {
res: "data",
url: "link",
}
},
minRows: 6,
span: 24,
},
{
label: "状态",
prop: "status",
slot: true,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
},
{
label: "发布时间",
prop: "releaseTime",
type: "date",
format: "yyyy-MM-dd hh:mm:ss",
valueFormat: "yyyy-MM-dd hh:mm:ss",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
},
]
},
data: []
};
},
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
addBtn: this.vaildData(this.permission.notice_add, false),
viewBtn: this.vaildData(this.permission.notice_view, false),
delBtn: this.vaildData(this.permission.notice_delete, false),
editBtn: this.vaildData(this.permission.notice_edit, false)
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
},
methods: {
//
publish(row, done, loading) {
console.log(row,done,loading)
},
rowSave(row, done, loading) {
add(row).then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
done();
}, error => {
window.console.log(error);
loading();
});
},
rowUpdate(row, index, done, loading) {
update(row).then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
done();
}, error => {
window.console.log(error);
loading();
});
},
rowDel(row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
searchReset() {
this.query = {};
this.onLoad(this.page);
},
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
},
selectionChange(list) {
this.selectionList = list;
},
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getNotice(this.form.id).then(res => {
this.form = res.data.data;
});
}
done();
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
},
refreshChange() {
this.onLoad(this.page, this.query);
},
onLoad(page, params = {}) {
const { releaseTimeRange } = this.query;
let values = {
...params,
...this.query
};
if (releaseTimeRange) {
values = {
...values,
releaseTime_datege: releaseTimeRange[0],
releaseTime_datelt: releaseTimeRange[1],
};
values.releaseTimeRange = null;
}
this.loading = true;
getList(page.currentPage, page.pageSize, values).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
this.loading = false;
this.selectionClear();
});
}
}
};
</script>
<style>
</style>

@ -1,363 +1,337 @@
<template>
<basic-container>
<avue-crud :option="option"
:table-loading="loading"
:data="data"
ref="crud"
v-model="form"
:permission="permissionList"
:before-open="beforeOpen"
:before-close="beforeClose"
@row-del="rowDel"
@row-update="rowUpdate"
@row-save="rowSave"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad"
@tree-load="treeLoad">
<avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form"
:permission="permissionList" :before-open="beforeOpen" :before-close="beforeClose" @row-del="rowDel"
@row-update="rowUpdate" @row-save="rowSave" @search-change="searchChange" @search-reset="searchReset"
@selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
@refresh-change="refreshChange" @on-load="onLoad" @tree-load="treeLoad">
<template slot="menuLeft">
<el-button type="danger"
size="small"
icon="el-icon-delete"
v-if="permission.dept_delete"
plain
@click="handleDelete">
<el-button type="danger" size="small" icon="el-icon-delete" v-if="permission.dept_delete" plain
@click="handleDelete">
</el-button>
</template>
<template slot-scope="scope" slot="menu">
<el-button
type="text"
icon="el-icon-circle-plus-outline"
size="small"
@click.stop="handleAdd(scope.row,scope.index)"
v-if="userInfo.role_name.includes('admin')"
>新增子项
<el-button type="text" icon="el-icon-circle-plus-outline" size="small"
@click.stop="handleAdd(scope.row, scope.index)" v-if="userInfo.role_name.includes('admin')">新增子项
</el-button>
</template>
<template slot-scope="{row}"
slot="deptCategory">
<el-tag>{{row.deptCategoryName}}</el-tag>
<template slot-scope="{row}" slot="deptCategory">
<el-tag>{{ row.deptCategoryName }}</el-tag>
</template>
</avue-crud>
</basic-container>
</template>
<script>
import {
getLazyList,
remove,
update,
add,
getDept,
getDeptTree
} from "@/api/system/dept";
import {mapGetters} from "vuex";
import website from '@/config/website';
import {
getLazyList,
remove,
update,
add,
getDept,
getDeptTree
} from "@/api/system/dept";
import { mapGetters } from "vuex";
import website from '@/config/website';
export default {
data() {
return {
form: {},
selectionList: [],
query: {},
loading: true,
parentId: 0,
page: {
pageSize: 10,
currentPage: 1,
total: 0,
},
option: {
lazy: true,
tip: false,
simplePage: true,
searchShow: true,
searchMenuSpan: 6,
tree: true,
border: true,
index: true,
selection: true,
viewBtn: true,
menuWidth: 300,
dialogClickModal: false,
column: [
{
label: "机构名称",
prop: "deptName",
search: true,
rules: [{
required: true,
message: "请输入机构名称",
trigger: "blur"
}]
},
{
label: "所属租户",
prop: "tenantId",
type: "tree",
dicUrl: "/api/blade-system/tenant/select",
addDisplay: false,
editDisplay: false,
viewDisplay: website.tenantMode,
span: 24,
props: {
label: "tenantName",
value: "tenantId"
},
hide: !website.tenantMode,
search: website.tenantMode,
rules: [{
required: true,
message: "请输入所属租户",
trigger: "click"
}]
},
{
label: "机构全称",
prop: "fullName",
search: true,
rules: [{
required: true,
message: "请输入机构全称",
trigger: "blur"
}]
export default {
data() {
return {
form: {},
selectionList: [],
query: {},
loading: true,
parentId: 0,
page: {
pageSize: 10,
currentPage: 1,
total: 0,
},
option: {
lazy: true,
tip: false,
simplePage: true,
searchShow: true,
searchMenuSpan: 6,
tree: true,
border: true,
index: true,
selection: true,
viewBtn: true,
menuWidth: 300,
dialogType: 'drawer',
dialogClickModal: false,
column: [
{
label: "机构名称",
prop: "deptName",
search: true,
rules: [{
required: true,
message: "请输入机构名称",
trigger: "blur"
}]
},
{
label: "机构logo",
prop: "deptName",
html: true,
formatter: (val) => {
return `${val.logo ? '<img src="' + val.logo + '"/>' : ''}`
},
{
label: "上级机构",
prop: "parentId",
dicData: [],
type: "tree",
hide: true,
addDisabled: false,
props: {
label: "title"
},
rules: [{
required: false,
message: "请选择上级机构",
trigger: "click"
}]
type: 'upload',
listType: 'picture-img',
span: 24,
fileType: 'img',//img/video/audio
propsHttp: {
res: 'data'
},
{
label: "机构类型",
type: "select",
dicUrl: "/api/blade-system/dict/dictionary?code=org_category",
props: {
label: "dictValue",
value: "dictKey"
},
dataType: "number",
width: 120,
prop: "deptCategory",
slot: true,
rules: [{
required: true,
message: "请输入机构类型",
trigger: "blur"
}]
tip: '只能上传jpg/png用户头像,且不超过500kb',
action: 'https://api.avuejs.com/imgupload'
},
{
label: "机构全称",
prop: "fullName",
search: true,
rules: [{
required: true,
message: "请输入机构全称",
trigger: "blur"
}]
},
{
label: "上级机构",
prop: "parentId",
dicData: [],
type: "tree",
hide: true,
addDisabled: false,
props: {
label: "title"
},
{
label: "排序",
prop: "sort",
type: "number",
align: "right",
width: 80,
rules: [{
required: true,
message: "请输入排序",
trigger: "blur"
}]
rules: [{
required: false,
message: "请选择上级机构",
trigger: "click"
}]
},
{
label: "机构类型",
type: "select",
dicUrl: "/api/blade-system/dict/dictionary?code=org_category",
props: {
label: "dictValue",
value: "dictKey"
},
{
label: "备注",
prop: "remark",
rules: [{
required: false,
message: "请输入备注",
trigger: "blur"
}],
hide: true
}
]
},
data: []
dataType: "number",
width: 120,
prop: "deptCategory",
slot: true,
rules: [{
required: true,
message: "请输入机构类型",
trigger: "blur"
}]
},
{
label: "排序",
prop: "sort",
type: "number",
align: "right",
width: 80,
rules: [{
required: true,
message: "请输入排序",
trigger: "blur"
}]
},
{
label: "备注",
prop: "remark",
rules: [{
required: false,
message: "请输入备注",
trigger: "blur"
}],
hide: true
}
]
},
data: []
};
},
computed: {
...mapGetters(["userInfo", "permission"]),
permissionList() {
return {
addBtn: this.vaildData(this.permission.dept_add, false),
viewBtn: this.vaildData(this.permission.dept_view, false),
delBtn: this.vaildData(this.permission.dept_delete, false),
editBtn: this.vaildData(this.permission.dept_edit, false)
};
},
computed: {
...mapGetters(["userInfo", "permission"]),
permissionList() {
return {
addBtn: this.vaildData(this.permission.dept_add, false),
viewBtn: this.vaildData(this.permission.dept_view, false),
delBtn: this.vaildData(this.permission.dept_delete, false),
editBtn: this.vaildData(this.permission.dept_edit, false)
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
},
methods: {
initData() {
getDeptTree().then(res => {
const column = this.findObject(this.option.column, "parentId");
column.dicData = res.data.data;
});
},
handleAdd(row) {
this.parentId = row.id;
const column = this.findObject(this.option.column, "parentId");
column.value = row.id;
column.addDisabled = true;
this.$refs.crud.rowAdd();
},
rowSave(row, done, loading) {
add(row).then((res) => {
//
const data = res.data.data;
row.id = data.id;
row.deptCategoryName = data.deptCategoryName;
row.tenantId = data.tenantId;
this.$message({
type: "success",
message: "操作成功!"
});
return ids.join(",");
}
//
done(row);
}, error => {
window.console.log(error);
loading();
});
},
methods: {
initData() {
getDeptTree().then(res => {
const column = this.findObject(this.option.column, "parentId");
column.dicData = res.data.data;
rowUpdate(row, index, done, loading) {
update(row).then(() => {
this.$message({
type: "success",
message: "操作成功!"
});
},
handleAdd(row) {
this.parentId = row.id;
const column = this.findObject(this.option.column, "parentId");
column.value = row.id;
column.addDisabled = true;
this.$refs.crud.rowAdd();
},
rowSave(row, done, loading) {
add(row).then((res) => {
//
const data = res.data.data;
row.id = data.id;
row.deptCategoryName = data.deptCategoryName;
row.tenantId = data.tenantId;
//
done(row);
}, error => {
window.console.log(error);
loading();
});
},
rowDel(row, index, done) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.$message({
type: "success",
message: "操作成功!"
});
//
done(row);
}, error => {
window.console.log(error);
loading();
});
},
rowUpdate(row, index, done, loading) {
update(row).then(() => {
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
//
this.data = [];
this.parentId = 0;
this.$refs.crud.refreshTable();
this.$refs.crud.toggleSelection();
//
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
//
done(row);
}, error => {
window.console.log(error);
loading();
});
},
rowDel(row, index, done) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.$message({
type: "success",
message: "操作成功!"
});
//
done(row);
});
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
//
this.data = [];
this.parentId = 0;
this.$refs.crud.refreshTable();
this.$refs.crud.toggleSelection();
//
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
searchReset() {
this.query = {};
this.parentId = 0;
this.onLoad(this.page);
},
searchChange(params, done) {
this.query = params;
this.parentId = '';
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
},
selectionChange(list) {
this.selectionList = list;
},
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
beforeOpen(done, type) {
if (["add", "edit"].includes(type)) {
this.initData();
}
if (["edit", "view"].includes(type)) {
getDept(this.form.id).then(res => {
this.form = res.data.data;
});
}
done();
},
beforeClose(done) {
this.parentId = "";
const column = this.findObject(this.option.column, "parentId");
column.value = "";
column.addDisabled = false;
done();
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
},
refreshChange() {
this.onLoad(this.page, this.query);
},
onLoad(page, params = {}) {
this.loading = true;
getLazyList(this.parentId, Object.assign(params, this.query)).then(res => {
this.data = res.data.data;
this.loading = false;
this.selectionClear();
});
},
treeLoad(tree, treeNode, resolve) {
const parentId = tree.id;
getLazyList(parentId).then(res => {
resolve(res.data.data);
},
searchReset() {
this.query = {};
this.parentId = 0;
this.onLoad(this.page);
},
searchChange(params, done) {
this.query = params;
this.parentId = '';
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
},
selectionChange(list) {
this.selectionList = list;
},
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
beforeOpen(done, type) {
if (["add", "edit"].includes(type)) {
this.initData();
}
if (["edit", "view"].includes(type)) {
getDept(this.form.id).then(res => {
this.form = res.data.data;
});
}
done();
},
beforeClose(done) {
this.parentId = "";
const column = this.findObject(this.option.column, "parentId");
column.value = "";
column.addDisabled = false;
done();
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
},
refreshChange() {
this.onLoad(this.page, this.query);
},
onLoad(page, params = {}) {
this.loading = true;
getLazyList(this.parentId, Object.assign(params, this.query)).then(res => {
this.data = res.data.data;
this.loading = false;
this.selectionClear();
});
},
treeLoad(tree, treeNode, resolve) {
const parentId = tree.id;
getLazyList(parentId).then(res => {
resolve(res.data.data);
});
}
};
}
};
</script>
<style>
</style>

@ -122,45 +122,49 @@
</basic-container>
</el-col>
<!-- 打印 -->
<div id="pintHtml">
<table border="1" width="100%" style="max-width:750pt;" cellspacing="0">
<van-button v-print="printObj">打印测试</van-button>
<div id="pintHtml" style="height:1000px;">
<table border="1" cellspacing="0">
<tr>
<td rowspan="6"><br/><br/><br/><br/><br/><br/></td>
<td rowspan="4"><br/><br/><br/><br/></td>
<td width="60pt">&nbsp;&nbsp; </td>
<td colspan="34" style="font-size:22pt;text-align:center;">机动车驾驶人身体条件证明</td>
</tr>
<tr>
<td rowspan="6" style="text-align:center;"><br/><br/><br/><br/><br/><br/></td>
<td rowspan="4" style="text-align:center;"><br/><br/><br/><br/></td>
<td width="60pt" style="text-align:center;"> </td>
<td colspan="3"></td>
<td>&nbsp;&nbsp;性别</td>
<td style="text-align:center;">性别</td>
<td>{{ sex }}</td>
<td colspan="4">&nbsp;出生日期</td>
<td colspan="4" style="text-align:center;">出生日期</td>
<td colspan="7"></td>
<td colspan="3">&nbsp;&nbsp; </td>
<td colspan="3" style="text-align:center;"> </td>
<td colspan="5"></td>
</tr>
<tr>
<td width="60pt">&nbsp;身份证<br/>&nbsp;明名称</td>
<td width="60pt" style="text-align:center;">身份证<br/>明名称</td>
<td colspan="4"></td>
<td>&nbsp; </td>
<td width="22pt"></td>
<td colspan="2" width="44pt"></td>
<td width="22pt"></td>
<td width="22pt"></td>
<td width="22pt"></td>
<td width="22pt"></td>
<td width="22pt"></td>
<td width="22pt"></td>
<td width="22pt"></td>
<td width="22pt"></td>
<td width="22pt"></td>
<td width="22pt"></td>
<td width="22pt"></td>
<td width="22pt"></td>
<td width="22pt"></td>
<td width="22pt"></td>
<td width="22pt"></td>
<td width="22pt"></td>
<td> </td>
<td width="20pt"></td>
<td colspan="2" width="40pt"></td>
<td width="20pt"></td>
<td width="20pt"></td>
<td width="20pt"></td>
<td width="20pt"></td>
<td width="20pt"></td>
<td width="20pt"></td>
<td width="20pt"></td>
<td width="20pt"></td>
<td width="20pt"></td>
<td width="20pt"></td>
<td width="20pt"></td>
<td width="20pt"></td>
<td width="20pt"></td>
<td width="20pt"></td>
<td width="20pt"></td>
<td width="20pt"></td>
</tr>
<tr>
<td colspan="3">&nbsp;&nbsp; / &nbsp;&nbsp;&nbsp;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td colspan="3" style="letter-spacing: 1px;">申请 / 已具有<br/>准驾车型代号</td>
<td colspan="3"></td>
<td colspan="4">档案编号</td>
<td colspan="9"></td>
@ -175,7 +179,7 @@
<td colspan="9"></td>
</tr>
<tr>
<td rowspan="2"><br/><br/><br/></td>
<td rowspan="2" style="text-align:center;"><br/><br/><br/></td>
<td colspan="19">本人如实申告 具有 不具有 下列疾病或者情况</td>
</tr>
<tr>
@ -186,8 +190,8 @@
</td>
</tr>
<tr>
<td rowspan="10" colspan="2"><br/><br/><br/><br/><br/><br/><br/></td>
<td width="60pt">身高cm</td>
<td rowspan="10" colspan="2" style="text-align:center;"><br/><br/><br/><br/><br/><br/><br/></td>
<td width="60pt" style="text-align:center;">身高cm</td>
<td colspan="2"></td>
<td width="90pt">辨色力</td>
<td colspan="3">
@ -198,15 +202,15 @@
<td colspan="15"></td>
</tr>
<tr>
<td rowspan="2"><br/></td>
<td rowspan="2" style="text-align:center;"><br/></td>
<td colspan="2">左眼</td>
<td rowspan="2" width="90pt">是否矫正</td>
<td colspan="2">
</td>
<td width="22pt"><br/><br/><br/><br/><br/></td>
<td width="20pt"><br/><br/><br/><br/><br/></td>
<td colspan="5"></td>
<td width="22pt"><br/><br/><br/></td>
<td width="20pt"><br/><br/><br/></td>
<td colspan="12"></td>
</tr>
<tr>
@ -214,13 +218,13 @@
<td colspan="2">
</td>
<td width="22pt"><br/><br/><br/><br/><br/></td>
<td width="20pt"><br/><br/><br/><br/><br/></td>
<td colspan="5"></td>
<td width="22pt"><br/><br/><br/></td>
<td width="20pt"><br/><br/><br/></td>
<td colspan="12"></td>
</tr>
<tr rowspan="2" colspan="2">
<td><br/></td>
<td style="text-align:center;"><br/></td>
</tr>
</table>
</div>
@ -251,7 +255,7 @@
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
import func from "@/util/func";
import print from 'print-js'
import print from "vue-print-nb";
export default {
data() {
@ -272,6 +276,9 @@
}
};
return {
printObj:{
id:'pintHtml'
},
form: {},
search:{},
roleBox: false,
@ -707,6 +714,9 @@
}
}
},
directives:{
print
},
computed: {
...mapGetters(["userInfo", "permission"]),
permissionList() {
@ -741,10 +751,6 @@
},
methods: {
handleUpdate() {
this.sex='女';
setTimeout(() => {
print('pintHtml','html');
},300)
},
nodeClick(data) {
this.treeDeptId = data.id;

@ -26,7 +26,7 @@ module.exports = {
proxy: {
'/api': {
//本地服务接口地址
target: 'http://192.168.1.118',
target: 'http://192.168.1.106',
//远程演示服务地址,可用于直接启动项目
// target: 'https://saber.bladex.vip/api',
ws: true,

Loading…
Cancel
Save