|
@@ -11,7 +11,7 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
<el-button @click="form.page=1,getData()" type="primary" icon="el-icon-search">搜索</el-button>
|
|
<el-button @click="form.page=1,getData()" type="primary" icon="el-icon-search">搜索</el-button>
|
|
|
- <el-button icon="el-icon-plus" @click="$router.push({path:'/company/add'})" type="primary">新增资料</el-button>
|
|
|
|
|
|
|
+ <el-button icon="el-icon-plus" @click="dialogVisible=true" type="primary">新增资料</el-button>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
</div>
|
|
</div>
|
|
@@ -38,12 +38,30 @@
|
|
|
prop="zip" width="170"
|
|
prop="zip" width="170"
|
|
|
label="操作">
|
|
label="操作">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- <el-button icon="el-icon-edit" @click="$router.push({path:'/company/add',query:{id:scope.row.id}})" size="mini" type="warning">编辑</el-button>
|
|
|
|
|
|
|
+ <el-button icon="el-icon-download" @click="download(scope.row.fileurl)" size="mini" type="warning">下载</el-button>
|
|
|
<el-button icon="el-icon-delete" @click="del(scope.row.id)" size="mini" type="danger">删除</el-button>
|
|
<el-button icon="el-icon-delete" @click="del(scope.row.id)" size="mini" type="danger">删除</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
<Page ref="pageButton" :total='total' @pageChange='gopage'/>
|
|
<Page ref="pageButton" :total='total' @pageChange='gopage'/>
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ title="新增资料" center
|
|
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
|
|
+ width="500px">
|
|
|
|
|
+ <el-form label-width="60px">
|
|
|
|
|
+ <el-form-item label="标题">
|
|
|
|
|
+ <el-input clearable v-model="doc.name"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="附件">
|
|
|
|
|
+ <input @change="upload('fileurl')" id='fileurl' type="file">
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+
|
|
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button size="small" @click="dialogVisible = false">取 消</el-button>
|
|
|
|
|
+ <el-button size="small" type="primary" @click="add">确 定</el-button>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </el-dialog>
|
|
|
</section>
|
|
</section>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
@@ -58,7 +76,9 @@ export default {
|
|
|
activeName:"1",
|
|
activeName:"1",
|
|
|
total:1,
|
|
total:1,
|
|
|
list:[{name:'2333'}],
|
|
list:[{name:'2333'}],
|
|
|
- loading:false
|
|
|
|
|
|
|
+ loading:false,
|
|
|
|
|
+ dialogVisible:false,
|
|
|
|
|
+ doc:{}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods:{
|
|
methods:{
|
|
@@ -72,17 +92,17 @@ export default {
|
|
|
getData(){
|
|
getData(){
|
|
|
var parm=this.form;
|
|
var parm=this.form;
|
|
|
this.loading=true
|
|
this.loading=true
|
|
|
- // this.$api.getClass(parm).then(res=>{
|
|
|
|
|
- // this.list=res.data.data.list
|
|
|
|
|
- // this.total=res.data.data.total
|
|
|
|
|
- // this.loading=false
|
|
|
|
|
- // })
|
|
|
|
|
|
|
+ this.$api.getDocumentionList(parm).then(res=>{
|
|
|
|
|
+ this.list=res.data.data.list
|
|
|
|
|
+ this.total=res.data.data.total
|
|
|
|
|
+ this.loading=false
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
del(id){
|
|
del(id){
|
|
|
this.$confirm('确定删除吗', '提示', {
|
|
this.$confirm('确定删除吗', '提示', {
|
|
|
type: 'warning'
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
}).then(() => {
|
|
|
- this.$api.deleteClass({id:id}).then((res)=>{
|
|
|
|
|
|
|
+ this.$api.deleteDoc({id:id}).then((res)=>{
|
|
|
this.$message({
|
|
this.$message({
|
|
|
message: '删除成功',
|
|
message: '删除成功',
|
|
|
type: 'success'
|
|
type: 'success'
|
|
@@ -91,9 +111,39 @@ export default {
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ upload(type){
|
|
|
|
|
+ var file=document.getElementById(type).files;
|
|
|
|
|
+ var data=new FormData();
|
|
|
|
|
+ data.append("file",file[0])
|
|
|
|
|
+ this.$api.uploadFile(data).then(res=>{
|
|
|
|
|
+ if(res.data.code==0){
|
|
|
|
|
+ let form=this.doc;
|
|
|
|
|
+ this.$set(form,type,res.data.data.url)
|
|
|
|
|
+ this.$message({message: '上传成功!',type: 'success'});
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.$message.error(res.data.message);
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ download(url){
|
|
|
|
|
+ window.open(url);
|
|
|
|
|
+ },
|
|
|
|
|
+ add(){
|
|
|
|
|
+ let parm=this.doc;
|
|
|
|
|
+ this.$api.saveDoc(parm).then(res=>{
|
|
|
|
|
+ if(res.data.code==0){
|
|
|
|
|
+ this.$message({message: '添加成功!',type: 'success'});
|
|
|
|
|
+ this.getData();
|
|
|
|
|
+ this.dialogVisible=false;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.$message.error(res.data.message);
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
created(){
|
|
created(){
|
|
|
- // this.getData()
|
|
|
|
|
|
|
+ this.getData()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|