init
This commit is contained in:
@@ -0,0 +1,436 @@
|
||||
<template>
|
||||
<a-drawer
|
||||
:title="title"
|
||||
:maskClosable="false"
|
||||
:width="drawerWidth"
|
||||
placement="right"
|
||||
:closable="true"
|
||||
@close="handleCancel"
|
||||
:visible="visible"
|
||||
style="height: 100%;overflow: auto;padding-bottom: 53px;">
|
||||
<add-form
|
||||
ref="addFormDataRef"
|
||||
@submitFormData="submitFormData"
|
||||
:flag="'1'"
|
||||
v-if="visible"
|
||||
:url="url"
|
||||
/>
|
||||
<div>
|
||||
<div class="header-text" style='margin-bottom: 0px'>
|
||||
{{$t('docLibrary.detailsPhasedImplementation')}}
|
||||
</div>
|
||||
<a-button key="submit" type="primary" @click="newlyAdded" style='float: right; z-index: 99; margin-bottom: 5px'>
|
||||
{{ $t('newlyAdded') }}
|
||||
</a-button>
|
||||
<a-table
|
||||
:loading="loading"
|
||||
:pagination="false"
|
||||
:data-source="dataGradto"
|
||||
:columns="columnsGrading"
|
||||
rowKey='id'
|
||||
:scroll="{x: '100%'}"
|
||||
>
|
||||
<span slot="gradOperation" slot-scope="text,result,index">
|
||||
<a @click="handleEdit(result,index)" style="margin-right: 10px">
|
||||
{{$t('edit')}}
|
||||
</a>
|
||||
<a @click="deleteLib(result,index)" style="margin-right: 10px">
|
||||
{{$t('delete')}}
|
||||
</a>
|
||||
</span>
|
||||
<span slot="standNumberOrClause">
|
||||
<span :title="$t('docLibrary.statuteNumberClause')">{{$t('docLibrary.statuteNumberClause')}}</span>
|
||||
</span>
|
||||
<span slot="implementationDateTwo">
|
||||
<span :title="$t('docLibrary.implementationDateTwo')">{{$t('docLibrary.implementationDateTwo')}}</span>
|
||||
</span>
|
||||
<span slot="typeofImplementation">
|
||||
<span :title="$t('docLibrary.typeofImplementation')">{{$t('docLibrary.typeofImplementation')}}</span>
|
||||
</span>
|
||||
</a-table>
|
||||
</div>
|
||||
<a-modal
|
||||
:title="$t('newlyAdded')"
|
||||
:width="900"
|
||||
:visible="visibleGrad"
|
||||
:confirm-loading="confirmLoading"
|
||||
:maskClosable="false"
|
||||
@cancel="visibleGrad = false"
|
||||
>
|
||||
<a-form-model :rules="tableRules" :model="tableDataGrad"
|
||||
ref="tableRuleForm">
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="required">*</span>
|
||||
<span :title="$t('docLibrary.statuteNumberClause')">{{$t('docLibrary.statuteNumberClause')}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="item-model" prop="standNumberOrClause">
|
||||
<a-input class="box-input" v-model.trim="tableDataGrad.standNumberOrClause"
|
||||
:placeholder="$t('pleaseEnter')+$t('docLibrary.statuteNumberClause')"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="required">*</span>
|
||||
<span :title="$t('docLibrary.typeofImplementation')">{{$t('docLibrary.typeofImplementation')}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="item-model" prop="implementationType">
|
||||
<j-multi-select-tag class="box-input" v-model="tableDataGrad.implementationType"
|
||||
:placeholder="$t('pleaseSelect')+$t('docLibrary.typeofImplementation')"
|
||||
:type="'select'"
|
||||
@changeQuery='implementationTypeChange'
|
||||
:triggerChange="false" dictCode="shi2_shi1_lei4_xing2"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="required">*</span>
|
||||
<span :title="$t('docLibrary.implementationDateTwo')">{{$t('docLibrary.implementationDateTwo')}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="item-model" prop="implementationDate">
|
||||
<a-date-picker class="box-input" v-model="tableDataGrad.implementationDate"
|
||||
:placeholder="$t('pleaseSelect')+$t('docLibrary.implementationDateTwo')"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 100%"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="24">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span :title="$t('remarks')">{{$t('remarks')}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="item-model" style="height: auto" prop="remarks">
|
||||
<a-textarea :placeholder="$t('pleaseEnter')+$t('remarks')"
|
||||
:rows="4" v-model="tableDataGrad.remarks"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form-model>
|
||||
<template slot="footer">
|
||||
<a-button key="back" @click="visibleGrad = false">
|
||||
{{ $t('cancel') }}
|
||||
</a-button>
|
||||
<a-button key="submit" type="primary" @click="handleTableSubmit">
|
||||
{{ $t('determine') }}
|
||||
</a-button>
|
||||
</template>
|
||||
</a-modal>
|
||||
<a-modal
|
||||
:title="$t('edit')"
|
||||
:width="900"
|
||||
:visible="tableVisibleGrad"
|
||||
:confirm-loading="confirmLoading"
|
||||
:maskClosable="false"
|
||||
@cancel="tableVisibleGrad = false"
|
||||
>
|
||||
<a-form-model :rules="tableRules" :model="tableDataGrad"
|
||||
ref="tableRuleFormEdit">
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="required">*</span>
|
||||
<span :title="$t('docLibrary.statuteNumberClause')">{{$t('docLibrary.statuteNumberClause')}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="item-model" prop="standNumberOrClause">
|
||||
<a-input class="box-input" v-model.trim="tableDataGrad.standNumberOrClause"
|
||||
:placeholder="$t('pleaseEnter')+$t('docLibrary.statuteNumberClause')"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="required">*</span>
|
||||
<span :title="$t('docLibrary.typeofImplementation')">{{$t('docLibrary.typeofImplementation')}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="item-model" prop="implementationType">
|
||||
<j-multi-select-tag class="box-input" v-model="tableDataGrad.implementationType"
|
||||
:placeholder="$t('pleaseSelect')+$t('docLibrary.typeofImplementation')"
|
||||
:type="'select'"
|
||||
@changeQuery="implementationTypeChange"
|
||||
:triggerChange="false" dictCode="shi2_shi1_lei4_xing2"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="required">*</span>
|
||||
<span :title="$t('docLibrary.implementationDateTwo')">{{$t('docLibrary.implementationDateTwo')}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="item-model" prop="implementationDate">
|
||||
<a-date-picker class="box-input" v-model="tableDataGrad.implementationDate"
|
||||
:placeholder="$t('pleaseSelect')+$t('docLibrary.implementationDateTwo')"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 100%"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="24">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span :title="$t('remarks')">{{$t('remarks')}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="item-model" style="height: auto" prop="remarks">
|
||||
<a-textarea :placeholder="$t('pleaseEnter')+$t('remarks')"
|
||||
:rows="4" v-model="tableDataGrad.remarks"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form-model>
|
||||
<template slot="footer">
|
||||
<a-button key="back" @click="tablevisibleGrad = false">
|
||||
{{ $t('cancel') }}
|
||||
</a-button>
|
||||
<a-button key="submit" type="primary" @click="handleTableEditSubmit">
|
||||
{{ $t('determine') }}
|
||||
</a-button>
|
||||
</template>
|
||||
</a-modal>
|
||||
<div class="drawer-bootom-button">
|
||||
<a-button style="margin-right: 8px" @click="handleCancel">{{$t('cancel')}}</a-button>
|
||||
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
|
||||
</div>
|
||||
</a-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddForm from '@/components/customField/AddForm'
|
||||
import { postAction } from '@/api/manage'
|
||||
import JMultiSelectTag from '@/components/dict/JMultiSelectTag'
|
||||
|
||||
export default {
|
||||
name: 'LibraryAddForm',
|
||||
components: { AddForm, JMultiSelectTag },
|
||||
data () {
|
||||
return {
|
||||
title: this.$t('add'),
|
||||
drawerWidth: 900,
|
||||
visible: false,
|
||||
confirmLoading: false,
|
||||
isDisplayType: false,
|
||||
dataList: [],
|
||||
// 分阶段实施详情的表格相关数据
|
||||
columns: [],
|
||||
loading: false,
|
||||
dataGradto: [],
|
||||
columnsGrading: [
|
||||
{
|
||||
dataIndex: 'standNumberOrClause',
|
||||
align: 'left',
|
||||
ellipsis: true,
|
||||
width: 160,
|
||||
scopedSlots: { title: 'standNumberOrClause' }
|
||||
},
|
||||
{
|
||||
// title: this.$t('Typeofimplementation'),
|
||||
dataIndex: 'implementationTypeText',
|
||||
align: 'left',
|
||||
ellipsis: true,
|
||||
width: 150,
|
||||
scopedSlots: { title: 'typeofimplementation' }
|
||||
},
|
||||
{
|
||||
// title: this.$t('implementationDateTwo'),
|
||||
dataIndex: 'implementationDate',
|
||||
align: 'left',
|
||||
ellipsis: true,
|
||||
width: 190,
|
||||
scopedSlots: { title: 'implementationDateTwo' }
|
||||
},
|
||||
{
|
||||
title: this.$t('remarks'),
|
||||
dataIndex: 'remarks',
|
||||
align: 'left',
|
||||
ellipsis: true,
|
||||
width: 204
|
||||
},
|
||||
{
|
||||
title: this.$t('operation'),
|
||||
align: 'left',
|
||||
fixed: 'right',
|
||||
width: 180,
|
||||
scopedSlots: { customRender: 'gradOperation' }
|
||||
}
|
||||
],
|
||||
visibleGrad: false,
|
||||
tableRules: {
|
||||
standNumberOrClause: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('docLibrary.statuteNumberClause') + this.$t('cannotEmpty'),
|
||||
trigger: 'blur'
|
||||
},
|
||||
{
|
||||
// required: true,
|
||||
max: 200,
|
||||
message: this.$t('docLibrary.statuteNumberClause') + this.$t('cannotExceed') + 200 + this.$t('characters'),
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
implementationType: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('docLibrary.typeofImplementation') + this.$t('cannotEmpty'),
|
||||
trigger: 'change'
|
||||
}
|
||||
],
|
||||
implementationDate: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('docLibrary.implementationDateTwo') + this.$t('cannotEmpty'),
|
||||
trigger: 'change'
|
||||
}
|
||||
],
|
||||
remarks: [
|
||||
{
|
||||
// required: true,
|
||||
max: 1000,
|
||||
message: this.$t('remarks') + this.$t('cannotExceed') + 1000 + this.$t('characters'),
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
},
|
||||
tableDataGrad: {},
|
||||
tableVisibleGrad: false
|
||||
}
|
||||
},
|
||||
props: {
|
||||
flag: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
// 接口
|
||||
url: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleCancel () {
|
||||
this.visible = false
|
||||
},
|
||||
add () {
|
||||
this.confirmLoading = false
|
||||
this.title = this.$t('add')
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addFormDataRef.add()
|
||||
})
|
||||
},
|
||||
edit (item) {
|
||||
this.confirmLoading = false
|
||||
this.title = this.$t('edit')
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addFormDataRef.edit(item)
|
||||
})
|
||||
},
|
||||
// 分阶段实施详情的新增
|
||||
newlyAdded () {
|
||||
this.tableDataGrad = {}
|
||||
this.visibleGrad = true
|
||||
},
|
||||
// 分阶段实施详情的编辑
|
||||
handleEdit (result, index) {
|
||||
this.tableVisibleGrad = true
|
||||
this.tableDataIndex = index
|
||||
this.tableDataGrad = JSON.parse(JSON.stringify(result))
|
||||
},
|
||||
// 分阶段实施详情的删除
|
||||
deleteLib (val, index) {
|
||||
this.$confirm({
|
||||
content: this.$t('confirmDeletion'),
|
||||
onOk: () => {
|
||||
this.dataGradto.splice(index, 1)
|
||||
this.dataGradto = [...this.dataGradto]
|
||||
}
|
||||
})
|
||||
},
|
||||
// 分阶段实施详情的新增弹框
|
||||
handleTableSubmit () {
|
||||
this.$refs.tableRuleForm.validate(valid => {
|
||||
if (valid) {
|
||||
this.dataGradto.push(this.tableDataGrad)
|
||||
this.visibleGrad = false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 实施类型下拉框改变
|
||||
implementationTypeChange (val) {
|
||||
this.tableDataGrad.implementationTypeText = val
|
||||
},
|
||||
// 表格编辑弹框的提交
|
||||
handleTableEditSubmit () {
|
||||
this.$refs.tableRuleFormEdit.validate((valid) => {
|
||||
if (valid) {
|
||||
this.tableVisibleGrad = false
|
||||
this.dataGradto[this.tableDataIndex] = this.tableDataGrad
|
||||
this.dataGradto = [...this.dataGradto]
|
||||
}
|
||||
})
|
||||
},
|
||||
handleSubmit () {
|
||||
this.confirmLoading = true
|
||||
this.$refs.addFormDataRef.submit()
|
||||
},
|
||||
// 表单提交的回调,获取表单数据
|
||||
submitFormData (formInline) {
|
||||
let url = ''
|
||||
if (formInline.id) {
|
||||
url = this.url.updateInfo
|
||||
} else {
|
||||
url = this.url.addInfo
|
||||
}
|
||||
postAction(url, formInline).then((res) => {
|
||||
if (res.success) {
|
||||
this.confirmLoading = false
|
||||
this.$message.success(this.$t('operationSuccessful'))
|
||||
if (this.formInline.id) {
|
||||
this.$emit('searchGetData')
|
||||
} else {
|
||||
this.$emit('searchGetData')
|
||||
}
|
||||
} else {
|
||||
this.confirmLoading = false
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
@import '~@assets/less/common.less';
|
||||
.header-text {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
margin-left: 15px;
|
||||
/*border-bottom: 1px #d9d9d9 dashed;*/
|
||||
height: 30px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,186 @@
|
||||
<template>
|
||||
<div>
|
||||
<a-drawer
|
||||
:title="$t('share')"
|
||||
:maskClosable="false"
|
||||
:width="600"
|
||||
placement="right"
|
||||
:closable="true"
|
||||
@close="handleCancel"
|
||||
:visible="visible"
|
||||
style="height: 100%;overflow: auto;padding-bottom: 53px;">
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-input-search style="margin-bottom: 8px" v-model="searchModel"
|
||||
@search="onSearch"
|
||||
allowClear
|
||||
:placeholder="$t('nodeQuickLookup')"/>
|
||||
<div class="drawer-content">
|
||||
<a-tree
|
||||
v-if="visibleTree"
|
||||
style="margin-bottom: 60px;height: 600px"
|
||||
checkable
|
||||
:autoExpandParent="false"
|
||||
:tree-data="gData"
|
||||
@select="onSelect"
|
||||
@check="checkChange"
|
||||
@expand="onExpand"
|
||||
:defaultExpandedKeys="defaultExpandedKeys"
|
||||
>
|
||||
</a-tree>
|
||||
</div>
|
||||
</a-spin>
|
||||
<div class="drawer-bootom-button">
|
||||
<a-button @click="handleCancel" style="margin-right: 16px">{{$t('cancel')}}</a-button>
|
||||
<a-button @click="handleSubmit" type="primary" :loading="submitLoading">{{$t('submit')}}</a-button>
|
||||
</div>
|
||||
</a-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getAction, postAction } from '../../../api/manage'
|
||||
|
||||
export default {
|
||||
name: 'LibraryPush',
|
||||
props: {
|
||||
url: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
gData: [],
|
||||
searchModel: '',
|
||||
autoExpandParent: true,
|
||||
expandedKeys: [],
|
||||
visible: false,
|
||||
confirmLoading: false,
|
||||
selectedKey: [],
|
||||
tableKey: [],
|
||||
userIds: [],
|
||||
departId: '',
|
||||
defaultExpandedKeys: [],
|
||||
submitLoading: false,
|
||||
visibleTree: false,
|
||||
flag: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getPush (data, flag) {
|
||||
this.tableKey = data
|
||||
this.flag = flag
|
||||
this.searchModel = ''
|
||||
this.visible = true
|
||||
this.visibleTree = false
|
||||
this.$nextTick(() => {
|
||||
this.departId = ''
|
||||
this.queryDepartUserTreeList()
|
||||
})
|
||||
},
|
||||
onSelect (selectedKeys) {
|
||||
this.selectedKey = selectedKeys
|
||||
},
|
||||
onExpand (selectedKeys, val) {
|
||||
if (this.searchModel === '' || !this.searchModel) {
|
||||
if (val.expanded) {
|
||||
if (this.departId === val.node.value) {
|
||||
} else {
|
||||
this.departId = val.node.value
|
||||
this.queryDepartUserTreeList()
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
handleCancel () {
|
||||
this.visible = false
|
||||
this.visibleTree = false
|
||||
},
|
||||
handleSubmit () {
|
||||
let query = {}
|
||||
if (this.flag) {
|
||||
query = {
|
||||
documentIds: this.tableKey.join(','),
|
||||
userIds: this.userIds.join(','),
|
||||
departIds: this.userIds.join(','),
|
||||
flag: this.flag
|
||||
}
|
||||
} else {
|
||||
query = {
|
||||
documentIds: this.tableKey.join(','),
|
||||
userIds: this.userIds.join(','),
|
||||
departIds: this.userIds.join(',')
|
||||
}
|
||||
}
|
||||
this.submitLoading = true
|
||||
this.confirmLoading = true
|
||||
getAction(this.url.pullMessage, query).then((res) => {
|
||||
this.confirmLoading = false
|
||||
this.submitLoading = false
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('operationSuccessful'))
|
||||
this.userIds = []
|
||||
this.visible = false
|
||||
this.visibleTree = false
|
||||
this.$emit('clearSelected')
|
||||
this.$emit('searchGetData')
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
}
|
||||
})
|
||||
},
|
||||
onSearch (e) {
|
||||
this.gData = []
|
||||
this.departId = ''
|
||||
this.visibleTree = false
|
||||
if (e) {
|
||||
this.getUserAndDepart()
|
||||
} else {
|
||||
this.queryDepartUserTreeList()
|
||||
}
|
||||
},
|
||||
getUserAndDepart () {
|
||||
getAction('sys/user/getUserAndDepart', { name: this.searchModel }).then((res) => {
|
||||
this.gData = res || []
|
||||
this.visibleTree = true
|
||||
})
|
||||
},
|
||||
queryDepartUserTreeList () {
|
||||
let gData = JSON.parse(JSON.stringify(this.gData))
|
||||
if (gData && gData.length > 0) {
|
||||
gData = JSON.stringify(gData)
|
||||
} else {
|
||||
gData = ''
|
||||
}
|
||||
this.confirmLoading = true
|
||||
postAction('sys/user/queryDepartUserTreeList', {
|
||||
departId: this.departId,
|
||||
json: gData
|
||||
}).then((res) => {
|
||||
this.confirmLoading = false
|
||||
if (res.success) {
|
||||
this.gData = res.result
|
||||
this.defaultExpandedKeys = [this.departId]
|
||||
this.visibleTree = true
|
||||
} else {
|
||||
this.gData = []
|
||||
}
|
||||
})
|
||||
},
|
||||
checkChange (e) {
|
||||
this.userIds = e
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
@import '~@assets/less/common.less';
|
||||
|
||||
.drawer-content {
|
||||
height: calc(100% - 60px);
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user