zjxpcyc 6 年前
父节点
当前提交
154a9a7094
共有 3 个文件被更改,包括 9 次插入68 次删除
  1. 4
    9
      src/pages/system/library/books/detail.vue
  2. 1
    1
      src/pages/system/library/books/list.vue
  3. 4
    58
      src/store/library/index.js

+ 4
- 9
src/pages/system/library/books/detail.vue 查看文件

@@ -135,28 +135,23 @@ export default {
135 135
   watch: {
136 136
     detail: {
137 137
       handler (nv, ov) {
138
-        console.log(nv)
139 138
         if (nv.BookId === this.formData.BookId) {
140 139
           return
141 140
         }
142 141
 
142
+        if (!this.$route.params.id) {
143
+          return
144
+        }
145
+
143 146
         let CaseId = nv.CaseId
144 147
         if (!CaseId) {
145 148
           CaseId = this.defaultCase
146 149
         }
147 150
 
148 151
         this.formData = { ...nv, CaseId }
149
-        // this.mergeDetail(nv)
150 152
       },
151 153
       immediate: true,
152 154
     },
153
-    // formData: {
154
-    //   handler (nv) {
155
-    //     console.log('----------', nv)
156
-    //     this.bookImg = nv.BookImg
157
-    //   },
158
-    //   deep: true,
159
-    // },
160 155
   },
161 156
   methods: {
162 157
     ...mapMutations({

+ 1
- 1
src/pages/system/library/books/list.vue 查看文件

@@ -90,7 +90,7 @@
90 90
       width="50%">
91 91
       <div :style="{ margin: 'auto', width: '80%' }">
92 92
         <div><el-button @click="inputRef.click()" :style="{ width: '100%' }">上传文件</el-button></div>
93
-        <div><el-button type="text" size="medium" :style="{ float: 'right' }">下载导入模板</el-button></div>
93
+        <div :style="{ textAlign: 'right', paddingTop: '20px' }"><a href="https://jinchengjiaye.oss-cn-beijing.aliyuncs.com/excel/books-batch-import.xlsx" download="书籍导入模板" :style="{ color: '#409EFF' }">下载导入模板</a></div>
94 94
       </div>
95 95
       <span slot="footer" class="dialog-footer">
96 96
         <el-button type="primary" @click="showDialog = false">确 定</el-button>

+ 4
- 58
src/store/library/index.js 查看文件

@@ -7,72 +7,18 @@ export default {
7 7
   state: {
8 8
     page: 0,
9 9
     pagenum: 0,
10
-    list: [
11
-      {
12
-        BookId: '1',
13
-        BookTypeId: '1',
14
-        BookName: '遮天',
15
-        BookBarcode: '123456',
16
-        BookImg: 'http://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/upload/135230460466.png',
17
-        Author: '辰东',
18
-        Publisher: '南京出版社',
19
-        Price: 90.00,
20
-        InStock: 10,
21
-        LeftNum: 2,
22
-        BorrowNum: 5,
23
-        BorrowDays: 7,
24
-        BookDescription: '《遮天》是一部古典仙侠类型的网络小说',
25
-        CaseId: '1',
26
-        OrgId: '1',
27
-        CreateDate: new Date(),
28
-        IsRecommend: 1,
29
-        Status: 1,
30
-      },
31
-    ],
10
+    list: [],
32 11
     detail: {},
33 12
     type: {
34 13
       page: 0,
35 14
       pagenum: 0,
36
-      list: [
37
-        {
38
-          BookTypeId: '1',
39
-          BookTypeName: '测试',
40
-          BookTypeImg: 'http://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/upload/135230460466.png',
41
-          CaseId: '1',
42
-          OrgId: '1',
43
-          Nums: 100,
44
-          Status: 1,
45
-          CreateDate: new Date()
46
-        }
47
-      ],
48
-      detail: {
49
-        BookTypeId: '',
50
-        BookTypeName: '',
51
-        BookTypeImg: '',
52
-        CaseId: '',
53
-        OrgId: '1',
54
-        Status: 1,
55
-        CreateDate: new Date()
56
-      },
15
+      list: [],
16
+      detail: {},
57 17
     },
58 18
     stock: {
59 19
       page: 0,
60 20
       pagenum: 0,
61
-      list: [
62
-        {
63
-          RecordId: '1',
64
-          BookId: '1',
65
-          InStockTotal: 20,
66
-          InStockBefore: 8,
67
-          InStockAfter: 10,
68
-          ChangeReason: '补库存',
69
-          ChangeDate: new Date(),
70
-          ChangeUser: '1',
71
-          ChangeUserName: 'admin',
72
-          CaseId: '1',
73
-          OrgId: '1',
74
-        }
75
-      ],
21
+      list: [],
76 22
       detail: {},
77 23
     },
78 24
     borrow: {