刘翔宇-旅管家 3 years ago
parent 1db595ef45
commit 893dfbe7d5

@ -1,8 +1,7 @@
NODE_ENV = production
# just a flag # just a flag
ENV = 'staging' ENV = 'production'
# base api # base api
VUE_APP_BASE_API = '/stage-api' VUE_APP_BASE_API = http://book.com
VUE_APP_UPLOAD_API =http://book.com/api/admin/upload-file
VUE_APP_PUBLIC='/admin/'

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

@ -21,14 +21,15 @@
</lx-header> </lx-header>
<xy-table :list="list" :table-item="table" :total="total"> <xy-table :list="list" :table-item="table" :total="total" @pageSizeChange="pageSizeChange"
@pageIndexChange="pageChange">
<template v-slot:btns> <template v-slot:btns>
<el-table-column fixed="right" header-align="center" align="center" label="操作" width="300"> <el-table-column fixed="right" header-align="center" align="center" label="操作" width="300">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="slot-btns"> <div class="slot-btns">
<Button type="primary" @click="edit(scope.row)"></Button> <Button type="primary" @click="edit(scope.row)"></Button>
<Button type="primary" @click="view(scope.row)" style="margin-left: 10px;">查看</Button> <Button type="primary" @click="view(scope.row)" style="margin-left: 10px;">查看</Button>
<Button type="primary" @click="put(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> <Button type="error" @click="deleteitem(scope.row)" style="margin-left: 10px;">删除</Button>
</div> </div>
</template> </template>
@ -57,8 +58,8 @@
export default { export default {
components: { components: {
addBook, addBook,
viewBook, viewBook,
putIn putIn
}, },
data() { data() {
@ -77,22 +78,23 @@
width: 280, width: 280,
fixed: 'left', fixed: 'left',
},{ }, {
prop: 'small_cover', prop: 'small_cover',
label: '图片', label: '图片',
align: 'cneter', align: 'cneter',
width: 140, width: 140,
fixed: 'left', fixed: 'left',
customFn: (row) => { customFn: (row) => {
return ( <div style = { return ( < div style = {
{ {
display: 'flex', display: 'flex',
alignItems: 'center', alignItems: 'center',
justifyContent: 'center' justifyContent: 'center'
} }
} > <img src = { } > < img src = {
row.small_cover?.url row.small_cover?.url
} style='width:120px;height:120px'> </img></div> ) }
style = 'width:120px;height:120px' > < /img></div > )
} }
}, { }, {
@ -131,14 +133,14 @@
], ],
} }
}, },
methods: { methods: {
put(row){ put(row) {
this.$refs['putIn'].id = ""; this.$refs['putIn'].id = "";
this.$refs['putIn'].bookid = row.id; this.$refs['putIn'].bookid = row.id;
this.$refs['putIn'].detail.book_id = row.id; this.$refs['putIn'].detail.book_id = row.id;
this.$refs['putIn'].isShow = true; this.$refs['putIn'].isShow = true;
this.$refs['putIn'].type = 'add' this.$refs['putIn'].type = 'add'
}, },
doSearch() { doSearch() {
this.select.page = 1; this.select.page = 1;
@ -147,6 +149,10 @@
add() { add() {
this.$refs['addBook'].isShow = true this.$refs['addBook'].isShow = true
}, },
pageChange(e) {
this.select.page = e
this.load();
},
pageSizeChange(e) { pageSizeChange(e) {
this.select.page_size = e; this.select.page_size = e;
this.select.page = 1; this.select.page = 1;
@ -182,8 +188,7 @@
mounted() { mounted() {
this.load() this.load()
}, },
created() { created() {}
}
} }
</script> </script>
@ -196,4 +201,4 @@
margin-bottom: 6px; margin-bottom: 6px;
} }
} }
</style> </style>

