Преглед на файлове

Merge branch 'master' of http://221.216.211.14:3000/GCLS/GCLS_Page_Book

gcj преди 3 години
родител
ревизия
9db4a7115a
променени са 6 файла, в които са добавени 101 реда и са изтрити 53 реда
  1. 1 1
      package.json
  2. 39 39
      src/permission.js
  3. 16 0
      src/router/index.js
  4. 19 0
      src/views/courseList.vue
  5. 8 0
      src/views/courseView.vue
  6. 18 13
      src/views/discountCodeList.vue

+ 1 - 1
package.json

@@ -17,7 +17,7 @@
     "@tinymce/tinymce-vue": "^3.2.8",
     "awe-dnd": "^0.3.4",
     "axios": "0.18.1",
-    "book-ui": "file:../GCLS-Book-question-ui/book-ui-0.2.17.tgz",
+    "book-ui": "file:../GCLS-Book-question-ui/book-ui-0.2.19.tgz",
     "cnchar": "^3.0.1",
     "cnchar-all": "^3.0.1",
     "cnchar-order": "^3.0.1",

+ 39 - 39
src/permission.js

@@ -10,49 +10,49 @@ NProgress.configure({ showSpinner: false }) // NProgress Configuration
 
 const whiteList = ['/login', '/BookBrowsing'] // no redirect whitelist
 
