|
|
|
@ -8,47 +8,53 @@ |
|
|
|
<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.business.study.study.sn') + ':'" prop="sn"> |
|
|
|
<el-input v-model="searchForm.sn" :placeholder="$t('form.placeholderInput')" clearable |
|
|
|
style="width: 150px" @keyup.enter.native="search" /> |
|
|
|
<el-form-item :label="$t('page.business.study.study.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.business.study.study.leader') + ':'" prop="leader"> |
|
|
|
<SelectDeptUser v-model="searchForm.leader" key="ffr2Id" /> |
|
|
|
<el-form-item :label="$t('page.business.study.study.leader') + ':'" prop="leader"> |
|
|
|
<SelectDeptUser v-model="searchForm.leader" key="ffr2Id" /> |
|
|
|
</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" border :data="list"> |
|
|
|
<!-- 单选列 --> |
|
|
|
<el-table-column width="80" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<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 v-loading="loading" border :data="list" @selection-change="handleSelectionChange"> |
|
|
|
<el-table-column type="selection" fixed="left" width="55" align="center" /> |
|
|
|
<el-table-column :label="$t('page.business.study.study.name')" align="center" prop="name" /> |
|
|
|
<el-table-column :label="$t('page.business.study.study.sn')" align="center" prop="sn" width="150px"/> |
|
|
|
<el-table-column :label="$t('page.business.study.study.leader')" align="center" prop="leaderName" width="150px"/> |
|
|
|
<el-table-column :label="$t('page.business.study.study.status')" prop="status" width="100"> |
|
|
|
<el-table-column :label="$t('page.business.study.study.sn')" align="center" prop="sn" width="150px" /> |
|
|
|
<el-table-column :label="$t('page.business.study.study.leader')" align="center" prop="leaderName" |
|
|
|
width="150px" /> |
|
|
|
<el-table-column :label="$t('page.business.study.study.status')" prop="status" width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="scope.row.status===1"><span class="status-circle cg"></span>{{$t('page.business.study.study.statusCg')}}</span> |
|
|
|
<span v-if="scope.row.status===3"><span class="status-circle syz"></span>{{$t('page.business.study.study.statusSyz')}}</span> |
|
|
|
<span v-if="scope.row.status===5"><span class="status-circle ysd"></span>{{$t('page.business.study.study.statusYsd')}}</span> |
|
|
|
<span v-if="scope.row.status===7"><span class="status-circle"></span>{{$t('page.business.study.study.statusDgd')}}</span> |
|
|
|
<span v-if="scope.row.status===9"><span class="status-circle"></span>{{$t('page.business.study.study.statusGd')}}</span> |
|
|
|
<span v-if="scope.row.status===10"><span class="status-circle"></span>{{$t('page.business.study.study.statusDjd')}}</span> |
|
|
|
<span v-if="scope.row.status === 1"><span class="status-circle cg"></span>{{ |
|
|
|
$t('page.business.study.study.statusCg') }}</span> |
|
|
|
<span v-if="scope.row.status === 3"><span class="status-circle syz"></span>{{ |
|
|
|
$t('page.business.study.study.statusSyz') }}</span> |
|
|
|
<span v-if="scope.row.status === 5"><span class="status-circle ysd"></span>{{ |
|
|
|
$t('page.business.study.study.statusYsd') }}</span> |
|
|
|
<span v-if="scope.row.status === 7"><span class="status-circle"></span>{{ |
|
|
|
$t('page.business.study.study.statusDgd') }}</span> |
|
|
|
<span v-if="scope.row.status === 9"><span class="status-circle"></span>{{ |
|
|
|
$t('page.business.study.study.statusGd') }}</span> |
|
|
|
<span v-if="scope.row.status === 10"><span class="status-circle"></span>{{ |
|
|
|
$t('page.business.study.study.statusDjd') }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column :label="$t('page.business.study.study.createDate')" align="center" prop="createTime" width="140" /> |
|
|
|
<el-table-column :label="$t('page.business.study.study.createDate')" align="center" prop="createTime" |
|
|
|
width="140" /> |
|
|
|
</el-table> |
|
|
|
<pagination v-show="total > 0" :total="total" :page.sync="searchForm.pageNum" :limit.sync="searchForm.pageSize" |
|
|
|
@pagination="getList" /> |
|
|
|
<el-checkbox v-model="checkedOther" @change="checkedOtherChange">{{ |
|
|
|
$t('page.business.study.study.other') }}</el-checkbox> |
|
|
|
<el-input v-model="others" :disabled="!checkedOther" style="width: 400px;margin-left: 20px;" /> |
|
|
|
</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">{{ |
|
|
|
<el-button type="primary" :disabled="this.selectList.length == 0 && this.others == ''" @click="handleSelect">{{ |
|
|
|
$t('form.saveConfirm') }}</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
@ -60,14 +66,18 @@ import { public_studyList } from "@/api/business/public/public"; |
|
|
|
import SelectDeptUser from '@/views/business/comps/select/SelectDeptUser'; |
|
|
|
export default { |
|
|
|
name: "SelectStudyDialog", |
|
|
|
components: {SelectDeptUser }, |
|
|
|
components: { SelectDeptUser }, |
|
|
|
props: { |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
checkedOther: false, |
|
|
|
others: '', |
|
|
|
selectedId: null, |
|
|
|
selectedName: null, |
|
|
|
selectList: [], |
|
|
|
loading: false, |
|
|
|
open: false, |
|
|
|
total: 0, |
|
|
|
@ -85,18 +95,35 @@ export default { |
|
|
|
mounted() { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
handleRadioClick(row) { |
|
|
|
this.selectedId = row.id |
|
|
|
checkedOtherChange() { |
|
|
|
if (!this.checkedOther) { |
|
|
|
this.others = '' |
|
|
|
} |
|
|
|
}, |
|
|
|
handleSelectionChange(selection) { |
|
|
|
this.single = selection.length !== 1 |
|
|
|
this.multiple = !selection.length |
|
|
|
this.selectList = selection |
|
|
|
this.selectedId = _.map(this.selectList, 'id').join(',') |
|
|
|
this.selectedName = _.map(this.selectList, 'name').join(',') |
|
|
|
}, |
|
|
|
show(val) { |
|
|
|
this.searchForm=_.merge({}, this.searchForm, val) |
|
|
|
this.selectedId=null |
|
|
|
this.searchForm = _.merge({}, this.searchForm, val) |
|
|
|
this.selectedId = null |
|
|
|
this.selectedName = null |
|
|
|
this.checkedOther = false |
|
|
|
this.others = null |
|
|
|
this.$emit('callback', { id: '', name: '', other: '' }) |
|
|
|
this.search() |
|
|
|
}, |
|
|
|
search() { |
|
|
|
this.searchForm.pageNum = 1; |
|
|
|
this.open = true |
|
|
|
this.selectedId=null |
|
|
|
this.selectedId = null |
|
|
|
this.selectedName = null |
|
|
|
this.checkedOther = false |
|
|
|
this.others = null |
|
|
|
this.$emit('callback', { id: '', name: '', other: '' }) |
|
|
|
this.getList(); |
|
|
|
}, |
|
|
|
reset() { |
|
|
|
@ -118,10 +145,13 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleSelect() { |
|
|
|
let that = this |
|
|
|
let _index = _.findIndex(this.list, function (item) { return item.id == that.selectedId }) |
|
|
|
debugger |
|
|
|
this.$emit('callback', this.list[_index]); |
|
|
|
let name='' |
|
|
|
if(this.selectedName!=''&&this.others!=''){ |
|
|
|
name=this.selectedName+','+this.others |
|
|
|
}else{ |
|
|
|
name=this.selectedName+this.others |
|
|
|
} |
|
|
|
this.$emit('callback', { id: this.selectedId, name: name, other: this.others }) |
|
|
|
this.open = false |
|
|
|
} |
|
|
|
} |
|
|
|
@ -129,7 +159,5 @@ export default { |
|
|
|
</script> |
|
|
|
|
|
|
|
<style rel="stylesheet/scss" lang="scss"> |
|
|
|
.select-template { |
|
|
|
|
|
|
|
} |
|
|
|
.select-template {} |
|
|
|
</style> |