|
|
@ -26,6 +26,8 @@ |
|
|
<el-form-item> |
|
|
<el-form-item> |
|
|
<el-button type="primary" icon="el-icon-search" @click="search">{{ $t('form.search') }}</el-button> |
|
|
<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-button icon="el-icon-refresh" @click="reset">{{ $t('form.reset') }}</el-button> |
|
|
|
|
|
|
|
|
|
|
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="edit(null)" v-hasPermi="['system:user:add']">新增-后期不需要</el-button> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
|
|
|
|
|
|
@ -41,7 +43,8 @@ |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column :label="$t('form.operate')" fixed="right" align="center" width="100"> |
|
|
<el-table-column :label="$t('form.operate')" fixed="right" align="center" width="100"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<el-button size="mini" type="text" @click="edit(scope.row)">{{$t('page.system.template.edit')}}</el-button> |
|
|
|
|
|
|
|
|
<el-button size="mini" type="text" @click="edit(scope.row)">编辑</el-button> |
|
|
|
|
|
<el-button size="mini" type="text" @click="edit(scope.row)">{{$t('page.system.template.detail')}}</el-button> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
</el-table> |
|
|
</el-table> |
|
|
@ -58,27 +61,39 @@ |
|
|
<el-form ref="infoDialogForm" :model="infoDialog.formData" :rules="infoDialog.rules" label-width="100px"> |
|
|
<el-form ref="infoDialogForm" :model="infoDialog.formData" :rules="infoDialog.rules" label-width="100px"> |
|
|
<el-row> |
|
|
<el-row> |
|
|
<el-col :span="24"> |
|
|
<el-col :span="24"> |
|
|
<el-form-item label="专业名称:" prop="name"> |
|
|
|
|
|
|
|
|
<el-form-item label="编号:" prop="sn"> |
|
|
|
|
|
<el-input v-model="infoDialog.formData.sn" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="24"> |
|
|
|
|
|
<el-form-item label="名称:" prop="name"> |
|
|
|
|
|
<el-input v-model="infoDialog.formData.name" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="24"> |
|
|
|
|
|
<el-form-item label="部门/学科:" prop="name"> |
|
|
<select-dept v-model="infoDialog.formData.deptId" /> |
|
|
<select-dept v-model="infoDialog.formData.deptId" /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
</el-row> |
|
|
</el-row> |
|
|
</el-form> |
|
|
</el-form> |
|
|
<!-- <div slot="footer" class="dialog-footer"> |
|
|
|
|
|
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
<el-button type="primary" @click="save">确 定</el-button> |
|
|
<el-button type="primary" @click="save">确 定</el-button> |
|
|
<el-button @click="infoDialog.visible = false">取 消</el-button> |
|
|
<el-button @click="infoDialog.visible = false">取 消</el-button> |
|
|
</div> --> |
|
|
|
|
|
|
|
|
</div> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { template_list,template_info} from "@/api/business/template/template"; |
|
|
|
|
|
|
|
|
import { template_list,template_info,template_save,template_delete} from "@/api/business/template/template"; |
|
|
import SelectDept from '../comps/select/SelectDept.vue'; |
|
|
import SelectDept from '../comps/select/SelectDept.vue'; |
|
|
const EmptyDialogData = { |
|
|
const EmptyDialogData = { |
|
|
id:'', |
|
|
id:'', |
|
|
name:'', |
|
|
name:'', |
|
|
|
|
|
sn:'', |
|
|
|
|
|
deptId:'' |
|
|
} |
|
|
} |
|
|
export default { |
|
|
export default { |
|
|
name: "Template", |
|
|
name: "Template", |
|
|
@ -141,13 +156,57 @@ export default { |
|
|
this.search() |
|
|
this.search() |
|
|
}, |
|
|
}, |
|
|
edit(row) { |
|
|
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() |
|
|
|
|
|
|
|
|
this.$refs['infoDialogForm'] && this.$refs['infoDialogForm'].resetFields() |
|
|
|
|
|
this.infoDialog.title = '新增' |
|
|
|
|
|
this.infoDialog.formData = _.merge({}, EmptyDialogData) |
|
|
|
|
|
if(row && row.id){ |
|
|
|
|
|
this.infoDialog.title = '编辑' |
|
|
|
|
|
this.$modal.loading() |
|
|
|
|
|
template_info({id:row.id}).then(({data}) => { |
|
|
|
|
|
this.infoDialog.formData = data |
|
|
|
|
|
}).finally(() => { |
|
|
|
|
|
this.$modal.closeLoading() |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
this.infoDialog.visible = true |
|
|
|
|
|
|
|
|
|
|
|
// 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() |
|
|
|
|
|
// }) |
|
|
|
|
|
}, |
|
|
|
|
|
save() { |
|
|
|
|
|
this.$refs['infoDialogForm'].validate(valid => { |
|
|
|
|
|
if (valid) { |
|
|
|
|
|
this.$modal.loading() |
|
|
|
|
|
template_save(this.infoDialog.formData).then(() => { |
|
|
|
|
|
this.infoDialog.visible = false |
|
|
|
|
|
this.getList() |
|
|
|
|
|
}).finally(() => { |
|
|
|
|
|
this.$modal.closeLoading() |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
del(row) { |
|
|
|
|
|
this.$confirm('确定要删除吗', '提示', { |
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
|
type: 'warning' |
|
|
|
|
|
}) |
|
|
|
|
|
.then(() => { |
|
|
|
|
|
this.$modal.loading() |
|
|
|
|
|
template_delete({ id: row.id}).then(() => { |
|
|
|
|
|
this.getList() |
|
|
|
|
|
}) |
|
|
|
|
|
.finally(() => { |
|
|
|
|
|
this.$modal.closeLoading() |
|
|
|
|
|
}) |
|
|
}) |
|
|
}) |
|
|
|
|
|
.catch(() => {}) |
|
|
}, |
|
|
}, |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
|