-
![]()
+
@@ -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();
+ })
}
}
diff --git a/src/views/bookStore/components/putIn.vue b/src/views/bookStore/components/putIn.vue
index 181d18d..b71dd5e 100644
--- a/src/views/bookStore/components/putIn.vue
+++ b/src/views/bookStore/components/putIn.vue
@@ -3,12 +3,23 @@
+
+
+
@@ -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() {
diff --git a/vue.config.js b/vue.config.js
index fd07d30..7ab996f 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -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]: {