|
|
@ -10,7 +10,7 @@ |
|
|
|
<el-input v-model="form.dicName" style="width: 370px;" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="门类类型" prop="dicCode"> |
|
|
|
<el-select v-model="form.dicCode" style="width: 370px;"> |
|
|
|
<el-select v-model="form.dicCode" style="width: 370px;" @change="changeType"> |
|
|
|
<el-option v-for="item in selectOptions" :key="item.value" :label="item.label" :value="item.value" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
@ -18,7 +18,7 @@ |
|
|
|
<!-- <el-select v-model="form.dicCode" placeholder="请选择" style="width: 370px;"> |
|
|
|
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" /> |
|
|
|
</el-select>--> |
|
|
|
<treeselect v-model="form.dicExplain" :options="treeOptions" placeholder="" style="width: 370px;" :disabled="form.dicCode !== '6'" /> |
|
|
|
<treeselect v-model="form.dicExplain" :options="templateTree" placeholder="" style="width: 370px;" :disabled="form.dicCode !== '6'" :normalizer="normalizer" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="内容说明"> |
|
|
|
<el-input v-model="form.dicExplain" style="width: 370px;" type="textarea" :rows="4" /> |
|
|
@ -47,7 +47,20 @@ |
|
|
|
<p><span style="color:#fff;">删除后,会永久清除此门类的相关设置及报表,请谨慎操作!</span></p> |
|
|
|
<p><span style="color:red;">提示:为确保档案安全,必须先手工删除此门类的所有档案数据。</span></p> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="primary" @click.native="handleConfirm">确定</el-button> |
|
|
|
<el-button type="primary" @click.native="handleReconfirm">确定</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
<el-dialog title="排序" :visible.sync="sortVisible"> |
|
|
|
<span class="dialog-right-top" /> |
|
|
|
<span class="dialog-left-bottom" /> |
|
|
|
<div class="setting-dialog"> |
|
|
|
<el-table :data="tableData" style="width: 100%"> |
|
|
|
<el-table-column type="index + 1" label="序号" width="100" /> |
|
|
|
<el-table-column prop="dicName" label="门类名称" /> |
|
|
|
</el-table> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="primary" @click.native="handleSort">保存</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
@ -59,7 +72,7 @@ |
|
|
|
<crudOperation :permission="permission"> |
|
|
|
<template v-slot:right> |
|
|
|
<el-button v-permission="permission.del" icon="el-icon-delete" size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="toDelete(crud.selections)">删除</el-button> |
|
|
|
<el-button v-permission="permission.sort" icon="el-icon-delete" size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="toDelete(crud.selections)">排序</el-button> |
|
|
|
<el-button v-permission="permission.sort" icon="el-icon-sort" size="mini" :loading="sortLoading" :disabled="!crud.selections[0]||!crud.selections[0].childMenus || crud.selections[0].childMenus.length <= 1" @click="toSort(crud.selections)">排序</el-button> |
|
|
|
</template> |
|
|
|
</crudOperation> |
|
|
|
<!--门类树状结构--> |
|
|
@ -156,7 +169,7 @@ export default { |
|
|
|
label: '选择模板' |
|
|
|
} |
|
|
|
], |
|
|
|
treeOptions: [ |
|
|
|
templateTree: [ |
|
|
|
{ |
|
|
|
id: 'a', |
|
|
|
label: 'a', |
|
|
@ -183,25 +196,27 @@ export default { |
|
|
|
// activeAddBtn: false, |
|
|
|
deleteVisible: false, |
|
|
|
reconfirmDeleteVisible: false, |
|
|
|
sortVisible: false, |
|
|
|
deleteData: {}, |
|
|
|
activeIndex: 0 |
|
|
|
activeIndex: 0, |
|
|
|
sortLoading: false |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 获取数据前设置好接口地址 |
|
|
|
[CRUD.HOOK.beforeRefresh]() { |
|
|
|
if (this.$refs.dictDetail) { |
|
|
|
this.$refs.dictDetail.query.id = '' |
|
|
|
} |
|
|
|
return true |
|
|
|
}, |
|
|
|
// 右边初始化数据是空 |
|
|
|
// [CRUD.HOOK.beforeRefresh]() { |
|
|
|
// if (this.$refs.dictDetail) { |
|
|
|
// this.$refs.dictDetail.query.id = '' |
|
|
|
// } |
|
|
|
// return true |
|
|
|
// }, |
|
|
|
// 选中字典后,设置字典详情数据 |
|
|
|
handleNodeClick(val) { |
|
|
|
if (val) { |
|
|
|
this.crud.selectionChangeHandler([val]) |
|
|
|
this.$refs.dictDetail.query.id = val.id |
|
|
|
this.$refs.dictDetail.dicPid = val.id |
|
|
|
this.$refs.dictDetail.crud.toQuery() |
|
|
|
// this.$refs.dictDetail.query.id = val.id |
|
|
|
// this.$refs.dictDetail.dicPid = val.id |
|
|
|
// this.$refs.dictDetail.crud.toQuery() |
|
|
|
// this.activeAddBtn = true |
|
|
|
} |
|
|
|
}, |
|
|
@ -218,17 +233,47 @@ export default { |
|
|
|
this.$refs.tree.updateKeyChildren(this.$refs.tree.getCurrentKey(), data) |
|
|
|
}, |
|
|
|
toDelete(data) { |
|
|
|
console.log(data.childMenus) |
|
|
|
this.deleteData = data |
|
|
|
this.deleteVisible = true |
|
|
|
}, |
|
|
|
handleConfirm() { |
|
|
|
this.deleteVisible = false |
|
|
|
this.reconfirmDeleteVisible = true |
|
|
|
}, |
|
|
|
handleReconfirm() { |
|
|
|
this.reconfirmDeleteVisible = false |
|
|
|
this.crud.delAllLoading = true |
|
|
|
this.crud.doDelete(this.deleteData) |
|
|
|
}, |
|
|
|
handleClose(done) { |
|
|
|
this.deleteData = {} |
|
|
|
done() |
|
|
|
}, |
|
|
|
toSort(data) { |
|
|
|
this.sortVisible = true |
|
|
|
console.log(data) |
|
|
|
}, |
|
|
|
handleSort() { |
|
|
|
|
|
|
|
}, |
|
|
|
changeType() { |
|
|
|
if (this.form.dicCode === '6') { |
|
|
|
// this.crudDict.getDicts() |
|
|
|
this.getTemplateTree() |
|
|
|
} |
|
|
|
}, |
|
|
|
getTemplateTree() { |
|
|
|
crudDict.getDicts().then(res => { |
|
|
|
this.templateTree = res |
|
|
|
}) |
|
|
|
}, |
|
|
|
normalizer(node) { |
|
|
|
return { |
|
|
|
id: node.id, |
|
|
|
label: node.dicName, |
|
|
|
children: node.childMenus |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -237,15 +282,15 @@ export default { |
|
|
|
<style lang="scss" scoped> |
|
|
|
.curd-in-out { |
|
|
|
margin-top: 50px; |
|
|
|
.crud-opts{ |
|
|
|
.crud-opts { |
|
|
|
padding: 0 !important; |
|
|
|
margin-top: -50px; |
|
|
|
border-bottom: none; |
|
|
|
} |
|
|
|
} |
|
|
|
.tab-content .tab-nav li{ |
|
|
|
.tab-content .tab-nav li { |
|
|
|
padding: 0 10px; |
|
|
|
&:first-child{ |
|
|
|
&:first-child { |
|
|
|
padding: 0 24px; |
|
|
|
} |
|
|
|
} |
|
|
|