-router.beforeEach(async (to, from, next) => {
-  // start progress bar
-  NProgress.start()
-  // set page title
-  document.title = getPageTitle(to.meta.title)
-  //next();
-  NProgress.done()
-  const hasToken = getToken()
-  if (hasToken) {
-    let config = getConfig();
-    if (config) {
-      if (to.path === '/login') {
-        // if is logged in, redirect to the home page
-        next({ path: '/EnterSys' })
-        NProgress.done()
-      } else {
-        try {
-          next()
-        } catch (error) {
-          Message.error(error || 'Has Error')
-          next(`/login?redirect=${to.path}`)
-          NProgress.done()
+router.beforeEach(async(to, from, next) => {
+    // start progress bar
+    NProgress.start()
+        // set page title
+    document.title = getPageTitle(to.meta.title)
+        //next();
+    NProgress.done()
+    const hasToken = getToken()
+    if (hasToken || to.path === '/BookBrowsing' || to.path === '/courseview') {
+        let config = getConfig();
+        if (config || to.path === '/BookBrowsing' || to.path === '/courseview') {
+            if (to.path === '/login') {
+                // if is logged in, redirect to the home page
+                next({ path: '/EnterSys' })
+                NProgress.done()
+            } else {
+                try {
+                    next()
+                } catch (error) {
+                    Message.error(error || 'Has Error')
+                    next(`/login?redirect=${to.path}`)
+                    NProgress.done()
+                }
+            }
+        } else {
+            removeToken();
+            next(`/login?redirect=${to.path}`)
+            NProgress.done()
         }
-      }
     } else {
-      removeToken();
-      next(`/login?redirect=${to.path}`)
-      NProgress.done()
-    }
-  } else {
-    /* has no token*/
-    if (whiteList.indexOf(to.path) !== -1) {
-      // in the free login whitelist, go directly
-      next()
-    } else {
-      // other pages that do not have permission to access are redirected to the login page.
-      next(`/login?redirect=${to.path}`)
-      NProgress.done()
+        /* has no token*/
+        if (whiteList.indexOf(to.path) !== -1) {
+            // in the free login whitelist, go directly
+            next()
+        } else {
+            // other pages that do not have permission to access are redirected to the login page.
+            next(`/login?redirect=${to.path}`)
+            NProgress.done()
+        }
     }
-  }
 })
 
 router.afterEach(() => {
-  // finish progress bar
-  NProgress.done()
+    // finish progress bar
+    NProgress.done()
 })

+ 16 - 0
src/router/index.js

@@ -206,6 +206,22 @@ export function handleSysType(sys_type, path_type) {
                 path = '/curGoodsDetail?' + cs
             }
             break;
+        case 'NPC':
+            if (path_type == 'home') {
+                path = '/GCLS-Book-Component-NPC/#/EnterSys';
+            } else if (path_type == 'goods') {
+
+                path = '/curGoodsDetail?' + cs
+            }
+            break;
+        case 'NNPE':
+            if (path_type == 'home') {
+                path = '/GCLS-Book-Component-NNPE/#/EnterSys';
+            } else if (path_type == 'goods') {
+
+                path = '/curGoodsDetail?' + cs
+            }
+            break;
         case 'AILP':
             console.log('课后三点半')
             if (path_type == 'home') {

+ 19 - 0
src/views/courseList.vue

@@ -263,6 +263,18 @@
         </el-form-item>
         <el-form-item
           class="label-input"
+          label="丛书编号"
+          label-width="90px"
+          prop="series_code"
+        >
+          <el-input
+            autocomplete="off"
+            name="series_code"
+            v-model="formDialog.series_code"
+          ></el-input>
+        </el-form-item>
+        <el-form-item
+          class="label-input"
           label="价格"
           label-width="90px"
           prop="price"
@@ -381,6 +393,7 @@ export default {
         edition: "",
         publisher: "",
         publish_number: "",
+        series_code: "",
         publish_status: -1,
       },
       dialogFlag: false, // 新建教材弹出层
@@ -396,6 +409,7 @@ export default {
         org_name: "",
         publish_scope: 0,
         publish_number: "",
+        series_code: "",
         picture_id: "",
         id: "",
         publisher: "",
@@ -434,6 +448,9 @@ export default {
         publish_number: [
           { required: true, trigger: "blur", validator: validateNull },
         ],
+        type_id: [
+          { required: true, message: "请选择教材类型", trigger: "change" },
+        ],
         org_id: [{ required: true, message: "请选择机构", trigger: "change" }],
         price: [{ required: true, validator: validatePrice }],
       },
@@ -566,6 +583,7 @@ export default {
         org_name: "",
         publish_scope: 0,
         publish_number: "",
+        series_code: "",
         picture_id: "",
         id: "",
         publisher: "",
@@ -809,6 +827,7 @@ export default {
             picture_id: res.picture_id,
             name_english: res.name_english,
             publish_number: res.publish_number,
+            series_code: res.series_code,
             publisher: res.publisher,
             edition: res.edition,
             type_id: res.type_id,

+ 8 - 0
src/views/courseView.vue

@@ -161,6 +161,14 @@ export default {
           name: "新航标职业英语 综合英语(提高级)学生用书1 (第3版)",
           id: "002-20211011-10-GOLXUZST4G",
         },
+        {
+          name: "新航标英语 汽车英语",
+          id: "002-20211222-15-O7WVMR4XHK",
+        },
+        {
+          name: "新航标职业英语 英语视听说教程(入门级)1",
+          id: "001-20211222-15-LXK64LQZST",
+        },
       ],
     };
   },

+ 18 - 13
src/views/discountCodeList.vue

@@ -56,7 +56,7 @@
 <script>
 import Header from "@/components/inputModules/common/Header";
 import Nav from "@/components/inputModules/common/Nav";
-import { getContent } from "@/api/ajax";
+import { LearnWebSI } from "@/api/ajax";
 import { getToken } from '@/utils/auth'
 import { encodeURL } from 'js-base64';
 export default {
@@ -104,12 +104,13 @@ export default {
         onSubmit () {
             if(this.discountNumber){
                 this.loading = true;
-                let MethodName = 'book-book_manager-BatchCreateDiscountCodeForBook'
+                let MethodName = 'order-discount_manager-BatchCreateDiscountCodeFoGoods'
                 let data = {
-                    book_id:this.bookId,
+                    goods_id:this.bookId,
+                    goods_type:101,
                     count:Number(this.discountNumber)
                 }
-                getContent(MethodName, data)
+                LearnWebSI(MethodName, data)
                 .then((res) => {
                     this.$message.success("操作成功");
                     this.discountNumber = null
@@ -133,14 +134,15 @@ export default {
         },
         // 查询数据列表
         getList () {
-            let MethodName = "page_query-PageQueryBookDiscountCodeList";
+            let MethodName = "page_query-PageQueryGoodsDiscountCodeList";
             let data = {
-                book_id: this.bookId,
+                goods_id: this.bookId,
+                goods_type: 101,
                 page_capacity: this.page_capacity,
                 cur_page: this.currentPage,
                 use_status:-1
             };
-            getContent(MethodName, data).then(
+            LearnWebSI(MethodName, data).then(
                 (res) => {
                     let _this = this;
                     _this.tableData = res.discount_code_list;
@@ -163,11 +165,13 @@ export default {
                 type: "warning",
             })
                 .then(() => {
-                    let MethodName = "book-book_manager-DeleteBookDiscountCode";
+                    let MethodName = "order-discount_manager-DeleteGoodsDiscountCode";
                     let data = {
-                        id: row.id,
+                        goods_id:this.bookId,
+                        goods_type:101,
+                        discount_code_id: row.id,
                     };
-                    getContent(MethodName, data).then(
+                    LearnWebSI(MethodName, data).then(
                         (res) => {
                             this.currentPage = 1;
                             this.getList()
@@ -194,13 +198,14 @@ export default {
                 UserType = user.user_type;
                 SessionID = user.session_id;
             }
-            let MethodName = "data_export-ExportBookDiscountCodeList"
+            let MethodName = "data_export-ExportGoodsDiscountCodeList"
             let data = {
-                book_id: this.bookId,
+                goods_id: this.bookId,
+                goods_type: 101,
                 use_status:this.exportRadio
             }
             window.open(process.env.VUE_APP_BASE_API +
-                    `/GCLSBookWebSI/ServiceInterface?MethodName=${MethodName}&UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}&Parameter=${encodeURIComponent(JSON.stringify(data))}`) 
+                    `/GCLSLearnWebSI/ServiceInterface?MethodName=${MethodName}&UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}&Parameter=${encodeURIComponent(JSON.stringify(data))}`) 
             this.exportLoading = false
         }
     }