@ -25,7 +25,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="name" label="条形码" align="center" width="180"> <el-table-column prop="name" label="条形码" align="center" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<img :src="scope.row.barcode" /> <img :src="scope.row.barcode" style="width: 120px;height: 90px;" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="remark" label="备注"> <el-table-column prop="remark" label="备注">
@ -38,6 +38,7 @@
<el-table-column prop="opt" label="操作"> <el-table-column prop="opt" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button @click="toPrint(scope.row)"></el-button> <el-button @click="toPrint(scope.row)"></el-button>
<el-button @click="toDelete(scope.row)" type='danger' style='margin-left: 10px;'>删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -51,7 +52,9 @@
show show
} from "@/api/bookStore/bookIndex"; } from "@/api/bookStore/bookIndex";
import {
del as delStore
} from "@/api/bookStore/storeList";
export default { export default {
@ -91,20 +94,31 @@
} }
}, },
methods: { methods: {
toDelete(row) {
delStore({
id: row.id
}).then(res => {
this.getDetail();
this.$Message.success("操作成功");
})
},
toPrint(row) { toPrint(row) {
this.window.width = screen.availWidth * 0.95 // this.window.width = screen.availWidth * 0.95
this.window.height = screen.availHeight * 0.95 // this.window.height = screen.availHeight * 0.95
this.window.top = (window.screen.height - 30 - this.window.height) / 2 // this.window.top = (window.screen.height - 30 - this.window.height) / 2
this.window.left = (window.screen.width - 10 - this.window.width) / 2 // this.window.left = (window.screen.width - 10 - this.window.width) / 2
let obj = { // let obj = {
id: row.id, // id: row.id,
barcode: row.barcode // barcode: row.barcode
} // }
let url = `${process.env.VUE_APP_PUBLIC}print.html?json=${JSON.stringify(obj)}` // let url = `${process.env.VUE_APP_PUBLIC}print.html?json=${JSON.stringify(obj)}`
window.open(url, 'toPrint', // window.open(url, 'toPrint',
`top=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0` // `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() { async getDetail() {
let res = await show({ let res = await show({

@ -15,15 +15,14 @@
<Button style="margin-left: 10px" type="primary" @click="select={page:1,keyword:''}"> <Button style="margin-left: 10px" type="primary" @click="select={page:1,keyword:''}">
</Button> </Button>
<Button style="margin-left: 10px" type="primary" @click="doSearch"></Button> <Button style="margin-left: 10px" type="primary" @click="doSearch"></Button>
<Button style="margin-left: 10px" type="primary" @click="doPrint"></Button>
</div> </div>
</slot> </slot>
</lx-header> </lx-header>
<xy-table :list="list" :table-item="table" :total="total"> <xy-table :list="list" :table-item="table" :total="total" @pageSizeChange="pageSizeChange"
<template v-slot:btns> @pageIndexChange="pageChange" @delete="deleteitem" >
</template>
</xy-table> </xy-table>
</div> </div>
@ -127,6 +126,14 @@
doSearch() { doSearch() {
this.select.page = 1; this.select.page = 1;
this.load(); 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) { pageSizeChange(e) {
@ -146,12 +153,7 @@
this.load(); this.load();
this.$Message.success("操作成功"); this.$Message.success("操作成功");
}) })
}, }
pageChange(e) {
this.select.page = e
this.load()
},
}, },
mounted() { mounted() {
this.load() this.load()

@ -56,7 +56,7 @@
class="content_box_body_search_no"></el-input> class="content_box_body_search_no"></el-input>
</div> </div>
<div class="content_box_body_table"> <div class="content_box_body_table">
<el-table :data="tableData" style="width: 100%;" height="300px"> <el-table :data="tableData" style="width: 100%;" height="40vh">
<el-table-column type="index" label="序号" align="center" width="80"> <el-table-column type="index" label="序号" align="center" width="80">
</el-table-column> </el-table-column>
<el-table-column prop="name" label="书名" align="center"> <el-table-column prop="name" label="书名" align="center">
@ -305,7 +305,7 @@
} }
.content_box_body_table .el-table th.el-table__cell { .content_box_body_table .el-table th.el-table__cell {
font-size: 20px !important; font-size: 20px !important;
@ -385,8 +385,8 @@
margin-top: 29px; margin-top: 29px;
background: rgba(250, 167, 1, 0.12); background: rgba(250, 167, 1, 0.12);
border-radius: 10px; border-radius: 10px;
max-height: 400px; max-height: 60vh;
min-height: 400px; min-height: 60vh;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
width: 100%; width: 100%;
@ -442,6 +442,8 @@
margin-left: 6px; margin-left: 6px;
margin-bottom: 10px; margin-bottom: 10px;
cursor: pointer; cursor: pointer;
font-weight: 400;
font-size: 1.125rem;
} }
.content_box_body_select_box_item_on { .content_box_body_select_box_item_on {
@ -451,7 +453,8 @@
box-shadow: 0px 1px 10px 0px rgba(174, 39, 38, 0.35); box-shadow: 0px 1px 10px 0px rgba(174, 39, 38, 0.35);
border-radius: 19px; border-radius: 19px;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 400; font-weight: 400;
font-size: 1.125rem;
color: #FFFFFF; color: #FFFFFF;
} }
} }

@ -28,8 +28,7 @@
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return {} return {}
@ -62,14 +61,15 @@
.content_box_header { .content_box_header {
display: flex; display: flex;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
.content_box_header_text{
font-size: 36px; .content_box_header_text {
font-family: MicrosoftYaHei; font-size: 36px;
font-weight: 400; font-family: MicrosoftYaHei;
color: #333333; font-weight: 400;
line-height: 60px; color: #333333;
line-height: 60px;
} }
} }
@ -78,13 +78,14 @@
} }
.content_box_body { .content_box_body {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
position: relative; position: relative;
z-index: 99; z-index: 99;
justify-content: space-between; justify-content: space-between;
margin-top: 100px; margin-top: 10%;
padding: 0 5%;
.content_box_body_btn { .content_box_body_btn {

@ -20,7 +20,7 @@
class="content_box_body_search_no"></el-input> class="content_box_body_search_no"></el-input>
</div> </div>
<div class="content_box_body_table"> <div class="content_box_body_table">
<el-table :data="tableData" style="width: 100%;" height="300px"> <el-table :data="tableData" style="width: 100%;" height="47vh">
<el-table-column type="index" label="序号" align="center" width="80"> <el-table-column type="index" label="序号" align="center" width="80">
</el-table-column> </el-table-column>
<el-table-column prop="name" label="书名" align="center"> <el-table-column prop="name" label="书名" align="center">
@ -141,7 +141,7 @@
</script> </script>
<style lang="scss"> <style lang="scss">
.content_box_body_table .el-table th.el-table__cell { .content_box_body_table .el-table th.el-table__cell {
font-size: 20px !important; font-size: 20px !important;

Loading…
Cancel
Save