|
|
|
@ -1,51 +1,39 @@ |
|
|
|
<template> |
|
|
|
<div class="select-template"> |
|
|
|
<el-dialog :title="$t('page.system.template.selectTemplate')" :visible.sync="open" width="80%" append-to-body :close-on-click-modal="false" |
|
|
|
style="padding: 20px 20px;"> |
|
|
|
<el-dialog :title="$t('page.system.template.selectTemplate')" :visible.sync="open" width="800px" append-to-body |
|
|
|
:close-on-click-modal="false" style="padding: 20px 20px;"> |
|
|
|
<div class="dialog-container"> |
|
|
|
<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"> |
|
|
|
<el-table v-loading="loading" border :data="list"> |
|
|
|
<!-- 单选列 --> |
|
|
|
<el-table-column width="80" align="center"> |
|
|
|
<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="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button type="primary" v-if="scope.row.status === 10" @click="handleSelect(scope.row)">{{ $t('page.system.template.select') }}</el-button> |
|
|
|
<el-radio v-model="selectedId" :label="scope.row.id" class="hide-label" @click.native.stop="handleRadioClick(scope.row)"></el-radio> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column :label="$t('page.system.template.sn')" align="center" prop="sn" width="150px"/> |
|
|
|
<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" width="150px"/> |
|
|
|
</el-table> |
|
|
|
<pagination v-show="total > 0" :total="total" :page.sync="searchForm.pageNum" |
|
|
|
:limit.sync="searchForm.pageSize" @pagination="getList" /> |
|
|
|
<pagination v-show="total > 0" :total="total" :page.sync="searchForm.pageNum" :limit.sync="searchForm.pageSize" |
|
|
|
@pagination="getList" /> |
|
|
|
</div> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button @click="open = false">{{ $t('form.cancel') }}</el-button> |
|
|
|
<el-button type="primary" :disabled="!(this.selectedId && this.selectedId !== '')" @click="handleSelect">{{ |
|
|
|
$t('form.saveConfirm') }}</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
@ -56,13 +44,14 @@ import { public_templateList } from "@/api/business/public/public"; |
|
|
|
import SelectDept from "@/views/business/comps/select/SelectDept"; |
|
|
|
export default { |
|
|
|
name: "SelectTemplateDialog", |
|
|
|
components: {SelectDept}, |
|
|
|
components: { SelectDept }, |
|
|
|
props: { |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
selectedId: null, |
|
|
|
loading: false, |
|
|
|
open: false, |
|
|
|
total: 0, |
|
|
|
@ -70,7 +59,7 @@ export default { |
|
|
|
searchForm: { |
|
|
|
pageNum: 1, |
|
|
|
pageSize: 10, |
|
|
|
sn: '', |
|
|
|
sn: '', |
|
|
|
name: '', |
|
|
|
deptId: null, |
|
|
|
status: '', |
|
|
|
@ -80,12 +69,16 @@ export default { |
|
|
|
mounted() { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
handleRadioClick(row) { |
|
|
|
this.selectedId = row.id |
|
|
|
}, |
|
|
|
show() { |
|
|
|
this.selectedId=null |
|
|
|
this.search() |
|
|
|
}, |
|
|
|
search() { |
|
|
|
this.searchForm.pageNum = 1; |
|
|
|
this.open = true |
|
|
|
this.open = true |
|
|
|
this.getList(); |
|
|
|
}, |
|
|
|
reset() { |
|
|
|
@ -106,8 +99,10 @@ export default { |
|
|
|
this.loading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleSelect(row) { |
|
|
|
this.$emit('callback', row); |
|
|
|
handleSelect() { |
|
|
|
let that = this |
|
|
|
let _index = _.findIndex(this.list, function (item) { return item.id = that.selectedId }) |
|
|
|
this.$emit('callback', this.list[_index]); |
|
|
|
this.open = false |
|
|
|
} |
|
|
|
} |
|
|
|
@ -115,5 +110,7 @@ export default { |
|
|
|
</script> |
|
|
|
|
|
|
|
<style rel="stylesheet/scss" lang="scss"> |
|
|
|
.select-template {} |
|
|
|
.select-template { |
|
|
|
|
|
|
|
} |
|
|
|
</style> |