|
|
@ -15,6 +15,10 @@ |
|
|
|
<el-checkbox v-model="fixedStatusBar">隐藏固定状态栏</el-checkbox> |
|
|
|
</div> |
|
|
|
<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.download" :loading="crud.downloadLoading" :disabled="!crud.data.length" size="mini" icon="el-icon-download" @click="crud.doExport">导出</el-button> |
|
|
|
</template> |
|
|
|
<template v-slot:rightButtonGroup> |
|
|
|
<div class="archives-handler-btn"> |
|
|
|
<el-button class="packing-btn iconfont icon-weibiaoti-2" type="primary">装盒</el-button> |
|
|
@ -25,42 +29,38 @@ |
|
|
|
</template> |
|
|
|
</crudOperation> |
|
|
|
</div> |
|
|
|
<!--表单组件--> |
|
|
|
<!--新增 / 编辑 表单组件--> |
|
|
|
<el-dialog class="preview-dialog" :modal-append-to-body="false" :close-on-click-modal="false" :before-close="crud.cancelCU" :visible="crud.status.cu > 0" :title="crud.status.title"> |
|
|
|
<span class="dialog-right-top" /> |
|
|
|
<span class="dialog-left-bottom" /> |
|
|
|
<div class="setting-dialog"> |
|
|
|
<PreviewForm :is-disabled="false" :this-fields="form" :form-preview-data="formPreviewData" /> |
|
|
|
<!-- :this-fields="form" --> |
|
|
|
<PreviewForm v-if="formPreviewData.length" ref="previewForm" :is-disabled="false" :form-preview-data.sync="formPreviewData" /> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="text" @click="crud.cancelCU">取消</el-button> |
|
|
|
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button> |
|
|
|
<el-button :loading="crud.status.cu === 2" type="primary" @click="handlerArchivesSubmit">确认</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
<!-- 弹框形式的内容展示 --> |
|
|
|
<el-dialog class="edit-form-dialog" :visible="popoverVisible" :before-close="handleClose" :close-on-click-modal="false" title="字典列表"> |
|
|
|
<!-- 删除档案 --> |
|
|
|
<el-dialog title="删除档案" :visible.sync="deleteVisible" :before-close="handleClose"> |
|
|
|
<span class="dialog-right-top" /> |
|
|
|
<span class="dialog-left-bottom" /> |
|
|
|
<div class="setting-dialog"> |
|
|
|
<el-table ref="table" :data="tableData" highlight-current-row style="width: 100%;"> |
|
|
|
<el-table-column type="selection" width="55" /> |
|
|
|
<el-table-column prop="dicName" label="字典名称" /> |
|
|
|
<el-table-column prop="dicCode" label="字典代码" /> |
|
|
|
<el-table-column prop="dicExplain" label="内容说明" /> |
|
|
|
</el-table> |
|
|
|
<div class="dialog-delt"> |
|
|
|
<p><span>确定删除当前档案吗?</span></p> |
|
|
|
<p v-if="selectedCategory.isType == 2">数据来源:项目 1条数据 案卷 4条数据</p> |
|
|
|
<p v-if="selectedCategory.isType == 3">数据来源:案卷 1条数据 卷内 2条数据</p> |
|
|
|
<p v-if="selectedCategory.isType == 4">数据来源:卷内 1条数据</p> |
|
|
|
<p v-if="selectedCategory.isType == 5">数据来源:卷内 1条数据</p> |
|
|
|
<p class="delt-tip"><span>提示:如果删除当前档案,此档案内所附带的文件会一并删除</span></p> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
<el-dialog title="删除字典内容" :visible.sync="deleteVisible" :before-close="handleClose"> |
|
|
|
<span class="dialog-right-top" /> |
|
|
|
<span class="dialog-left-bottom" /> |
|
|
|
<div class="setting-dialog"> |
|
|
|
<p><span style="color:#fff;">确定删除当前档案吗?</span></p> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="primary" @click.native="handleConfirm">确定</el-button> |
|
|
|
<el-button type="primary" @click.native="handleDeltConfirm">确定</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
<!--表格渲染--> |
|
|
|
<!-- table表格渲染 --> |
|
|
|
<el-table ref="table" v-loading="crud.loading || getTableDisplayFieldsLoading" class="archives-table" :data="crud.data" highlight-current-row style="width: 100%; " height="calc(100vh - 370px)" @selection-change="crud.selectionChangeHandler" @row-click="clickRowHandler"> |
|
|
|
<el-table-column type="selection" width="55" align="center" /> |
|
|
|
<el-table-column type="index" label="序号" width="55" align="center" /> |
|
|
@ -71,9 +71,9 @@ |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="装盒" width="100" align="center" :fixed="fixedStatusBar?false:'right'"> |
|
|
|
<!-- state-active 已装/已入/已借/已绑 --> |
|
|
|
<template slot-scope=""> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<!-- 未装 / 已装 --> |
|
|
|
<span class="row-state row-packing state-active">已装</span> |
|
|
|
<span class="row-state row-packing state-active">{{ scope.row.case_no ? '已装': '未装' }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="入库" width="100" align="center" :fixed="fixedStatusBar?false:'right'"> |
|
|
@ -89,9 +89,9 @@ |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="标签" width="100" align="center" :fixed="fixedStatusBar?false:'right'"> |
|
|
|
<template slot-scope=""> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<!-- 未绑 / 已绑 --> |
|
|
|
<span class="row-state row-binding">未绑</span> |
|
|
|
<span class="row-state row-binding">{{ scope.row.tid ? '已绑': '未绑' }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
@ -133,9 +133,9 @@ export default { |
|
|
|
optShow: { |
|
|
|
add: true, |
|
|
|
edit: true, |
|
|
|
del: true, |
|
|
|
del: false, |
|
|
|
reset: false, |
|
|
|
download: true, |
|
|
|
download: false, |
|
|
|
group: false |
|
|
|
}, |
|
|
|
queryOnPresenterCreated: false, |
|
|
@ -145,17 +145,7 @@ export default { |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
// dicPid: null, |
|
|
|
// needRefreshTree: false, |
|
|
|
// rules: { |
|
|
|
// dicName: [ |
|
|
|
// { required: true, message: '请输入字典名称', trigger: 'blur' } |
|
|
|
// ], |
|
|
|
// dicCode: [ |
|
|
|
// { required: true, message: '请输入字典代码', trigger: 'blur' } |
|
|
|
// ] |
|
|
|
// }, |
|
|
|
stateOptions: [ |
|
|
|
stateOptions: [ // 搜索 - 状态选择 |
|
|
|
{ key: '1', label: '全部' }, |
|
|
|
{ key: '2', label: '未装' }, |
|
|
|
{ key: '3', label: '未入' }, |
|
|
@ -166,19 +156,17 @@ export default { |
|
|
|
permission: { |
|
|
|
add: ['admin', 'archivesList:add'], |
|
|
|
edit: ['admin', 'archivesList:edit'], |
|
|
|
del: ['admin', 'archivesList:del'] |
|
|
|
del: ['admin', 'archivesList:del'], |
|
|
|
download: ['admin', 'archivesList:download'] |
|
|
|
}, |
|
|
|
fixedStatusBar: false, |
|
|
|
deleteVisible: false, |
|
|
|
deleteData: {}, |
|
|
|
tableDisplayFields: [], |
|
|
|
getTableDisplayFieldsLoading: false, |
|
|
|
formPreviewData: [], |
|
|
|
rules: {}, |
|
|
|
popoverVisible: false, |
|
|
|
selectData: [], |
|
|
|
tableData: [], |
|
|
|
defaultForm: {} |
|
|
|
fixedStatusBar: false, // table-右侧fixed |
|
|
|
deleteVisible: false, // 删除dialog |
|
|
|
deleteData: {}, // 删除选中data |
|
|
|
tableDisplayFields: [], // table-list-title字段 |
|
|
|
getTableDisplayFieldsLoading: false, // table-loading |
|
|
|
formPreviewData: [], // 预览界面data |
|
|
|
isEditOrAdd: '', |
|
|
|
selectedData: null |
|
|
|
} |
|
|
|
}, |
|
|
|
watch: { |
|
|
@ -196,6 +184,16 @@ export default { |
|
|
|
mounted() { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 获取数据前设置默认参数 |
|
|
|
// [CRUD.HOOK.beforeRefresh]() { |
|
|
|
// this.crud.query.id = this.dicPid |
|
|
|
// }, |
|
|
|
// [CRUD.HOOK.afterRefresh](crud) { |
|
|
|
// console.log(this.curd) |
|
|
|
// // if (this.needRefreshTree) { |
|
|
|
// // this.$emit('treeRefresh', crud.data) |
|
|
|
// // } |
|
|
|
// }, |
|
|
|
[CRUD.HOOK.beforeRefresh]() { |
|
|
|
this.getTableDisplayFieldsLoading = true |
|
|
|
// 档案列表获取显示列 |
|
|
@ -205,61 +203,69 @@ export default { |
|
|
|
return true |
|
|
|
}) |
|
|
|
}, |
|
|
|
// getData() { |
|
|
|
[CRUD.HOOK.beforeToCU]() { |
|
|
|
[CRUD.HOOK.beforeToCU](crud, form, btn) { |
|
|
|
this.isEditOrAdd = btn |
|
|
|
this.selectedData = crud.selections |
|
|
|
this.form.dictionaryConfigId = {} |
|
|
|
// 档案预编辑获取字段 |
|
|
|
getFormDisplayFields({ categoryId: this.selectedCategory.id }).then(data => { |
|
|
|
this.formPreviewData = data.showFiled.filter((fields) => { return fields.isInput }) |
|
|
|
// this.formPreviewData.map(item => { |
|
|
|
// this.rules[item.fieldName] = [ |
|
|
|
// { |
|
|
|
// required: item.isRequired, |
|
|
|
// message: (item.isInputClass === 'text' ? '请输入' : '请选择') + item.fieldCnName, |
|
|
|
// trigger: item.isInputClass === 'text' ? 'blur' : 'change' |
|
|
|
// } |
|
|
|
// ] |
|
|
|
// if (item.isDefaultValue) { |
|
|
|
// this.crud.defaultForm[item.fieldName] = item.isDefaultValue |
|
|
|
// } else { |
|
|
|
// this.crud.defaultForm[item.fieldName] = null |
|
|
|
// } |
|
|
|
// }) |
|
|
|
this.form.categoryId = this.selectedCategory.id |
|
|
|
return true |
|
|
|
}) |
|
|
|
}, |
|
|
|
// }, |
|
|
|
/* 重新渲染table组件 防止table-fixed 错位 配合watch-table数据 */ |
|
|
|
doLayout() { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.table.doLayout() |
|
|
|
}) |
|
|
|
handlerArchivesSubmit() { |
|
|
|
let arcId |
|
|
|
if (this.isEditOrAdd === 'add') { |
|
|
|
arcId = null |
|
|
|
} else if (this.isEditOrAdd === 'edit') { |
|
|
|
arcId = this.selectedData[0].id |
|
|
|
} |
|
|
|
this.$refs.previewForm.submitForm('addOrUpdateForm', this.selectedCategory.id, arcId) |
|
|
|
}, |
|
|
|
// // 获取数据前设置默认参数 |
|
|
|
// [CRUD.HOOK.beforeRefresh]() { |
|
|
|
// this.crud.query.id = this.dicPid |
|
|
|
// }, |
|
|
|
// [CRUD.HOOK.afterRefresh](crud) { |
|
|
|
// if (this.needRefreshTree) { |
|
|
|
// this.$emit('treeRefresh', crud.data) |
|
|
|
// } |
|
|
|
// }, |
|
|
|
// table - 当前选中得row |
|
|
|
clickRowHandler(row) { |
|
|
|
this.$refs.table.toggleRowSelection(row) |
|
|
|
}, |
|
|
|
// 选择删除 |
|
|
|
toDelete(data) { |
|
|
|
this.deleteData = data |
|
|
|
this.deleteVisible = true |
|
|
|
}, |
|
|
|
handleConfirm() { |
|
|
|
// 确认删除 |
|
|
|
handleDeltConfirm() { |
|
|
|
this.deleteVisible = false |
|
|
|
this.crud.delAllLoading = true |
|
|
|
this.crud.doDelete(this.deleteData) |
|
|
|
// this.crud.doDelete(this.deleteData) |
|
|
|
const ids = [] |
|
|
|
this.deleteData.forEach(val => { |
|
|
|
ids.push(val.id) |
|
|
|
}) |
|
|
|
const params = { |
|
|
|
'ids': ids, |
|
|
|
'categoryId': this.selectedCategory.id |
|
|
|
} |
|
|
|
// 删除fetch |
|
|
|
del(params).then(res => { |
|
|
|
this.crud.delAllLoading = false |
|
|
|
this.$notify({ |
|
|
|
title: '删除成功', |
|
|
|
type: 'success', |
|
|
|
duration: 2500 |
|
|
|
}) |
|
|
|
this.crud.refresh() |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 删除 - 关闭 |
|
|
|
handleClose(done) { |
|
|
|
this.deleteData = {} |
|
|
|
done() |
|
|
|
}, |
|
|
|
clickRowHandler(row) { |
|
|
|
this.$refs.table.toggleRowSelection(row) |
|
|
|
/* 重新渲染table组件 防止table-fixed 错位 配合watch-table数据 */ |
|
|
|
doLayout() { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.table.doLayout() |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|