刘翔宇-旅管家 3 years ago
parent 45e73bb293
commit c720f088cf

@ -2,6 +2,5 @@
ENV = 'development'
# base api
VUE_APP_BASE_API = http://book-test.ali251.langye.net
VUE_APP_UPLOAD_API = http://book-test.ali251.langye.net/api/admin/upload-file
VUE_APP_PUBLIC=''
VUE_APP_BASE_API = https://yybtest.ali251.langye.net
#VUE_APP_BASE_API = https://yunyubang.ali251.langye.net

@ -2,6 +2,5 @@
ENV = 'production'
# base api
VUE_APP_BASE_API = http://book-test.ali251.langye.net
VUE_APP_UPLOAD_API =http://book-test.ali251.langye.net/api/admin/upload-file
VUE_APP_PUBLIC='/admin/'
VUE_APP_BASE_API = https://yunyubang.ali251.langye.net

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

@ -1,35 +0,0 @@
import request from '@/utils/request'
export function save(data) {
return request({
url: '/api/admin/borrow-log/save',
method: 'post',
data
})
}
export function list(params) {
return request({
url: '/api/admin/borrow-log/index',
method: 'get',
params
})
}
export function show(params) {
return request({
url: '/api/admin/borrow-log/show',
method: 'get',
params
})
}
export function del(params) {
return request({
url: '/api/admin/borrow-log/destroy',
method: 'get',
params
})
}

@ -1,89 +0,0 @@
import request from '@/utils/request'
export function save(data) {
return request({
url: '/api/admin/book/save',
method: 'post',
data
})
}
export function list(params) {
return request({
url: '/api/admin/book/index',
method: 'get',
params
})
}
export function show(params) {
return request({
url: '/api/admin/book/show',
method: 'get',
params
})
}
export function del(params) {
return request({
url: '/api/admin/book/destroy',
method: 'get',
params
})
}
export function isbn(params) {
return request({
url: '/api/admin/other/isbn',
method: 'get',
params
})
}
export function isbnCheck(params) {
return request({
url: '/api/admin/other/isbn-check',
method: 'get',
params
})
}
export function saveDetail(data) {
return request({
url: '/api/admin/book_detail/save',
method: 'post',
data
})
}
export function listDetail(params) {
return request({
url: '/api/admin/book_detail/index',
method: 'get',
params
})
}
export function showDetail(params) {
return request({
url: '/api/admin/book_detail/show',
method: 'get',
params
})
}
export function delDetail(params) {
return request({
url: '/api/admin/book_detail/destroy',
method: 'get',
params
})
}

@ -1,34 +0,0 @@
import request from '@/utils/request'
export function save(data) {
return request({
url: '/api/admin/book_type/save',
method: 'post',
data
})
}
export function list(params) {
return request({
url: '/api/admin/book_type/index',
method: 'get',
params
})
}
export function show(params) {
return request({
url: '/api/admin/book_type/show',
method: 'get',
params
})
}
export function del(params) {
return request({
url: '/api/admin/book_type/destroy',
method: 'get',
params
})
}

@ -1,67 +0,0 @@
import Vue from "vue"
import vueResource from "vue-resource"
Vue.use(vueResource)
import {
MessageBox,
Message,
Loading
} from 'element-ui'
// 请求接口通用方法
export function request(api, params, callback) {
let url = api + "?t=" + new Date();
Vue.http.post(url, params, {
header: {
"Content-Type": "application/x-www-form-urlencoded"
}
}).then((response) => {
let res = response.body
if (res.retCode === 0) {
if (typeof callback === "function") {
callback(res)
}
} else {
Message({
message: res.msg + ',重新获取中' || 'Error',
type: 'error',
duration: 5 * 1000
})
}
}).catch(err => {
})
}
export function get_isbn(params, callback) {
const api = "/query"
requestGet(api, {
params: {
key: "417d45266d502c8f67235e96f1e891e2",
...params
}
}, callback)
}
// 请求接口通用方法
export function requestGet(api, params, callback) {
let url = api + "?t=" + new Date();
Vue.http.get(url, params).then((response) => {
console.log(response)
let res = response.body
if (res.error_code === 0) {
if (typeof callback === "function") {
callback(res)
}
} else {
Message({
message: res.msg + ',重新获取中' || 'Error',
type: 'error',
duration: 5 * 1000
})
}
}).catch(err => {
})
}

@ -1,34 +0,0 @@
import request from '@/utils/request'
export function save(data) {
return request({
url: '/api/admin/book_detail/save',
method: 'post',
data
})
}
export function list(params) {
return request({
url: '/api/admin/book_detail/index',
method: 'get',
params
})
}
export function show(params) {
return request({
url: '/api/admin/book_detail/show',
method: 'get',
params
})
}
export function del(params) {
return request({
url: '/api/admin/book_detail/destroy',
method: 'get',
params
})
}

@ -1,47 +0,0 @@
import request from '@/utils/request'
export function userIndex(params) {
return request({
url: '/api/mobile/other/user-index',
method: 'get',
params
})
}
export function bookDetail(params) {
return request({
url: '/api/mobile/other/book-detail',
method: 'get',
params
})
}
export function bookBorrow(data) {
return request({
url: '/api/mobile/other/book-borrow',
method: 'post',
data
})
}
export function bookReturn(data) {
return request({
url: '/api/mobile/other/book-return',
method: 'post',
data
})
}
export function checkBookBorrow(data) {
return request({
url: '/api/mobile/other/check-book-borrow',
method: 'post',
data
})
}

@ -1,34 +0,0 @@
import request from '@/utils/request'
export function save(data) {
return request({
url: '/api/admin/user-department/save',
method: 'post',
data
})
}
export function list(params) {
return request({
url: '/api/admin/user-department/index',
method: 'get',
params
})
}
export function show(params) {
return request({
url: '/api/admin/user-department/show',
method: 'get',
params
})
}
export function del(params) {
return request({
url: '/api/admin/user-department/destroy',
method: 'get',
params
})
}

@ -1,34 +0,0 @@
import request from '@/utils/request'
export function save(data) {
return request({
url: '/api/admin/user/save',
method: 'post',
data
})
}
export function list(params) {
return request({
url: '/api/admin/user/index',
method: 'get',
params
})
}
export function show(params) {
return request({
url: '/api/admin/user/show',
method: 'get',
params
})
}
export function del(params) {
return request({
url: '/api/admin/user/destroy',
method: 'get',
params
})
}

