|
|
@ -0,0 +1,156 @@ |
|
|
|
|
|
<template> |
|
|
|
|
|
<div class="app-container template-page"> |
|
|
|
|
|
<el-form :model="searchForm" ref="searchForm" :inline="true"> |
|
|
|
|
|
<el-form-item :label="$t('page.system.template.sn')+':'" prop="sn"> |
|
|
|
|
|
<el-input v-model="searchForm.sn" :placeholder="$t('form.placeholderInput')" clearable style="width: 150px" @keyup.enter.native="search" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item :label="$t('page.system.template.name')+':'" prop="name"> |
|
|
|
|
|
<el-input v-model="searchForm.name" :placeholder="$t('form.placeholderInput')" clearable style="width: 150px" @keyup.enter.native="search" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
<el-form-item :label="$t('page.system.template.department')+':'" prop="deptId"> |
|
|
|
|
|
<select-dept style="width:200px" v-model="searchForm.deptId" @change="search" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item :label="$t('page.system.template.status')+':'" prop="status"> |
|
|
|
|
|
<el-select |
|
|
|
|
|
v-model="searchForm.status" |
|
|
|
|
|
:placeholder="$t('form.placeholderSelect')" |
|
|
|
|
|
clearable |
|
|
|
|
|
style="width: 100px" |
|
|
|
|
|
@change="search" |
|
|
|
|
|
> |
|
|
|
|
|
<el-option key="0" :label="$t('page.system.template.statusEnable')" :value="10" /> |
|
|
|
|
|
<el-option key="1" :label="$t('page.system.template.statusDisable')" :value="1" /> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item> |
|
|
|
|
|
<el-button type="primary" icon="el-icon-search" @click="search">{{ $t('form.search') }}</el-button> |
|
|
|
|
|
<el-button icon="el-icon-refresh" @click="reset">{{ $t('form.reset') }}</el-button> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-form> |
|
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="list"> |
|
|
|
|
|
<el-table-column :label="$t('page.system.template.sn')" align="center" prop="sn" /> |
|
|
|
|
|
<el-table-column :label="$t('page.system.template.name')" align="center" prop="name" /> |
|
|
|
|
|
<el-table-column :label="$t('page.system.template.department')" align="center" prop="deptName" /> |
|
|
|
|
|
<el-table-column :label="$t('page.system.template.status')" prop="status" width="150"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<span v-if="scope.row.status===10">{{$t('page.system.template.statusEnable')}}</span> |
|
|
|
|
|
<span v-if="scope.row.status===1">{{$t('page.system.template.statusDisable')}}</span> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column :label="$t('form.operate')" fixed="right" align="center" width="100"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-button size="mini" type="text" @click="edit(scope.row)">{{$t('page.system.template.edit')}}</el-button> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
</el-table> |
|
|
|
|
|
|
|
|
|
|
|
<pagination |
|
|
|
|
|
v-show="total>0" |
|
|
|
|
|
:total="total" |
|
|
|
|
|
:page.sync="searchForm.pageNum" |
|
|
|
|
|
:limit.sync="searchForm.pageSize" |
|
|
|
|
|
@pagination="getList" |
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog :close-on-click-modal="false" :title="infoDialog.title" :visible.sync="infoDialog.visible" width="600px" append-to-body> |
|
|
|
|
|
<el-form ref="infoDialogForm" :model="infoDialog.formData" :rules="infoDialog.rules" label-width="100px"> |
|
|
|
|
|
<el-row> |
|
|
|
|
|
<el-col :span="24"> |
|
|
|
|
|
<el-form-item label="专业名称:" prop="name"> |
|
|
|
|
|
<select-dept v-model="infoDialog.formData.deptId" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
</el-row> |
|
|
|
|
|
</el-form> |
|
|
|
|
|
<!-- <div slot="footer" class="dialog-footer"> |
|
|
|
|
|
<el-button type="primary" @click="save">确 定</el-button> |
|
|
|
|
|
<el-button @click="infoDialog.visible = false">取 消</el-button> |
|
|
|
|
|
</div> --> |
|
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
|
import { template_list,template_info} from "@/api/business/template/template"; |
|
|
|
|
|
import SelectDept from '../comps/select/SelectDept.vue'; |
|
|
|
|
|
const EmptyDialogData = { |
|
|
|
|
|
id:'', |
|
|
|
|
|
name:'', |
|
|
|
|
|
} |
|
|
|
|
|
export default { |
|
|
|
|
|
name: "Template", |
|
|
|
|
|
props:{ |
|
|
|
|
|
}, |
|
|
|
|
|
components:{ |
|
|
|
|
|
SelectDept |
|
|
|
|
|
}, |
|
|
|
|
|
computed: { |
|
|
|
|
|
}, |
|
|
|
|
|
filters:{ |
|
|
|
|
|
}, |
|
|
|
|
|
data() { |
|
|
|
|
|
return { |
|
|
|
|
|
searchForm: { |
|
|
|
|
|
pageNum: 1, |
|
|
|
|
|
pageSize: 10, |
|
|
|
|
|
sn:'', |
|
|
|
|
|
name:'', |
|
|
|
|
|
deptId:null, |
|
|
|
|
|
status:'', |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
loading: true, |
|
|
|
|
|
total: 0, |
|
|
|
|
|
list: [], |
|
|
|
|
|
|
|
|
|
|
|
infoDialog:{ |
|
|
|
|
|
title:'', |
|
|
|
|
|
visible:false, |
|
|
|
|
|
formData:{}, |
|
|
|
|
|
}, |
|
|
|
|
|
}; |
|
|
|
|
|
}, |
|
|
|
|
|
created() { |
|
|
|
|
|
this.getList(); |
|
|
|
|
|
}, |
|
|
|
|
|
methods: { |
|
|
|
|
|
getList() { |
|
|
|
|
|
this.loading = true; |
|
|
|
|
|
template_list(this.searchForm).then(response => { |
|
|
|
|
|
this.list = response.rows; |
|
|
|
|
|
this.total = response.total; |
|
|
|
|
|
this.loading = false; |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
search() { |
|
|
|
|
|
this.searchForm.pageNum = 1; |
|
|
|
|
|
this.getList(); |
|
|
|
|
|
}, |
|
|
|
|
|
reset(){ |
|
|
|
|
|
this.searchForm = { |
|
|
|
|
|
pageNum: 1, |
|
|
|
|
|
pageSize: 10, |
|
|
|
|
|
sn:'', |
|
|
|
|
|
name:'', |
|
|
|
|
|
deptId:null, |
|
|
|
|
|
status:'', |
|
|
|
|
|
} |
|
|
|
|
|
this.search() |
|
|
|
|
|
}, |
|
|
|
|
|
edit(row) { |
|
|
|
|
|
this.infoDialog.title = this.$t('page.system.template.edit') |
|
|
|
|
|
this.$modal.loading() |
|
|
|
|
|
template_info({id:row.id}).then(({data}) => { |
|
|
|
|
|
this.infoDialog.formData = data |
|
|
|
|
|
}).finally(() => { |
|
|
|
|
|
this.$modal.closeLoading() |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
</script> |
|
|
|
|
|
<style lang="scss"> |
|
|
|
|
|
</style> |