Browse Source

档案编研

master
xuhuajiao 1 year ago
parent
commit
6e05a01d9f
  1. 51
      src/api/archiveUtilize/archiveEditing.js
  2. 218
      src/views/archiveUtilize/archiveEditing/form.vue
  3. 113
      src/views/archiveUtilize/archiveEditing/index.vue
  4. 33
      src/views/archiveUtilize/archiveEditing/module/detail.vue
  5. 2
      src/views/archiveUtilize/archiveEditing/module/material.vue
  6. 1
      src/views/archiveUtilize/archiveEditing/module/materialSelected.vue
  7. 2
      src/views/archiveUtilize/archiveEditing/module/onlineEditing.vue

51
src/api/archiveUtilize/archiveEditing.js

@ -0,0 +1,51 @@
import request from '@/utils/request'
import qs from 'qs'
export function add(form) {
return edit(form)
}
// 编辑档案编研
export function edit(parameter) {
return request({
url: 'api/archivesUtilize/editResearch',
method: 'post',
data: parameter
})
}
// 删除档案盒
export function del(data) {
return request({
url: 'api/archivesDeposit/del',
method: 'post',
data: data
})
}
// 档案编研详情
export function FetchInitResearchDetails(params) {
return request({
url: 'api/archivesUtilize/initResearchDetails' + '?' + qs.stringify(params, { indices: false }),
method: 'get'
})
}
// 编辑档案编研素材收集
export function FetchAddResearchSource(data) {
return request({
url: 'api/archivesUtilize/addResearchSource',
method: 'post',
data: data
})
}
// 档案编研素材收集列表
export function FetchInitResearchSourceList(params) {
return request({
url: 'api/archivesUtilize/initResearchSourceList' + '?' + qs.stringify(params, { indices: false }),
method: 'get'
})
}
export default { add, edit, del, FetchInitResearchDetails, FetchAddResearchSource, FetchInitResearchSourceList }

218
src/views/archiveUtilize/archiveEditing/form.vue