@ -2,7 +2,7 @@ import request from '@/utils/request'
export function login(data) {
return request({
url: '/api/admin/auth/login',
url: '/api/merchant/login',
method: 'post',
data
})
@ -10,7 +10,7 @@ export function login(data) {
export function getInfo(token) {
return request({
url: '/api/admin/auth/me',
url: '/api/merchant/me',
method: 'post',
params: { token }
})
@ -29,4 +29,4 @@ export function getAuthMenu(token) {
method: 'get',
params: { token }
})
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 34 KiB

@ -6,6 +6,7 @@
<img src="../../../assets/logo-mini.png?v=1" class="sidebar-logo">
</router-link>
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
<img src="../../../assets/logo-mini.png?v=1" class="sidebar-logo">
<img src="../../../assets/logo.png?v=2" class="sidebar-name-logo" />
</router-link>
</transition>
@ -35,8 +36,8 @@
transition: opacity 1.5s;
}
.sidebar-name-logo {
width: 160px;
height: 36px;
width: 120px;
height: 28px;
}
.sidebarLogoFade-enter,

@ -31,18 +31,6 @@ import Layout from '@/layout'
* all roles can be accessed
*/
export const constantRoutes = [{
path: '/index',
component: () => import('@/views/lendCenter/index'),
hidden: true
},{
path: '/brrow',
component: () => import('@/views/lendCenter/brrow'),
hidden: true
},{
path: '/return',
component: () => import('@/views/lendCenter/return'),
hidden: true
},{
path: '/login',
component: () => import('@/views/login/index'),
hidden: true

@ -1,6 +1,6 @@
module.exports = {
title: '同心读书会自助借阅系统',
title: '孕育邦-商家端',
/**
* @type {boolean} true | false

@ -179,29 +179,17 @@ const actions = {
}, roles) {
return new Promise(resolve => {
const loadMenuData = []
// 先查询后台并返回左侧菜单数据并把数据添加到路由
getAuthMenu(state.token).then(response => {
let data = response
//console.log(JSON.stringify(data))
Object.assign(loadMenuData, data)
asyncRoutes.length=0;
generaMenu(asyncRoutes, loadMenuData)
let accessedRoutes
if (roles.includes('admin')) {
// alert(JSON.stringify(asyncRoutes))
accessedRoutes = asyncRoutes || []
} else {
accessedRoutes = filterAsyncRoutes(asyncRoutes, roles)
}
commit('SET_ROUTES', accessedRoutes)
resolve(accessedRoutes)
// generaMenu(asyncRoutes, data)
}).catch(error => {
console.log(error)
})
Object.assign(loadMenuData, asyncRoutes)
generaMenu(asyncRoutes, loadMenuData)
let accessedRoutes
if (roles.includes('admin')) {
// alert(JSON.stringify(asyncRoutes))
accessedRoutes = asyncRoutes || []
} else {
accessedRoutes = filterAsyncRoutes(asyncRoutes, roles)
}
commit('SET_ROUTES', accessedRoutes)
resolve(accessedRoutes)
})
}
}

@ -1,5 +1,5 @@
/* 改变主题色变量 */
$--color-primary: #006756;
$--color-primary: #071e34;
/* 改变 icon 字体路径变量,必需 */
$--font-path: '~element-ui/lib/theme-chalk/fonts';

@ -11,7 +11,7 @@
transition: width 0.28s;
width: $sideBarWidth !important;
//background-color: $menuBg;
background: linear-gradient(180deg, #006756, #039980);
background: linear-gradient(180deg, #071e34, #071e34);
box-shadow: 1px 1px 15px 0px rgba(17, 76, 157, 0.2);
height: 100%;
position: fixed;
@ -229,7 +229,7 @@
>.el-menu--popup {
max-height: 100vh;
overflow-y: auto;
background: #006756 !important;
background: #071e34 !important;
&::-webkit-scrollbar-track-piece {
background: #d3dce6;

@ -13,7 +13,7 @@ $subMenuHover:rgba(242, 242, 242, .4);
$submenuActiveBg:rgba(242, 242, 242, .4);
$sideBarWidth: 210px;
$primaryColor: #006756;
$primaryColor: #071e34;
// the :export directive is the magic sauce for webpack
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
:export {

@ -1,4 +1,4 @@
@import '~view-design/src/styles/index.less';
// Here are the variables to cover, such as:
@primary-color: #006756;
@primary-color: #071e34;

@ -1,6 +1,6 @@
import Cookies from 'js-cookie'
const TokenKey = 'sishitongtang_token'
const TokenKey = 'YUNYUBANG_SUPPLIER_TOKEN'
export function getToken() {
return Cookies.get(TokenKey)

@ -14,7 +14,7 @@
</div>
<div class="bullshit__headline">{{ message }}</div>
<div class="bullshit__info">Please check that the URL you entered is correct, or click the button below to return to the homepage.</div>
<a href="" class="bullshit__return-home">Back to home</a>
<a href="" class="bullshit__return-home">返回</a>
</div>
</div>
</div>

@ -1,174 +0,0 @@
<template>
<div>
<lx-header icon="md-apps" style="margin-bottom: 10px; border: 0px; margin-top: 15px" text="借阅记录">
<div slot="content"></div>
<slot>
<div class="selects">
<div>
<span style="padding: 0 6px;word-break: keep-all;">
关键字
</span>
<Input v-model="select.keyword" placeholder="请输入关键字" style="width: 180px"></Input>
</div>
<Button style="margin-left: 10px" type="primary" @click="select={page:1,keyword:''}">
</Button>
<Button style="margin-left: 10px" type="primary" @click="doSearch"></Button>
</div>
</slot>
</lx-header>
<xy-table :list="list" :table-item="table" :total="total">
<template v-slot:btns>
<el-table-column fixed="right" header-align="center" align="center" label="操作" width="220">
<template slot-scope="scope">
<div class="slot-btns">
<Button type="primary" @click="back(scope.row)" v-if="!scope.row.return_time"></Button>
<Button type="error" @click="deleteitem(scope.row)" style="margin-left: 10px;">删除</Button>
</div>
</template>
</el-table-column>
</template>
</xy-table>
</div>
</template>
<script>
import {
list as index,
save,
del,
show
} from "@/api/bookRecord/recordIndex";
export default {
data() {
return {
select: {
page: 1,
page_size: 20,
keyword: '',
},
total: 0,
list: [],
table: [{
prop: 'type.name',
label: '图书类目',
align: 'center',
width: 120,
fixed: 'left',
}, {
prop: 'book.name',
label: '图书名称',
align: 'left',
minWidth: 280,
fixed: 'left',
}, {
prop: 'book.author',
label: '作者',
align: 'center',
width: 120,
fixed: 'left',
}, {
prop: 'book_detail.no',
label: '库存编号',
align: 'center',
width: 120,
fixed: 'left',
}, {
prop: 'user.name',
label: '借阅人',
align: 'center',
width: 120,
fixed: 'left',
}, {
prop: 'department.name',
label: '借阅人部门',
align: 'center',
width: 120,
},
{
prop: 'created_at',
label: '借阅时间',
width: 180,
formatter: (v1, v2, value) => {
return value;
}
},
{
prop: 'return_time',
label: '归还时间',
width: 180,
formatter: (v1, v2, value) => {
return value;
}
}
],
}
},
methods: {
doSearch() {
this.select.page = 1;
this.load();
},
pageSizeChange(e) {
this.select.page_size = e;
this.select.page = 1;
this.load();
},
async load() {
const res = await index(this.select)
this.total = res.total
this.list = res.data
},
deleteitem(row) {
del({
id: row.id
}).then(res => {
this.load();
this.$Message.success("操作成功");
})
},
back(row) {
save({
id: row.id,
status:1,
user_id:row.user?.id,
return_time:this.$moment().format("YYYY-MM-DD HH:mm:ss")
}).then(res => {
this.load();
this.$Message.success("归还成功");
})
},
pageChange(e) {
this.select.page = e
this.load()
},
},
mounted() {
this.load()
},
created() {}
}
</script>
<style lang="scss" scoped>
.selects {
display: flex;
flex-wrap: wrap;
&>div {
margin-bottom: 6px;
}
}
</style>

@ -1,209 +0,0 @@
<template>
<div>
<lx-header icon="md-apps" style="margin-bottom: 10px; border: 0px; margin-top: 15px" text="项目列表管理">
<div slot="content"></div>
<slot>
<div class="selects">
<div>
<span style="padding: 0 6px;word-break: keep-all;">
关键字
</span>
<Input v-model="select.keyword" placeholder="请输入关键字" style="width: 180px"></Input>
</div>
<Button style="margin-left: 10px" type="primary" @click="select={page:1,keyword:''}">
</Button>
<Button style="margin-left: 10px" type="primary" @click="doSearch"></Button>
<Button style="margin-left: 10px" type="primary" @click="add"></Button>
</div>
</slot>
</lx-header>
<xy-table :list="list" :table-item="table" :total="total" @pageSizeChange="pageSizeChange"
@pageIndexChange="pageChange">
<template v-slot:btns>
<el-table-column fixed="right" header-align="center" align="center" label="操作" width="400">
<template slot-scope="scope">
<div class="slot-btns">
<Button type="primary" @click="edit(scope.row)"></Button>
<Button type="primary" @click="view(scope.row)" style="margin-left: 10px;">查看</Button>
<Button type="info" @click="print(scope.row)" style="margin-left: 10px;">打印</Button>
<Button type="primary" @click="put(scope.row)" style="margin-left: 10px;">入库</Button>
<Button type="error" @click="deleteitem(scope.row)" style="margin-left: 10px;">删除</Button>
</div>
</template>
</el-table-column>
</template>
</xy-table>
<addBook ref="addBook" @refresh="load()"></addBook>
<viewBook ref="viewBook" @refresh="load()"></viewBook>
<putIn ref="putIn" @refresh="load()"></putIn>
</div>
</template>
<script>
import {
list as index,
save,
del,
show
} from "@/api/bookStore/bookIndex";
import addBook from '@/views/bookStore/components/addBook'
import viewBook from '@/views/bookStore/components/viewBook'
import putIn from '@/views/bookStore/components/putIn'
export default {
components: {
addBook,
viewBook,
putIn
},
data() {
return {
select: {
page: 1,
page_size: 20,
keyword: '',
},
total: 0,
list: [],
table: [{
prop: 'name',
label: '图书名称',
align: 'left',
width: 280,
fixed: 'left',
}, {
prop: 'small_cover',
label: '图片',
align: 'cneter',
width: 140,
fixed: 'left',
customFn: (row) => {
return ( < div style = {
{
display: 'flex',
alignItems: 'center',
justifyContent: 'center'
}
} > < img src = {
(row.small_cover?row.small_cover.url:(row.big_cover?row.big_cover.url:''))
}
style = 'width:120px;height:120px' > < /img></div > )
}
}, {
prop: 'author',
label: '作者',
align: 'center',
width: 120,
fixed: 'left',
}, {
prop: 'bind_way',
label: '装订方式',
width: 180,
align: 'center'
}, {
prop: 'publish_date',
label: '出版日期',
width: 180,
align: 'center'
},
{
prop: 'font_total',
label: '图书页数',
align: 'center',
width: 180,
},
{
prop: 'created_at',
label: '创建信息',
width: 180,
formatter: (v1, v2, value) => {
return value;
}
}
],
}
},
methods: {
print(row){
let baseUrl = process.env.VUE_APP_BASE_API + "/print?book_id=" + row.id;
window.open(baseUrl)
},
put(row) {
this.$refs['putIn'].id = "";
this.$refs['putIn'].bookid = row.id;
this.$refs['putIn'].detail.book_id = row.id;
this.$refs['putIn'].isShow = true;
this.$refs['putIn'].type = 'add'
},
doSearch() {
this.select.page = 1;
this.load();
},
add() {
this.$refs['addBook'].isShow = true
},
pageChange(e) {
this.select.page = e
this.load();
},
pageSizeChange(e) {
this.select.page_size = e;
this.select.page = 1;
this.load();
},
async load() {
const res = await index(this.select)
this.total = res.total
this.list = res.data
},
deleteitem(row) {
del({
id: row.id
}).then(res => {
this.load();
this.$Message.success("操作成功");
})
},
edit(row) {
this.$refs['addBook'].id = row.id;
this.$refs['addBook'].isShow = true;
this.$refs['addBook'].type = 'editor'
},
view(row) {
this.$refs['viewBook'].id = row.id;
this.$refs['viewBook'].isShow = true;
},
pageChange(e) {
this.select.page = e
this.load()
},
},
mounted() {
this.load()
},
created() {}
}
</script>
<style lang="scss" scoped>
.selects {
display: flex;
flex-wrap: wrap;
&>div {
margin-bottom: 6px;
}
}
</style>

@ -1,224 +0,0 @@
<template>
<div class="container">
<!-- 查询配置 -->
<div>
<div ref="lxHeader">
<LxHeader icon="md-apps" text="图书类目" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content"></div>
<slot>
<div>
<Input style="width: 200px; margin-right: 10px" v-model.number="searchFields.Name" placeholder="关键字搜索" />
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button>
<Button type="primary" @click="edit()" style="margin-left: 10px">新增</Button>
</div>
</slot>
</LxHeader>
</div>
<div class="table-tree">
<el-table :data="tableData" :height="tableHeight" class="v-table" style="width: 100%;margin-bottom: 20px;"
row-key="id" border default-expand-all :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
<el-table-column type="index" align="center">
</el-table-column>
<el-table-column prop="name" label="类型" sortable>
</el-table-column>
<el-table-column prop="sort" label="排序" sortable width="180">
</el-table-column>
<el-table-column fixed="right" label="操作" width="300">
<template slot-scope="scope">
<Button type="primary" @click="addchildren(scope.row)" size="small" style="margin-left: 10px;"
ghost>下级</Button>
<Button type="error" @click="del(scope.row)" size="small" style="margin-left: 10px;" ghost>删除</Button>
<Button type="primary" @click="edit(scope.row)" size="small" style="margin-left: 10px;" ghost>编辑</Button>
</template>
</el-table-column>
</el-table>
</div>
</div>
<el-dialog title="图书类目编辑" :visible.sync="dialogFormVisible" width="60%">
<el-form :model="form" :rules="rules" ref="form" label-position="right" :label-width="formLabelWidth">
<el-row>
<el-col :span="12">
<el-form-item label="父节点">
<el-input v-model="form.pname" disabled autocomplete="off"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="18">
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" autocomplete="off"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="排序">
<el-input v-model="form.sort" autocomplete="off"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="状态" prop="status">
<el-select v-model="form.status">
<el-option label="启用" value="1"></el-option>
<el-option label="禁用" value="0"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="resetForm('form')"> </el-button>
<el-button type="primary" @click="submitForm('form')"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import LxHeader from "@/components/LxHeader/index.vue";
import {
save,
list,
del,
show
} from "../../api/bookStore/bookType.js";
export default {
components: {
LxHeader
},
created() {
this.initLoad();
this.load();
},
mounted() {},
data() {
return {
dialogFormVisible: false,
formLabelWidth: "120px",
form: {
name: "",
id: "",
pid: "0",
status: "1",
sort: 0,
pname: "根菜单"
},
rules: {
name: [{
required: true,
message: '请输入菜单名称',
trigger: 'blur'
}],
status: [{
required: true,
message: '请选择状态',
trigger: 'change'
}],
},
tableHeight: 0,
//
searchFields: {
KeyWord: ""
},
tableData: [],
list: []
}
},
methods: {
initLoad() {
var that = this;
var clientHeight = document.documentElement.clientHeight
var lxHeader_height = 96.5; //
var paginationHeight = 37; //
var topHeight = 50; //
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
that.tableHeight = tableHeight;
},
load() {
var that = this;
list({
is_tree: 1
}).then(response => {
that.tableData = response;
}).catch(error => {
//reject(error)
})
},
edit(obj) {
this.form = this.$options.data().form;
if (obj) {
obj.status = obj.status.toString();
this.form = obj;
this.form.pname=obj.pid_info?obj.pid_info.name:'根目录'
}
this.dialogFormVisible = true;
},
addchildren(obj) {
this.form = this.$options.data().form
if (obj) {
this.form.pname = obj.name;
this.form.pid = obj.id;
this.dialogFormVisible = true;
}
},
submitForm(formName) {
var that = this;
this.$refs[formName].validate((valid) => {
if (valid) {
save(that.form).then(response => {
this.$Message.success('操作成功');
that.dialogFormVisible = false;
that.load();
}).catch(error => {
reject(error)
})
} else {
this.$Message.error('数据校验失败');
return false;
}
});
},
resetForm(formName) {
var that = this;
this.$refs[formName].resetFields();
if (formName == "form")
that.dialogFormVisible = false;
},
del(obj) {
var that = this;
if (obj) {
this.$Modal.confirm({
title: '确认要删除数据?',
onOk: () => {
del({
id: obj.id
}).then(response => {
this.$Message.success('操作成功');
that.load();
}).catch(error => {
console.log(error)
reject(error)
})
},
onCancel: () => {
//this.$Message.info('Clicked cancel');
}
});
}
},
}
};
</script>

@ -1,509 +0,0 @@
<template>
<div>
<!-- 编辑-->
<xy-dialog :is-show.sync="isShow" title="图书编辑" type="form" :form="detail" :rules="rules" @submit="editor"
ref="addActivity">
<template v-slot:name>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>图书名称
</div>
<div class="xy-table-item-content">
<el-input clearable placeholder="请填写图书名称" v-model="detail.name" style="width: 300px;" />
</div>
</div>
</template>
<template v-slot:isbn>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>ISBN
</div>
<div class="xy-table-item-content">
<el-input clearable autofocus placeholder="请填写ISBN" @change="getBookInfo" ref="inputisbn"
v-model="detail.isbn" style="width: 300px;">
<el-button slot="append" icon="el-icon-search"></el-button>
</el-input>
</div>
</div>
</template>
<template v-slot:type_id>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>图书类目
</div>
<div class="xy-table-item-content">
<treeselect v-model="detail.type_id" :normalizer="normalizer" :multiple="false" clearable
style="width: 300px;" :show-count="true" placeholder="选择图书类目" :options="typeOptions" />
</div>
</div>
</template>
<template v-slot:small_cover_id>
<div class="xy-table-item">
<div class="xy-table-item-label">封面
</div>
<div class="xy-table-item-content">
<div v-if="detail.small_cover" style="position: relative;">
<img :src="detail.small_cover" class="avatar" style="width:120px;height:120px">
<Button shape="circle" icon="md-close" type="error" size="small" class="img__delete"
@click="detail.small_cover = '',detail.small_cover=''"></Button>
</div>
<el-upload v-else accept="picture" :limit="1" class="avatar-uploader" list-type="picture-card"
:action="action" :show-file-list="true" :on-error="uploadFail" :on-success="uploadSuccess"
:before-upload="uploadBefore">
<i class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
尺寸要求120*120
</div>
</div>
</template>
<template v-slot:big_cover_id>
<div class="xy-table-item">
<div class="xy-table-item-label">大封面
</div>
<div class="xy-table-item-content">
<div v-if="detail.big_cover" style="position: relative;">
<img :src="detail.big_cover" class="avatar" style="width:280px;height:280px">
<Button shape="circle" icon="md-close" type="error" size="small" class="img__delete"
@click="detail.big_cover = '',detail.big_cover_id=''"></Button>
</div>
<el-upload v-else accept="picture" :limit="1" class="avatar-uploader" list-type="picture-card"
:action="action" :show-file-list="true" :on-error="uploadFailLogo" :on-success="uploadSuccessLogo"
:before-upload="uploadBeforeLogo">
<i class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
尺寸要求480*480
</div>
</div>
</template>
<template v-slot:bind_way>
<div class="xy-table-item">
<div class="xy-table-item-label">装帧方式
</div>
<div class="xy-table-item-content">
<el-input clearable placeholder="请填写装帧方式" v-model="detail.bind_way" style="width: 150px;" />
</div>
</div>
</template>
<template v-slot:publish_date>
<div class="xy-table-item">
<div class="xy-table-item-label">出版日期
</div>
<div class="xy-table-item-content">
<el-input clearable placeholder="请填写出版日期" v-model="detail.publish_date" style="width: 150px;" />
</div>
</div>
</template>
<template v-slot:author>
<div class="xy-table-item">
<div class="xy-table-item-label">图书作者
</div>
<div class="xy-table-item-content">
<el-input clearable placeholder="请填写图书作者" v-model="detail.author" style="width: 150px;" />
</div>
</div>
</template>
<template v-slot:publish_house>
<div class="xy-table-item">
<div class="xy-table-item-label">出版社
</div>
<div class="xy-table-item-content">
<el-input clearable placeholder="请填写出版社" v-model="detail.publish_house" style="width: 150px;" />
</div>
</div>
</template>
<template v-slot:font_total>
<div class="xy-table-item">
<div class="xy-table-item-label">图书页数
</div>
<div class="xy-table-item-content">
<el-input clearable placeholder="请填写图书页数" v-model="detail.font_total" style="width: 150px;" />
</div>
</div>
</template>
<template v-slot:content>
<div class="xy-table-item">
<div class="xy-table-item-label">图书介绍
</div>
<div class="xy-table-item-content">
<el-input clearable placeholder="请填写图书介绍" type="textarea" rows="4" v-model="detail.content"
style="width: 300px;" />
</div>
</div>
</template>
<template v-slot:stockNum v-if="this.id==''">
<div class="xy-table-item">
<div class="xy-table-item-label">入库数量
</div>
<div class="xy-table-item-content">
<el-input clearable placeholder="请填写入库数量" v-model="detail.stockNum" style="width: 150px;" />
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
save,
show,
isbn,
isbnCheck
} from "@/api/bookStore/bookIndex";
import {
list as bookTypeIndex
} from "@/api/bookStore/bookType";
import {
get_isbn
} from "@/api/bookStore/interface";
import {
uploadFile,
uploadFileByUrl
} from "@/api/common";
// import the component
import Treeselect from '@riophae/vue-treeselect'
// import the styles
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default {
// register the component
components: {
Treeselect
},
data() {
return {
typeOptions: [],
isShow: false,
id: "",
type: "add",
action: `${process.env.VUE_APP_BASE_API}/api/admin/upload-file`,
detail: {
id: "",
isbn: "",
name: "",
sub_title: "",
author: "",
bind_way: "",
type_id: "",
publish_date: "",
publish_house: "",
font_total: "",
content: "",
small_cover_id: "",
small_cover: "",
big_cover: "",
big_cover_id: "",
stockNum: 1,
details: [],
},
normalizer(node) {
return {
id: node.id,
label: node.name,
children: node.children,
}
},
rules: {
name: [{
required: true,
message: "项目名称必填"
}],
type_id: [{
required: true,
message: "请选择图书类目",
trigger: 'change'
}]
}
}
},
watch: {
isShow(newVal) {
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
}
} else {
this.id = ''
this.type = ''
this.$refs['addActivity'].reset();
this.detail.id = "";
this.detail.small_cover = "";
this.detail.big_cover = "";
}
let that = this;
this.$nextTick(function() {
console.log(that.$refs.inputisbn)
that.$refs.inputisbn.focus();
})
}
},
methods: {
downloadByBlob(url, name, id) {
uploadFileByUrl({
url: url
}).then(r => {
let fileFormData = new FormData();
fileFormData.append('file', r, "name.jpg"); //filenamefiletest.zip
uploadFile(fileFormData).then(res => {
console.log("res", res)
this.detail[name] = res.url;
this.detail[id] = res.id;
})
})
},
getBookInfo(e) {
console.log(e);
let that = this;
if (e == "" || e.length < 10) {
this.$Message.error("请正确输入ISBN");
return false;
}
isbnCheck({
isbn: e
}).then(r => {
console.log("r", r)
this.getISBN(e);
})
},
getISBN(isbnNo) {
let that = this;
isbn({
isbn: isbnNo
}).then(res => {
console.log("res", res)
console.log("res.msg", res.msg);
var json = JSON.parse(res.msg);
console.log("json", json);
if (json.error_code != 0) {
that.$Message.error("存在错误" + res.error_code);
} else {
let book = json.result.data;
that.detail.name = book.title;
that.detail.sub_title = book.subtitle;
that.detail.author = book.author;
that.detail.bind_way = book.paper;
that.detail.publish_date = book.pubDate;
that.detail.publish_house = book.publisher;
that.detail.font_total = book.wordNum;
that.detail.content = book.gist;
if (book.smallImg && book.smallImg != '') {
that.downloadByBlob(book.smallImg, "small_cover", "small_cover_id");
}
if (book.img && book.img != '') {
that.downloadByBlob(book.img, "big_cover", "big_cover_id");
}
}
})
},
loadbookTypeIndex() {
bookTypeIndex({
is_tree: 1
}).then(res => {
this.typeOptions = res;
})
},
//
uploadFailLogo(err) {
console.log(err)
},
uploadSuccessLogo(response) {
this.detail.big_cover = response.url
this.detail.big_cover_id = response.id
},
uploadBeforeLogo(file) {
if ((file.size / 1000) > 2024) {
Message({
type: 'warning',
message: '上传图片大小超过2M'
})
return false
}
},
//
uploadFail(err) {
console.log(err)
},
uploadSuccess(response) {
this.detail.small_cover = response.url
this.detail.small_cover_id = response.id
},
uploadBefore(file) {
if ((file.size / 1000) > 2024) {
Message({
type: 'warning',
message: '上传图片大小超过2M'
})
return false
}
},
querySearch(queryString, cb) {
listuser().then(response => {
var data = response.data;
for (var m of data) {
m.value = m.name;
}
cb(data)
}).catch(error => {
//reject(error)
})
},
handleSelectUser(item) {
this.detail.admin_id = item.id;
this.detail.admin_name = item.value;
},
async getDetail() {
let res = await show({
id: this.id
})
Object.assign(this.detail, res);
this.detail.small_cover = res.small_cover.url;
this.detail.big_cover = res.big_cover.url;
},
editor() {
if (this.detail.id == "") {
let _arr = [];
console.log(this.detail.stockNum)
for (var i = 0; i < this.detail.stockNum; i++) {
_arr.push({
enter_date: this.$moment().format("YYYY-MM-DD"),
remark: "",
status: 0,
})
}
console.log(this.detail.id)
this.detail.details = _arr;
}
save(this.detail).then(res => {
this.isShow = false
this.$Message.success("操作成功");
this.$emit('refresh')
})
},
},
computed: {
},
created() {
let that = this;
that.loadbookTypeIndex();
that.$nextTick(function() {
console.log(that.$refs.inputisbn)
that.$refs.inputisbn.focus();
})
},
mounted() {
let that = this;
that.$nextTick(function() {
console.log(that.$refs.inputisbn)
that.$refs.inputisbn.focus();
})
}
}
</script>
<style scoped lang="scss">
.contract-add-plan {
min-height: 30px;
border: 1px solid #dcdee2;
border-radius: 4px;
display: flex;
flex-wrap: wrap;
align-items: center;
align-content: center;
padding: 0 8px;
&-no-plan {
height: 30px;
line-height: 30px;
color: #CDD0D5;
}
}
.xy-table-item-label {
width: 140px;
}
.xy-table-item-price {
position: relative;
&::after {
z-index: 1;
position: absolute;
right: 0;
top: 0;
content: '(元)'
}
::v-deep .el-input__clear {
position: relative;
right: 30px;
z-index: 2;
}
}
.xy-table-item-price-wan {
position: relative;
&::after {
position: absolute;
right: 0;
top: 0;
content: '(万元)'
}
::v-deep .el-input__clear {
position: relative;
right: 46px;
z-index: 2;
}
}
</style>

@ -1,183 +0,0 @@
<template>
<div>
<!-- 编辑-->
<xy-dialog :is-show.sync="isShow" title="图书入库" type="form" :form="detail" :rules="rules" @submit="editor"
ref="addActivity">
<template v-slot:booknum>
<div class="xy-table-item">
<div class="xy-table-item-label">入库数量
</div>
<div class="xy-table-item-content">
<el-input-number v-model="detail.booknum" :min="1" :max="99"></el-input-number>
</div>
</div>
</template>
<template v-slot:enter_date>
<div class="xy-table-item">
<div class="xy-table-item-label">入库日期
</div>
<div class="xy-table-item-content">
<el-date-picker style="width: 150px;" clearable v-model="detail.enter_date" type="date"
value-format="yyyy-MM-dd" placeholder="选择日期时间">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:remark>
<div class="xy-table-item">
<div class="xy-table-item-label">备注
</div>
<div class="xy-table-item-content">
<el-input clearable placeholder="请填写备注" type="textarea" rows="4" v-model="detail.remark"
style="width: 300px;" />
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
saveDetail,
showDetail
} from "@/api/bookStore/bookIndex";
export default {
data() {
return {
isShow: false,
id: "",
bookid: "",
type: "add",
detail: {
book_id: "",
id: "",
no: "",
enter_date: "",
remark: "",
status: 0,
booknum: 1
},
rules: {
enter_date: [{
required: true,
message: "入库日期必填"
}]
}
}
},
watch: {
isShow(newVal) {
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
}
} else {
this.id = ''
this.type = ''
this.$refs['addActivity'].reset()
}
}
},
methods: {
async getDetail() {
let res = await showDetail({
id: this.id
})
Object.assign(this.detail, res);
},
editor() {
for (var i = 1; i <= this.detail.booknum;i++) {
saveDetail(this.detail).then(res => {
})
}
this.isShow = false
this.$Message.success("操作成功");
this.$emit('refresh')
},
},
computed: {
},
created() {
let that = this;
that.detail.enter_date = this.$moment().format("YYYY-MM-DD")
},
mounted() {
}
}
</script>
<style scoped lang="scss">
.contract-add-plan {
min-height: 30px;
border: 1px solid #dcdee2;
border-radius: 4px;
display: flex;
flex-wrap: wrap;
align-items: center;
align-content: center;
padding: 0 8px;
&-no-plan {
height: 30px;
line-height: 30px;
color: #CDD0D5;
}
}
.xy-table-item-label {
width: 140px;
}
.xy-table-item-price {
position: relative;
&::after {
z-index: 1;
position: absolute;
right: 0;
top: 0;
content: '(元)'
}
::v-deep .el-input__clear {
position: relative;
right: 30px;
z-index: 2;
}
}
.xy-table-item-price-wan {
position: relative;
&::after {
position: absolute;
right: 0;
top: 0;
content: '(万元)'
}
::v-deep .el-input__clear {
position: relative;
right: 46px;
z-index: 2;
}
}
</style>

@ -1,202 +0,0 @@
<template>
<div>
<!-- 编辑-->
<xy-dialog :is-show.sync="isShow" title="图书查看" ref="addActivity">
<el-descriptions title="图书信息" column=2>
<el-descriptions-item label="所属类目">
<el-tag>{{detail.type?detail.type.name:""}}</el-tag>
</el-descriptions-item>
<el-descriptions-item label="图片"><img :src="detail.small_cover?detail.small_cover.url:''"
style="width: 120px;height: 120px;"></img></el-descriptions-item>
<el-descriptions-item label="书名">{{detail.name}}</el-descriptions-item>
<el-descriptions-item label="ISBN">{{detail.isbn}}</el-descriptions-item>
<el-descriptions-item label="作者">{{detail.author}}</el-descriptions-item>
<el-descriptions-item label="描述">{{detail.content}}</el-descriptions-item>
<el-descriptions-item label="页数">{{detail.font_total}}</el-descriptions-item>
<el-descriptions-item label="出版社">{{detail.publish_house}}</el-descriptions-item>
<el-descriptions-item label="出版日期">{{detail.publish_date}}</el-descriptions-item>
</el-descriptions>
<el-descriptions title="库存信息">
</el-descriptions>
<el-table :data="detail.details" style="width: 100%">
<el-table-column prop="enter_date" label="入库日期" width="180">
</el-table-column>
<el-table-column prop="name" label="条形码" align="center" width="180">
<template slot-scope="scope">
<img :src="scope.row.barcode" style="width: 120px;height: 90px;" />
</template>
</el-table-column>
<el-table-column prop="remark" label="备注">
</el-table-column>
<el-table-column prop="status" label="状态" align="center" width="180">
<template slot-scope="scope">
<el-tag>{{scope.row.status=="0"?"未打印":"已打印"}}</el-tag>
</template>
</el-table-column>
<el-table-column prop="opt" label="操作">
<template slot-scope="scope">
<el-button @click="toPrint(scope.row)"></el-button>
<el-button @click="toDelete(scope.row)" type='danger' style='margin-left: 10px;'>删除</el-button>
</template>
</el-table-column>
</el-table>
</xy-dialog>
</div>
</template>
<script>
import {
show
} from "@/api/bookStore/bookIndex";
import {
del as delStore
} from "@/api/bookStore/storeList";
export default {
data() {
return {
isShow: false,
id: "",
window: {},
detail: {
isbn: "",
name: "",
sub_title: "",
author: "",
bind_way: "",
type_id: "",
publish_date: "",
publish_house: "",
font_total: "",
content: "",
small_cover_id: "",
small_cover: "",
big_cover: "",
big_cover_id: ""
}
}
},
watch: {
isShow(newVal) {
if (newVal) {
this.getDetail()
} else {
this.id = ''
this.type = ''
this.$refs['addActivity'].reset()
}
}
},
methods: {
toDelete(row) {
delStore({
id: row.id
}).then(res => {
this.getDetail();
this.$Message.success("操作成功");
})
},
toPrint(row) {
// this.window.width = screen.availWidth * 0.95
// this.window.height = screen.availHeight * 0.95
// this.window.top = (window.screen.height - 30 - this.window.height) / 2
// this.window.left = (window.screen.width - 10 - this.window.width) / 2
// let obj = {
// id: row.id,
// barcode: row.barcode
// }
// let url = `${process.env.VUE_APP_PUBLIC}print.html?json=${JSON.stringify(obj)}`
// window.open(url, 'toPrint',
// `top=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0`
// )
let baseUrl = process.env.VUE_APP_BASE_API + "/print?id=" + row.id;
window.open(baseUrl)
},
async getDetail() {
let res = await show({
id: this.id
})
Object.assign(this.detail, res);
if(!this.detail.small_cover){
this.detail.small_cover=res.big_cover;
}
}
},
computed: {
},
created() {
let that = this;
},
mounted() {
}
}
</script>
<style scoped lang="scss">
.contract-add-plan {
min-height: 30px;
border: 1px solid #dcdee2;
border-radius: 4px;
display: flex;
flex-wrap: wrap;
align-items: center;
align-content: center;
padding: 0 8px;
&-no-plan {
height: 30px;
line-height: 30px;
color: #CDD0D5;
}
}
.xy-table-item-label {
width: 140px;
}
.xy-table-item-price {
position: relative;
&::after {
z-index: 1;
position: absolute;
right: 0;
top: 0;
content: '(元)'
}
::v-deep .el-input__clear {
position: relative;
right: 30px;
z-index: 2;
}
}
.xy-table-item-price-wan {
position: relative;
&::after {
position: absolute;
right: 0;
top: 0;
content: '(万元)'
}
::v-deep .el-input__clear {
position: relative;
right: 46px;
z-index: 2;
}
}
</style>

@ -1,174 +0,0 @@
<template>
<div>
<lx-header icon="md-apps" style="margin-bottom: 10px; border: 0px; margin-top: 15px" text="库存记录">
<div slot="content"></div>
<slot>
<div class="selects">
<div>
<span style="padding: 0 6px;word-break: keep-all;">
关键字
</span>
<Input v-model="select.keyword" placeholder="请输入关键字" style="width: 180px"></Input>
</div>
<Button style="margin-left: 10px" type="primary" @click="select={page:1,keyword:''}">
</Button>
<Button style="margin-left: 10px" type="primary" @click="doSearch"></Button>
<Button style="margin-left: 10px" type="primary" @click="doPrint"></Button>
</div>
</slot>
</lx-header>
<xy-table :list="list" :table-item="table" :total="total" @pageSizeChange="pageSizeChange"
@pageIndexChange="pageChange" @delete="deleteitem" >
</xy-table>
</div>
</template>
<script>
import {
list as index,
save,
del,
show
} from "@/api/bookStore/storeList";
export default {
data() {
return {
select: {
page: 1,
page_size: 20,
keyword: '',
},
total: 0,
list: [],
table: [{
prop: 'no',
label: '库存编号',
align: 'center',
width: 120,
fixed: 'left',
}, {
prop: 'book.name',
label: '图书',
width: 280,
align: 'left',
fixed: 'left'
}, {
prop: 'small_cover',
label: '图片',
align: 'cneter',
width: 180,
fixed: 'left',
customFn: (row) => {
return ( < div style = {
{
display: 'flex',
alignItems: 'center',
justifyContent: 'center'
}
} > < img src = {
row.barcode
} style='width:120px;height:90px'> < /img></div > )
}
}, {
prop: 'book.author',
label: '作者',
align: 'center',
width: 140,
}, {
prop: 'book.bind_way',
label: '装订方式',
width: 180,
align: 'center'
}, {
prop: 'enter_date',
label: '入库日期',
width: 180,
align: 'center'
}, {
prop: 'borrow_status',
label: '借阅状态',
width: 120,
align: 'center',
formatter: (v1, v2, value) => {
return value == 1 ? "借出" : "在库";
}
},{
prop: 'remark',
label: '备注',
minWidth:280,
align: 'left'
},
{
prop: 'created_at',
label: '创建信息',
width: 180,
formatter: (v1, v2, value) => {
return value;
}
}
],
}
},
methods: {
doSearch() {
this.select.page = 1;
this.load();
},
doPrint(){
let baseUrl = process.env.VUE_APP_BASE_API+"/print";
window.open(baseUrl)
},
pageChange(e) {
this.select.page = e
this.load();
},
pageSizeChange(e) {
this.select.page_size = e;
this.select.page = 1;
this.load();
},
async load() {
const res = await index(this.select)
this.total = res.total
this.list = res.data
},
deleteitem(row) {
del({
id: row.id
}).then(res => {
this.load();
this.$Message.success("操作成功");
})
}
},
mounted() {
this.load()
},
created() {}
}
</script>
<style lang="scss" scoped>
.selects {
display: flex;
flex-wrap: wrap;
&>div {
margin-bottom: 6px;
}
}
</style>

@ -1,556 +0,0 @@
<template>
<div class="content_box">
<div class="content_box_header">
<div class="content_box_header_title">
借阅
</div>
<div class="content_box_header_back" @click="back">
<img src="../../assets/center/icon_arrow.png" />
<span class="content_box_header_back_text">
返回
</span>
</div>
</div>
<div class="content_box_body">
<div class="content_box_body_steps">
<div class="content_box_body_steps_item " v-for="(item,index) of listSteps"
:class="{'content_box_body_steps_item_on':(item.step==step)}">
<span>{{item.name}}</span>
<span style="margin-left: 10px;" v-if="item.step==step">></span>
</div>
</div>
<div id="section1" v-if="step==1" style="width: 100%;">
<!-- 滚动条要包裹的内容 -->
<div class="content_box_body_select">
<div class="content_box_body_select_box" v-for="(item,index) of listDepts" :key="index">
<div class="content_box_body_select_box_header">
<div class="content_box_body_select_box_header_left">
<img src="../../assets/center/people.png" />
<span>{{item.name}}</span>
</div>
<div class="content_box_body_select_box_header_right">
</div>
</div>
<div class="content_box_body_select_box_items">
<div class="content_box_body_select_box_item" @click="toSelectuser(uitem)"
v-for="(uitem,uindex) of item.user" :class="{'content_box_body_select_box_item_on':(uitem.on==true)}">
{{uitem.name}}
</div>
</div>
</div>
</div>
</div>
<transition name="el-fade-in" v-else-if="step==2">
<div id="section2" style="width: 100%;">
<div class="content_box_body_search">
<span>* 书籍编号</span>
<el-input v-model="form.no" ref="inputNo" @change="checkBookBorrow" autofocus placeholder="请扫描条形码"
class="content_box_body_search_no"></el-input>
</div>
<div class="content_box_body_table">
<el-table :data="tableData" style="width: 100%;" height="40vh">
<el-table-column type="index" label="序号" align="center" width="80">
</el-table-column>
<el-table-column prop="name" label="书名" align="center">
</el-table-column>
<el-table-column prop="author" label="作者" align="center" width="120">
</el-table-column>
<el-table-column prop="publish_date" label="出版时间" align="center" width="120">
</el-table-column>
<el-table-column prop="publish_house" label="出版社" align="center" width="200">
</el-table-column>
<el-table-column prop="bind_way" label="装订方式" align="center" width="120">
</el-table-column>
<el-table-column prop="op" label="操作" align="center" width="120">
<template slot-scope="scope">
<el-button type="danger" size="medium" @click="del(scope.$index)" plain>删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="content_box_body_table_footer" @click="toBorrow">
<div class="content_box_body_table_footer_btn">
确定借阅
</div>
</div>
</div>
</div>
</transition>
<div id="section3" v-else-if="step==3" style="width: 100%;">
<el-result icon="success" title="借阅成功" subTitle="请及时归还图书">
<template slot="extra">
<div class="content_box_body_table_footer" @click="back">
<div class="content_box_body_table_footer_btn">
返回
</div>
</div>
</template>
</el-result>
</div>
</div>
<div class="content_box_bottom">
</div>
<div class="content_box_bottom_right">
</div>
</div>
</template>
<script>
import {
bookDetail,
userIndex,
checkBookBorrow,
bookBorrow
} from "@/api/lendCenter/index";
export default {
data() {
return {
form: {
no: ""
},
userId: "",
step: 1,
listDepts: [],
tableData: [],
listSteps: [{
step: 1,
name: '选择借阅人'
}, {
step: 2,
name: '添加借阅书籍'
}, {
step: 3,
name: '借阅成功'
}]
}
},
methods: {
del(index) {
this.tableData.splice(index, 1);
this.$nextTick(function() {
this.$refs.inputNo.focus();
this.form.no = ""
})
},
//
checkBookBorrow(no) {
let arr = this.tableData.filter(function(item) {
let no = (e.length == 7 ? e : e.substring(0, 7))
return item.no == no;
})
if (arr.length != 0) {
this.$Message.error("已在待借阅中,请勿重复添加");
this.$nextTick(function() {
this.$refs.inputNo.focus();
this.form.no = ""
})
return fals;
}
var _arr = [];
_arr.push(no)
checkBookBorrow({
no: _arr
}).then(res => {
this.bookDetail(no);
}).catch((error) => {
if (error) {
this.$nextTick(function() {
this.$refs.inputNo.focus();
this.form.no = ""
})
}
console.log(error)
})
},
//
toBorrow() {
if (this.tableData.length == 0) {
this.$Message.error("请扫码需要借阅的图书");
return false;
}
let _arr = [];
for (var mod of this.tableData) {
_arr.push(mod.no);
}
let that = this;
bookBorrow({
user_id: this.userId,
no_list: _arr
}).then(res => {
this.$Message.success("借阅完成");
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
setTimeout(function() {
loading.close();
that.step = 3;
}, 500)
}).catch(res => {
this.$Message.error(res);
})
},
//
userIndex() {
userIndex().then(res => {
for (var item of res) {
for (var user of item.user) {
user.on = false;
}
}
this.listDepts = res;
})
},
//
bookDetail(e) {
bookDetail({
no: e
}).then(res => {
if (res != {} || res.length != 0 || JSON.stringify(res) != "{}") {
this.tableData.push({
id: res.id,
no: res.no,
name: res.book?.name,
author: res.book?.author,
publish_date: res.book?.publish_date,
publish_house: res.book?.publish_house,
bind_way: res.book?.bind_way,
});
}
this.$nextTick(function() {
this.$refs.inputNo.focus();
this.form.no = ""
})
})
},
back() {
if (window.history.length <= 1) {
this.$router.push({
path: '/'
})
return false
} else {
this.$router.go(-1)
}
},
toSelectuser(item) {
var that = this;
if (item) {
item.on = true;
that.userId = item.id;
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
setTimeout(function() {
loading.close();
that.step = 2;
}, 500)
}
}
},
mounted() {
},
created() {
this.userIndex();
}
}
</script>
<style lang="scss" >
.content_box_body_table_footer {
margin: 42px auto;
.content_box_body_table_footer_btn {
width: 180px;
height: 55px;
background: linear-gradient(0deg, #AE2726, #D67179);
box-shadow: 0px 1px 10px 0px rgba(174, 39, 38, 0.35);
border-radius: 10px;
font-size: 18px;
font-family: PingFang SC;
font-weight: 400;
color: #FFFFFF;
line-height: 55px;
text-align: center;
margin: 0 auto;
cursor: pointer;
}
}
.content_box_body_table .el-table th.el-table__cell {
font-size: 20px !important;
font-family: PingFang SC !important;
font-weight: 400 !important;
color: #333333 !important;
background: #FAE6E4 !important;
}
.content_box {
background: linear-gradient(0deg, #F9E1E3, #FFFFFF);
width: 100vw;
height: 100vh;
position: relative;
padding: 61px 156px 0px 156px;
.content_box_bottom_logo {
position: absolute;
left: 156px;
top: 13.75px;
}
.content_box_header {
display: flex;
align-items: center;
justify-content: space-between;
.content_box_header_back {
width: 123px;
height: 49px;
background: #FAE6E4;
border-radius: 24px;
display: flex;
align-items: center;
padding: 0px 10px;
.content_box_header_back_text {
font-size: 20px;
font-family: PingFang SC;
font-weight: 300;
color: #AE2726;
line-height: 49px;
margin-left: 13px;
}
}
.content_box_header_title {
background: linear-gradient(90deg, #FAE6E4, #FFFFFF);
width: 539px;
height: 70px;
line-height: 70px;
font-size: 36px;
font-family: PingFang SC;
font-weight: 400;
color: #AE2726;
padding-left: 43px;
}
}
.content_box_bottom_name {
margin: 0 auto;
}
.content_box_body {
display: flex;
align-items: center;
flex-direction: column;
position: relative;
z-index: 99;
justify-content: space-between;
margin: 50px auto;
.content_box_body_select {
margin-top: 29px;
background: rgba(250, 167, 1, 0.12);
border-radius: 10px;
max-height: 60vh;
min-height: 60vh;
overflow-y: auto;
overflow-x: hidden;
width: 100%;
.content_box_body_select_box {
padding: 20px 29px;
.content_box_body_select_box_header {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 20px;
font-family: PingFang SC;
font-weight: 400;
color: #AE2726;
.content_box_body_select_box_header_left {
display: flex;
align-items: center;
span {
margin-left: 20px;
}
}
.content_box_body_select_box_header_right {
span {
display: block;
-ms-transform: rotate(90deg);
/* IE 9 */
-webkit-transform: rotate(90deg);
/* Safari and Chrome */
transform: rotate(90deg);
}
}
}
.content_box_body_select_box_items {
background: rgba(255, 255, 255, 0.8);
border-radius: 10px;
margin-left: 50px;
padding: 30px;
margin-top: 21px;
display: flex;
flex-wrap: wrap;
.content_box_body_select_box_item {
width: 100px;
height: 37px;
text-align: center;
line-height: 37px;
margin-left: 6px;
margin-bottom: 10px;
cursor: pointer;
font-weight: 400;
font-size: 1.125rem;
}
.content_box_body_select_box_item_on {
width: 100px;
height: 37px;
background: linear-gradient(0deg, #AE2726, #D67179);
box-shadow: 0px 1px 10px 0px rgba(174, 39, 38, 0.35);
border-radius: 19px;
font-family: PingFang SC;
font-weight: 400;
font-size: 1.125rem;
color: #FFFFFF;
}
}
}
}
.content_box_body_table {
width: 100%;
margin-top: 42px;
}
.content_box_body_search {
display: flex;
align-items: center;
margin-top: 30px;
justify-content: center;
span {
font-size: 18px;
font-family: PingFang SC;
font-weight: 400;
color: #AE2726;
line-height: 16px;
width: 140px;
}
.content_box_body_search_no {
width: 644px;
height: 66px;
}
.content_box_body_search_no input.el-input__inner {
height: 100% !important;
line-height: 100% !important;
font-size: 18px;
font-weight: 400;
}
}
.content_box_body_steps {
display: flex;
.content_box_body_steps_item {
width: 257px;
height: 80px;
display: flex;
line-height: 80px;
font-size: 18px;
font-family: PingFang SC;
font-weight: 400;
color: #333333;
margin-right: 25px;
justify-content: center;
align-items: center;
border-bottom: 1px solid #AE2726;
}
.content_box_body_steps_item_on {
background: url("../../assets/center/brrow_step_on.png") no-repeat;
background-size: cover;
font-size: 18px;
font-family: PingFang SC;
font-weight: 400;
color: #FBF7EC;
border-bottom: none !important;
}
}
}
.content_box_bottom {
background: url("../../assets/center/index_bottom.png") no-repeat;
width: 100%;
height: 20%;
background-size: cover;
position: fixed;
left: 0;
bottom: 0;
z-index: 1;
}
.content_box_bottom_right {
background: url("../../assets/center/index_bottom_right.png") no-repeat;
width: 801px;
height: 491px;
background-size: cover;
position: fixed;
right: 0;
bottom: 0;
z-index: 1;
}
}
</style>

@ -1,123 +0,0 @@
<template>
<div class="content_box">
<div class="content_box_bottom_logo">
<img src="../../assets/center/index_logo.png" />
</div>
<div class="content_box_header">
<div class="content_box_bottom_name">
<img src="../../assets/center/index_name.png" />
</div>
<div class="content_box_header_text">
自助借阅系统
</div>
</div>
<div class="content_box_body">
<div class="content_box_body_btn" @click="todo('/brrow')">
<img class="content_box_body_btn_img" src="../../assets/center/index_brrow.png" />
</div>
<div class="content_box_body_btn" @click="todo('/return')">
<img class="content_box_body_btn_img" src="../../assets/center/index_retrun.png" />
</div>
</div>
<div class="content_box_bottom">
</div>
<div class="content_box_bottom_right">
</div>
</div>
</template>
<script>
export default {
data() {
return {}
},
methods: {
todo(route) {
this.$router.push(route)
}
},
mounted() {
},
created() {}
}
</script>
<style lang="scss" scoped>
.content_box {
background: linear-gradient(0deg, #F9E1E3, #FFFFFF);
width: 100vw;
height: 100vh;
position: relative;
padding: 61px 156px 0px 156px;
.content_box_bottom_logo {
position: absolute;
left: 156px;
top: 13.75px;
}
.content_box_header {
display: flex;
align-items: center;
flex-direction: column;
.content_box_header_text {
font-size: 36px;
font-family: MicrosoftYaHei;
font-weight: 400;
color: #333333;
line-height: 60px;
}
}
.content_box_bottom_name {
margin: 0 auto;
}
.content_box_body {
display: flex;
flex-direction: row;
align-items: center;
position: relative;
z-index: 99;
justify-content: space-between;
margin-top: 10%;
padding: 0 5%;
.content_box_body_btn {
.content_box_body_btn_img {
width: 714*.8px;
height: 384*.8px;
}
}
}
.content_box_bottom {
background: url("../../assets/center/index_bottom.png") no-repeat;
width: 100%;
height: 20%;
background-size: cover;
position: fixed;
left: 0;
bottom: 0;
z-index: 1;
}
.content_box_bottom_right {
background: url("../../assets/center/index_bottom_right.png") no-repeat;
width: 801px;
height: 491px;
background-size: cover;
position: fixed;
right: 0;
bottom: 0;
z-index: 1;
}
}
</style>

@ -1,309 +0,0 @@
<template>
<div class="content_box">
<div class="content_box_header">
<div class="content_box_header_title">
归还
</div>
<div class="content_box_header_back" @click="back">
<img src="../../assets/center/icon_arrow.png" />
<span class="content_box_header_back_text">
返回
</span>
</div>
</div>
<div class="content_box_body">
<div class="content_box_body_search">
<span>* 书籍编号</span>
<el-input v-model="form.no" ref="inputNo" @change="returnBook" autofocus placeholder="请扫描条形码"
class="content_box_body_search_no"></el-input>
</div>
<div class="content_box_body_table">
<el-table :data="tableData" style="width: 100%;" height="47vh">
<el-table-column type="index" label="序号" align="center" width="80">
</el-table-column>
<el-table-column prop="name" label="书名" align="center">
</el-table-column>
<el-table-column prop="author" label="作者" align="center" width="120">
</el-table-column>
<el-table-column prop="publish_date" label="出版时间" align="center" width="120">
</el-table-column>
<el-table-column prop="publish_house" label="出版社" align="center" width="200">
</el-table-column>
<el-table-column prop="bind_way" label="装订方式" align="center" width="120">
</el-table-column>
</el-table>
<div class="content_box_body_table_footer" @click="back">
<div class="content_box_body_table_footer_btn">
返回
</div>
</div>
</div>
</div>
<div class="content_box_bottom">
</div>
<div class="content_box_bottom_right">
</div>
</div>
</template>
<script>
import {
bookDetail,
userIndex,
checkBookBorrow,
bookBorrow,
bookReturn
} from "@/api/lendCenter/index";
export default {
data() {
return {
form: {
no: ""
},
tableData: []
}
},
methods: {
returnBook(e) {
let arr = this.tableData.filter(function(item) {
let no = (e.length == 7 ? e : e.substring(0, 7))
return item.no == no;
});
if (arr.length != 0) {
this.$Message.error("已归还,请勿重复操作");
this.$nextTick(function() {
this.$refs.inputNo.focus();
this.form.no = ""
})
return false;
}
bookReturn({
no_list: [e]
}).then(res => {
this.$Message.success("成功归还");
this.bookDetail(e);
this.$nextTick(function() {
this.$refs.inputNo.focus();
this.form.no = ""
})
})
},
//
bookDetail(e) {
bookDetail({
no: e
}).then(res => {
if (res != {} || res.length != 0 || JSON.stringify(res) != "{}") {
this.tableData.push({
id: res.id,
no: res.no,
name: res.book?.name,
author: res.book?.author,
publish_date: res.book?.publish_date,
publish_house: res.book?.publish_house,
bind_way: res.book?.bind_way,
});
}
this.$nextTick(function() {
this.$refs.inputNo.focus();
this.form.no = ""
})
})
},
back() {
if (window.history.length <= 1) {
this.$router.push({
path: '/'
})
return false
} else {
this.$router.go(-1)
}
}
},
mounted() {
},
created() {
this.$nextTick(function() {
this.$refs.inputNo.focus();
this.form.no = ""
})
}
}
</script>
<style lang="scss">
.content_box_body_table .el-table th.el-table__cell {
font-size: 20px !important;
font-family: PingFang SC !important;
font-weight: 400 !important;
color: #333333 !important;
background: #FAE6E4 !important;
}
.content_box {
background: linear-gradient(0deg, #F9E1E3, #FFFFFF);
width: 100vw;
height: 100vh;
position: relative;
padding: 61px 156px 0px 156px;
.content_box_bottom_logo {
position: absolute;
left: 156px;
top: 13.75px;
}
.content_box_header {
display: flex;
align-items: center;
justify-content: space-between;
.content_box_header_back {
width: 123px;
height: 49px;
background: #FAE6E4;
border-radius: 24px;
display: flex;
align-items: center;
padding: 0px 10px;
.content_box_header_back_text {
font-size: 20px;
font-family: PingFang SC;
font-weight: 300;
color: #AE2726;
line-height: 49px;
margin-left: 13px;
}
}
.content_box_header_title {
background: linear-gradient(90deg, #FAE6E4, #FFFFFF);
width: 539px;
height: 70px;
line-height: 70px;
font-size: 36px;
font-family: PingFang SC;
font-weight: 400;
color: #AE2726;
padding-left: 43px;
}
}
.content_box_bottom_name {
margin: 0 auto;
}
.content_box_body {
display: flex;
align-items: center;
flex-direction: column;
position: relative;
z-index: 99;
justify-content: space-between;
margin: 50px auto;
.content_box_body_table {
width: 100%;
margin-top: 42px;
.content_box_body_table_footer {
margin: 42px auto;
.content_box_body_table_footer_btn {
width: 180px;
height: 55px;
background: linear-gradient(0deg, #AE2726, #D67179);
box-shadow: 0px 1px 10px 0px rgba(174, 39, 38, 0.35);
border-radius: 10px;
font-size: 18px;
font-family: PingFang SC;
font-weight: 400;
color: #FFFFFF;
line-height: 55px;
text-align: center;
margin: 0 auto;
cursor: pointer;
}
}
}
.content_box_body_search {
display: flex;
align-items: center;
justify-content: center;
span {
font-size: 18px;
font-family: PingFang SC;
font-weight: 400;
color: #AE2726;
line-height: 16px;
width: 140px;
}
.content_box_body_search_no {
width: 644px;
height: 66px;
}
.content_box_body_search_no input.el-input__inner {
height: 100% !important;
line-height: 100% !important;
font-size: 18px;
font-weight: 400;
}
}
.content_box_body_btn {
.content_box_body_btn_img {
width: 714*.8px;
height: 384*.8px;
}
}
}
.content_box_bottom {
background: url("../../assets/center/index_bottom.png") no-repeat;
width: 100%;
height: 20%;
background-size: cover;
position: fixed;
left: 0;
bottom: 0;
z-index: 1;
}
.content_box_bottom_right {
background: url("../../assets/center/index_bottom_right.png") no-repeat;
width: 801px;
height: 491px;
background-size: cover;
position: fixed;
right: 0;
bottom: 0;
z-index: 1;
}
}
</style>

@ -193,7 +193,7 @@
min-height: 100%;
width: 100%;
//background-color: $bg;
background: url("../../assets/bg.jpg") no-repeat;
background: url("../../assets/bg.png") no-repeat;
overflow: hidden;
.login-form {

@ -1,230 +0,0 @@
<template>
<div class="container">
<!-- 查询配置 -->
<div>
<div ref="lxHeader">
<LxHeader icon="md-apps" text="组织机构管理" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content"></div>
<slot>
<div>
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button>
<Button type="primary" @click="edit()" style="margin-left: 10px">新增</Button>
</div>
</slot>
</LxHeader>
</div>
<div class="table-tree">
<el-table :data="tableData" :height="tableHeight" class="v-table" style="width: 100%;margin-bottom: 20px;"
row-key="id" border default-expand-all :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
<el-table-column type="index" align="center">
</el-table-column>
<el-table-column prop="name" label="部门名称" sortable>
</el-table-column>
<el-table-column prop="manger" label="部门负责人" sortable width="180">
<template slot-scope="scope">
<el-tag type="primary" disable-transitions>{{scope.row.manager?scope.row.manager.name:"无"}}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="leader" label="部门分管人" sortable width="180">
<template slot-scope="scope">
<el-tag type="success" disable-transitions>{{scope.row.leader?scope.row.leader.name:"无"}}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="sort" align="center" label="排序" sortable width="80">
</el-table-column>
<el-table-column fixed="right" label="操作" width="300">
<template slot-scope="scope">
<Button type="primary" @click="addchildren(scope.row)" size="small" style="margin-left: 10px;"
ghost>下级部门</Button>
<Button type="error" @click="del(scope.row)" size="small" style="margin-left: 10px;" ghost>删除</Button>
<Button type="primary" @click="edit(scope.row)" size="small" style="margin-left: 10px;" ghost>编辑</Button>
</template>
</el-table-column>
</el-table>
</div>
</div>
<el-dialog title="组织机构编辑" :visible.sync="dialogFormVisible" width="30%">
<el-form :model="form" :rules="rules" ref="form" label-position="right" :label-width="formLabelWidth">
<el-form-item label="上级部门">
<el-input v-model="form.pname" disabled autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="部门名称" prop="name">
<el-input v-model="form.name" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="部门负责人" prop="manager">
<el-autocomplete class="inline-input" v-model="form.manager" :fetch-suggestions="querySearch"
placeholder="请输入部门负责人" :trigger-on-focus="false" @select="handleSelectManager"></el-autocomplete>
</el-form-item>
<el-form-item label="部门分管人" prop="leader">
<el-autocomplete class="inline-input" v-model="form.leader" :fetch-suggestions="querySearch"
placeholder="请输入部门分管人" :trigger-on-focus="false" @select="handleSelectLeader"></el-autocomplete>
</el-form-item>
<el-form-item label="排序">
<el-input v-model="form.sort" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="resetForm('form')"> </el-button>
<el-button type="primary" @click="submitForm('form')"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import LxHeader from "@/components/LxHeader/index.vue";
import {
list as listdept,
save,
del
} from "../../api/staff/deptIndex"
export default {
components: {
LxHeader
},
created() {
this.initLoad();
this.load();
},
mounted() {},
data() {
return {
dialogFormVisible: false,
formLabelWidth: "120px",
form: {
name: "",
id: "",
pid: "0",
manager_id: "",
leader_id: "",
manager: "",
leader: "",
sort: 0,
icon: "",
pname: "上级部门"
},
rules: {
name: [{
required: true,
message: '请输入部门名称',
trigger: 'blur'
}]
},
tableHeight: 0,
//
searchFields: {
KeyWord: ""
},
tableData: []
}
},
methods: {
querySearch(queryString, cb) {
listuser().then(response => {
var data = response.data;
for (var m of data) {
m.value = m.name;
}
cb(data)
}).catch(error => {
//reject(error)
})
},
handleSelectManager(item) {
this.form.manager_id = item.id;
},
handleSelectLeader(item) {
this.form.leader_id = item.id;
},
initLoad() {
var that = this;
var clientHeight = document.documentElement.clientHeight
var lxHeader_height = 96.5; //
var paginationHeight = 37; //
var topHeight = 50; //
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
that.tableHeight = tableHeight;
},
load() {
var that = this;
listdept({
is_tree: 1
}).then(response => {
that.tableData = response;
}).catch(error => {
//reject(error)
})
},
edit(obj) {
this.form = this.$options.data().form
if (obj) {
var result = Object.assign(this.form, obj);
if (obj.leader)
result.leader = obj.leader.name
if (obj.manager)
result.manager = obj.manager.name
this.form = result;
}
this.dialogFormVisible = true;
},
addchildren(obj) {
this.form = this.$options.data().form
if (obj) {
this.form.pname = obj.name;
this.form.pid = obj.id;
this.dialogFormVisible = true;
}
},
submitForm(formName) {
var that = this;
this.$refs[formName].validate((valid) => {
if (valid) {
save(that.form).then(response => {
console.log(response)
this.$Message.success('操作成功');
that.dialogFormVisible = false;
that.load();
}).catch(error => {
reject(error)
})
} else {
this.$Message.error('数据校验失败');
return false;
}
});
},
resetForm(formName) {
var that = this;
this.$refs[formName].resetFields();
that.dialogFormVisible = false;
},
del(obj) {
var that = this;
if (obj) {
this.$Modal.confirm({
title: '确认要删除数据?',
onOk: () => {
del({
id: obj.id
}).then(response => {
this.$Message.success('操作成功');
that.load();
}).catch(error => {
console.log(error)
reject(error)
})
},
onCancel: () => {
//this.$Message.info('Clicked cancel');
}
});
}
},
}
};
</script>

@ -1,233 +0,0 @@
<template>
<div class="container">
<!-- 查询配置 -->
<div>
<div ref="lxHeader">
<LxHeader icon="md-apps" text="借阅人管理" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content"></div>
<slot>
<div>
<Input style="width: 200px; margin-right: 10px" v-model.number="searchFields.keyword" placeholder="关键字搜索" />
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button>
<Button type="primary" @click="edit()" style="margin-left: 10px">新增借阅人</Button>
</div>
</slot>
</LxHeader>
</div>
<div class="table-tree">
<el-table :data="tableData" class="v-table" :height="tableHeight" border style="width: 100%">
<el-table-column type="index" align="center">
</el-table-column>
<el-table-column prop="name" label="用户" width="180">
</el-table-column>
<el-table-column prop="deptName" label="部门">
<template slot-scope="scope">
{{scope.row.department?scope.row.department.name:"无"}}
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="300">
<template slot-scope="scope">
<Button ghost size="small" @click="edit(scope.row)" type="primary" style="margin-left: 10px;">编辑</Button>
<Button ghost size="small" @click="del(scope.row)" type="error" style="margin-left: 10px;">删除</Button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination @current-change="handleCurrentChange" :current-page="paginations.page"
:page-size="paginations.page_size" background layout="prev, pager, next" :total="paginations.total">
</el-pagination>
</div>
</div>
<el-dialog title="借阅人编辑" :visible.sync="dialogFormVisible" width="30%">
<el-form :model="form" :rules="rules" ref="form" label-position="right" :label-width="formLabelWidth">
<el-form-item label="姓名" prop="name">
<el-input v-model="form.name" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="部门" prop="department_id">
<treeselect v-model="form.department_id" :normalizer="normalizer" :multiple="false" clearable
style="width: 300px;" :show-count="true" placeholder="选择图书类目" :options="deptList" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="resetForm('form')"> </el-button>
<el-button type="primary" @click="submitForm('form')"> </el-button>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
import LxHeader from "@/components/LxHeader/index.vue";
import {
save,
show,
list as listuser,
del
} from "../../api/staff/staffIndex.js";
import {
list as listDept
} from "../../api/staff/deptIndex.js";
// import the component
import Treeselect from '@riophae/vue-treeselect'
// import the styles
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default { // register the component
components: {
Treeselect,
LxHeader
},
created() {
var that = this;
this.initLoad();
that.loadDept();
that.load();
},
mounted() {},
data() {
return {
normalizer(node) {
return {
id: node.id,
label: node.name,
children: node.children,
}
},
deptList: [],
checkAll: false,
isIndeterminate: true,
dialogFormVisible: false,
formLabelWidth: "120px",
userNameStatus: true,
form: {
name: "",
department_id: "",
},
rules: {
name: [{
required: true,
message: '请输入姓名',
trigger: 'blur'
}],
department_id: [{
required: true,
message: '请选择部门ID',
trigger: 'change'
}]
},
paginations: {
page: 1,
page_size: 15,
total: 0
},
tableHeight: 0,
//
searchFields: {
keyword: ""
},
tableData: []
}
},
methods: {
handleCurrentChange(page) {
this.paginations.page = page;
this.load();
},
initLoad() {
var that = this;
var clientHeight = document.documentElement.clientHeight
var lxHeader_height = 96.5; //
var paginationHeight = 37; //
var topHeight = 50; //
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
that.tableHeight = tableHeight;
},
loadDept() {
listDept({
is_tree: 1
}).then(response => {
this.deptList = response;
}).catch(error => {
//reject(error)
})
},
load() {
var that = this;
listuser({
page: that.paginations.page,
...that.searchFields
}).then(response => {
var data = response.data;
that.tableData = data;
this.paginations.total = response.total;
}).catch(error => {
console.log(error)
//reject(error)
})
},
del(obj) {
var that = this;
if (obj) {
this.$Modal.confirm({
title: '确认要删除数据?',
onOk: () => {
del({
id: obj.id
}).then(response => {
this.$Message.success('操作成功');
that.load();
}).catch(error => {
console.log(error)
reject(error)
})
},
onCancel: () => {
//this.$Message.info('Clicked cancel');
}
});
}
},
edit(obj) {
this.form = this.$options.data().form
if (obj) {
var result = Object.assign(this.form, obj);
this.form = result;
}
this.dialogFormVisible = true;
},
submitForm(formName) {
var that = this;
this.$refs[formName].validate((valid) => {
if (valid) {
save(that.form).then(response => {
//console.log(response)
this.$Message.success('操作成功');
that.load();
that.dialogFormVisible = false;
}).catch(error => {
//reject(error)
})
} else {
this.$Message.error('数据校验失败');
console.log('error submit!!');
return false;
}
});
},
resetForm(formName) {
var that = this;
this.$refs[formName].resetFields();
that.dialogFormVisible = false;
}
}
};
</script>
<style>
</style>

@ -13,7 +13,7 @@ const name = defaultSettings.title // page title
// For example, Mac: sudo npm run
// You can change the port by the following methods:
// port = 9528 npm run dev OR npm run dev --port = 9528
const port = process.env.port || process.env.npm_config_port || 8014 // dev port
const port = process.env.port || process.env.npm_config_port || 8015 // dev port
// All configuration item explanations can be find in https://cli.vuejs.org/config/
module.exports = {
@ -25,7 +25,7 @@ module.exports = {
* Detail: https://cli.vuejs.org/config/#publicpath
*/
publicPath: '/admin/',
outputDir: '/Users/liuxiangyu/Work/g-guangdian/app/b-bookmanage/book-manage-service/public/admin',
outputDir: '/Users/liuxiangyu/Work/yunyubang/yunyubang-service/public/merchant',
assetsDir: 'static',
css: {
loaderOptions: { // 向 CSS 相关的 loader 传递选项
@ -45,14 +45,6 @@ module.exports = {
},
//before: require('./mock/mock-server.js'),
proxy: {
'^/query': {
target: "http://apis.juhe.cn/isbn/query",
secure: true,
changeOrigin: true, //配置跨域
pathRewrite: {
"^/query": "",
}
},
[process.env.VUE_APP_BASE_API]: {
target: process.env.VUE_APP_BASE_API,
changeOrigin: true, //配置跨域

Loading…
Cancel
Save