刘翔宇-旅管家 3 years ago
parent 19b3df2f7e
commit 1db595ef45

@ -35,10 +35,10 @@ export function request(api, params, callback) {
export function get_isbn(params, callback) {
const api = "/ISBN"
const api = "/query"
requestGet(api, {
params: {
key: "376b36e8dc0771b23dc85ac4e7749c5f",
key: "417d45266d502c8f67235e96f1e891e2",
...params
}
}, callback)

@ -92,7 +92,7 @@
}
} > <img src = {
row.small_cover?.url
} > </img></div> )
} style='width:120px;height:120px'> </img></div> )
}
}, {

@ -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">
<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>
@ -76,7 +76,7 @@
<div class="xy-table-item-content">
<div v-if="detail.big_cover" style="position: relative;">
<img :src="detail.big_cover" class="avatar">
<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>
@ -178,7 +178,6 @@
get_isbn
} from "@/api/bookStore/interface";
import {
uploadFile,
uploadFileByUrl
@ -251,11 +250,16 @@
} else {
this.id = ''
this.type = ''
this.$refs['addActivity'].reset();
this.detail.small_cover = "";
this.detail.big_cover = "";
this.$refs['addActivity'].reset();
this.detail.small_cover = "";
this.detail.big_cover = "";
}
let that = this;
this.$nextTick(function() {
console.log(that.$refs.inputisbn)
that.$refs.inputisbn.focus();
})
}
},
methods: {
@ -281,28 +285,28 @@
return false;
}
get_isbn({
sub: e
isbn: e
}, function(res) {
console.log(res)
if (res.error_code != 0) {
that.$Message.error("存在错误" + res.error_code);
} else {
let book = res.result;
let book = res.result.data;
that.detail.name = book.title;
that.detail.sub_title = book.subtitle;
that.detail.author = book.author;
that.detail.bind_way = book.binding;
that.detail.publish_date = book.pubdate;
that.detail.bind_way = book.paper;
that.detail.publish_date = book.pubDate;
that.detail.publish_house = book.publisher;
that.detail.font_total = book.pages;
that.detail.content = book.summary;
that.detail.font_total = book.wordNum;
that.detail.content = book.gist;
if (book.images_medium && book.images_medium != '') {
that.downloadByBlob(book.images_medium, "small_cover", "small_cover_id");
if (book.smallImg && book.smallImg != '') {
that.downloadByBlob(book.smallImg, "small_cover", "small_cover_id");
}
if (book.images_large && book.images_large != '') {
that.downloadByBlob(book.images_medium, "big_cover", "big_cover_id");
if (book.img && book.img != '') {
that.downloadByBlob(book.img, "big_cover", "big_cover_id");
}
}
@ -376,7 +380,7 @@
editor() {
if (this.detail.id == "") {
let _arr = [];
let _arr = [];
console.log(this.detail.stockNum)
for (var i = 0; i < this.detail.stockNum; i++) {
_arr.push({
@ -384,7 +388,7 @@
remark: "",
status: 0,
})
}
}
console.log(this.detail.id)
this.detail.details = _arr;
}
@ -409,7 +413,11 @@
})
},
mounted() {
let that = this;
that.$nextTick(function() {
console.log(that.$refs.inputisbn)
that.$refs.inputisbn.focus();
})
}
}
</script>

@ -3,12 +3,23 @@
<!-- 编辑-->
<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-input clearable placeholder="请填写入库日期" v-model="detail.enter_date" style="width: 150px;" />
<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>
@ -42,15 +53,17 @@
return {
isShow: false,
id: "",
bookid:"",
id: "",
bookid: "",
type: "add",
detail: {
book_id: "",
id: "",
no: "",
enter_date: "",
remark: ""
remark: "",
status: 0,
booknum: 1
},
rules: {
enter_date: [{
@ -83,11 +96,17 @@
Object.assign(this.detail, res);
},
editor() {
saveDetail(this.detail).then(res => {
for (var i = 1; i <= this.detail.booknum;i++) {
saveDetail(this.detail).then(res => {
})
}
this.isShow = false
this.$Message.success("操作成功");
this.$emit('refresh')
})
},
},
@ -96,6 +115,7 @@
},
created() {
let that = this;
that.detail.enter_date = this.$moment().format("YYYY-MM-DD")
},
mounted() {

@ -45,12 +45,12 @@ module.exports = {
},
//before: require('./mock/mock-server.js'),
proxy: {
'^/ISBN': {
target: "http://feedback.api.juhe.cn/ISBN",
'^/query': {
target: "http://apis.juhe.cn/isbn/query",
secure: true,
changeOrigin: true, //配置跨域
pathRewrite: {
"^/ISBN": "",
"^/query": "",
}
},
[process.env.VUE_APP_BASE_API]: {

Loading…
Cancel
Save