Bladeren bron

Merge branch 'master' of http://118.190.145.217:3000/xiaojincai/yfadmin_web

xjc 5 jaren geleden
bovenliggende
commit
f2da6ac41d

+ 3 - 1
package.json

@@ -51,7 +51,9 @@
       "plugin:vue/essential",
       "eslint:recommended"
     ],
-    "rules": {},
+    "rules": {
+      "no-console":"off"
+    },
     "parserOptions": {
       "parser": "babel-eslint"
     }

+ 22 - 1
src/api.js

@@ -194,7 +194,28 @@ export default {
 			params: params
 		})
 	},
-	
+	//资料
+	getDocsList: params => {
+		return axios.get(`${baseURL}/api/admin/docs/list`, {
+			params: params
+		})
+	},
+	getDocs: params => {
+		return axios.get(`${baseURL}/api/admin/docs`, {
+			params: params
+		})
+	},
+	saveDocs: params => {
+		return axios.post(`${baseURL}/api/admin/docs`, params);
+	},
+	putDocs: params => {
+		return axios.put(`${baseURL}/api/admin/docs`, params);
+	},
+	deleteDocs: params => {
+		return axios.delete(`${baseURL}/api/admin/docs`, {
+			params: params
+		})
+	},
 	
 	// 内容管理
 	// 栏目列表

+ 11 - 0
src/router.js

