刘翔宇-旅管家 3 years ago
parent 893dfbe7d5
commit 42f18b3326

@ -32,3 +32,4 @@ export function del(params) {
params
})
}

@ -33,8 +33,24 @@ export function del(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
})
}

@ -90,6 +90,7 @@ service.interceptors.response.use(
}
return Promise.reject(new Error(res.errmsg || 'Error'))
} else {
// console.log(res)
return res
}
},

@ -24,11 +24,12 @@
<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="300">
<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>
@ -92,7 +93,7 @@
justifyContent: 'center'
}
} > < img src = {
row.small_cover?.url
(row.small_cover?row.small_cover.url:(row.big_cover?row.big_cover.url:''))
}
style = 'width:120px;height:120px' > < /img></div > )
}
@ -133,7 +134,11 @@
],
}
},
methods: {
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;

@ -53,7 +53,7 @@
<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">
<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>
@ -125,6 +125,15 @@
</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>
@ -168,7 +177,9 @@
<script>
import {
save,
show
show,
isbn,
isbnCheck
} from "@/api/bookStore/bookIndex";
import {
list as bookTypeIndex
@ -252,6 +263,7 @@
this.type = ''
this.$refs['addActivity'].reset();
this.detail.id = "";
this.detail.small_cover = "";
this.detail.big_cover = "";
}
@ -284,14 +296,29 @@
this.$Message.error("请正确输入ISBN");
return false;
}
get_isbn({
isbnCheck({
isbn: e
}, function(res) {
console.log(res)
if (res.error_code != 0) {
}).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 = res.result.data;
let book = json.result.data;
that.detail.name = book.title;
that.detail.sub_title = book.subtitle;
that.detail.author = book.author;

@ -124,7 +124,10 @@
let res = await show({
id: this.id
})
Object.assign(this.detail, res);
Object.assign(this.detail, res);
if(!this.detail.small_cover){
this.detail.small_cover=res.big_cover;
}
}
},
computed: {

@ -75,7 +75,7 @@
}
} > < img src = {
row.barcode
} > < /img></div > )
} style='width:120px;height:90px'> < /img></div > )
}
}, {

Loading…
Cancel
Save