|
@@ -75,6 +75,7 @@ import useDebounceFn from "@/hooks/useDebounceFn";
|
|
import { getDeliveryBookList, getBooksByName, addDeliveryBook } from "@/api";
|
|
import { getDeliveryBookList, getBooksByName, addDeliveryBook } from "@/api";
|
|
import { TableColumnOfPutBooks } from "../_pageOptions/table-put";
|
|
import { TableColumnOfPutBooks } from "../_pageOptions/table-put";
|
|
import { IBookSearchResult, IDeliveryBook } from "@/types/api";
|
|
import { IBookSearchResult, IDeliveryBook } from "@/types/api";
|
|
|
|
+import useValidate from "../../hooks/useValidate";
|
|
|
|
|
|
const PutBooks = defineComponent({
|
|
const PutBooks = defineComponent({
|
|
components: {
|
|
components: {
|
|
@@ -150,16 +151,19 @@ const PutBooks = defineComponent({
|
|
// TODO 没做字段校验 字段校验封装
|
|
// TODO 没做字段校验 字段校验封装
|
|
this.addFormState.inConfirm = true;
|
|
this.addFormState.inConfirm = true;
|
|
const { official_id, platform, book } = this.addFormState;
|
|
const { official_id, platform, book } = this.addFormState;
|
|
- await addDeliveryBook({
|
|
|
|
- delivery_bid: book.id!,
|
|
|
|
- official_id,
|
|
|
|
- platform,
|
|
|
|
- });
|
|
|
|
|
|
+ // useValidate({ official_id, platform });
|
|
|
|
+ await addDeliveryBook(
|
|
|
|
+ useValidate({
|
|
|
|
+ delivery_bid: book.id!,
|
|
|
|
+ official_id,
|
|
|
|
+ platform,
|
|
|
|
+ })
|
|
|
|
+ );
|
|
this.open = false;
|
|
this.open = false;
|
|
this.$message.success("添加成功");
|
|
this.$message.success("添加成功");
|
|
} catch (error) {
|
|
} catch (error) {
|
|
- console.log("error while add delivery book", error);
|
|
|
|
- this.$message.error("添加失败!");
|
|
|
|
|
|
+ console.log("error while add delivery book");
|
|
|
|
+ error.message && this.$message.error(error.message);
|
|
} finally {
|
|
} finally {
|
|
this.addFormState.inConfirm = false;
|
|
this.addFormState.inConfirm = false;
|
|
}
|
|
}
|