@@ -151,6 +151,17 @@ export default new Router({
           name: '新增文章',
           hide:1,
         },
+        {
+          path: '/docs',
+          component: () => import('./views/docs/Index.vue'),
+          name: '资料管理'
+        },
+        {
+          path: '/docs/add',
+          hide:1,
+          component: () => import('./views/docs/Add.vue'),
+          name: '新增资料'
+        },
       ]
     },
     {

+ 46 - 18
src/views/apply/Change.vue

@@ -1,4 +1,17 @@
-
+<style lang="scss">
+    .paydone{
+        color:#67C23A;
+    }
+    .unpay{
+        color:#FFB800;
+    }
+    .payprice{
+        color:#409EFF;
+    }
+    .el-table td, .el-table th{
+        padding:5px 0!important;
+    }
+</style>
 <template>
     <section class="apply">
         <p>报名列表 > {{subject_item}} > 换证</p>
@@ -17,7 +30,7 @@
                 <el-form-item label="报名时间">
                     <el-date-picker clearable
                     v-model="form.signup_time"
-                    type="date" value-format="yyyy-MM-dd"
+                    type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
                     placeholder="选择日期">
                     </el-date-picker>
                 </el-form-item>
@@ -43,8 +56,8 @@
                 </el-form-item>
                 <el-form-item label="考试时间" >
                     <el-date-picker clearable
-                    v-model="form.exam_time" value-format="yyyy-MM-dd"
-                    type="date"
+                    v-model="form.exam_time" value-format="yyyy-MM-dd HH:mm:ss"
+                    type="datetime"
                     placeholder="选择日期">
                     </el-date-picker>
                 </el-form-item>
@@ -59,7 +72,7 @@
                 <el-form-item label="培训时间">
                     <el-date-picker clearable
                     v-model="form.train_time1"
-                    type="daterange" value-format="yyyy-MM-dd"
+                    type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss"
                     range-separator="至"
                     start-placeholder="开始日期"
                     end-placeholder="结束日期">
@@ -113,8 +126,8 @@
                 <el-button style="float:right;margin-right:5px" @click="download('apply')"  size="small" type="info" >导出学员申报资料</el-button>
                &nbsp;&nbsp;
                 <el-button style="float:right;margin-right:5px" @click="download('exam')" size="small" type="success" >导出考勤表与申报考试表</el-button>
-                <el-button style="float:right;margin-right:5px" @click="setTime(1)" size="small" type="primary" >设置培训时间</el-button>
                 <el-button style="float:right;margin-right:5px" @click="setTime(2)" size="small" type="primary" >设置考试时间</el-button>
+                <el-button style="float:right;margin-right:5px" @click="setTime(1)" size="small" type="primary" >设置培训时间</el-button>
                 <!--<el-button style="float:right;margin-right:5px" @click="setTime(3)" size="small" type="primary" >生成学时证明</el-button>-->
               
         </div>
@@ -129,6 +142,19 @@
                 width="40">
                 </el-table-column>
                 <template v-for="(item,index) in itemList" >
+                    <el-table-column :key='index' v-if='item.checked&&item.name=="支付状态"' :width='item.width'
+                    :prop="item.value"  :label="item.name" :class-name="item.value">
+                        <template  slot-scope="scope">
+                            <span v-if="scope.row.pay_status_1" class="paydone">已支付</span>       
+                            <span v-else class="unpay">未支付</span>       
+                        </template>
+                    </el-table-column>
+                    <el-table-column :key='index' v-if='item.checked&&item.name=="支付金额"' :width='item.width'
+                    :prop="item.value"  :label="item.name" :class-name="item.value">
+                        <template  slot-scope="scope">
+                            <span class="payprice">{{scope.row.price}}</span>       
+                        </template>
+                    </el-table-column>
                     <el-table-column :key='index' v-if='item.checked&&item.name=="学时证明"' :width='item.width'
                     :prop="item.value"  :label="item.name" :class-name="item.value">
                         <template  slot-scope="scope">
@@ -148,8 +174,8 @@
                         <el-button size="mini" v-if='scope.row.order_status==9' type="danger">{{scope.row.order_status_1}}</el-button>         
                     </template>
                     </el-table-column>
-                    <el-table-column :key='index' v-if='item.checked&&item.name!="状态"&&item.name!="学时证明"' :width='item.width'
-                    :prop="item.value"  :label="item.name" show-overflow-tooltip=true>
+                    <el-table-column :key='index' v-if='item.checked&&item.name!="状态"&&item.name!="学时证明"&&item.name!="支付状态"&&item.name!="支付金额"' :width='item.width'
+                    :prop="item.value"  :label="item.name" :show-overflow-tooltip="true">
                     </el-table-column>
                 </template>             
                 <el-table-column
@@ -201,17 +227,17 @@ export default {
       checkList:[],
       class_list:[],
       itemList:[
-          {name:'姓名', value:'name',checked:true},
+          {name:'姓名', value:'name',checked:true,width:'70px'},
           {name:'联系电话', value:'phone',checked:true,width:'120px'},
-          {name:'状态', value:'order_status_1',checked:true,width:'200px'},
+          {name:'状态', value:'order_status_1',checked:true,width:'110px'},
           {name:'支付状态', value:'pay_status_1',checked:true},
           {name:'支付金额', value:'price',checked:true},
           {name:'管理员备注', value:'remark',checked:true,width:'150px'},
           {name:'报名类型', value:'subject_item0',checked:true,width:'120px'},
           {name:'作业类别', value:'subject_item1',checked:true,width:'150px'},
           {name:'准操项目', value:'subject_item2',checked:true,width:'200px'},
-          {name:'培训类型', value:'train_type',checked:true},
-          {name:'学时证明', value:'classhour_cert_url',checked:true,width:'150px'},
+          {name:'培训类型', value:'train_type',checked:true,width:"90px"},
+          {name:'学时证明', value:'classhour_cert_url',checked:true,width:'90px'},
           {name:'培训时间', value:'train_time',checked:true,width:'200px'},
           {name:'考试时间', value:'exam_time',checked:true,width:'150px'},
           {name:'报名时间', value:'signup_time',checked:true,width:'150px'},
@@ -250,7 +276,7 @@ export default {
       },
       getData(){
           var parm=this.form;
-          if(parm.train_time1){parm.train_time=parm.train_time1.join(',')};
+          if(parm.train_time1){parm.train_time=parm.train_time1.join(',')}
           this.loading=true;
           if(this.order_status != '-3'){parm.order_status=this.order_status}else{parm.order_status=''}
           this.$api.getSignList(parm).then(res=>{
@@ -298,11 +324,13 @@ export default {
                     type: 'warning'
                 }).then(() => {
                    this.$api.deleteSign({id:id}).then((res)=>{
-                        this.$message({
-                            message: '删除成功',
-                            type: 'success'
-                        })
-                        this.getData()
+                        if(res.status=="suc"){
+                            this.$message({
+                                message: '删除成功',
+                                type: 'success'
+                            })
+                            this.getData()
+                        }
                 })
             })
       },

+ 46 - 25
src/views/apply/New.vue

@@ -1,6 +1,16 @@
 <style lang="scss">
-    
-    
+    .paydone{
+        color:#67C23A;
+    }
+    .unpay{
+        color:#FFB800;
+    }
+    .payprice{
+        color:#409EFF;
+    }
+    .el-table td, .el-table th{
+        padding:2px 2px!important;
+    }
 </style>
 <template>
     <section class="apply" v-loading="download_loading">
@@ -48,8 +58,8 @@
                 </el-form-item>
                 <el-form-item label="考试时间" v-if="more_search">
                     <el-date-picker clearable
-                    v-model="form.exam_time" value-format="yyyy-MM-dd"
-                    type="date"
+                    v-model="form.exam_time" value-format="yyyy-MM-dd HH:mm:ss"
+                    type="datetime"
                     placeholder="选择日期">
                     </el-date-picker>
                 </el-form-item>
@@ -61,7 +71,7 @@
                 <el-form-item label="培训时间" v-if="more_search">
                     <el-date-picker clearable
                     v-model="form.train_time1"
-                    type="daterange" value-format="yyyy-MM-dd"
+                    type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss"
                     range-separator="至"
                     start-placeholder="开始日期"
                     end-placeholder="结束日期">
@@ -70,7 +80,7 @@
                 <el-form-item>
                     <span @click="more_search=!more_search" style="font-size:12px;color:#999;cursor:pointer;">   高级搜索</span>
                     <i v-if="!more_search" @click="more_search=!more_search" class="el-icon-arrow-down"></i>
-                    <i v-else="more_search" @click="more_search=!more_search" class="el-icon-arrow-up"></i>
+                    <i v-else @click="more_search=!more_search" class="el-icon-arrow-up"></i>
                 </el-form-item>
                 <el-form-item style="">
                        <el-button  @click="list=[],getData()" type="primary" icon="el-icon-search">搜索</el-button>
@@ -120,8 +130,8 @@
                 <el-button style="float:right;margin-right:5px" @click="download('apply')"  size="small" type="info" >导出学员申报资料</el-button>
                &nbsp;&nbsp;
                 <el-button style="float:right;margin-right:5px" @click="download('exam')" size="small" type="success" >导出考勤表与申报考试表</el-button>
-                <el-button style="float:right;margin-right:5px" @click="setTime(1)" size="small" type="primary" >设置培训时间</el-button>
                 <el-button style="float:right;margin-right:5px" @click="setTime(2)" size="small" type="primary" >设置考试时间</el-button>
+                <el-button style="float:right;margin-right:5px" @click="setTime(1)" size="small" type="primary" >设置培训时间</el-button>
                 <!--<el-button style="float:right;margin-right:5px" @click="setTime(3)" size="small" type="primary" >生成学时证明</el-button>-->
               
         </div>
@@ -136,6 +146,19 @@
                 width="40">
                 </el-table-column>
                 <template v-for="(item,index) in itemList" >
+                    <el-table-column :key='index' v-if='item.checked&&item.name=="支付状态"' :width='item.width'
+                    :prop="item.value"  :label="item.name" :class-name="item.value">
+                        <template  slot-scope="scope">
+                            <span v-if="scope.row.pay_status_1" class="paydone">已支付</span>       
+                            <span v-else class="unpay">未支付</span>       
+                        </template>
+                    </el-table-column>
+                    <el-table-column :key='index' v-if='item.checked&&item.name=="支付金额"' :width='item.width'
+                    :prop="item.value"  :label="item.name" :class-name="item.value">
+                        <template  slot-scope="scope">
+                            <span class="payprice">{{scope.row.price}}</span>       
+                        </template>
+                    </el-table-column>
                     <el-table-column :key='index' v-if='item.checked&&item.name=="学时证明"' :width='item.width'
                     :prop="item.value"  :label="item.name" :class-name="item.value">
                         <template  slot-scope="scope">
@@ -155,8 +178,8 @@
                             <el-button size="mini" v-if='scope.row.order_status==9' type="danger">{{scope.row.order_status_1}}</el-button>    
                         </template>
                     </el-table-column>
-                    <el-table-column :key='index' v-if='item.checked&&item.name!="状态"&&item.name!="学时证明"' :width='item.width'
-                    :prop="item.value"  :label="item.name" show-overflow-tooltip=true>
+                    <el-table-column :key='index' v-if='item.checked&&item.name!="状态"&&item.name!="学时证明"&&item.name!="支付状态"&&item.name!="支付金额"' :width='item.width'
+                    :prop="item.value"  :label="item.name" :show-overflow-tooltip="true">
                     </el-table-column>
                 </template>             
                 <el-table-column
@@ -178,14 +201,14 @@
             width="30%">
             <el-date-picker
             v-model="time1" v-show='date_type == 1'
-            type="daterange" value-format="yyyy-MM-dd"
+            type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss"
             range-separator="至"
             start-placeholder="开始日期"
             end-placeholder="结束日期">
             </el-date-picker>
             <el-date-picker
             v-model="time2" v-show='date_type == 2'
-            type="date" value-format="yyyy-MM-dd">
+            type="datetime" value-format="yyyy-MM-dd HH:mm:ss">
             </el-date-picker>
             <span slot="footer" class="dialog-footer">
                 <el-button @click="dialogVisible = false">取 消</el-button>
@@ -207,17 +230,17 @@ export default {
       key:1,
       checkList:[],
       itemList:[
-          {name:'姓名', value:'name',checked:true},
+          {name:'姓名', value:'name',checked:true,width:'70px'},
           {name:'联系电话', value:'phone',checked:true,width:'120px'},
-          {name:'状态', value:'order_status_1',checked:true,width:'200px'},
+          {name:'状态', value:'order_status_1',checked:true,width:'110px'},
           {name:'支付状态', value:'pay_status_1',checked:true},
           {name:'支付金额', value:'price',checked:true},
           {name:'管理员备注', value:'remark',checked:true,width:'150px'},
           {name:'报名类型', value:'subject_item0',checked:true,width:'120px'},
           {name:'作业类别', value:'subject_item1',checked:true,width:'150px'},
           {name:'准操项目', value:'subject_item2',checked:true,width:'200px'},
-          {name:'培训类型', value:'train_type',checked:true},
-          {name:'学时证明', value:'classhour_cert_url',checked:true,width:'150px'},
+          {name:'培训类型', value:'train_type',checked:true,width:"90px"},
+          {name:'学时证明', value:'classhour_cert_url',checked:true,width:'90px'},
           {name:'培训时间', value:'train_time',checked:true,width:'200px'},
           {name:'考试时间', value:'exam_time',checked:true,width:'150px'},
           {name:'报名时间', value:'signup_time',checked:true,width:'150px'},
@@ -258,7 +281,7 @@ export default {
       },
       getData(){
           var parm=this.form;
-          if(parm.train_time1){parm.train_time=parm.train_time1.join(',')};
+          if(parm.train_time1){parm.train_time=parm.train_time1.join(',')}
           this.loading=true;
           if(this.order_status != '-3'){parm.order_status=this.order_status}else{parm.order_status=''}
           this.$api.getSignList(parm).then(res=>{
@@ -292,7 +315,6 @@ export default {
           })
       },
       subChange(data){
-          console.log(data)
           this.form.subject_item=this.subject_item+'|'+data.join('|');
           this.getData();
       },
@@ -306,11 +328,13 @@ export default {
                     type: 'warning'
                 }).then(() => {
                    this.$api.deleteSign({id:id}).then((res)=>{
-                        this.$message({
-                            message: '删除成功',
-                            type: 'success'
-                        })
-                        this.getData()
+                       if(res.status=="suc"){
+                            this.$message({
+                                message: '删除成功',
+                                type: 'success'
+                            })
+                            this.getData()
+                       }
                 })
             })
       },
@@ -332,7 +356,6 @@ export default {
       },
       handleSelectionChange(val) {
           this.ids=val      
-          console.log(val)
       },
       setStatus(type,text){
           var ids=[],val=this.ids;
@@ -385,7 +408,6 @@ export default {
       },
       save(){
           var parm={id:this.select_ids}
-          console.log(this.time)
           if(this.date_type == 1){
               parm.train_time=this.time1.join(',')
           }else if(this.date_type == 2){
@@ -438,7 +460,6 @@ export default {
                 ${tr}
             </table>
         `
-        console.log(table)
         newwindow.document.write(table);
         newwindow.window.print();  
       },

+ 47 - 19
src/views/apply/Update.vue

@@ -1,4 +1,17 @@
-
+<style lang="scss">
+    .paydone{
+        color:#67C23A;
+    }
+    .unpay{
+        color:#FFB800;
+    }
+    .payprice{
+        color:#409EFF;
+    }
+    .el-table td, .el-table th{
+        padding:5px 0!important;
+    }
+</style>
 <template>
     <section class="apply">
         <p>报名列表 > {{subject_item}} > 复审</p>
@@ -43,8 +56,8 @@
                 </el-form-item>
                 <el-form-item label="考试时间" >
                     <el-date-picker clearable
-                    v-model="form.exam_time" value-format="yyyy-MM-dd"
-                    type="date"
+                    v-model="form.exam_time" value-format="yyyy-MM-dd HH:mm:ss"
+                    type="datetime"
                     placeholder="选择日期">
                     </el-date-picker>
                 </el-form-item>
@@ -59,7 +72,7 @@
                 <el-form-item label="培训时间">
                     <el-date-picker clearable
                     v-model="form.train_time1"
-                    type="daterange" value-format="yyyy-MM-dd"
+                    type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss"
                     range-separator="至"
                     start-placeholder="开始日期"
                     end-placeholder="结束日期">
@@ -113,8 +126,8 @@
                 <el-button style="float:right;margin-right:5px" @click="download('apply')"  size="small" type="info" >导出学员申报资料</el-button>
                &nbsp;&nbsp;
                 <el-button style="float:right;margin-right:5px" @click="download('exam')" size="small" type="success" >导出考勤表与申报考试表</el-button>
-                <el-button style="float:right;margin-right:5px" @click="setTime(1)" size="small" type="primary" >设置培训时间</el-button>
                 <el-button style="float:right;margin-right:5px" @click="setTime(2)" size="small" type="primary" >设置考试时间</el-button>
+                <el-button style="float:right;margin-right:5px" @click="setTime(1)" size="small" type="primary" >设置培训时间</el-button>
                 <!--<el-button style="float:right;margin-right:5px" @click="setTime(3)" size="small" type="primary" >生成学时证明</el-button>-->
               
         </div>
@@ -129,6 +142,19 @@
                 width="40">
                 </el-table-column>
                 <template v-for="(item,index) in itemList" >
+                    <el-table-column :key='index' v-if='item.checked&&item.name=="支付状态"' :width='item.width'
+                    :prop="item.value"  :label="item.name" :class-name="item.value">
+                        <template  slot-scope="scope">
+                            <span v-if="scope.row.pay_status_1" class="paydone">已支付</span>       
+                            <span v-else class="unpay">未支付</span>       
+                        </template>
+                    </el-table-column>
+                    <el-table-column :key='index' v-if='item.checked&&item.name=="支付金额"' :width='item.width'
+                    :prop="item.value"  :label="item.name" :class-name="item.value">
+                        <template  slot-scope="scope">
+                            <span class="payprice">{{scope.row.price}}</span>       
+                        </template>
+                    </el-table-column>
                     <el-table-column :key='index' v-if='item.checked&&item.name=="学时证明"' :width='item.width'
                     :prop="item.value"  :label="item.name" :class-name="item.value">
                         <template  slot-scope="scope">
@@ -148,8 +174,8 @@
                         <el-button size="mini" v-if='scope.row.order_status==9' type="danger">{{scope.row.order_status_1}}</el-button>            
                     </template>
                     </el-table-column>
-                    <el-table-column :key='index' v-if='item.checked&&item.name!="状态"&&item.name!="学时证明"' :width='item.width'
-                    :prop="item.value"  :label="item.name" show-overflow-tooltip=true>
+                    <el-table-column :key='index' v-if='item.checked&&item.name!="状态"&&item.name!="学时证明"&&item.name!="支付状态"&&item.name!="支付金额"' :width='item.width'
+                    :prop="item.value"  :label="item.name" :show-overflow-tooltip="true">
                     </el-table-column>
                 </template>             
                 <el-table-column
@@ -171,14 +197,14 @@
             width="30%">
             <el-date-picker
             v-model="time1" v-show='date_type == 1'
-            type="daterange" value-format="yyyy-MM-dd"
+            type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss"
             range-separator="至"
             start-placeholder="开始日期"
             end-placeholder="结束日期">
             </el-date-picker>
             <el-date-picker
             v-model="time2" v-show='date_type == 2'
-            type="date" value-format="yyyy-MM-dd">
+            type="datetime" value-format="yyyy-MM-dd HH:mm:ss">
             </el-date-picker>
             <span slot="footer" class="dialog-footer">
                 <el-button @click="dialogVisible = false">取 消</el-button>
@@ -201,17 +227,17 @@ export default {
       checkList:[],
       class_list:[],
       itemList:[
-          {name:'姓名', value:'name',checked:true},
+          {name:'姓名', value:'name',checked:true,width:'70px'},
           {name:'联系电话', value:'phone',checked:true,width:'120px'},
-          {name:'状态', value:'order_status_1',checked:true,width:'200px'},
+          {name:'状态', value:'order_status_1',checked:true,width:'110px'},
           {name:'支付状态', value:'pay_status_1',checked:true},
           {name:'支付金额', value:'price',checked:true},
           {name:'管理员备注', value:'remark',checked:true,width:'150px'},
           {name:'报名类型', value:'subject_item0',checked:true,width:'120px'},
           {name:'作业类别', value:'subject_item1',checked:true,width:'150px'},
           {name:'准操项目', value:'subject_item2',checked:true,width:'200px'},
-          {name:'培训类型', value:'train_type',checked:true},
-          {name:'学时证明', value:'classhour_cert_url',checked:true,width:'150px'},
+          {name:'培训类型', value:'train_type',checked:true,width:"90px"},
+          {name:'学时证明', value:'classhour_cert_url',checked:true,width:'90px'},
           {name:'培训时间', value:'train_time',checked:true,width:'200px'},
           {name:'考试时间', value:'exam_time',checked:true,width:'150px'},
           {name:'报名时间', value:'signup_time',checked:true,width:'150px'},
@@ -250,7 +276,7 @@ export default {
       },
       getData(){
           var parm=this.form;
-          if(parm.train_time1){parm.train_time=parm.train_time1.join(',')};
+          if(parm.train_time1){parm.train_time=parm.train_time1.join(',')}
           this.loading=true;
           if(this.order_status != '-3'){parm.order_status=this.order_status}else{parm.order_status=''}
           this.$api.getSignList(parm).then(res=>{
@@ -298,11 +324,13 @@ export default {
                     type: 'warning'
                 }).then(() => {
                    this.$api.deleteSign({id:id}).then((res)=>{
-                        this.$message({
-                            message: '删除成功',
-                            type: 'success'
-                        })
-                        this.getData()
+                        if(res.status=="suc"){
+                            this.$message({
+                                message: '删除成功',
+                                type: 'success'
+                            })
+                            this.getData()
+                        }
                 })
             })
       },

+ 1 - 1
src/views/classes/Index.vue

@@ -87,7 +87,7 @@
                 prop="zip"  width="200"
                 label="操作">
                 <template slot-scope="scope">
-                    <el-button @click="download(scope.row.id)" size="mini"  type="success">导出学员</el-button>
+                    <!--<el-button @click="download(scope.row.id)" size="mini"  type="success">导出学员</el-button>-->
                     <el-button @click="$router.push({path:'/classes/add',query:{id:scope.row.id}})" size="mini" type="warning">编辑</el-button>
                     <el-button @click="del(scope.row.id)" size="mini"  type="danger">删除</el-button>
                 </template>

+ 3 - 2
src/views/content/addArticle.vue

@@ -77,6 +77,7 @@
         <el-form-item label="多图上传">
           <ul class="imgs">
             <li v-for="(item,index) in form.imgs" :key='index'>
+                <i class="el-icon-delete" @click="form.imgs.splice(index,1)"></i>
                 <img width="100%" :src="item" alt="">
             </li>
             <li class="up_img">
@@ -92,7 +93,7 @@
           </baidu-map> -->
           <el-input style="width:100%" v-model="keyword" placeholder="请输入关键词搜索"></el-input>
           <p>点击地图添加标记  &nbsp;&nbsp; 当前标记地址:{{form.address}}</p>
-          <baidu-map @click="getClickInfo"   @ready="onBaiduMapReady" class="map bm-view" :center="point.lng||point.lat?point:'成都'" :zoom="15" :scroll-wheel-zoom="true">
+          <baidu-map @click="getClickInfo"   @ready="onBaiduMapReady" class="map bm-view" :center="point.lng||point.lat?point:'巴中'" :zoom="15" :scroll-wheel-zoom="true">
             <bm-view style="width: 100%; height:300px;"></bm-view>
             <bm-marker  :position="point" :dragging="true" animation="BMAP_ANIMATION_BOUNCE">
             </bm-marker>
@@ -204,7 +205,7 @@ export default {
       }
     },
     onBaiduMapReady(e) {
-      const that = this
+      // const that = this
       this.BMap = e.BMap
     },
      getClickInfo(e) {

+ 115 - 0
src/views/docs/Add.vue

@@ -0,0 +1,115 @@
+<style lang="scss">
+    .add{
+        .el-input,button{
+            width: 300px;
+        }
+    }
+</style>
+<template>
+    <section class="add">
+        <p>内容管理  >  资料管理  >  新增资料</p>
+        <div class="content" v-loading.fullscreen.lock="fullscreenLoading">
+            <el-form label-width="80px">
+                <el-form-item label="资料名称">
+                        <el-input placeholder="资料名称" v-model="form.name"></el-input>
+                </el-form-item>
+                <el-form-item label="资料文件">
+                    <a :href="form.url">{{form.url}}</a>
+                    <input type="file" @change="upload('url')" id='url'>
+                </el-form-item>
+                <el-form-item label=" ">
+                        <el-button @click="save" type="primary">保存</el-button>
+                </el-form-item>
+            </el-form>
+        </div>
+    </section>
+</template>
+<script>
+import Subject from '../../components/Subject';
+export default {
+  components:{
+        Subject
+    },
+  data(){
+    return{
+      fullscreenLoading:false,
+      form:{},
+      id:''
+    }
+  },
+  methods:{
+      subChange(data,id){
+          this.form.subject_id=id
+          this.form.subject_item=data.join('|')
+      },
+      upload(type){
+          var file=document.getElementById(type).files;
+          var data=new FormData();
+            data.append("file",file[0])
+            this.fullscreenLoading=true
+          this.$api.uploadFile(data).then(res=>{
+              this.fullscreenLoading=false
+              if(res.data.code==0){
+                      let form=this.form;
+                      this.$set(form,type,res.data.data.url)
+                      this.$message({message: '上传成功!',type: 'success'});
+                  }else{
+                      this.$message.error(res.data.message);
+                  }
+          })
+      },
+      getData(){
+          this.$api.getDocs({id:this.form.id}).then(res=>{
+              this.form=res.data.data
+          })
+      },
+      save(){
+          var parm=this.form;
+          if(parm.id){
+              this.$api.putDocs(parm).then(res=>{
+                  if(res.data.code==0){
+                      this.$message({message: '修改成功!',type: 'success'});
+                      this.$router.push({path:'/docs'})
+                  }else{
+                      this.$message.error(res.data.message);
+                  }
+              })
+          }else{
+              this.$api.saveDocs(parm).then(res=>{
+                  if(res.data.code==0){
+                      this.$message({message: '添加成功!',type: 'success'});
+                      this.$router.push({path:'/docs'})
+                  }else{
+                      this.$message.error(res.data.message);
+                  }
+              })
+          }
+      },
+      del(id){
+            this.$confirm('确定删除吗', '提示', {
+                    type: 'warning'
+                }).then(() => {
+                   this.$api.deleteDocs({id:id}).then((res)=>{
+                        this.$message({
+                            message: '删除成功',
+                            type: 'success'
+                        })
+                        this.getData()
+                })
+            })
+      },
+  },
+  created(){
+      if(this.$route.query.id){
+            this.form.id=this.$route.query.id
+            this.id=this.$route.query.id
+            this.getData()
+        }
+  }
+}
+</script>
+
+
+
+
+

+ 127 - 0
src/views/docs/Index.vue

@@ -0,0 +1,127 @@
+<style lang="scss">
+    .apply{
+       .filter{
+            background: #fff;
+            padding: 20px 20px 10px; 
+            border:1px solid #EDEDED;
+            border-radius:2px;
+            margin-bottom: 10px;
+            margin-top: 10px;
+            .el-form-item{
+                margin-bottom: 10px;
+            }
+            .el-input,.el-select{
+                width: 150px;
+            }
+    
+       }
+       thead{
+           th{
+               background: #eee;
+           }
+       }
+    }
+</style>
+<template>
+    <section class="apply">
+        <p>内容管理  >  资料管理</p>
+        <div class="filter">
+            <el-form label-width="80px" :inline="true" size="small">
+                <el-form-item label="资料名称">
+                        <el-input placeholder="资料名称" v-model="form.name"></el-input>
+                </el-form-item>
+                <el-form-item>
+                       <el-button @click="getData" type="primary" icon="el-icon-search">搜索</el-button>
+                       <el-button @click="$router.push({path:'/docs/add'})" type="primary">新增</el-button>
+                </el-form-item>
+            </el-form>
+        </div>
+
+
+        <el-table
+                class="table"
+                :data="list" height="450px"
+                border  v-loading="loading"
+                style="width: 100%">
+                <el-table-column
+                prop="name"
+                label="资料名称">
+                </el-table-column>
+                <el-table-column
+                prop="title"
+                label="文件">
+                <template slot-scope="scope">
+                    <a :href="scope.row.url"><i style="font-size:16px;" class="el-icon-link">下载</i></a>
+                </template>
+                </el-table-column>
+                <el-table-column
+                prop="ctime"
+                label="创建时间">
+                </el-table-column>
+                <el-table-column
+                prop="zip" width="200"
+                label="操作">
+                <template slot-scope="scope">
+                    <el-button @click="$router.push({path:'/docs/add',query:{id:scope.row.id}})"  size="mini" type="success">编辑</el-button>
+                    <el-button @click="del(scope.row.id)"  size="mini" type="danger">删除</el-button>
+                </template>
+                </el-table-column>
+        </el-table>
+        <Page  ref="pageButton"  :total='total' @pageChange='gopage'/>
+    </section>
+</template>
+<script>
+import Page from '../../components/Page';
+import Subject from '../../components/Subject';
+export default {
+  components:{
+        Page,Subject
+    },
+  data(){
+    return{
+      form:{name:'',page:1,page_size:20},
+      activeName:"1",
+      total:1,
+      list:[],
+      loading:false
+    }
+  },
+  methods:{
+      gopage(size){
+          if(size){
+              this.form.page_size=size
+          }
+            this.form.page=this.$refs.pageButton.page
+            this.getData()
+      },
+      subChange(data){
+          this.form.subject_item=data.join('|')
+      },
+      getData(){
+         var parm=this.form;
+         this.loading=true
+          this.$api.getDocsList(parm).then(res=>{
+              this.list=res.data.data.list
+              this.total=res.data.data.total
+              this.loading=false
+          })
+      },
+      del(id){
+            this.$confirm('确定删除吗', '提示', {
+                    type: 'warning'
+                }).then(() => {
+                   this.$api.deleteDocs({id:id}).then((res)=>{
+                        this.$message({
+                            message: '删除成功',
+                            type: 'success'
+                        })
+                        this.getData()
+                })
+            })
+      },
+  },
+  created(){
+      this.getData()
+  }
+}
+</script>