浏览代码

订阅价格接口

natasha 1 年之前
父节点
当前提交
34f6f131e0
共有 2 个文件被更改,包括 46 次插入66 次删除
  1. 1 1
      src/views/login.vue
  2. 45 65
      src/views/system_config/OrderSetting.vue

+ 1 - 1
src/views/login.vue

@@ -163,7 +163,7 @@ export default {
                     user_name:this.loginCodeForm.phone,
                     user_name:this.loginCodeForm.phone,
                     password:this.loginCodeForm.code,
                     password:this.loginCodeForm.code,
                     is_dynamic_verification_code_login:"true",
                     is_dynamic_verification_code_login:"true",
-                    dynamic_verification_send_type:"SMS"
+                    dynamic_verification_code_send_type:"SMS"
                 }
                 }
             }
             }
             getLogin(MethodName, data)
             getLogin(MethodName, data)

+ 45 - 65
src/views/system_config/OrderSetting.vue

@@ -14,7 +14,7 @@
                     </div>
                     </div>
                 </div>
                 </div>
                 <div class="tabs">
                 <div class="tabs">
-                    <a :class="[typeValue===item.value?'active':'']" @click="handleChangeTabs(item.value)" v-for="item in typeList" :key="item.value">{{item.label}}</a>
+                    <a :class="[typeValue===item.study_phase?'active':'']" @click="handleChangeTabs(item.study_phase)" v-for="item in $studyType" :key="item.study_phase">{{item.study_phase_name}}</a>
                 </div>
                 </div>
                 <el-table
                 <el-table
                     class="search-table order-table"
                     class="search-table order-table"
@@ -28,28 +28,28 @@
                         width="64">
                         width="64">
                     </el-table-column>
                     </el-table-column>
                     <el-table-column
                     <el-table-column
-                        prop="period"
+                        prop="period_num"
                         label="总期数"
                         label="总期数"
                         width="152">
                         width="152">
                         <template slot-scope="scope">
                         <template slot-scope="scope">
-                            <el-input v-model="scope.row.period" placeholder="输入" maxlength="20"></el-input>
+                            <el-input v-model="scope.row.period_num" placeholder="输入" maxlength="20"></el-input>
                         </template>
                         </template>
                     </el-table-column>
                     </el-table-column>
                     <el-table-column
                     <el-table-column
-                        prop="issue"
+                        prop="comb_count"
                         label="合刊"
                         label="合刊"
                         width="152">
                         width="152">
                         <template slot-scope="scope">
                         <template slot-scope="scope">
-                            <el-input v-model="scope.row.issue" placeholder="0" maxlength="20"></el-input>
+                            <el-input v-model="scope.row.comb_count" placeholder="1" maxlength="20"></el-input>
                         </template>
                         </template>
                     </el-table-column>
                     </el-table-column>
                     <el-table-column
                     <el-table-column
-                        prop="date"
+                        prop="shelve_date"
                         label="发行日期"
                         label="发行日期"
                         width="152" >
                         width="152" >
                        <template slot-scope="scope">
                        <template slot-scope="scope">
                             <el-date-picker
                             <el-date-picker
-                                v-model="scope.row.date"
+                                v-model="scope.row.shelve_date"
                                 prefix-icon="-"
                                 prefix-icon="-"
                                 type="date"
                                 type="date"
                                 placeholder="选择日期"
                                 placeholder="选择日期"
@@ -90,6 +90,7 @@ import NavMenu from "../../components/NavMenu.vue"
 import Breadcrumb from '../../components/Breadcrumb.vue';
 import Breadcrumb from '../../components/Breadcrumb.vue';
 import { getLogin } from "@/api/ajax";
 import { getLogin } from "@/api/ajax";
 import { cutMoneyFiter } from '@/utils/defined';
 import { cutMoneyFiter } from '@/utils/defined';
+import { mapState } from 'vuex';
 
 
 export default {
 export default {
   //import引入的组件需要注入到对象中才能使用
   //import引入的组件需要注入到对象中才能使用
@@ -121,38 +122,12 @@ export default {
             }
             }
         ],
         ],
         loading: false,
         loading: false,