@ -1,44 +1,49 @@
<template>
<div>
<el-dialog :title="crud.status.title" :visible="crud.status.cu > 0" append-to-body :close-on-click-modal="false" :modal-append-to-body="false" :before-close="crud.cancelCU">
<el-dialog :title="formTitle" :visible="formVisible" append-to-body :close-on-click-modal="false" :modal-append-to-body="false" :before-close="handleCloseForm">
<span class="dialog-right-top" />
<span class="dialog-left-bottom" />
<div class="setting-dialog">
<el-form ref="form" :model="form" size="small" label-width="80px" :rules="rules">
<el-form-item label="专题名称" prop="name">
<el-input v-model="form.name" style="width: 580px;" />
<el-form-item label="专题名称" prop="title">
<el-input v-model="form.title" style="width: 580px;" />
</el-form-item>
<el-form-item label="编研类型" prop="type">
<el-select v-model="form.type" placeholder="请选择" style="width: 225px;">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
<el-form-item label="编研类型" prop="researchType">
<el-select v-model="form.researchType" placeholder="请选择" style="width: 225px;">
<el-option v-for="item in options" :key="item.id" :label="item.dictionaryName" :value="item.dictionaryName" />
</el-select>
</el-form-item>
<el-form-item label="主编人" prop="main">
<el-input v-model="form.main" placeholder="请输入" type="hidden" style="display: none;" suffix-icon="el-icon-search" />
<el-form-item label="主编人" prop="editor1">
<el-input v-model="form.editor1" placeholder="请输入" type="hidden" style="display: none;" suffix-icon="el-icon-search" />
<div class="tag-wrapper el-icon-search" @click="handleSelectUser(1)">
<el-tag v-for="item in userMainSelected" :key="item.userId" :closable="item !== '*'" @close="removeTag(item)">
{{ item.username }}
</el-tag>
</div>
</el-form-item>
<el-form-item label="编研人员" prop="other">
<el-input v-model="form.other" placeholder="请输入" suffix-icon="el-icon-search" style="width: 580px;" @blur="userVisible = true" />
<el-form-item label="编研人员" prop="editor2">
<el-input v-model="form.editor2" placeholder="请输入" type="hidden" style="display: none;" suffix-icon="el-icon-search" />
<div class="tag-wrapper el-icon-search" @click="handleSelectUser(2)">
<el-tag v-for="item in userOtherSelected" :key="item.userId" :closable="item !== '*'" @close="removeOtherTag(item)">
{{ item.username }}
</el-tag>
</div>
</el-form-item>
<el-row style="display: flex; justify-content: space-between; padding-right: 30px;">
<el-form-item label="开始时间" prop="startTime" style="flex: 1;">
<el-date-picker v-model="form.startTime" placeholder="请选择" type="date" align="right" format="yyyy-MM-dd" />
<el-date-picker v-model="form.startTime" placeholder="请选择" type="date" align="right" format="yyyy-MM-dd" value-format="yyyy-MM-dd" />
</el-form-item>
<el-form-item label="结束时间" prop="endTime" style="flex: 1;">
<el-date-picker v-model="form.endTime" placeholder="请选择" type="date" align="right" format="yyyy-MM-dd" />
<el-date-picker v-model="form.endTime" placeholder="请选择" type="date" align="right" format="yyyy-MM-dd" value-format="yyyy-MM-dd" />
</el-form-item>
</el-row>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入" :rows="3" style="width: 580px;" />
<el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" type="textarea" placeholder="请输入" :rows="3" style="width: 580px;" />
</el-form-item>
</el-form>
<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 type="text" @click="handleCloseForm">取消</el-button>
<el-button :loading="crud.status.cu === 2" type="primary" @click="handleComfiredEditing">确定</el-button>
</div>
</div>
</el-dialog>
@ -78,10 +83,10 @@
<el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left" @click="resetQuery()">重置</el-button>
</el-form>
<el-table
ref="table"
ref="userTable"
v-loading="userLoading"
:data="userTable"
row-key="id"
row-key="userId"
style="width: 100%;"
height="calc(100vh - 500px)"
@row-click="clickRowHandler"
@ -97,68 +102,47 @@
</div>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="handleClose">取消</el-button>
<el-button :loading="crud.status.cu === 2" type="primary" @click="handleUserComfired">确定</el-button>
<el-button type="primary" @click="handleUserComfired">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import CRUD from '@crud/crud'
import { crud, form } from '@crud/crud'
import { form } from '@crud/crud'
import { edit } from '@/api/archiveUtilize/archiveEditing'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
import { getDepts, FetchSonDepts } from '@/api/system/dept'
import { FetchFondsAll } from '@/api/system/fonds'
import { FetchInitUserList } from '@/api/system/user'
import { FetchDictionaryTree } from '@/api/system/dict'
import { mapGetters } from 'vuex'
const defaultForm = { name: null, type: null, main: null, other: null, startTime: null, endTime: null, remark: null }
const defaultForm = { id: null, title: null, researchType: null, editor1: null, editor2: null, startTime: null, endTime: null, remarks: null }
export default {
name: 'Form',
components: { Treeselect },
mixins: [
crud(),
form(function() {
return Object.assign({ }, defaultForm)
})
],
data() {
return {
formType: 1,
formTitle: '',
formVisible: false,
userVisible: false,
options: [
{
label: '汇编',
value: 1
},
{
label: '文摘',
value: 2
},
{
label: '索引',
value: 3
},
{
label: '简介',
value: 4
},
{
label: '综合调研材料',
value: 5
},
{
label: '史志',
value: 6
}
],
options: [],
userForm: {
fonds: { id: null }, dept: { id: null }, blurry: null
},
rules: {
name: [{ required: true, trigger: 'blur', message: '专题名称不可为空' }],
type: [{ required: true, trigger: 'change', message: '请选择' }],
main: [{ required: true, trigger: 'change', message: '请选择' }],
title: [{ required: true, trigger: 'blur', message: '专题名称不可为空' }],
researchType: [{ required: true, trigger: 'change', message: '请选择' }],
editor1: [{ required: true, trigger: 'change', message: '请选择' }],
startTime: [{ required: true, trigger: 'change', message: '请选择' }],
endTime: [{ required: true, trigger: 'change', message: '请选择' }]
},
@ -170,15 +154,21 @@ export default {
deptDatas: [],
userType: 1,
userLoading: false,
userTable: [{}, {}],
selections: [],
userTable: [],
selections: null,
userMainSelected: [],
userOtherSelected: []
}
},
computed: {
...mapGetters([
'user'
])
},
created() {
this.getFondsDatas()
this.getUserList()
this.getDictsList()
},
methods: {
getAutoNameUnknown(name) {
@ -188,15 +178,27 @@ export default {
return name
}
},
[CRUD.HOOK.beforeSubmit]() {
},
//
[CRUD.HOOK.afterValidateCU](crud) {
return true
},
handleSelectUser(type) {
this.userType = type
this.resetQuery()
this.userVisible = true
this.$nextTick(() => {
if (this.userType === 1) {
if (this.userMainSelected.length !== 0) {
this.$refs.userTable.clearSelection()
this.userMainSelected.forEach(item => {
this.$refs.userTable.toggleRowSelection(item)
})
}
} else {
if (this.userOtherSelected.length !== 0) {
this.$refs.userTable.clearSelection()
this.userOtherSelected.forEach(item => {
this.$refs.userTable.toggleRowSelection(item)
})
}
}
})
},
getFondsDatas() {
const parent = {}
@ -310,6 +312,15 @@ export default {
children: node.children
}
},
getDictsList() {
FetchDictionaryTree().then((res) => {
const filterCodes = ['research_type']
const filteredItems = JSON.parse(JSON.stringify(res)).filter(item => filterCodes.includes(item.dictionaryCode))
this.options = filteredItems[0].childDictionarys
}).catch(err => {
console.log(err)
})
},
toQueryUser() {
const userParams = {
'fondsId': this.userForm.fonds.id,
@ -320,6 +331,7 @@ export default {
this.getUserList(userParams)
},
getUserList(params) {
this.selections = []
this.userLoading = true
FetchInitUserList(params).then(res => {
this.userTable = res.content
@ -339,20 +351,25 @@ export default {
}
this.getUserList(userParams)
},
handleClose() {
this.resetQuery()
this.userVisible = false
},
handleUserComfired() {
console.log(this.selections)
if (this.userType === 1) {
this.userMainSelected = this.selections
const arry = []
this.userMainSelected.forEach(item => {
arry.push(item.userId)
})
this.form.editor1 = arry.join(',')
} else {
this.userOtherSelected = this.selections
const arry = []
this.userOtherSelected.forEach(item => {
arry.push(item.userId)
})
this.form.editor2 = arry.join(',')
}
this.userVisible = false
// userMainSelected: [],
// userOtherSelected: []
this.selections = []
},
removeTag(tag) {
const index = this.userMainSelected.indexOf(tag)
@ -360,6 +377,71 @@ export default {
this.userMainSelected.splice(index, 1)
}
},
removeOtherTag(tag) {
const index = this.userOtherSelected.indexOf(tag)
if (index !== -1) {
this.userOtherSelected.splice(index, 1)
}
},
handleComfiredEditing() {
this.$refs['form'].validate((valid) => {
if (valid) {
const arry = []
this.userMainSelected.forEach(item => {
arry.push(item.userId)
})
this.form.editor1 = arry.join(',')
const arry2 = []
this.userOtherSelected.forEach(item => {
arry2.push(item.userId)
})
this.form.editor2 = arry2.join(',')
this.form.fondsAffiliation = this.user.fonds.id.toString()
this.form.operator = this.user.username
if (this.form.startTime.split(' ')[1]) {
this.form.startTime = this.form.startTime.split(' ')[0]
}
if (this.form.endTime.split(' ')[1]) {
this.form.endTime = this.form.endTime.split(' ')[0]
}
const params = { ...this.form }
delete params.editor1
delete params.editor2
params.editor1s = arry
params.editor2s = arry2
edit(params).then((res) => {
if (res.code !== 500) {
this.$message({ message: this.formType === 1 ? '新增成功' : '编辑成功', type: 'success', offset: 8 })
} else {
this.$message({ message: res.message, type: 'error', offset: 8 })
}
this.handleCloseForm()
this.$emit('refresh')
}).catch(err => {
console.log(err)
})
} else {
return false
}
})
},
handleClose() {
this.resetQuery()
this.userVisible = false
},
handleCloseForm() {
this.$refs['form'].clearValidate()
this.$refs['form'].resetFields()
this.form = {}
this.userMainSelected = []
this.userOtherSelected = []
this.formVisible = false
this.selections = []
},
clickRowHandler(row) {
// this.$refs.table.clearSelection()
// this.$refs.table.toggleRowSelection(row)
@ -367,7 +449,6 @@ export default {
// this.selections.push(row)
},
selectionChangeHandler(val) {
console.log(val)
this.selections = val
}
}
@ -398,6 +479,7 @@ export default {
right: 10px;
top: 0;
line-height: 30px;
color: #e6e8ed;
}
.el-tag{
margin-right: 6px;

113
src/views/archiveUtilize/archiveEditing/index.vue

@ -17,7 +17,24 @@
<el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left" @click="resetQuery()">重置</el-button>
<el-checkbox v-model="participants" style="line-height: 32px; padding-left: 10px;">我参与得编研</el-checkbox>
</div>
<crudOperation :permission="permission" />
<crudOperation :permission="permission">
<template v-slot:left>
<el-button v-permission="permission.add" size="mini" @click="toAdd(1,null)">
<i class="iconfont icon-xinzeng" />
新增
</el-button>
<el-button v-permission="permission.edit" size="mini" :disabled="crud.selections.length === 0" @click="toAdd(2,crud.selections[0])">
<i class="iconfont icon-bianji" />
编辑
</el-button>
</template>
<template v-slot:right>
<el-button v-permission="permission.del" size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="toDelete(crud.selections)">
<i class="iconfont icon-shanchu" />
删除
</el-button>
</template>
</crudOperation>
</div>
<el-table
ref="table"
@ -31,34 +48,36 @@
@selection-change="crud.selectionChangeHandler"
>
<el-table-column type="selection" :reserve-selection="true" width="55" align="center" />
<el-table-column prop="username" label="编研主题" />
<el-table-column prop="username" label="编研类型" align="center" />
<el-table-column prop="username" label="主编人" align="center" />
<el-table-column prop="username" label="其他编研人员" align="center" />
<el-table-column prop="createTime" label="开始时间" width="200">
<el-table-column prop="title" label="编研主题" />
<el-table-column prop="researchType" label="编研类型" align="center" />
<el-table-column prop="editor1" label="主编人" align="center" />
<el-table-column prop="editor2" label="其他编研人员" align="center" />
<el-table-column prop="startTime" label="开始时间" width="200">
<template slot-scope="scope">
<div>{{ scope.row.createTime | parseTime }}</div>
<div>{{ scope.row.startTime | parseTime }}</div>
</template>
</el-table-column>
<el-table-column prop="createTime" label="结束时间" width="200">
<el-table-column prop="endTime" label="结束时间" width="200">
<template slot-scope="scope">
<div>{{ scope.row.createTime | parseTime }}</div>
<div>{{ scope.row.endTime | parseTime }}</div>
</template>
</el-table-column>
</el-table>
<pagination v-if="crud.data.length !== 0" />
<eForm ref="eform" />
<eForm ref="eform" @refresh="initData" />
<EditingDetail ref="editingDetail" />
</div>
</template>
<script>
import CRUD, { presenter, crud } from '@crud/crud'
import crudEditing from '@/api/archiveUtilize/archiveEditing'
import pagination from '@crud/Pagination'
import DateRangePicker from '@/components/DateRangePicker'
import crudOperation from '@crud/CRUD.operation'
import eForm from './form'
import EditingDetail from './module/detail'
import { mapGetters } from 'vuex'
export default {
name: 'ArchiveEditing',
@ -68,10 +87,11 @@ export default {
return CRUD({
url: 'api/archivesUtilize/initResearchList',
title: '档案编研',
crudMethod: { ...crudEditing },
optShow: {
add: true,
edit: true,
del: true,
add: false,
edit: false,
del: false,
download: false,
reset: false,
group: false
@ -101,9 +121,19 @@ export default {
participants: false
}
},
computed: {
...mapGetters([
'user'
])
},
mounted() {
},
methods: {
initData() {
this.crud.refresh()
this.crud.selections = []
this.$refs.table.clearSelection()
},
resetQuery() {
this.blurryTime = []
this.crud.query.startTime = null
@ -112,7 +142,11 @@ export default {
},
[CRUD.HOOK.beforeRefresh]() {
this.crud.query.search = this.keyWord
this.crud.query.participants = this.participants
if (this.participants) {
this.crud.query.participants = this.user.username
} else {
this.crud.query.participants = ''
}
if (this.blurryTime) {
this.crud.query.startTime = this.blurryTime[0]
this.crud.query.endTime = this.blurryTime[1]
@ -121,22 +155,53 @@ export default {
this.crud.query.endTime = null
}
},
// -
[CRUD.HOOK.beforeToAdd](crud, form, btn) {
this.$refs.eform.crud.title = '编研主题'
},
//
[CRUD.HOOK.beforeToEdit](crud, form, btn) {
this.$refs.eform.crud.title = '编研主题'
},
// /
[CRUD.HOOK.afterSubmit](crud, addedCategory) {
toAdd(type, row) {
if (type === 1) {
this.$refs.eform.formTitle = '新增编研主题'
} else {
this.$refs.eform.formTitle = '编辑编研主题'
this.$refs.eform.form = {
'id': row.id,
'title': row.title,
'editor1': row.editor1,
'editor2': row.editor2,
'researchType': row.researchType,
'startTime': row.startTime,
'endTime': row.endTime,
'remarks': row.remarks
}
if (row.editor1) {
var usernames = row.editor1.split(',')
var matchedItems = []
for (var i = 0; i < this.$refs.eform.userTable.length; i++) {
if (usernames.includes(this.$refs.eform.userTable[i].username)) {
matchedItems.push(this.$refs.eform.userTable[i])
}
}
this.$refs.eform.userMainSelected = matchedItems
}
if (row.editor2) {
var usernames2 = row.editor2.split(',')
var matchedItems2 = []
for (var j = 0; j < this.$refs.eform.userTable.length; j++) {
if (usernames2.includes(this.$refs.eform.userTable[j].username)) {
matchedItems2.push(this.$refs.eform.userTable[j])
}
}
this.$refs.eform.userOtherSelected = matchedItems2
}
}
this.$refs.eform.formType = type
this.$refs.eform.formVisible = true
},
clickRowHandler(row) {
// this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(row)
},
tableDoubleClick(row) {
// this.$refs.editingDetail.currentRow = row
this.$refs.editingDetail.getDetail(row)
this.$refs.editingDetail.editingDetailVisible = true
},
handleCloseDialog(done) {

33
src/views/archiveUtilize/archiveEditing/module/detail.vue

@ -16,41 +16,41 @@
<el-row>
<el-col :span="24" class="base-info-item">
<span>专题名称</span>
<p>编研专题1</p>
<p>{{ currentRow && currentRow.title }}</p>
</el-col>
<el-col :span="24" class="base-info-item">
<span>编研类型</span>
<p>汇编</p>
<p>{{ currentRow && currentRow.researchType }}</p>
</el-col>
<el-col :span="24" class="base-info-item">
<span>主编人</span>
<p>张三李四</p>
<p>{{ currentRow && currentRow.showeditor1 }}</p>
</el-col>
<el-col :span="24" class="base-info-item">
<span>编研人员</span>
<p>王五赵六</p>
<p>{{ currentRow && currentRow.showeditor2 }}</p>
</el-col>
<el-col :span="24" class="base-info-item">
<span>开始时间</span>
<p>2016-09-21</p>
<p>{{ currentRow && currentRow.startTime }}</p>
</el-col>
<el-col :span="24" class="base-info-item">
<span>结束时间</span>
<p>2016-09-30</p>
<p>{{ currentRow && currentRow.endTime }}</p>
</el-col>
<el-col :span="24" class="base-info-item">
<span>备注</span>
<p>备注123</p>
<p>{{ currentRow && currentRow.remarks }}</p>
</el-col>
</el-row>
<el-row style="margin-top: 160px;">
<el-col :span="24" class="base-info-item">
<span>收集材料</span>
<p>3</p>
<p>{{ currentRow && currentRow.materialNum }} </p>
</el-col>
<el-col :span="24" class="base-info-item">
<span>在线编研</span>
<p>草稿 1 发布 1 </p>
<p>草稿 {{ currentRow && currentRow.draftNum }} 发布 {{ currentRow && currentRow.releaseNum }} </p>
</el-col>
</el-row>
</div>
@ -72,8 +72,9 @@
</template>
<script>
import { FetchInitResearchDetails } from '@/api/archiveUtilize/archiveEditing'
import Material from './material.vue'
import OnlineEditing from './onlineEditing.vue'
import OnlineEditing from './onlineEditing'
export default {
name: 'ArchiveEditingDetail',
components: { Material, OnlineEditing },
@ -93,6 +94,7 @@ export default {
},
data() {
return {
currentRow: null,
editingDetailVisible: false,
archivesTabIndex: 0,
archivesDetailsData: []
@ -103,6 +105,17 @@ export default {
mounted() {
},
methods: {
getDetail(row) {
const params = {
'researchId': row.id
}
FetchInitResearchDetails(params).then((res) => {
console.log(res)
this.currentRow = res
}).catch(err => {
console.log(err)
})
},
changeActiveTab(index) {
this.archivesTabIndex = index
},

2
src/views/archiveUtilize/archiveEditing/module/material.vue

@ -122,7 +122,7 @@ export default {
mixins: [presenter(), crud()],
cruds() {
return CRUD({
url: 'api/log/initLog',
url: 'api/archivesUtilize/initResearchSourceList',
title: '素材收集',
optShow: {
add: false,

1
src/views/archiveUtilize/archiveEditing/module/materialSelected.vue

@ -74,7 +74,6 @@
<script>
import CategoryTree from '@/views/components/categoryTree'
// FetchMove
import { FetchInitCategoryViewTable, FetchInitCategoryView } from '@/api/collect/collect'
export default {
name: 'CollectMoveFile',

2
src/views/archiveUtilize/archiveEditing/module/onlineEditing.vue

@ -119,7 +119,7 @@ export default {
mixins: [presenter(), crud()],
cruds() {
return CRUD({
url: 'api/log/initLog',
url: 'api/archivesUtilize/initResearchOnlineList',
title: '在线编研',
optShow: {
add: false,

Loading…
Cancel
Save