-        typeValue: 'huakan',
-        typeList: [
-            {
-                value: 'huakan',
-                label: '画刊'
-            },
-            {
-                value: 'xiaoxue',
-                label: '小学'
-            },
-            {
-                value: 'chuyi',
-                label: '初一'
-            },
-            {
-                value: 'chuer',
-                label: '初二'
-            },
-            {
-                value: 'chusan',
-                label: '初三'
-            },
-            {
-                value: 'gaoyi',
-                label: '高一'
-            }
-        ],
+        typeValue: 11,
         tableList:[
         tableList:[
             {
             {
-                period: '',
-                issue: '',
-                date: '',
+                period_num: '',
+                comb_count: '',
+                shelve_date: '',
                 price: ''
                 price: ''
             }
             }
         ],
         ],
@@ -161,7 +136,7 @@ export default {
   },
   },
   //计算属性 类似于data概念
   //计算属性 类似于data概念
   computed: {
   computed: {
-    
+    ...mapState(['$studyType', 'file_preview_url']),
   },
   },
   //监控data中数据变化
   //监控data中数据变化
   watch: {
   watch: {
@@ -171,33 +146,36 @@ export default {
   methods: {
   methods: {
     handleChangeTabs(value){
     handleChangeTabs(value){
         this.typeValue = value
         this.typeValue = value
+        this.getInfo()
     },
     },
     // 去掉前后空格
     // 去掉前后空格
     handleTrim(form,fild){
     handleTrim(form,fild){
         this[form][fild] = this[form][fild].trim()
         this[form][fild] = this[form][fild].trim()
     },
     },
     // 提交表单
     // 提交表单
-    onSubmit(formName){
-        this.$refs[formName].validate((valid) => {
-          if (valid) {
-            this.loading = true
-            let MethodName = "/OrgServer/Manager/SysConfigManager/SetSysConfig_SharePath";
-            let data = {
-                article_share_url_path: this.registerForm.article_share_url_path
-            }
-            getLogin(MethodName, data)
-            .then((res) => {
-                this.loading = false
-                if(res.status===1){
-                    this.$message.success("保存成功")
-                }
-            }).catch((res) =>{
-                this.loading = false
-            })
-          } else {
-            return false;
-          }
+    onSubmit(){
+        this.loading = true
+        let MethodName = "/OrgServer/Manager/ReservationPriceManager/SaveReservationPriceList";
+        let table = JSON.parse(JSON.stringify(this.tableList))
+        table.forEach(item => {
+            item.comb_count = item.comb_count ? item.comb_count * 1 : 1
+            item.price = item.price * 1
+            item.period_num = item.period_num *1
         });
         });
+        let data = {
+            goods_type: 2,
+            goods_study_phase: this.typeValue,
+            reservation_price_list: table
+        }
+        getLogin(MethodName, data)
+        .then((res) => {
+            this.loading = false
+            if(res.status===1){
+                this.$message.success("保存成功")
+            }
+        }).catch((res) =>{
+            this.loading = false
+        })
     },
     },
     // 取消 恢复到修改前状态
     // 取消 恢复到修改前状态
     onCancel(){
     onCancel(){
@@ -205,11 +183,14 @@ export default {
     },
     },
     // 得到配置信息
     // 得到配置信息
     getInfo(){
     getInfo(){
-        let MethodName = "/OrgServer/Manager/SysConfigManager/GetSysConfig_SharePath";
-        getLogin(MethodName, {})
+        let MethodName = "/OrgServer/Manager/ReservationPriceManager/GetReservationPriceList";
+        getLogin(MethodName, {
+            goods_type: 2,
+            goods_study_phase: this.typeValue
+        })
         .then((res) => {
         .then((res) => {
             if(res.status===1){
             if(res.status===1){
-                
+                this.tableList = res.reservation_price_list
             }
             }
         }).catch((res) =>{
         }).catch((res) =>{
             
             
@@ -238,9 +219,9 @@ export default {
         }else{
         }else{
             for(let i = 0; i < Number(type); i++){
             for(let i = 0; i < Number(type); i++){
                 let obj = {
                 let obj = {
-                    period: '',
-                    issue: '',
-                    date: '',
+                    period_num: '',
+                    comb_count: '',
+                    shelve_date: '',
                     price: ''
                     price: ''
                 }
                 }
                 this.tableList.push(obj)
                 this.tableList.push(obj)
@@ -255,7 +236,6 @@ export default {
   },
   },
   //生命周期 - 挂载完成(可以访问DOM元素)
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
   mounted() {
-
   },
   },
   //生命周期-创建之前
   //生命周期-创建之前
   beforeCreated() { },
   beforeCreated() { },