code init

This commit is contained in:
chenxiaoxi
2021-05-25 18:06:45 +08:00
parent 02698d6dab
commit f54a8d4fa1
1367 changed files with 540755 additions and 21713 deletions
+16
View File
@@ -0,0 +1,16 @@
<!-- 配置管理 -->
<template>
<div class="config-manage">
<router-view />
</div>
</template>
<script>
export default {
name: 'config'
}
</script>
<style lang="less" scoped>
.config-manage{
height: 100%;
}
</style>
@@ -0,0 +1,798 @@
<!-- 配置管理 - 属性自定义 - 企业标准库 -->
<template>
<div class="attribute-custom v-class">
<div class="action-bar1">
<el-button round class="common-button-primary add-button" v-btn-permission="'7UARYUBX8J8BX3ELZDH2'" type="primary" @click="showAddModel"><i class="iconfont">&#xe84e;</i>新增</el-button>
<el-button round class="common-button-default" v-btn-permission="'8QSDDR8R7UMDS9S6M2HU'" @click="showDisplayLocationDialog" >展示区域管理</el-button>
</div>
<loading :loading="attributeDataLoading">数据处理中</loading>
<div class="content">
<el-table
style="width: 100%;"
:data="attributeList"
height="100%"
border
ref="selections"
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}"
@on-selection-change="handleSelectone"
>
<el-table-column
type="selection"
width="55"
align="center"
>
</el-table-column>
<el-table-column
prop="sarType"
label="所属模块"
width="140"
>
<template slot-scope="scope">
{{ getSarTypeText(scope.row.sarType) }}
</template>
</el-table-column>
<el-table-column
prop="attrField"
label="属性字段"
width="120"
>
</el-table-column>
<el-table-column
prop="attrName"
label="属性名称"
>
</el-table-column>
<el-table-column
prop="attrType"
label="属性类型"
width="140"
>
<template slot-scope="scope">
{{ getAttrTypeText(scope.row.attrType) }}
</template>
</el-table-column>
<el-table-column
prop="attrLen"
label="字段长度"
width="120"
>
</el-table-column>
<el-table-column
prop="orderNum"
label="展示顺序"
width="100"
>
</el-table-column>
<el-table-column
prop="areaName"
label="展示区域"
width="120"
>
</el-table-column>
<el-table-column label="操作" align="center" width="50" fixed="right">
<template slot-scope="scope">
<div @click.stop style="display: inline-block">
<el-dropdown trigger="click" @command="handleCommand">
<i class="iconfont">&#xe61e;</i>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="[scope.row, '编辑']" v-btn-permission="'QNDKHM2VNP8D938ZA9CQ'">编辑</el-dropdown-item>
<el-dropdown-item :disabled="scope.row.isEdit==='1'" :command="[scope.row, '删除']">删除</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</template>
</el-table-column>
</el-table>
</div>
<pagination :total="total" :pageChange="pageNo" :pageSizeChange="pageSize" @pageChange="pageChange" @pageSizeChange="pageSizeChange"></pagination>
<!-- 新建抽屉-->
<el-drawer
:title="attributeTitle"
:visible.sync="showInfoModal"
size="800px"
:styles="styles"
:wrapperClosable="false"
@close="cancelModel"
>
<div class="demo-drawer-content">
<el-form
ref="attributeEO"
:model="attributeEO"
:rules="attributeEOFormRules"
class="label-input-form"
label-width="150px"
>
<input v-model="attributeEO.id" v-show="false">
<!-- <el-form-item label="所属模块" prop="sarType" class="add-form-item">-->
<!-- <el-select-->
<!-- v-model="attributeEO.sarType"-->
<!-- placeholder="请选择"-->
<!-- filterable-->
<!-- @change="handleSarTypeChange">-->
<!-- <el-option-->
<!-- v-for="item in sarTypeOptions"-->
<!-- :label="item.label"-->
<!-- :value="item.value"-->
<!-- :key="item.value"-->
<!-- ></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="属性字段" prop="attrField" class="add-form-item" :class="{'form-item-disabled': addOrEdit === 'edit'}">
<el-input v-model.trim="attributeEO.attrField" :disabled="addOrEdit === 'edit'" placeholder="请输入属性字段" clearable/>
</el-form-item>
<el-form-item label="属性名称" prop="attrName" class="add-form-item">
<el-input v-model.trim="attributeEO.attrName" placeholder="请输入属性名称" clearable/>
</el-form-item>
<el-form-item label="属性类型" prop="attrType" class="add-form-item" :class="{'form-item-disabled': addOrEdit === 'edit'}">
<el-select v-model="attributeEO.attrType" placeholder="请选择" :disabled="addOrEdit === 'edit'" filterable>
<el-option
v-for="item in attrTypeOptions"
:label="item.label"
:value="item.value"
:key="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="选项值" prop="selVal" class="add-form-item" v-if="attributeEO.attrType === 'SEL_OPTION' || attributeEO.attrType === 'SEL_OPTS'">
<el-select v-model="attributeEO.selVal" placeholder="请选择" :disabled="addOrEdit === 'edit'" filterable>
<el-option
v-for="item in relateDicIdOptions"
:label="item.label"
:value="item.value"
:key="item.value"
></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="是否预警" prop="isWarn" class="laws-info-item" v-if="attributeEO.attrType === 'DATE_PICKER'">-->
<!-- <Select v-model="attributeEO.isWarn">-->
<!-- <Option v-for="opt in isMustOptions" :key="opt.value" :value="opt.value">{{ opt.label }}</Option>-->
<!-- </Select>-->
<!-- </el-form-item>-->
<el-form-item label="字段长度" prop="attrLen" class="add-form-item">
<el-input v-model.number="attributeEO.attrLen" :disabled="addOrEdit === 'edit'" placeholder="只允许输入正整数" number :maxlength="4"/>
</el-form-item>
<el-form-item label="展示顺序" prop="orderNum" class="add-form-item">
<el-input v-model.number="attributeEO.orderNum" placeholder="只允许输入正整数" number :maxlength="3"/>
</el-form-item>
<el-form-item label="是否必填" prop="isMust" class="add-form-item">
<el-select v-model="attributeEO.isMust">
<el-option v-for="opt in isMustOptions" :key="opt.value" :value="opt.value" :label="opt.label">{{ opt.label }}</el-option>
</el-select>
</el-form-item>
<el-form-item label="是否展示" prop="isShowImp" class="add-form-item">
<el-select v-model="attributeEO.isShowImp">
<el-option
v-for="opt in isMustOptions"
:key="opt.value"
:value="opt.value"
:label="opt.label"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="展示区域" prop="showRegionId" class="add-form-item" v-if="attributeEO.isShowImp === '0'">
<el-select v-model="attributeEO.showRegionId">
<el-option
v-for="opt in showRegionOptions"
:key="opt.value"
:value="opt.value"
:label="opt.label"
></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="作为搜索条件" prop="isSearch" class="laws-info-item">-->
<!-- <Select v-model="attributeEO.isSearch">-->
<!-- <Option v-for="opt in isMustOptions" :key="opt.value" :value="opt.value">{{ opt.label }}</Option>-->
<!-- </Select>-->
<!-- </el-form-item>-->
</el-form>
</div>
<div id="roleFormButton" class="demo-drawer-footer">
<el-button
round
class="common-button-primary"
icon="el-icon-check"
type="primary"
:loading="loading.submit"
@click="saveInfo()">提交</el-button>
<el-button round class="common-button-default" icon="el-icon-close" @click="cancelModel">取消</el-button>
</div>
</el-drawer>
<el-dialog
:visible.sync="displayLocationDialogVisible"
title="展示区域管理"
width="400px"
>
<div style="margin-bottom: 10px;">
<el-button round class="common-button-primary add-button" type="primary" icon="add" @click="showAddDisplayLocationDialog(undefined)">新增</el-button>
</div>
<el-table
:loading="displayLocationDialogTableConfig.loading"
:data="displayLocationDialogTableData"
border
style="width: 100%"
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}"
>
<el-table-column
prop="areaName"
label="展示区域">
</el-table-column>
<el-table-column
prop="areaName"
label="所属模块">
<template slot-scope="scope">
{{ getSarTypeText(scope.row.sarType) }}
</template>
</el-table-column>
<el-table-column
prop="showIndex"
label="排序号">
</el-table-column>
<el-table-column label="操作" align="center" width="50" fixed="right">
<template slot-scope="scope">
<div @click.stop style="display: inline-block">
<el-dropdown trigger="click" @command="handleCommand2">
<i class="iconfont">&#xe61e;</i>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="[scope.row, '修改']">修改</el-dropdown-item>
<el-dropdown-item :disabled="scope.row.validFlag===1" :command="[scope.row, '删除']">删除</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</template>
</el-table-column>
</el-table>
</el-dialog>
<el-dialog
destroy-on-close
:close-on-click-modal="false"
:close-on-press-escape="false"
:visible.sync="displayLocationFormDialogVisible"
:title="displayLocationFormDialogTilte"
@on-ok="handleDisplayLocationFormDialogSubmit('displayLocationDialogForm')"
@on-cancel="handleDisplayLocationFormDialogReset('displayLocationDialogForm')"
width="400px"
>
<el-form
ref="displayLocationDialogForm"
:model="displayLocationDialogFormData"
:rules="displayLocationDialogFormRules"
label-width="100px"
class="label-input-form"
>
<el-form-item label="区域名称" prop="areaName" class="add-form-item">
<el-input v-model="displayLocationDialogFormData.areaName" placeholder="请输入区域名称"></el-input>
</el-form-item>
<!-- <el-form-item label="所属模块" prop="sarType" class="add-form-item">-->
<!-- <el-select v-model="displayLocationDialogFormData.sarType" filterable>-->
<!-- <el-option-->
<!-- v-for="item in sarTypeLocationOptions"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value"-->
<!-- ></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="排序号" prop="showIndex" class="add-form-item">
<el-input v-model.number="displayLocationDialogFormData.showIndex" placeholder="请输入排序号"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button round class="common-button-default" @click="handleDisplayLocationFormDialogReset('displayLocationDialogForm')">取 消</el-button>
<el-button round class="common-button-primary" type="primary" @click="handleDisplayLocationFormDialogSubmit('displayLocationDialogForm')">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
const sarType = 'BUSS'
export default {
name: 'attribute-custom',
data () {
return {
sarType: sarType,
displayLocationDialogTableConfig: {
columns: [
{
title: '展示区域',
key: 'areaName'
},
{
title: '排序号',
key: 'showIndex'
},
{
title: '操作',
slot: 'operations'
}
],
page: {
pageSize: 100,
currentPage: 1,
total: 0
},
loading: false
},
loading: {
submit: false
},
displayLocationDialogTableData: [],
displayLocationDialogVisible: false,
displayLocationFormDialogVisible: false,
defaultDisplayLocationDialogFormData: {
areaName: '',
sarType: 'BUSS',
showIndex: ''
},
displayLocationDialogFormData: {
areaName: '',
showIndex: '',
sarType: 'BUSS'
},
displayLocationDialogFormRules: {
areaName: [
{ required: true, message: '请输入展示区域', trigger: 'blur' },
{ type: 'string', max: 100, message: '最多输入100字', trigger: 'blur' }
],
sarType: [
{required: true, message: '所属模块不能为空', trigger: 'change'}
],
showIndex: [
{ type: 'number', required: true, message: '请输入排序号', trigger: 'blur' },
{ type: 'number', min: 0, max: 999, message: '请输入0-999之间的整数', trigger: 'blur' }
]
},
attributeDataLoading: false,
attributeList: [],
total: 0,
pageNo: 1,
pageSize: this.$store.getters.userInfo.configContent,
attributeEO: {
id: '',
attrField: '',
attrName: '',
attrLen: '',
attrType: '',
orderNum: '',
isMust: '1',
isShowImp: '0',
showRegionId: '',
selVal: '',
isSearch: '1',
sarType: 'BUSS',
isWarn: '1'
},
attrTypeOptions: [
{ label: '输入框(字符串)', value: 'INPUT_STR' },
{ label: '输入框(数字)', value: 'INPUT_NUM' },
{ label: '单选下拉框', value: 'SEL_OPTION' },
{ label: '多选下拉框', value: 'SEL_OPTS' },
{ label: '单日期选择', value: 'DATE_PICKER' },
{ label: '多日期选择', value: 'DATE_PIC_OPTS' },
{ label: '文件', value: 'FILE' },
{ label: '文本框', value: 'TEXTAREA' }
],
sarTypeOptions: [
{ label: '国内标准法规', value: 'INLAND_STAND' },
{ label: '海外标准法规', value: 'FOREIGN_STAND' },
{ label: '国内及海外标准法规', value: 'STAND' }
],
sarTypeLocationOptions: [
{ label: '国内标准法规', value: 'INLAND_STAND' },
{ label: '海外标准法规', value: 'FOREIGN_STAND' }
],
isMustOptions: [
{ label: '是', value: '0' },
{ label: '否', value: '1' }
],
showRegionOptions: [],
relateDicIdOptions: [],
attributeTitle: '',
showInfoModal: false,
attributeEOFormRules: {
sarType: [
{required: true, message: '所属模块不能为空', trigger: 'change'}
],
attrField: [
{required: true, message: '属性字段不能为空', trigger: 'blur'},
{type: 'string', max: 50, message: '最多输入50位', trigger: 'blur'},
{type: 'string', validator: this.verify.validFieldOracle, trigger: 'blur'}
],
attrName: [
{required: true, message: '属性名称不能为空', trigger: 'blur'},
{type: 'string', max: 100, message: '最多输入100位', trigger: 'blur'}
],
attrType: [
{required: true, message: '属性类型不能为空', trigger: 'change'}
],
attrLen: [
{type: 'number', required: true, message: '字段长度不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
],
orderNum: [
{type: 'number', required: true, message: '展示顺序不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
],
isMust: [
{required: true, message: '是否必填不能为空', trigger: 'change'}
],
isShowImp: [
{required: true, message: '是否展示必填不能为空', trigger: 'change'}
],
showRegionId: [
{required:true, message:'展示区域不能为空', trigger:'change'}
]
},
styles: {
height: 'calc(100% - 55px)',
overflow: 'auto',
paddingBottom: '53px',
position: 'static'
},
addOrEdit: '',
selectedList: []
}
},
computed: {
displayLocationFormDialogTilte () {
const formData = {...this.displayLocationDialogFormData}
const isEdit = !!formData.id
return isEdit ? '修改展示区域' : '新增展示区域'
}
},
methods: {
// 更多
handleCommand (command) {
switch (command[1]) {
case '编辑':
this.handleTableEdit(command[0])
break
case '删除':
this.handleTableDelete(command[0])
break
}
},
// 展示区域 更多
handleCommand2 (command) {
switch (command[1]) {
case '修改':
this.showAddDisplayLocationDialog(command[0])
break
case '删除':
this.removeDisplayLocation(command[0])
break
}
},
removeDisplayLocation (data) {
this.$confirm('确认删除该条数据?', {
title: '确认删除',
confirmButtonClass: 'common-button-primary',
roundButton: true,
callback: (action, instance) => {
if (action === 'confirm') {
const {id} = data
this.$http.delete('lawssBase/utArea/deleteById', {
id,
sarType: this.sarType
}, {
_this: this
}, res => {
this.queryDisplayLocationDialogTableData()
}, e => {
console.log(e)
})
}
}
})
},
handleDisplayLocationFormDialogSubmit (name) {
this.$refs[name].validate((valid) => {
if (valid) {
const formData = {...this.displayLocationDialogFormData}
const isEdit = !!formData.id
const url = isEdit ? 'lawssBase/utArea/updateUtArea' : 'lawssBase/utArea/createUtArea'
const method = isEdit ? 'putData' : 'postData'
this.$http[method](url, formData, {
_this: this
}, res => {
this.displayLocationFormDialogVisible = false
this.queryDisplayLocationDialogTableData()
// this.displayLocationDialogTableData = res.data.list
// this.displayLocationDialogTableConfig.page.total = res.data.count
}, e => {
console.log(e)
})
} else {
// this.$message.error('Fail!')
}
})
},
handleDisplayLocationFormDialogReset (name) {
this.displayLocationFormDialogVisible = false
this.$nextTick(() => {
this.$refs.displayLocationDialogForm.resetFields()
})
},
/**
* 打开新增展示区域管理弹框
*/
showAddDisplayLocationDialog (data) {
if (data) {
// 编辑
this.displayLocationDialogFormData = {
areaName: data.areaName,
showIndex: data.showIndex,
id: data.id,
sarType: data.sarType
}
} else {
this.displayLocationDialogFormData = {...this.defaultDisplayLocationDialogFormData}
}
this.displayLocationFormDialogVisible = true
},
/**
* 打开展示区域管理弹框 并 查询展示区域数据
*/
showDisplayLocationDialog () {
this.queryDisplayLocationDialogTableData().then(res => {
this.displayLocationDialogVisible = true
})
},
/**
* 查询展示区域管理弹框里的列表数据
*/
queryDisplayLocationDialogTableData () {
return new Promise((resolve, reject) => {
this.$http.get('lawssBase/utArea/page', {
page: this.displayLocationDialogTableConfig.page.currentPage,
pageSize: this.displayLocationDialogTableConfig.page.pageSize,
sarType: this.sarType
}, {
_this: this.displayLocationDialogTableConfig,
loading: 'loading'
}, res => {
this.displayLocationDialogTableData = res.data.list
this.displayLocationDialogTableConfig.page.total = res.data.count
resolve(res)
}, e => {
console.log(e)
reject(e)
})
})
},
/**
* 查询新增弹框里的列表数据
*/
queryDisplayLocationList (sarType) {
return new Promise((resolve, reject) => {
this.$http.get('lawssBase/utArea/getAreaList', {
sarType: sarType || this.sarType
}, {
_this: this
}, res => {
this.showRegionOptions = res.data || []
resolve(res)
}, e => {
console.log(e)
reject(e)
})
})
},
handleSelectone (data) {
this.selectedList = []
for (let i = 0; i < data.length; i++) {
this.selectedList.push(data[i].id)
}
},
pageChange (page) {
this.pageNo = page
this.getAttrByPage()
},
pageSizeChange (pageSize) {
this.pageSize = pageSize
this.getAttrByPage()
},
getAttrByPage () {
this.$http.get('lawss/sarStandAttrDetails/page', {
page: this.pageNo,
pageSize: this.pageSize,
sarType: this.sarType
}, {
_this: this,
loading: 'attributeDataLoading'
},
res => {
this.attributeList = res.data.list
this.total = res.data.count
}, e => {})
this.$refs.selections.clearSelection()
},
async showAddModel () {
await this.queryDisplayLocationList()
// this.$refs['attributeEO'] && this.$refs['attributeEO'].resetFields()
this.attributeEO.newWebSite = ''
this.addOrEdit = 'add'
this.attributeTitle = '新增'
this.showInfoModal = true
this.$nextTick(() => {
this.$refs['attributeEO'].resetFields()
})
},
saveInfo () {
if (this.loading.submit) {
return false
}
this.$refs['attributeEO'].validate((valid) => {
if (valid) {
if ((this.attributeEO.attrType === 'SEL_OPTION' || this.attributeEO.attrType === 'SEL_OPTS') && (this.attributeEO.selVal == null || this.attributeEO.selVal === '')) {
this.$message.warning('下拉框类型字段,选项值不能为空')
} else if (this.attributeEO.isShowImp === '0' && (this.attributeEO.showRegionId == null || this.attributeEO.showRegionId === '')) {
this.$message.warning('展示字段,展示区域不能为空')
} else {
this.loading.submit = true
if (this.addOrEdit === 'add') {
this.$http.postData('lawss/sarStandAttrDetails/createStandAttrDetails', this.attributeEO,
{
_this: this
}, res => {
this.loading.submit = false
if (res.ok) {
this.getAttrByPage()
this.showInfoModal = false
} else {
}
})
} else {
this.$http.putData('lawss/sarStandAttrDetails/updateStandAttrDetails', this.attributeEO,
{
_this: this
}, res => {
this.loading.submit = false
if (res.ok) {
this.getAttrByPage()
this.showInfoModal = false
} else {
}
})
}
}
}
})
},
cancelModel () {
this.showInfoModal = false
this.$refs['attributeEO'] && this.$refs['attributeEO'].resetFields()
},
deleteAttr () {
if (this.selectedList.length === 0) {
this.$message.error('请先选择要删除的数据!')
} else {
this.$confirm('确认删除选中数据?',{
title: '提示',
confirmButtonClass: 'common-button-primary',
roundButton: true,
callback: (action, instance) => {
if (action === 'confirm') {
this.$http.put('lawss/sarStandAttrDetails/deleteByIds', {
ids: this.selectedList.join(','),
sarType: this.sarType
}, {
_this: this
}, res => {
this.getAttrByPage()
}, e => {
})
}
}
})
}
},
getDictionarySelList () {
this.$http.get('sys/dictionary/getDictionaryCodeSelList', {
sarType: this.sarType
}, {
_this: this
},
res => {
this.relateDicIdOptions = res.data
}, e => {})
},
getAttrTypeText(type) {
let texts = ''
if (type === 'INPUT_STR') {
texts = '输入框(字符串)'
} else if (type === 'INPUT_NUM') {
texts = '输入框(数字)'
} else if (type === 'SEL_OPTION') {
texts = '单选下拉框'
} else if (type === 'SEL_OPTS') {
texts = '多选下拉框'
} else if (type === 'DATE_PICKER') {
texts = '单日期选择'
} else if (type === 'DATE_PIC_OPTS') {
texts = '多日期选择'
} else if (type === 'FILE') {
texts = '文件'
} else if (type === 'TEXTAREA') {
texts = '文本框'
}
return texts
},
getSarTypeText(type) {
let texts = ''
if (type === 'INLAND_STAND') {
texts = '国内标准法规'
} else if (type === 'FOREIGN_STAND') {
texts = '海外标准法规'
} else if (type === 'STAND') {
texts = '国内及海外标准法规'
} else if (type === 'BUSS') {
texts = '企业标准库'
}
return texts
},
async handleTableEdit (params) {
await this.queryDisplayLocationList(params.sarType)
// this.$refs['attributeEO'] && this.$refs['attributeEO'].resetFields()
this.addOrEdit = 'edit'
this.attributeTitle = '编辑'
this.showInfoModal = true
this.attributeEO = JSON.parse(JSON.stringify(params))
},
handleTableDelete (params) {
this.selectedList = []
this.selectedList.push(params.id)
this.deleteAttr()
},
async handleSarTypeChange(sarType) {
this.attributeEO.showRegionId = ''
await this.queryDisplayLocationList(sarType)
}
},
mounted () {
this.getAttrByPage()
this.getDictionarySelList()
}
}
</script>
<style lang="less" scoped>
@import '~@/assets/styles/mixins';
.attribute-custom{
background: #FFF;
height: 100%;
position: relative;
display: flex;
flex-direction: column;
flex: auto;
.action-bar{
padding: 0;
}
.content {
padding: 0;
overflow-y: auto;
flex: auto;
//height: calc(~'100% - 50px - 56px');
display: flex;
flex-direction: column;
}
.pagination {
position: static;
/deep/ .pagination-slot {
padding: 0;
}
}
.modalStyle{
padding: 14px;
font-size: 15px;
}
.sysMenuTreeDiv{
height: 400px;
overflow-y: auto;
}
}
</style>
@@ -0,0 +1,780 @@
<!-- 配置管理 - 属性自定义 - 国内外政策 -->
<template>
<div class="attribute-custom v-class">
<div class="action-bar1">
<el-button round class="common-button-primary add-button" type="primary" v-btn-permission="'H9WU2ZJHG5WNTY5MDUXH'" @click="showAddModel"><i class="iconfont">&#xe84e;</i>新增</el-button>
<el-button round class="common-button-default" @click="showDisplayLocationDialog" v-btn-permission="'XT94XKWBCTELWNJQVYCU'">展示区域管理</el-button>
</div>
<loading :loading="attributeDataLoading">数据处理中</loading>
<div class="content">
<el-table
style="width: 100%;"
:data="attributeList"
height="100%"
border
ref="selections"
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}"
@on-selection-change="handleSelectone"
>
<el-table-column
type="selection"
width="55"
align="center"
>
</el-table-column>
<el-table-column
prop="sarType"
label="所属模块"
width="140"
>
<template slot-scope="scope">
{{ getSarTypeText(scope.row.sarType) }}
</template>
</el-table-column>
<el-table-column
prop="attrField"
label="属性字段"
width="120"
>
</el-table-column>
<el-table-column
prop="attrName"
label="属性名称"
>
</el-table-column>
<el-table-column
prop="attrType"
label="属性类型"
width="140"
>
<template slot-scope="scope">
{{ getAttrTypeText(scope.row.attrType) }}
</template>
</el-table-column>
<el-table-column
prop="attrLen"
label="字段长度"
width="120"
>
</el-table-column>
<el-table-column
prop="orderNum"
label="展示顺序"
width="100"
>
</el-table-column>
<el-table-column
prop="areaName"
label="展示区域"
width="120"
>
</el-table-column>
<el-table-column label="操作" align="center" width="50" fixed="right">
<template slot-scope="scope">
<div @click.stop style="display: inline-block">
<el-dropdown trigger="click" @command="handleCommand">
<i class="iconfont">&#xe61e;</i>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="[scope.row, '编辑']" v-btn-permission="'XFFUQ8ASE5SS9HGDGANZ'">编辑</el-dropdown-item>
<el-dropdown-item :disabled="scope.row.isEdit==='1'" :command="[scope.row, '删除']">删除</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</template>
</el-table-column>
</el-table>
</div>
<pagination :total="total" :pageChange="pageNo" :pageSizeChange="pageSize" @pageChange="pageChange" @pageSizeChange="pageSizeChange"></pagination>
<!-- 新建抽屉-->
<el-drawer
:title="attributeTitle"
:visible.sync="showInfoModal"
size="800px"
:styles="styles"
:wrapperClosable="false"
@close="cancelModel"
>
<div class="demo-drawer-content">
<el-form
ref="attributeEO"
:model="attributeEO"
:rules="attributeEOFormRules"
class="label-input-form"
label-width="150px"
>
<input v-model="attributeEO.id" v-show="false">
<el-form-item label="所属模块" prop="sarType" class="add-form-item">
<el-select
v-model="attributeEO.sarType"
placeholder="请选择"
filterable
@change="handleSarTypeChange">
<el-option
v-for="item in sarTypeOptions"
:label="item.label"
:value="item.value"
:key="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="属性字段" prop="attrField" class="add-form-item" :class="{'form-item-disabled': addOrEdit === 'edit'}">
<el-input v-model.trim="attributeEO.attrField" :disabled="addOrEdit === 'edit'" placeholder="请输入属性字段" clearable/>
</el-form-item>
<el-form-item label="属性名称" prop="attrName" class="add-form-item">
<el-input v-model.trim="attributeEO.attrName" placeholder="请输入属性名称" clearable/>
</el-form-item>
<el-form-item label="属性类型" prop="attrType" class="add-form-item" :class="{'form-item-disabled': addOrEdit === 'edit'}">
<el-select v-model="attributeEO.attrType" placeholder="请选择" :disabled="addOrEdit === 'edit'" filterable>
<el-option
v-for="item in attrTypeOptions"
:label="item.label"
:value="item.value"
:key="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="选项值" prop="selVal" class="add-form-item" v-if="attributeEO.attrType === 'SEL_OPTION' || attributeEO.attrType === 'SEL_OPTS'">
<el-select v-model="attributeEO.selVal" placeholder="请选择" :disabled="addOrEdit === 'edit'" filterable>
<el-option
v-for="item in relateDicIdOptions"
:label="item.label"
:value="item.value"
:key="item.value"
></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="是否预警" prop="isWarn" class="laws-info-item" v-if="attributeEO.attrType === 'DATE_PICKER'">-->
<!-- <Select v-model="attributeEO.isWarn">-->
<!-- <Option v-for="opt in isMustOptions" :key="opt.value" :value="opt.value">{{ opt.label }}</Option>-->
<!-- </Select>-->
<!-- </el-form-item>-->
<el-form-item label="字段长度" prop="attrLen" class="add-form-item">
<el-input v-model.number="attributeEO.attrLen" :disabled="addOrEdit === 'edit'" placeholder="只允许输入正整数" number :maxlength="4"/>
</el-form-item>
<el-form-item label="展示顺序" prop="orderNum" class="add-form-item">
<el-input v-model.number="attributeEO.orderNum" placeholder="只允许输入正整数" number :maxlength="3"/>
</el-form-item>
<el-form-item label="是否必填" prop="isMust" class="add-form-item">
<el-select v-model="attributeEO.isMust">
<el-option v-for="opt in isMustOptions" :key="opt.value" :value="opt.value" :label="opt.label">{{ opt.label }}</el-option>
</el-select>
</el-form-item>
<el-form-item label="是否展示" prop="isShowImp" class="add-form-item">
<el-select v-model="attributeEO.isShowImp">
<el-option
v-for="opt in isMustOptions"
:key="opt.value"
:value="opt.value"
:label="opt.label"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="展示区域" prop="showRegionId" class="add-form-item" v-if="attributeEO.isShowImp === '0'">
<el-select v-model="attributeEO.showRegionId">
<el-option
v-for="opt in showRegionOptions"
:key="opt.value"
:value="opt.value"
:label="opt.label"
></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="作为搜索条件" prop="isSearch" class="laws-info-item">-->
<!-- <Select v-model="attributeEO.isSearch">-->
<!-- <Option v-for="opt in isMustOptions" :key="opt.value" :value="opt.value">{{ opt.label }}</Option>-->
<!-- </Select>-->
<!-- </el-form-item>-->
</el-form>
</div>
<div id="roleFormButton" class="demo-drawer-footer">
<el-button round class="common-button-primary" icon="el-icon-check" type="primary" @click="saveInfo()">提交</el-button>
<el-button round class="common-button-default" icon="el-icon-close" @click="cancelModel">取消</el-button>
</div>
</el-drawer>
<el-dialog
:visible.sync="displayLocationDialogVisible"
title="展示区域管理"
width="400px"
>
<div style="margin-bottom: 10px;">
<el-button round class="common-button-primary add-button" type="primary" icon="add" @click="showAddDisplayLocationDialog(undefined)">新增</el-button>
</div>
<el-table
:loading="displayLocationDialogTableConfig.loading"
:data="displayLocationDialogTableData"
border
style="width: 100%"
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}"
>
<el-table-column
prop="areaName"
label="展示区域">
</el-table-column>
<el-table-column
prop="areaName"
label="所属模块">
<template slot-scope="scope">
{{ getSarTypeText(scope.row.sarType) }}
</template>
</el-table-column>
<el-table-column
prop="showIndex"
label="排序号">
</el-table-column>
<el-table-column label="操作" align="center" width="50" fixed="right">
<template slot-scope="scope">
<div @click.stop style="display: inline-block">
<el-dropdown trigger="click" @command="handleCommand2">
<i class="iconfont">&#xe61e;</i>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="[scope.row, '修改']">修改</el-dropdown-item>
<el-dropdown-item :disabled="scope.row.validFlag===1" :command="[scope.row, '删除']">删除</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</template>
</el-table-column>
</el-table>
</el-dialog>
<el-dialog
destroy-on-close
:close-on-click-modal="false"
:close-on-press-escape="false"
:visible.sync="displayLocationFormDialogVisible"
:title="displayLocationFormDialogTilte"
@on-ok="handleDisplayLocationFormDialogSubmit('displayLocationDialogForm')"
@on-cancel="handleDisplayLocationFormDialogReset('displayLocationDialogForm')"
width="400px"
>
<el-form
ref="displayLocationDialogForm"
:model="displayLocationDialogFormData"
:rules="displayLocationDialogFormRules"
label-width="100px"
class="label-input-form"
>
<el-form-item label="区域名称" prop="areaName" class="add-form-item">
<el-input v-model="displayLocationDialogFormData.areaName" placeholder="请输入区域名称"></el-input>
</el-form-item>
<el-form-item label="所属模块" prop="sarType" class="add-form-item">
<el-select v-model="displayLocationDialogFormData.sarType" filterable>
<el-option
v-for="item in sarTypeLocationOptions"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="排序号" prop="showIndex" class="add-form-item">
<el-input v-model.number="displayLocationDialogFormData.showIndex" placeholder="请输入排序号"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button round class="common-button-default" @click="handleDisplayLocationFormDialogReset('displayLocationDialogForm')">取 消</el-button>
<el-button round class="common-button-primary" type="primary" @click="handleDisplayLocationFormDialogSubmit('displayLocationDialogForm')">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
const sarType = 'FOREIGN_LAWS'
export default {
name: 'attribute-custom',
data () {
return {
sarType: sarType,
displayLocationDialogTableConfig: {
columns: [
{
title: '展示区域',
key: 'areaName'
},
{
title: '排序号',
key: 'showIndex'
},
{
title: '操作',
slot: 'operations'
}
],
page: {
pageSize: 100,
currentPage: 1,
total: 0
},
loading: false
},
displayLocationDialogTableData: [],
displayLocationDialogVisible: false,
displayLocationFormDialogVisible: false,
defaultDisplayLocationDialogFormData: {
areaName: '',
sarType: '',
showIndex: ''
},
displayLocationDialogFormData: {
areaName: '',
showIndex: ''
},
displayLocationDialogFormRules: {
areaName: [
{ required: true, message: '请输入展示区域', trigger: 'blur' },
{ type: 'string', max: 100, message: '最多输入100字', trigger: 'blur' }
],
sarType: [
{required: true, message: '所属模块不能为空', trigger: 'change'}
],
showIndex: [
{ type: 'number', required: true, message: '请输入排序号', trigger: 'blur' },
{ type: 'number', min: 0, max: 999, message: '请输入0-999之间的整数', trigger: 'blur' }
]
},
attributeDataLoading: false,
attributeList: [],
total: 0,
pageNo: 1,
pageSize: this.$store.getters.userInfo.configContent,
attributeEO: {
id: '',
attrField: '',
attrName: '',
attrLen: '',
attrType: '',
orderNum: '',
isMust: '1',
isShowImp: '0',
showRegionId: '',
selVal: '',
isSearch: '1',
sarType: 'FOREIGN_LAWS',
isWarn: '1'
},
attrTypeOptions: [
{ label: '输入框(字符串)', value: 'INPUT_STR' },
{ label: '输入框(数字)', value: 'INPUT_NUM' },
{ label: '单选下拉框', value: 'SEL_OPTION' },
{ label: '多选下拉框', value: 'SEL_OPTS' },
{ label: '单日期选择', value: 'DATE_PICKER' },
{ label: '多日期选择', value: 'DATE_PIC_OPTS' },
{ label: '文件', value: 'FILE' },
{ label: '文本框', value: 'TEXTAREA' }
],
sarTypeOptions: [
// { label: '国内政策', value: 'INLAND_LAWS' },
{ label: '国内外政策', value: 'FOREIGN_LAWS' }
// { label: '国内外政策', value: 'LAWS' }
],
sarTypeLocationOptions: [
// { label: '国内政策', value: 'INLAND_LAWS' },
{ label: '国内外政策', value: 'FOREIGN_LAWS' }
],
isMustOptions: [
{ label: '是', value: '0' },
{ label: '否', value: '1' }
],
showRegionOptions: [],
relateDicIdOptions: [],
attributeTitle: '',
showInfoModal: false,
attributeEOFormRules: {
sarType: [
{required: true, message: '所属模块不能为空', trigger: 'change'}
],
attrField: [
{required: true, message: '属性字段不能为空', trigger: 'blur'},
{type: 'string', max: 50, message: '最多输入50位', trigger: 'blur'},
{type: 'string', validator: this.verify.validFieldOracle, trigger: 'blur'}
],
attrName: [
{required: true, message: '属性名称不能为空', trigger: 'blur'},
{type: 'string', max: 100, message: '最多输入100位', trigger: 'blur'}
],
attrType: [
{required: true, message: '属性类型不能为空', trigger: 'change'}
],
attrLen: [
{type: 'number', required: true, message: '字段长度不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
],
orderNum: [
{type: 'number', required: true, message: '展示顺序不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
],
isMust: [
{required: true, message: '是否必填不能为空', trigger: 'change'}
],
isShowImp: [
{required: true, message: '是否展示必填不能为空', trigger: 'change'}
],
showRegionId:[
{required:true, message:'展示区域不能为空', trigger:'change'}
]
},
styles: {
height: 'calc(100% - 55px)',
overflow: 'auto',
paddingBottom: '53px',
position: 'static'
},
addOrEdit: '',
selectedList: []
}
},
computed: {
displayLocationFormDialogTilte () {
const formData = {...this.displayLocationDialogFormData}
const isEdit = !!formData.id
return isEdit ? '修改展示区域' : '新增展示区域'
}
},
methods: {
// 更多
handleCommand (command) {
switch (command[1]) {
case '编辑':
this.handleTableEdit(command[0])
break
case '删除':
this.handleTableDelete(command[0])
break
}
},
// 展示区域 更多
handleCommand2 (command) {
switch (command[1]) {
case '修改':
this.showAddDisplayLocationDialog(command[0])
break
case '删除':
this.removeDisplayLocation(command[0])
break
}
},
removeDisplayLocation (data) {
this.$confirm('确认删除该条数据?', {
confirmButtonClass: 'common-button-primary',
roundButton: true,
title: '确认删除',
callback: (action, instance) => {
if (action === 'confirm') {
const {id} = data
this.$http.delete('lawssBase/utArea/deleteById', {
id,
sarType: this.sarType
}, {
_this: this
}, res => {
this.queryDisplayLocationDialogTableData()
}, e => {
console.log(e)
})
}
}
})
},
handleDisplayLocationFormDialogSubmit (name) {
this.$refs[name].validate((valid) => {
if (valid) {
const formData = {...this.displayLocationDialogFormData, sarType: this.sarType}
const isEdit = !!formData.id
const url = isEdit ? 'lawssBase/utArea/updateUtArea' : 'lawssBase/utArea/createUtArea'
const method = isEdit ? 'putData' : 'postData'
this.$http[method](url, formData, {
_this: this
}, res => {
this.displayLocationFormDialogVisible = false
this.queryDisplayLocationDialogTableData()
// this.displayLocationDialogTableData = res.data.list
// this.displayLocationDialogTableConfig.page.total = res.data.count
}, e => {
console.log(e)
})
} else {
// this.$message.error('Fail!')
}
})
},
handleDisplayLocationFormDialogReset (name) {
this.displayLocationFormDialogVisible = false
this.$nextTick(() => {
this.$refs.displayLocationDialogForm.resetFields()
})
},
/**
* 打开新增展示区域管理弹框
*/
showAddDisplayLocationDialog (data) {
if (data) {
// 编辑
this.displayLocationDialogFormData = {
areaName: data.areaName,
showIndex: data.showIndex,
id: data.id,
sarType: data.sarType
}
} else {
this.displayLocationDialogFormData = {...this.defaultDisplayLocationDialogFormData}
}
this.displayLocationFormDialogVisible = true
},
/**
* 打开展示区域管理弹框 并 查询展示区域数据
*/
showDisplayLocationDialog () {
this.queryDisplayLocationDialogTableData().then(res => {
this.displayLocationDialogVisible = true
})
},
/**
* 查询展示区域管理弹框里的列表数据
*/
queryDisplayLocationDialogTableData () {
return new Promise((resolve, reject) => {
this.$http.get('lawssBase/utArea/page', {
page: this.displayLocationDialogTableConfig.page.currentPage,
pageSize: this.displayLocationDialogTableConfig.page.pageSize,
sarType: this.sarType
}, {
_this: this.displayLocationDialogTableConfig,
loading: 'loading'
}, res => {
this.displayLocationDialogTableData = res.data.list
this.displayLocationDialogTableConfig.page.total = res.data.count
resolve(res)
}, e => {
console.log(e)
reject(e)
})
})
},
/**
* 查询新增弹框里的列表数据
*/
queryDisplayLocationList (sarType) {
return new Promise((resolve, reject) => {
this.$http.get('lawssBase/utArea/getAreaList', {
sarType: sarType || this.sarType
}, {
_this: this
}, res => {
this.showRegionOptions = res.data || []
resolve(res)
}, e => {
console.log(e)
reject(e)
})
})
},
handleSelectone (data) {
this.selectedList = []
for (let i = 0; i < data.length; i++) {
this.selectedList.push(data[i].id)
}
},
pageChange (page) {
this.pageNo = page
this.getAttrByPage()
},
pageSizeChange (pageSize) {
this.pageSize = pageSize
this.getAttrByPage()
},
getAttrByPage () {
this.$http.get('lawss/sarStandAttrDetails/page', {
page: this.pageNo,
pageSize: this.pageSize,
sarType: this.sarType
}, {
_this: this,
loading: 'attributeDataLoading'
},
res => {
this.attributeList = res.data.list
this.total = res.data.count
}, e => {})
this.$refs.selections.clearSelection()
},
async showAddModel () {
await this.queryDisplayLocationList()
// this.$refs['attributeEO'] && this.$refs['attributeEO'].resetFields()
this.attributeEO.newWebSite = ''
this.addOrEdit = 'add'
this.attributeTitle = '新增'
this.showInfoModal = true
this.$nextTick(() => {
this.$refs['attributeEO'].resetFields()
})
},
saveInfo () {
this.$refs['attributeEO'].validate((valid) => {
if (valid) {
if ((this.attributeEO.attrType === 'SEL_OPTION' || this.attributeEO.attrType === 'SEL_OPTS') && (this.attributeEO.selVal == null || this.attributeEO.selVal === '')) {
this.$message.warning('下拉框类型字段,选项值不能为空')
} else if (this.attributeEO.isShowImp === '0' && (this.attributeEO.showRegionId == null || this.attributeEO.showRegionId === '')) {
this.$message.warning('展示字段,展示区域不能为空')
} else {
if (this.addOrEdit === 'add') {
this.$http.postData('lawss/sarStandAttrDetails/createStandAttrDetails', this.attributeEO,
{
_this: this
}, res => {
if (res.ok) {
this.getAttrByPage()
this.showInfoModal = false
} else {
}
})
} else {
this.$http.putData('lawss/sarStandAttrDetails/updateStandAttrDetails', this.attributeEO,
{
_this: this
}, res => {
if (res.ok) {
this.getAttrByPage()
this.showInfoModal = false
} else {
}
})
}
}
}
})
},
cancelModel () {
this.showInfoModal = false
this.$refs['attributeEO'] && this.$refs['attributeEO'].resetFields()
},
deleteAttr () {
if (this.selectedList.length === 0) {
this.$message.error('请先选择要删除的数据!')
} else {
this.$confirm('确认删除选中数据?', {
title: '提示',
confirmButtonClass: 'common-button-primary',
roundButton: true,
callback: (action, instance) => {
if (action === 'confirm') {
this.$http.put('lawss/sarStandAttrDetails/deleteByIds', {
ids: this.selectedList.join(','),
sarType: this.sarType
}, {
_this: this
}, res => {
this.getAttrByPage()
}, e => {
})
}
}
})
}
},
getDictionarySelList () {
this.$http.get('sys/dictionary/getDictionaryCodeSelList', {
sarType: this.sarType
}, {
_this: this
},
res => {
this.relateDicIdOptions = res.data
}, e => {})
},
getAttrTypeText (type) {
let texts = ''
if (type === 'INPUT_STR') {
texts = '输入框(字符串)'
} else if (type === 'INPUT_NUM') {
texts = '输入框(数字)'
} else if (type === 'SEL_OPTION') {
texts = '单选下拉框'
} else if (type === 'SEL_OPTS') {
texts = '多选下拉框'
} else if (type === 'DATE_PICKER') {
texts = '单日期选择'
} else if (type === 'DATE_PIC_OPTS') {
texts = '多日期选择'
} else if (type === 'FILE') {
texts = '文件'
} else if (type === 'TEXTAREA') {
texts = '文本框'
}
return texts
},
getSarTypeText (type) {
let texts = ''
if (type === 'INLAND_LAWS') {
texts = '国内政策'
} else if (type === 'FOREIGN_LAWS') {
texts = '国内外政策'
} else if (type === 'LAWS') {
texts = '国内外通用政策'
}
return texts
},
async handleTableEdit (params) {
await this.queryDisplayLocationList(params.sarType)
// this.$refs['attributeEO'] && this.$refs['attributeEO'].resetFields()
this.addOrEdit = 'edit'
this.attributeTitle = '编辑'
this.showInfoModal = true
this.attributeEO = JSON.parse(JSON.stringify(params))
},
handleTableDelete (params) {
this.selectedList = []
this.selectedList.push(params.id)
this.deleteAttr()
},
async handleSarTypeChange (sarType) {
this.attributeEO.showRegionId = ''
await this.queryDisplayLocationList(sarType)
}
},
mounted () {
this.getAttrByPage()
this.getDictionarySelList()
}
}
</script>
<style lang="less" scoped>
@import '~@/assets/styles/mixins';
.attribute-custom{
background: #FFF;
height: 100%;
position: relative;
display: flex;
flex-direction: column;
flex: auto;
.action-bar{
padding: 0;
}
.content {
padding: 0;
overflow-y: auto;
flex: auto;
display: flex;
flex-direction: column;
//height: calc(~'100% - 50px - 56px');
}
.pagination {
position: static;
/deep/ .pagination-slot {
padding: 0;
}
}
.modalStyle{
padding: 14px;
font-size: 15px;
}
.sysMenuTreeDiv{
height: 400px;
overflow-y: auto;
}
}
</style>
@@ -0,0 +1,778 @@
<!-- 配置管理 - 属性自定义 - 国内外标准法规 -->
<template>
<div class="attribute-custom v-class">
<div class="action-bar1">
<el-button round class="common-button-primary add-button" v-btn-permission="'EAT8LJFSP6P4QMR6M8F4'" type="primary" @click="showAddModel"><i class="iconfont">&#xe84e;</i>新增</el-button>
<el-button round class="common-button-default" v-btn-permission="'Q2AQMSUHKZDKLXJBHJEN'" @click="showDisplayLocationDialog">展示区域管理</el-button>
</div>
<loading :loading="attributeDataLoading">数据处理中</loading>
<div class="content">
<el-table
style="width: 100%;"
:data="attributeList"
height="100%"
border
ref="selections"
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}"
@on-selection-change="handleSelectone"
>
<el-table-column
type="selection"
width="55"
align="center"
>
</el-table-column>
<el-table-column
prop="sarType"
label="所属模块"
width="140"
>
<template slot-scope="scope">
{{ getSarTypeText(scope.row.sarType) }}
</template>
</el-table-column>
<el-table-column
prop="attrField"
label="属性字段"
width="120"
>
</el-table-column>
<el-table-column
prop="attrName"
label="属性名称"
>
</el-table-column>
<el-table-column
prop="attrType"
label="属性类型"
width="140"
>
<template slot-scope="scope">
{{ getAttrTypeText(scope.row.attrType) }}
</template>
</el-table-column>
<el-table-column
prop="attrLen"
label="字段长度"
width="120"
>
</el-table-column>
<el-table-column
prop="orderNum"
label="展示顺序"
width="100"
>
</el-table-column>
<el-table-column
prop="areaName"
label="展示区域"
width="120"
>
</el-table-column>
<el-table-column label="操作" align="center" width="50" fixed="right">
<template slot-scope="scope">
<div @click.stop style="display: inline-block">
<el-dropdown trigger="click" @command="handleCommand">
<i class="iconfont">&#xe61e;</i>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-btn-permission="'PTH96GYZT6SQZE9H8XCF'" :command="[scope.row, '编辑']">编辑</el-dropdown-item>
<el-dropdown-item :disabled="scope.row.isEdit==='1'" :command="[scope.row, '删除']">删除</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</template>
</el-table-column>
</el-table>
</div>
<pagination :total="total" :pageChange="pageNo" :pageSizeChange="pageSize" @pageChange="pageChange" @pageSizeChange="pageSizeChange"></pagination>
<!-- 新建抽屉-->
<el-drawer
:title="attributeTitle"
:visible.sync="showInfoModal"
size="800px"
:styles="styles"
:wrapperClosable="false"
@close="cancelModel"
>
<div class="demo-drawer-content">
<el-form
ref="attributeEO"
:model="attributeEO"
:rules="attributeEOFormRules"
class="label-input-form"
label-width="150px"
>
<input v-model="attributeEO.id" v-show="false">
<el-form-item label="所属模块" prop="sarType" class="add-form-item">
<el-select
v-model="attributeEO.sarType"
placeholder="请选择"
filterable
@change="handleSarTypeChange">
<el-option
v-for="item in sarTypeOptions"
:label="item.label"
:value="item.value"
:key="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="属性字段" prop="attrField" class="add-form-item" :class="{'form-item-disabled': addOrEdit === 'edit'}">
<el-input v-model.trim="attributeEO.attrField" :disabled="addOrEdit === 'edit'" placeholder="请输入属性字段" clearable/>
</el-form-item>
<el-form-item label="属性名称" prop="attrName" class="add-form-item">
<el-input v-model.trim="attributeEO.attrName" placeholder="请输入属性名称" clearable/>
</el-form-item>
<el-form-item label="属性类型" prop="attrType" class="add-form-item" :class="{'form-item-disabled': addOrEdit === 'edit'}">
<el-select v-model="attributeEO.attrType" placeholder="请选择" :disabled="addOrEdit === 'edit'" filterable>
<el-option
v-for="item in attrTypeOptions"
:label="item.label"
:value="item.value"
:key="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="选项值" prop="selVal" class="add-form-item" v-if="attributeEO.attrType === 'SEL_OPTION' || attributeEO.attrType === 'SEL_OPTS'">
<el-select v-model="attributeEO.selVal" placeholder="请选择" :disabled="addOrEdit === 'edit'" filterable>
<el-option
v-for="item in relateDicIdOptions"
:label="item.label"
:value="item.value"
:key="item.value"
></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="是否预警" prop="isWarn" class="laws-info-item" v-if="attributeEO.attrType === 'DATE_PICKER'">-->
<!-- <Select v-model="attributeEO.isWarn">-->
<!-- <Option v-for="opt in isMustOptions" :key="opt.value" :value="opt.value">{{ opt.label }}</Option>-->
<!-- </Select>-->
<!-- </el-form-item>-->
<el-form-item label="字段长度" prop="attrLen" class="add-form-item">
<el-input v-model.number="attributeEO.attrLen" :disabled="addOrEdit === 'edit'" placeholder="只允许输入正整数" number :maxlength="4"/>
</el-form-item>
<el-form-item label="展示顺序" prop="orderNum" class="add-form-item">
<el-input v-model.number="attributeEO.orderNum" placeholder="只允许输入正整数" number :maxlength="3"/>
</el-form-item>
<el-form-item label="是否必填" prop="isMust" class="add-form-item">
<el-select v-model="attributeEO.isMust">
<el-option v-for="opt in isMustOptions" :key="opt.value" :value="opt.value" :label="opt.label">{{ opt.label }}</el-option>
</el-select>
</el-form-item>
<el-form-item label="是否展示" prop="isShowImp" class="add-form-item">
<el-select v-model="attributeEO.isShowImp">
<el-option
v-for="opt in isMustOptions"
:key="opt.value"
:value="opt.value"
:label="opt.label"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="展示区域" prop="showRegionId" class="add-form-item" v-if="attributeEO.isShowImp === '0'">
<el-select v-model="attributeEO.showRegionId">
<el-option
v-for="opt in showRegionOptions"
:key="opt.value"
:value="opt.value"
:label="opt.label"
></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="作为搜索条件" prop="isSearch" class="laws-info-item">-->
<!-- <Select v-model="attributeEO.isSearch">-->
<!-- <Option v-for="opt in isMustOptions" :key="opt.value" :value="opt.value">{{ opt.label }}</Option>-->
<!-- </Select>-->
<!-- </el-form-item>-->
</el-form>
</div>
<div id="roleFormButton" class="demo-drawer-footer">
<el-button round class="common-button-primary" icon="el-icon-check" type="primary" @click="saveInfo()">提交</el-button>
<el-button round class="common-button-default" icon="el-icon-close" @click="cancelModel">取消</el-button>
</div>
</el-drawer>
<el-dialog
:visible.sync="displayLocationDialogVisible"
title="展示区域管理"
width="400px"
>
<div style="margin-bottom: 10px;">
<el-button round class="common-button-primary add-button" type="primary" icon="add" @click="showAddDisplayLocationDialog(undefined)">新增</el-button>
</div>
<el-table
:loading="displayLocationDialogTableConfig.loading"
:data="displayLocationDialogTableData"
border
style="width: 100%"
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}"
>
<el-table-column
prop="areaName"
label="展示区域">
</el-table-column>
<el-table-column
prop="areaName"
label="所属模块">
<template slot-scope="scope">
{{ getSarTypeText(scope.row.sarType) }}
</template>
</el-table-column>
<el-table-column
prop="showIndex"
label="排序号">
</el-table-column>
<el-table-column label="操作" align="center" width="50" fixed="right">
<template slot-scope="scope">
<div @click.stop style="display: inline-block">
<el-dropdown trigger="click" @command="handleCommand2">
<i class="iconfont">&#xe61e;</i>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="[scope.row, '修改']">修改</el-dropdown-item>
<el-dropdown-item :disabled="scope.row.validFlag===1" :command="[scope.row, '删除']">删除</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</template>
</el-table-column>
</el-table>
</el-dialog>
<el-dialog
destroy-on-close
:close-on-click-modal="false"
:close-on-press-escape="false"
:visible.sync="displayLocationFormDialogVisible"
:title="displayLocationFormDialogTilte"
@close="handleDisplayLocationFormDialogReset('displayLocationDialogForm')"
width="400px"
>
<el-form
ref="displayLocationDialogForm"
:model="displayLocationDialogFormData"
:rules="displayLocationDialogFormRules"
label-width="100px"
class="label-input-form"
>
<el-form-item label="区域名称" prop="areaName" class="add-form-item">
<el-input v-model="displayLocationDialogFormData.areaName" placeholder="请输入区域名称"></el-input>
</el-form-item>
<el-form-item label="所属模块" prop="sarType" class="add-form-item">
<el-select v-model="displayLocationDialogFormData.sarType" filterable>
<el-option
v-for="item in sarTypeLocationOptions"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="排序号" prop="showIndex" class="add-form-item">
<el-input v-model.number="displayLocationDialogFormData.showIndex" placeholder="请输入排序号"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button round class="common-button-default" @click="handleDisplayLocationFormDialogReset('displayLocationDialogForm')">取 消</el-button>
<el-button round class="common-button-primary" type="primary" @click="handleDisplayLocationFormDialogSubmit('displayLocationDialogForm')">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
const sarType = 'STAND'
export default {
name: 'attribute-custom',
data () {
return {
sarType: sarType,
displayLocationDialogTableConfig: {
columns: [
{
title: '展示区域',
key: 'areaName'
},
{
title: '排序号',
key: 'showIndex'
},
{
title: '操作',
slot: 'operations'
}
],
page: {
pageSize: 100,
currentPage: 1,
total: 0
},
loading: false
},
displayLocationDialogTableData: [],
displayLocationDialogVisible: false,
displayLocationFormDialogVisible: false,
defaultDisplayLocationDialogFormData: {
areaName: '',
sarType: '',
showIndex: ''
},
displayLocationDialogFormData: {
areaName: '',
showIndex: ''
},
displayLocationDialogFormRules: {
areaName: [
{ required: true, message: '请输入展示区域', trigger: 'blur' },
{ type: 'string', max: 100, message: '最多输入100字', trigger: 'blur' }
],
sarType: [
{required: true, message: '所属模块不能为空', trigger: 'change'}
],
showIndex: [
{ type: 'number', required: true, message: '请输入排序号', trigger: 'blur' },
{ type: 'number', min: 0, max: 999, message: '请输入0-999之间的整数', trigger: 'blur' }
]
},
attributeDataLoading: false,
attributeList: [],
total: 0,
pageNo: 1,
pageSize: this.$store.getters.userInfo.configContent,
attributeEO: {
id: '',
attrField: '',
attrName: '',
attrLen: '',
attrType: '',
orderNum: '',
isMust: '1',
isShowImp: '0',
showRegionId: '',
selVal: '',
isSearch: '1',
sarType: '',
isWarn: '1'
},
attrTypeOptions: [
{ label: '输入框(字符串)', value: 'INPUT_STR' },
{ label: '输入框(数字)', value: 'INPUT_NUM' },
{ label: '单选下拉框', value: 'SEL_OPTION' },
{ label: '多选下拉框', value: 'SEL_OPTS' },
{ label: '单日期选择', value: 'DATE_PICKER' },
{ label: '多日期选择', value: 'DATE_PIC_OPTS' },
{ label: '文件', value: 'FILE' },
{ label: '文本框', value: 'TEXTAREA' }
],
sarTypeOptions: [
{ label: '国内标准法规', value: 'INLAND_STAND' },
{ label: '海外标准法规', value: 'FOREIGN_STAND' },
{ label: '国内及海外标准法规', value: 'STAND' }
],
sarTypeLocationOptions: [
{ label: '国内标准法规', value: 'INLAND_STAND' },
{ label: '海外标准法规', value: 'FOREIGN_STAND' }
],
isMustOptions: [
{ label: '是', value: '0' },
{ label: '否', value: '1' }
],
showRegionOptions: [],
relateDicIdOptions: [],
attributeTitle: '',
showInfoModal: false,
attributeEOFormRules: {
sarType: [
{required: true, message: '所属模块不能为空', trigger: 'change'}
],
attrField: [
{required: true, message: '属性字段不能为空', trigger: 'blur'},
{type: 'string', max: 50, message: '最多输入50位', trigger: 'blur'},
{type: 'string', validator: this.verify.validFieldOracle, trigger: 'blur'}
],
attrName: [
{required: true, message: '属性名称不能为空', trigger: 'blur'},
{type: 'string', max: 100, message: '最多输入100位', trigger: 'blur'}
],
attrType: [
{required: true, message: '属性类型不能为空', trigger: 'change'}
],
attrLen: [
{type: 'number', required: true, message: '字段长度不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile3, trigger: 'blur'}
],
orderNum: [
{type: 'number', required: true, message: '展示顺序不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
],
isMust: [
{required: true, message: '是否必填不能为空', trigger: 'change'}
],
showRegionId: [
{required:true, message:'展示区域不能为空', trigger:'change'}
],
isShowImp: [
{required: true, message: '是否展示必填不能为空', trigger: 'change'}
],
},
styles: {
height: 'calc(100% - 55px)',
overflow: 'auto',
paddingBottom: '53px',
position: 'static'
},
addOrEdit: '',
selectedList: []
}
},
computed: {
displayLocationFormDialogTilte () {
const formData = {...this.displayLocationDialogFormData}
const isEdit = !!formData.id
return isEdit ? '修改展示区域' : '新增展示区域'
}
},
methods: {
// 更多
handleCommand (command) {
switch (command[1]) {
case '编辑':
this.handleTableEdit(command[0])
break
case '删除':
this.handleTableDelete(command[0])
break
}
},
// 展示区域 更多
handleCommand2 (command) {
switch (command[1]) {
case '修改':
this.showAddDisplayLocationDialog(command[0])
break
case '删除':
this.removeDisplayLocation(command[0])
break
}
},
removeDisplayLocation (data) {
this.$confirm('确认删除该条数据?', {
title: '确认删除',
confirmButtonClass: 'common-button-primary',
roundButton: true,
callback: (action, instance) => {
if (action === 'confirm') {
const {id} = data
this.$http.delete('lawssBase/utArea/deleteById', {
id,
sarType: this.sarType
}, {
_this: this
}, res => {
this.queryDisplayLocationDialogTableData()
}, e => {
console.log(e)
})
}
}
})
},
handleDisplayLocationFormDialogSubmit (name) {
this.$refs[name].validate((valid) => {
if (valid) {
const formData = {...this.displayLocationDialogFormData}
const isEdit = !!formData.id
const url = isEdit ? 'lawssBase/utArea/updateUtArea' : 'lawssBase/utArea/createUtArea'
const method = isEdit ? 'putData' : 'postData'
this.$http[method](url, formData, {
_this: this
}, res => {
this.displayLocationFormDialogVisible = false
this.queryDisplayLocationDialogTableData()
// this.displayLocationDialogTableData = res.data.list
// this.displayLocationDialogTableConfig.page.total = res.data.count
}, e => {
console.log(e)
})
} else {
// this.$message.error('Fail!')
}
})
},
handleDisplayLocationFormDialogReset (name) {
this.displayLocationFormDialogVisible = false
this.$refs.displayLocationDialogForm.resetFields()
},
/**
* 打开新增展示区域管理弹框
*/
showAddDisplayLocationDialog (data) {
this.displayLocationFormDialogVisible = true
if (data) {
// 编辑
this.displayLocationDialogFormData = {
areaName: data.areaName,
showIndex: data.showIndex,
id: data.id,
sarType: data.sarType
}
} else {
this.displayLocationDialogFormData = {...this.defaultDisplayLocationDialogFormData}
this.$nextTick(() => {
this.$refs.displayLocationDialogForm.resetFields()
})
}
},
/**
* 打开展示区域管理弹框 并 查询展示区域数据
*/
showDisplayLocationDialog () {
this.queryDisplayLocationDialogTableData().then(res => {
this.displayLocationDialogVisible = true
})
},
/**
* 查询展示区域管理弹框里的列表数据
*/
queryDisplayLocationDialogTableData () {
return new Promise((resolve, reject) => {
this.$http.get('lawssBase/utArea/page', {
page: this.displayLocationDialogTableConfig.page.currentPage,
pageSize: this.displayLocationDialogTableConfig.page.pageSize,
sarType: this.sarType
}, {
_this: this.displayLocationDialogTableConfig,
loading: 'loading'
}, res => {
this.displayLocationDialogTableData = res.data.list
this.displayLocationDialogTableConfig.page.total = res.data.count
resolve(res)
}, e => {
console.log(e)
reject(e)
})
})
},
/**
* 查询新增弹框里的列表数据
*/
queryDisplayLocationList (sarType) {
return new Promise((resolve, reject) => {
this.$http.get('lawssBase/utArea/getAreaList', {
sarType: 'INLAND_STAND'
}, {
_this: this
}, res => {
this.showRegionOptions = res.data || []
resolve(res)
}, e => {
console.log(e)
reject(e)
})
})
},
handleSelectone (data) {
this.selectedList = []
for (let i = 0; i < data.length; i++) {
this.selectedList.push(data[i].id)
}
},
pageChange (page) {
this.pageNo = page
this.getAttrByPage()
},
pageSizeChange (pageSize) {
this.pageSize = pageSize
this.getAttrByPage()
},
getAttrByPage () {
this.$http.get('lawss/sarStandAttrDetails/page', {
page: this.pageNo,
pageSize: this.pageSize,
sarType: this.sarType
}, {
_this: this,
loading: 'attributeDataLoading'
},
res => {
this.attributeList = res.data.list
this.total = res.data.count
}, e => {})
this.$refs.selections.clearSelection()
},
async showAddModel () {
await this.queryDisplayLocationList()
// this.$refs['attributeEO'] && this.$refs['attributeEO'].resetFields()
this.attributeEO.newWebSite = ''
this.addOrEdit = 'add'
this.attributeTitle = '新增'
this.showInfoModal = true
this.$nextTick(() => {
this.$refs['attributeEO'].resetFields()
})
},
saveInfo () {
this.$refs['attributeEO'].validate((valid) => {
if (valid) {
if ((this.attributeEO.attrType === 'SEL_OPTION' || this.attributeEO.attrType === 'SEL_OPTS') && (this.attributeEO.selVal == null || this.attributeEO.selVal === '')) {
this.$message.warning('下拉框类型字段,选项值不能为空')
} else if (this.attributeEO.isShowImp === '0' && (this.attributeEO.showRegionId == null || this.attributeEO.showRegionId === '')) {
this.$message.warning('展示字段,展示区域不能为空')
} else {
if (this.addOrEdit === 'add') {
this.$http.postData('lawss/sarStandAttrDetails/createStandAttrDetails', this.attributeEO,
{
_this: this
}, res => {
if (res.ok) {
this.getAttrByPage()
this.showInfoModal = false
} else {
}
})
} else {
this.$http.putData('lawss/sarStandAttrDetails/updateStandAttrDetails', this.attributeEO,
{
_this: this
}, res => {
if (res.ok) {
this.getAttrByPage()
this.showInfoModal = false
} else {
}
})
}
}
}
})
},
cancelModel () {
this.showInfoModal = false
this.$refs['attributeEO'] && this.$refs['attributeEO'].resetFields()
},
deleteAttr () {
if (this.selectedList.length === 0) {
this.$message.error('请先选择要删除的数据!')
} else {
this.$confirm('确认删除选中数据?', {
title: '提示',
confirmButtonClass: 'common-button-primary',
roundButton: true,
callback: (action, instance) => {
if (action === 'confirm') {
this.$http.put('lawss/sarStandAttrDetails/deleteByIds', {
ids: this.selectedList.join(','),
sarType: this.sarType
}, {
_this: this
}, res => {
this.getAttrByPage()
}, e => {
})
}
}
})
}
},
getDictionarySelList () {
this.$http.get('sys/dictionary/getDictionaryCodeSelList', {
sarType: this.sarType
}, {
_this: this
},
res => {
this.relateDicIdOptions = res.data
}, e => {})
},
getAttrTypeText (type) {
let texts = ''
if (type === 'INPUT_STR') {
texts = '输入框(字符串)'
} else if (type === 'INPUT_NUM') {
texts = '输入框(数字)'
} else if (type === 'SEL_OPTION') {
texts = '单选下拉框'
} else if (type === 'SEL_OPTS') {
texts = '多选下拉框'
} else if (type === 'DATE_PICKER') {
texts = '单日期选择'
} else if (type === 'DATE_PIC_OPTS') {
texts = '多日期选择'
} else if (type === 'FILE') {
texts = '文件'
} else if (type === 'TEXTAREA') {
texts = '文本框'
}
return texts
},
getSarTypeText (type) {
let texts = ''
if (type === 'INLAND_STAND') {
texts = '国内标准法规'
} else if (type === 'FOREIGN_STAND') {
texts = '海外标准法规'
} else if (type === 'STAND') {
texts = '国内及海外标准法规'
}
return texts
},
async handleTableEdit (params) {
await this.queryDisplayLocationList(params.sarType)
// this.$refs['attributeEO'] && this.$refs['attributeEO'].resetFields()
this.addOrEdit = 'edit'
this.attributeTitle = '编辑'
this.showInfoModal = true
this.attributeEO = JSON.parse(JSON.stringify(params))
},
handleTableDelete (params) {
this.selectedList = []
this.selectedList.push(params.id)
this.deleteAttr()
},
async handleSarTypeChange (sarType) {
this.attributeEO.showRegionId = ''
await this.queryDisplayLocationList(sarType)
}
},
mounted () {
this.getAttrByPage()
this.getDictionarySelList()
}
}
</script>
<style lang="less" scoped>
@import '~@/assets/styles/mixins';
.attribute-custom{
height: 100%;
position: relative;
display: flex;
flex-direction: column;
flex: auto;
.action-bar{
padding: 0;
}
.content {
padding: 0;
overflow-y: auto;
flex: auto;
display: flex;
flex-direction: column;
//height: calc(~'100% - 50px - 56px');
}
.pagination {
position: static;
/deep/ .pagination-slot {
padding: 0;
}
}
.modalStyle{
padding: 14px;
font-size: 15px;
}
.sysMenuTreeDiv{
height: 400px;
overflow-y: auto;
}
}
</style>
@@ -0,0 +1,72 @@
<template>
<div class="wx-custom-tab">
<el-tabs v-model="tabValue" style="height: 100%;">
<el-tab-pane label="国内外标准法规" name="stand">
<div style="position: absolute;top: 0;left: 0;right: 0;bottom: 0;">
<stand v-if="tabValue === 'stand'"></stand>
</div>
</el-tab-pane>
<el-tab-pane label="国内外政策" name="laws">
<div style="position: absolute;top: 0;left: 0;right: 0;bottom: 0;">
<laws v-if="tabValue === 'laws'"></laws>
</div>
</el-tab-pane>
<el-tab-pane label="企业标准库" name="buss">
<div style="position: absolute;top: 0;left: 0;right: 0;bottom: 0;">
<buss v-if="tabValue === 'buss'"></buss>
</div>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import Laws from './components/laws'
import Stand from './components/stand'
import Buss from './components/buss'
export default {
name: 'index',
components: {
Laws,
Stand,
Buss
},
data () {
return {
tabValue: 'stand'
}
}
}
</script>
<style lang="less" scoped>
.wx-custom-tab {
height: 100%;
padding: 0 10px;
background: #fff;
display: flex;
flex-direction: column;
/deep/.el-tabs{
flex: auto;
display: flex;
flex-direction: column;
/deep/ .el-tabs__header{
margin:0 !important;
}
.el-tabs__content {
height: 100% !important;
flex: auto;
position: relative;
display: flex;
flex-direction: column;
.el-tab-pane {
height: 100%;
flex: auto;
display: flex;
flex-direction: column;
}
}
}
}
</style>
@@ -0,0 +1,200 @@
<!--配置管理 - 文档转换监控-->
<template>
<div id="convertDocView" class="v-class">
<table-tools-bar>
<div slot="left">
<div class="search-area">
<el-form :model="convertPage" inline class="label-input-form">
<el-form-item :label="$t('m.conversionResults')" prop="type" class="search-item" @keyup.enter.native="selectConvertBtn">
<el-select v-model="convertPage.mqStateSe">
<el-option
v-for="item in resultOptions"
:key="item.value"
:value="item.value"
:label="item.label"
></el-option>
</el-select>
</el-form-item>
<el-form-item class="search-item btn-box">
<el-button
icon="el-icon-search"
type="primary"
class="common-button-primary"
round
@click="selectConvertBtn"
:title="$t('m.search')"
></el-button>
</el-form-item>
<el-form-item class="search-item btn-box">
<el-button
class="common-button-default"
icon="el-icon-refresh-left"
round
@click="resetSearch"></el-button>
</el-form-item>
</el-form>
</div>
</div>
</table-tools-bar>
<div class="content">
<loading :loading="loading">数据获取中</loading>
<el-table
:data="convertDocListDatas"
tooltip-effect="dark"
style="width: 100%;"
height="100%"
border
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}"
>
<el-table-column
prop="oldFileName"
:label="$t('m.fileName')">
</el-table-column>
<el-table-column
prop="modifyTime"
sortable
:label="$t('m.conversionTime')">
</el-table-column>
<el-table-column
prop="mqState"
:label="$t('m.conversionResults')">
<template slot-scope="scope">
<a v-if="scope.row.mqState === 0">待转换</a>
<a v-if="scope.row.mqState === 1">转换成功</a>
<a v-if="scope.row.mqState === 2">转换失败</a>
<a v-if="scope.row.mqState === 3">转换中</a>
<a v-if="scope.row.mqState === 4">加入重新转换</a>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="50" fixed="right">
<template slot-scope="scope">
<div @click.stop style="display: inline-block">
<el-dropdown trigger="click" @command="handleCommand">
<i class="iconfont">&#xe61e;</i>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-btn-permission="'FZDD347DNC'" :command="[scope.row, '重新转换']">重新转换</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</template>
</el-table-column>
</el-table>
</div>
<pagination :total="convertDocTotal" @pageChange="pageChange" @pageSizeChange="pageSizeChange"></pagination>
</div>
</template>
<script>
export default {
name: 'ConvertDocView',
data () {
return {
convertDocListDatas: [],
convertObj: {
id: '',
attId: '',
filePath: '',
pdfId: '',
convertType: ''
},
convertPage: {
page: 1,
pageSize: 10,
mqStateSe: ''
},
loading: false,
convertDocTotal: 0,
resultOptions: [
{value: 4, label: '待转换'},
{value: 1, label: '转换成功'},
{value: 2, label: '转换失败'},
{value: 3, label: '转换中'}
]
}
},
methods: {
// 更多
handleCommand (command) {
switch (command[1]) {
case '重新转换':
this.resendConvert(command[0])
break
}
},
serchConvertDoc () {
this.convertPage.page = this.page
this.convertPage.pageSize = this.$store.getters.userInfo.configContent
if (this.convertPage.mqStateSe === 4) {
this.convertPage.mqState = 0
} else {
this.convertPage.mqState = this.convertPage.mqStateSe
}
this.$http.get('convert/otConvertMq/page', this.convertPage, {
_this: this,
loading: 'loading'
}, res => {
this.convertDocListDatas = res.data.list
this.convertDocTotal = res.data.count
}, e => {
})
},
pageChange (page) {
this.page = page
this.serchConvertDoc()
},
pageSizeChange (pageSize) {
this.pageSize = this.$store.getters.userInfo.configContent
this.serchConvertDoc()
},
resendConvert (row) {
this.convertObj.id = row.id
this.convertObj.attId = row.attId
this.convertObj.filePath = row.fileOriginPath
this.convertObj.pdfId = row.pdfId
this.convertObj.convertType = row.mqCode
this.$http.putData('convert/otConvertMq/resendMQ', this.convertObj, {
_this: this,
loading: 'loading'
}, res => {
this.serchConvertDoc()
}, e => {
})
},
selectConvertBtn () {
this.page = 1
this.serchConvertDoc()
},
resetSearch () {
this.convertPage.mqStateSe = ''
this.page = 1
this.serchConvertDoc()
}
},
components: {},
props: {},
computed: {},
watch: {},
mounted () {
this.serchConvertDoc()
}
}
</script>
<style lang="less" scoped>
#convertDocView {
height: 100%;
display: flex;
flex-direction: column;
.content{
flex: auto;
display: flex;
flex-direction: column;
//height: calc(~'100% - 53px - 55px');
}
.pagination {
position: static;
width: 100% !important;
}
}
</style>
@@ -0,0 +1,792 @@
<!--资料中心管理 - 动态信息详情-->
<template>
<div class="dynamic-details-content v-class" id="dynamicDetailsContent">
<!--title 标题-->
<div class="details-header">
<span>{{title}}</span>
</div>
<!--主体内容-->
<div class="details-content">
<div class="details-content-modular basic-information">
<div class="modular-header">
<div class="modular-header-title"><i class="icon-modular-title" /><span>查看信息</span>
</div>
<div class="modular-header-btn">
<el-button v-if="msgDetails.collectId" @click="collectClick(msgDetails.collectId)" title="取消收藏" class="collection-btn" icon="icon-collection" :loading="isSubmit"></el-button>
<el-button v-else @click="collectClick()" title="收藏" class="collection-btn" icon="el-icon-star-off" :loading="isSubmit"></el-button>
<el-button class="relation-btn" icon="icon-relation" v-btn-permission="'NSPJFVXX84'" @click="shareStandard()">分享</el-button>
</div>
</div>
<div class="basic-information-content">
<p><label>资料名称:</label><span>{{ title}}</span></p>
<p><label>资料来源:</label><span>{{ msgDetails.pubOrg}}</span></p>
<p><label>相关工作组:</label><span>{{ msgDetails.releventGroupName}}</span></p>
<p v-if="msgDetails.releventStand" style="display: flex; flex-wrap: wrap;"><label>相关标准:</label>
<!-- <span>{{ msgDetails.releventStand}}</span>-->
<span v-for="(item, index) in msgDetails.releventStand.split(',')" :key="index">
<a @click="handlePreview(item)" style="cursor: pointer;color: #0c91e5;margin-right: 5px;" class="span-line">{{item}}</a>
</span>
</p>
<p v-else><label>相关标准:</label>
<span>--</span>
</p>
<p v-if="msgDetails.releventLaws" style="display: flex; flex-wrap: wrap;"><label>相关政策:</label>
<!-- <span>{{ msgDetails.releventLaws}}</span>-->
<span v-for="(item, index) in msgDetails.releventLaws.split(',')" :key="index">
<a @click="handleLaws(item)" style="cursor: pointer;color: #0c91e5;margin-right: 5px;" class="span-line">{{item}}</a>
</span>
</p>
<p v-else><label>相关政策:</label>
<span>--</span>
</p>
<p><label>资料类别:</label>
<span v-if="msgDetails.msgMode === '1'">会议资料</span>
<span v-if="msgDetails.msgMode === '2'">知识点分享</span>
</p>
<p><label>保密等级:</label><span>{{ msgDetails.saveLevel}}</span></p>
<p><label>资料文本:</label>
<span v-if="msgDetails.getFileList != null && msgDetails.getFileList.length > 0">
<span
class="files-title"
style="margin-right: 10px"
v-for="(file, fileIndex) in msgDetails.getFileList"
:key="fileIndex"
>
<!-- <span>{{ file.originFileName}}</span>-->
<!-- <a @click="openFileInPdf(file.id, file.originFileName)" target="_blank">{{ file.originFileName }}</a>-->
<a @click="downloadFile(file.attId)" target="_blank">{{ file.originFileName }}</a>
<i title="下载" @click="downloadFile(file.attId)" class="icon-download" />
<i title="下载带水印" @click="downloadFileByWater(file.attId, file.fileSuffix)" class="icon-download2" />
</span>
</span>
</p>
<p><label>发布时间:</label><span>{{ getDate(msgDetails.pubTime) }}</span></p>
<p><label>标签:</label><span>{{ msgDetails.linkUri}}</span></p>
<!-- 新增三个字段-->
<!-- <p><label>正文内容:</label><span>{{ msgDetails.linkUri}}</span></p>-->
<p><label>相关部门:</label><span>{{ msgDetails.releventDepartName}}</span></p>
<p><label>重点通知人员:</label><span>{{ msgDetails.notifyPersonName}}</span></p>
</div>
</div>
</div>
<!-- 关联事件 -->
<el-dialog
title="关联事件"
:visible.sync="relateDialog"
width="60%"
:before-close="relateDialogClose">
<div
v-for="(item, index) in relateNowList"
:key="index"
v-if="relateNowList"
style="margin-bottom: 10px;line-height: 20px"
>
{{index+1}}. {{item.creationUserName}} {{item.creationTime}} {{item.content}}
<div v-if="relateNowList.length >1">
<el-divider></el-divider>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button round @click="relateDialogClose()">取 消</el-button>
<el-button round type="primary" @click="relateDialogClose()">确 定</el-button>
</span>
</el-dialog>
<!-- <div class="contentTitle">-->
<!-- <div class="back" title="返回" @click="back">-->
<!-- <i class="el-icon-back"></i>-->
<!-- </div>-->
<!-- <div class="title" :title="title">{{title}}</div>-->
<!-- </div>-->
<!-- <div class="contentOrigin">-->
<!-- <el-row>-->
<!-- <el-col :span="6">-->
<!-- 发布时间: <span>{{getDate(putTime) }}</span>-->
<!-- </el-col>-->
<!-- <el-col :span="6">-->
<!-- 发布机构: <span :title="pubOrgName">{{ pubOrgName }}</span>-->
<!-- </el-col>-->
<!-- <el-col :span="6">-->
<!-- 浏览数: <span>{{ countCookie }}</span>-->
<!-- </el-col>-->
<!-- <el-col :span="6">-->
<!-- <i class="el-icon-star-off" v-show="collectBtn" size="26" @click="collectLawsInfo()" v-btn-permission="'PRLQRGI83H'" style="margin-right:5px; cursor: pointer"></i>-->
<!-- <i class="el-icon-star-on" v-show="cancelCollectBtn" size="26" @click="cancelCollectLawsInfo()" v-btn-permission="'PRLQRGI83H'" style="margin-right:5px;cursor: pointer"></i>-->
<!-- <i class="el-icon-paperclip" style="cursor: pointer" size="26" @click="shareStandard()" v-btn-permission="'NSPJFVXX84'"></i>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- </div>-->
<!-- <div class="msgContent" v-html="content"></div>-->
<!-- <div class="fileContent" v-if="fileList.length > 0">-->
<!-- <div class="fileContent" v-for="(item, index) in fileList" :key="index">-->
<!-- <span>附件{{ index+1 }}:</span>-->
<!-- <a @click="downloadFile(item.attId)">{{ item.originFileName }}</a>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="linkContent">-->
<!-- <div v-if="linkUri != null && linkUri !== ''">-->
<!-- <span>相关链接:</span>-->
<!-- <a @click="openLinkUrl(linkUri)">{{ linkUri }}</a>-->
<!-- </div>-->
<!-- </div>-->
<el-dialog
title="请选择要分享的人"
:visible.sync="shareStandardModal"
:show-close="false"
width="360"
>
<!--multiple-->
<el-select v-model="shareStandardSelect" style="width:200px" multiple>
<el-option v-for="shareUser in shareUserInfoList" :value="shareUser.usid" :key="shareUser.usid">{{
shareUser.account }}
</el-option>
</el-select>
<div slot="footer">
<el-button type="text" size="mini" @click="shareStandardModal=false">取消</el-button>
<el-button type="primary" size="mini" @click="shareStandardBt">确定</el-button>
</div>
</el-dialog>
<loading :loading="loading">加载中...</loading>
<el-drawer
title="分享动态信息"
:visible.sync="drawerModal"
size="300px"
@close="cancelShareLaws"
>
<dept-tree treeDivId="drawerModalTree"
ref="drawerModalTree"
@treeClick="selcetShareLawsTree"
allDept
showUser
:editable="false"
style="padding: 0 15px">
</dept-tree>
<div id="roleFormButton" class="demo-drawer-footer">
<el-button type="primary" class="common-button-primary" round icon="el-icon-check" @click="shareStandardBt">提交</el-button>
<el-button round icon="el-icon-close" class="common-button-default" @click="cancelShareLaws">取消</el-button>
</div>
</el-drawer>
<adc-back-top scroll-bind="dynamicDetailsContent"></adc-back-top>
</div>
</template>
<script>
export default {
name: 'DynamicInformationManageDetails',
data () {
return {
relateDialog: false,
relateList: [],
relateNowList: [],
title: '',
putTime: '',
pubUserName: '',
pubOrgName: '',
content: '',
linkUri: '',
uploadPath: 'uploadPath',
resPk: '',
fileList: [],
picList: [],
shareUserInfoList: [],
shareStandardSelect: [],
collectBtn: false,
cancelCollectBtn: false,
shareStandardModal: false,
personCollect: {
collectResId: '',
collectTitle: '',
collectType: ''
},
personCookieEO: {
cookieType: '',
resTitle: '',
resId: ''
},
// 消息推送保存对象
personShareEO: {
id: '',
recipientId: '',
shareUserId: '',
resType: '',
resId: '',
resUri: '',
resTitle: '',
readFlag: '',
validFlag: '',
modifyTime: '',
creationTime: ''
},
countCookie: 0,
msgDetails: {},
// 提交状态
isSubmit: false,
loading: false, // 加载中
drawerModal: false
}
},
methods: {
handlePreview (item) {
console.log('item1111111', item)
// let routeUrl = this.$router.resolve({
// name: 'OtherStandardDetails',
// params: {
// id: item.id,
// pageType: 'INLAND_STAND'
// }
// })
// window.open(routeUrl.href, '_blank')
this.$http.post('lawss/sarTestItem/validateStandNumber', {
standnumber: item
}, {
_this: this
}, res => {
this.pageType = res.data.standType
let routeUrl = this.$router.resolve({
name: 'OtherStandardDetails',
params: {
id: res.data.standid,
pageType: 'INLAND_STAND'
}
})
window.open(routeUrl.href, '_blank')
console.log('res.data', res)
}, e => {
})
},
handleLaws (item) {
console.log('item1111111', item)
// let routeUrl = this.$router.resolve({
// name: 'OtherLawsDetails',
// params: {
// id: item.id,
// pageType: 'FOREIGN_LAWS'
// }
// })
// window.open(routeUrl.href, '_blank')
let replaceLawsEO = {}
replaceLawsEO.lawsNumber = item
replaceLawsEO.lawsType = 'FOREIGN_LAWS'
this.$http.get('lawss/sarLawsInfo/queryLawsByNum', {
replaceLawsEO
}, {
_this: this
}, res => {
this.pageType = res.data.standType
let routeUrl = this.$router.resolve({
name: 'OtherLawsDetails',
params: {
id: res.data.id,
pageType: 'FOREIGN_LAWS'
}
})
window.open(routeUrl.href, '_blank')
console.log('res.data', res)
}, e => {
})
},
openFileInPdf (attId, oldFileName) {
// 缺少文件
if (this.$hasPermission('ZWBGBNTL11')) {
this.$http.get('lawss/sarStandFile/queryConvertAtt', {
attId: attId
}, {
_this: this
}, res => {
if (res.data) {
let fileObj = {}
fileObj.fileId = res.data.attId
fileObj.fileName = oldFileName
let fileList = []
let repeatData = 0
if (sessionStorage.getItem('fileInfo')) {
fileList = JSON.parse(sessionStorage.getItem('fileInfo'))
if (fileList != null && fileList.length > 0) {
for (let i = 0; i < fileList.length; i++) {
if (fileList[i].fileId === res.data.attId) {
repeatData = 1
break
}
}
if (repeatData === 0) {
fileList.push(fileObj)
fileList = JSON.stringify(fileList)
sessionStorage.setItem('fileInfo', fileList)
}
}
} else {
fileList.push(fileObj)
fileList = JSON.stringify(fileList)
sessionStorage.setItem('fileInfo', fileList)
}
window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + res.data.attId))
} else {
this.$message.error('文档未转换成功或本地读取不到该文档')
}
}, e => {
this.$message.error('文档未转换成功或本地读取不到该文档')
})
} else {
this.$message.error('没有在线预览文档权限!')
}
},
/**
* 点击 加收藏 按钮事件
* @param collectId 有值:取消收藏 无值:加收藏
*/
collectClick (collectId) {
this.isSubmit = true
if (collectId) {
// 取消收藏
this.$http.put('person/personCollect/updateByUserId', {
id: collectId,
loading: ''
}, {
_this: this
}, res => {
this.isSubmit = false
this.msgDetails.collectId = ''
}, e => {
this.isSubmit = false
})
} else {
// 加收藏
let collectTitle
if (this.msgDetails.standYear != null && this.msgDetails.standYear !== '') {
collectTitle = this.msgDetails.standName + ' ( 编号:' + this.msgDetails.standSort + ' ' + this.msgDetails.standNumber + '-' + this.msgDetails.standYear + ' )'
} else {
collectTitle = this.msgDetails.standName + ' ( 编号:' + this.msgDetails.standSort + ' ' + this.msgDetails.standNumber + ' )'
}
let personCollect = {
collectResId: this.msgDetails.id,
collectTitle: collectTitle,
collectType: 'INLAND_STAND' // 国内收藏type
}
this.$http.postData('person/personCollect', personCollect, {
_this: this
}, res => {
this.isSubmit = false
this.msgDetails.collectId = res.data.id
console.log('msgDetails.collectId', this.msgDetails.collectId)
}, e => {
this.isSubmit = false
})
}
},
relateDialogClose () {
this.relateDialog = false
this.relateNowList = []
},
// 关联事件-----?
relateEvent () {
this.relateDialog = true
this.$http.get('lawss/sarUpdLog/getLogList', {
sarId: this.$route.params.id,
sarType: 'INLAND_STAND'
}, {
_this: this
}, res => {
this.relateList = res.data
var i
for (i = 0; i < this.relateList.length; i++) {
let obj = {creationUserName: '', creationTime: '', content: ''}
obj.creationUserName = this.relateList[i].creationUserName
obj.creationTime = this.relateList[i].creationTime
obj.content = this.relateList[i].content
this.relateNowList.push(obj)
}
console.log('relateNowList', this.relateNowList)
}, e => {
})
},
// 返回
back () {
if (this.$store.state.detailMap !== '') {
this.$router.push(this.$store.state.detailMap)
this.$store.commit('setDetailMap', '')
} else {
let lastPathList = this.$store.getters.getLastDetailMap
let lastPath = lastPathList[lastPathList.length - 1]
this.$router.push(lastPath)
lastPathList.pop(1)
this.$store.commit('setLastDetailMap', JSON.stringify(lastPathList))
}
},
queryMsgDetailsById () {
let id = this.$route.params.id
this.$http.get('lawss/msgDynamicInfo/selectByMsgId', {
id: id
}, {
_this: this,
loading: 'loading'
}, res => {
this.title = res.data.title
this.putTime = res.data.pubTime
this.pubUserName = res.data.pubUserName
this.pubOrgName = res.data.pubOrgName || res.data.pubOrg
this.content = res.data.content
this.linkUri = res.data.linkUri
if (res.data.getFileList != null) {
this.fileList = res.data.getFileList
}
if (res.data.getPicList != null) {
this.picList = res.data.getPicList
}
if (res.data.collectId != null && res.data.collectId !== '') {
this.collectBtn = false
this.cancelCollectBtn = true
} else {
this.collectBtn = true
this.cancelCollectBtn = false
}
this.msgDetails = res.data
this.addPersonCookie()
}, e => {
})
},
openLinkUrl (linkUri) {
let getHttp = linkUri.substring(0, 7)
let getHttps = linkUri.substring(0, 8)
if (getHttp === 'http://' || getHttps === 'https://') {
window.open(linkUri)
} else {
window.open('https://' + linkUri)
}
},
// 新增浏览记录
addPersonCookie () {
this.personCookieEO.cookieType = this.$route.params.pageType
this.personCookieEO.resTitle = this.title
this.personCookieEO.resId = this.$route.params.id
this.$http.postData('person/personCookies/create', this.personCookieEO, {
_this: this
}, res => {
this.countPageCookie()
}, e => {
})
},
// 时间截取
getDate (date) {
return date !== undefined && date != null ? date.split(' ')[0] : ''
},
// 统计浏览总数
countPageCookie () {
this.$http.get('person/personCookies/countPageCookie', {
resId: this.$route.params.id
}, {
_this: this
}, res => {
this.countCookie = res.data
}, e => {
})
},
downloadFile (attId) {
if (attId != null && attId !== '') {
window.location.href = '/api/att/attFile/downloadFileForSar?fileId=' + attId
} else {
this.$message.error('请选择要下载的文件')
}
},
downloadFileByWater (attId, fileSuffix) {
if (fileSuffix !== 'pdf' && fileSuffix !== 'PDF') {
this.$message.error('水印下载仅支持PDF,pdf格式文件')
} else {
if (attId != null && attId !== '') {
window.location.href = '/api/att/attFile/downloadFileForSarWaterMark?fileId=' + attId
} else {
this.$message.error('请选择要下载的文件')
}
}
},
// 转发
cancelShareLaws () {
this.drawerModal = false
this.$refs.drawerModalTree.treeReload()
},
// 树点击
selcetShareLawsTree (treeId, treeNode) {
this.shareStandardSelect = treeNode.id
},
shareStandard (item) {
this.resPk = item
this.drawerModal = true
this.$nextTick(() => {
this.$refs.drawerModalTree.clearSearch()
})
this.shareStandardSelect = ''
},
shareStandardBt () {
this.personShareEO.resType = this.$route.params.pageType
this.personShareEO.resTitle = this.title
this.personShareEO.resId = this.$route.params.id
this.personShareEO.recipientId = this.shareStandardSelect
if (this.personShareEO.recipientId == null || this.personShareEO.recipientId === '') {
this.$message.error('请选择要分享的人!')
} else {
this.$http.post('/person/personShare/savePersonShare', this.personShareEO, {
_this: this
}, res => {
this.drawerModal = false
this.$message.success('消息推送成功!')
this.$refs.drawerModalTree.treeReload()
}, e => {
this.$message.error('消息推送失败!')
})
}
}
},
components: {},
props: {},
computed: {},
watch: {},
mounted () {
this.queryMsgDetailsById()
this.tableHeight = $('.container').height() - 30
window.onresize = () => {
this.tableHeight = $('.container').height() - 30
}
}
}
</script>
<style lang="less" scoped>
@import '~@/assets/styles/mixins';
.dynamic-details-content{
padding: 0 35px 0;
/*width: 1200px;*/
margin: 0 auto;
/*height: 100vh;*/
background: white;
.details-header{
padding: 34px 0;
font-size: 20px;
font-weight: bold;
color: #555555;
text-align: center;
& > span{
width: 100%;
}
}
/deep/.details-content{
/*padding: 0 67px;*/
.details-content-modular{
margin-bottom: 20px;
.modular-header{
display: flex;
align-items: center;
justify-content: space-between;
height: 50px;
border-bottom: 1px solid #E5E5E5;
.modular-header-title{
font-size: 18px;
font-weight: bold;
color: #3B424C;
& > .icon-modular-title{
display: inline-block;
margin-left: -28px;
width: 18px;
height: 18px;
background-size: 100% 100%;
background-position: center center;
background-image: url("~assets/images/shangqi/standardDetails/modular-title.png");
vertical-align: top;
}
& > span{
padding-left: 10px;
}
}
.modular-header-btn{
& > button{
height: 30px;
line-height: 30px;
font-size: 14px;
border-radius: 15px;
padding: 0 10px;
font-family: 'Microsoft Yahei', '\5FAE\8F6F\96C5\9ED1', Arial, sans-serif !important;
& > i{
display: inline-block;
margin-right: 3px;
width: 18px;
height: 18px;
background-repeat: no-repeat;
background-size: 100% 100%;
background-position: center center;
vertical-align: text-bottom;
}
}
.collection-btn{
padding: 0;
border: none;
/deep/ i {
display: block;
color: #F2CB51;
font-size: 18px;
width: 18px;
height: 18px;
}
/*background: rgba(244, 162, 39, 0.1);*/
/deep/ .icon-collection{
background-image: url("~assets/images/shangqi/standardDetails/collection.png");
background-size: 100%;
}
&:hover{
background: transparent;
}
}
.relation-btn{
color: #409EFF;
border: 1px solid #409EFF;
background: rgba(64, 158, 255, 0.1);
.icon-relation{
background-image: url("~assets/images/shangqi/standardDetails/relation.png");
}
}
}
}
.basic-information-content{
color: #333333;
font-size: 18px;
font-weight: 400;
.standard-text{
height: 50px;
line-height: 50px;
border-bottom: 1px solid #E5E5E5;
}
}
.modular-content{
& > div{
border-bottom: 1px solid #E5E5E5;
.modular-content-p-name{
display: inline-block;
width: 220px;
height: 50px;
line-height: 50px;
font-size: 16px;
color: #333333;
vertical-align: top;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.modular-content-p-val{
display: inline-block;
width: calc(~'100% - 225px');
height: 50px;
line-height: 50px;
font-size: 16px;
color: #999999;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.modular-content-p-flies{
position: relative;
display: inline-block;
width: calc(~'100% - 225px');
min-height: 50px;
& > .files-title{
height: 50px;
line-height: 50px;
font-size: 16px;
color: #409EFF;
& > a{
cursor: pointer;
}
& > i{
display: inline-block;
margin-left: 3px;
width: 18px;
height: 16px;
background-repeat: no-repeat;
background-size: 100% 100%;
background-position: center center;
vertical-align: sub;
cursor: pointer;
}
.icon-download{
background-image: url("~assets/images/shangqi/img/download.png");
}
.icon-download2{
background-image: url("~assets/images/shangqi/img/download2.png");
}
}
.decomposition-btn{
position: absolute;
top: 10px;
right: 0;
padding: 0 10px;
height: 30px;
line-height: 30px;
font-size: 14px;
border-radius: 15px;
color: #07C160;
border: 1px solid #07C160;
background: rgba(1, 193, 96, 0.1);
.icon-separate{
display: inline-block;
margin-right: 3px;
width: 16px;
height: 16px;
background-repeat: no-repeat;
background-size: 100% 100%;
background-position: center center;
vertical-align: sub;
background-image: url("~assets/images/shangqi/standardDetails/separate.png");
}
}
}
}
}
}
.basic-information{
border-top: 2px dashed #D1D1D1;
border-bottom: 2px dashed #D1D1D1;
.modular-header{
height: 60px;
border-bottom: none;
}
.basic-information-content{
& > p{
line-height: 55px;
}
}
}
}
}
.details-container .el-divider {
height: 1px;
background-color: #d5d8da;
}
.files-title{
height: 50px;
line-height: 50px;
font-size: 16px;
color: #409EFF;
& > a{
cursor: pointer;
}
& > i{
display: inline-block;
margin-left: 3px;
width: 18px;
height: 16px;
background-repeat: no-repeat;
background-size: 100% 100%;
background-position: center center;
vertical-align: sub;
cursor: pointer;
}
.icon-download{
background-image: url("~assets/images/shangqi/img/download.png");
}
.icon-download2{
background-image: url("~assets/images/shangqi/img/download2.png");
}
}
.span-line:hover{
text-decoration: underline;
}
</style>
@@ -0,0 +1,751 @@
<!--资料中心管理 - 动态信息详情-->
<template>
<div class="dynamic-details-content v-class" id="dynamicDetailsContent">
<!--title 标题-->
<div class="details-header">
<span>{{title}}</span>
</div>
<!--主体内容-->
<div class="details-content">
<div class="details-content-modular basic-information">
<div class="modular-header">
<div class="modular-header-title"><i class="icon-modular-title" /><span>查看信息</span>
</div>
<div class="modular-header-btn">
<el-button v-if="msgDetails.collectId" @click="collectClick(msgDetails.collectId)" title="取消收藏" class="collection-btn" icon="icon-collection" :loading="isSubmit"></el-button>
<el-button v-else @click="collectClick()" title="收藏" class="collection-btn" icon="el-icon-star-off" :loading="isSubmit"></el-button>
<el-button class="relation-btn" icon="icon-relation" @click="shareStandard()">分享</el-button>
</div>
</div>
<div class="basic-information-content">
<p><label>资料名称:</label><span>{{ title}}</span></p>
<p><label>资料来源:</label><span>{{ msgDetails.pubOrg}}</span></p>
<p><label>相关工作组:</label><span>{{ msgDetails.releventGroupName}}</span></p>
<p><label>相关标准:</label>
<span v-for="(item, index) in releventStandJson" :key="index">
<a @click="handlePreview(item)" style="cursor: pointer;color: #0c91e5;margin-right: 5px;" class="span-line">{{item.releventStand}}</a>
</span>
<!-- <span>{{ msgDetails.releventStand}}</span>-->
</p>
<p><label>相关政策:</label>
<span v-for="(item, index) in releventLawsJson" :key="index">
<a @click="showLawsDetails(item)" style="cursor: pointer;color: #0c91e5;margin-right: 5px;" class="span-line">{{item.releventLaws}}</a>
</span>
<!-- <span>{{ msgDetails.releventLaws}}</span>-->
</p>
<!-- <p><label>资料类别:</label>-->
<!-- <span v-if="msgDetails.msgMode === '1'">会议资料</span>-->
<!-- <span v-if="msgDetails.msgMode === '2'">知识点分享</span>-->
<!-- </p>-->
<p><label>保密等级:</label><span>{{ msgDetails.saveLevel}}</span></p>
<p><label>资料文本:</label>
<span v-if="msgDetails.getFileList != null && msgDetails.getFileList.length > 0">
<span
class="files-title"
v-for="(file, fileIndex) in msgDetails.getFileList"
:key="fileIndex"
>
<span>{{ file.originFileName}}</span>
<!-- <a @click="openFileInPdf(file.attId, file.originFileName)" target="_blank">{{ file.originFileName }}</a>-->
<i title="下载" @click="downloadFile(file.attId)" class="icon-download" />
<i title="下载带水印" @click="downloadFileByWater(file.attId, file.originFileName.substring(file.originFileName.lastIndexOf('.')+1))" class="icon-download2" />
</span>
</span>
</p>
<p><label>发布时间:</label><span>{{ getDate(msgDetails.pubTime) }}</span></p>
<p><label>标签:</label><span>{{ msgDetails.linkUri}}</span></p>
</div>
</div>
</div>
<!-- 关联事件 -->
<el-dialog
title="关联事件"
:visible.sync="relateDialog"
width="60%"
:before-close="relateDialogClose">
<div
v-for="(item, index) in relateNowList"
:key="index"
v-if="relateNowList"
style="margin-bottom: 10px;line-height: 20px"
>
{{index+1}}. {{item.creationUserName}} {{item.creationTime}} {{item.content}}
<div v-if="relateNowList.length >1">
<el-divider></el-divider>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button round @click="relateDialogClose()">取 消</el-button>
<el-button round type="primary" @click="relateDialogClose()">确 定</el-button>
</span>
</el-dialog>
<!-- <div class="contentTitle">-->
<!-- <div class="back" title="返回" @click="back">-->
<!-- <i class="el-icon-back"></i>-->
<!-- </div>-->
<!-- <div class="title" :title="title">{{title}}</div>-->
<!-- </div>-->
<!-- <div class="contentOrigin">-->
<!-- <el-row>-->
<!-- <el-col :span="6">-->
<!-- 发布时间: <span>{{getDate(putTime) }}</span>-->
<!-- </el-col>-->
<!-- <el-col :span="6">-->
<!-- 发布机构: <span :title="pubOrgName">{{ pubOrgName }}</span>-->
<!-- </el-col>-->
<!-- <el-col :span="6">-->
<!-- 浏览数: <span>{{ countCookie }}</span>-->
<!-- </el-col>-->
<!-- <el-col :span="6">-->
<!-- <i class="el-icon-star-off" v-show="collectBtn" size="26" @click="collectLawsInfo()" v-btn-permission="'PRLQRGI83H'" style="margin-right:5px; cursor: pointer"></i>-->
<!-- <i class="el-icon-star-on" v-show="cancelCollectBtn" size="26" @click="cancelCollectLawsInfo()" v-btn-permission="'PRLQRGI83H'" style="margin-right:5px;cursor: pointer"></i>-->
<!-- <i class="el-icon-paperclip" style="cursor: pointer" size="26" @click="shareStandard()" v-btn-permission="'NSPJFVXX84'"></i>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- </div>-->
<!-- <div class="msgContent" v-html="content"></div>-->
<!-- <div class="fileContent" v-if="fileList.length > 0">-->
<!-- <div class="fileContent" v-for="(item, index) in fileList" :key="index">-->
<!-- <span>附件{{ index+1 }}:</span>-->
<!-- <a @click="downloadFile(item.attId)">{{ item.originFileName }}</a>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="linkContent">-->
<!-- <div v-if="linkUri != null && linkUri !== ''">-->
<!-- <span>相关链接:</span>-->
<!-- <a @click="openLinkUrl(linkUri)">{{ linkUri }}</a>-->
<!-- </div>-->
<!-- </div>-->
<el-dialog
title="请选择要分享的人"
:visible.sync="shareStandardModal"
:show-close="false"
width="360"
>
<!--multiple-->
<el-select v-model="shareStandardSelect" style="width:200px" multiple>
<el-option v-for="shareUser in shareUserInfoList" :value="shareUser.usid" :key="shareUser.usid">{{
shareUser.account }}
</el-option>
</el-select>
<div slot="footer">
<el-button type="text" size="mini" @click="shareStandardModal=false">取消</el-button>
<el-button type="primary" size="mini" @click="shareStandardBt">确定</el-button>
</div>
</el-dialog>
<loading :loading="loading">加载中...</loading>
<el-drawer
title="分享资料信息"
:visible.sync="drawerModal"
size="300px"
@close="cancelShareLaws"
>
<div class="demo-drawer-content">
<dept-tree treeDivId="drawerModalTree"
ref="drawerModalTree"
@treeClick="selcetShareLawsTree"
allDept
showUser
:editable="false"
style="padding: 0 15px">
</dept-tree>
</div>
<div id="roleFormButton" class="demo-drawer-footer">
<el-button type="primary" class="common-button-primary" round icon="el-icon-check" @click="shareStandardBt">提交</el-button>
<el-button round icon="el-icon-close" class="common-button-default" @click="cancelShareLaws">取消</el-button>
</div>
</el-drawer>
<adc-back-top scroll-bind="dynamicDetailsContent"></adc-back-top>
</div>
</template>
<script>
export default {
name: 'DynamicInformationManageDetails',
data () {
return {
relateDialog: false,
relateList: [],
relateNowList: [],
title: '',
putTime: '',
pubUserName: '',
pubOrgName: '',
content: '',
linkUri: '',
uploadPath: 'uploadPath',
resPk: '',
fileList: [],
picList: [],
shareUserInfoList: [],
shareStandardSelect: [],
collectBtn: false,
cancelCollectBtn: false,
shareStandardModal: false,
personCollect: {
collectResId: '',
collectTitle: '',
collectType: ''
},
personCookieEO: {
cookieType: '',
resTitle: '',
resId: ''
},
// 消息推送保存对象
personShareEO: {
id: '',
recipientId: '',
shareUserId: '',
resType: '',
resId: '',
resUri: '',
resTitle: '',
readFlag: '',
validFlag: '',
modifyTime: '',
creationTime: ''
},
countCookie: 0,
msgDetails: {},
releventStandJson: [],
releventLawsJson: [],
// 提交状态
isSubmit: false,
loading: false, // 加载中
drawerModal: false
}
},
methods: {
openFileInPdf (attId, oldFileName) {
// 缺少文件
if (this.$hasPermission('ZWBGBNTL11')) {
this.$http.get('lawss/sarStandFile/queryConvertAtt', {
attId: attId
}, {
_this: this
}, res => {
if (res.data) {
let fileObj = {}
fileObj.fileId = res.data.attId
fileObj.fileName = oldFileName
let fileList = []
let repeatData = 0
if (sessionStorage.getItem('fileInfo')) {
fileList = JSON.parse(sessionStorage.getItem('fileInfo'))
if (fileList != null && fileList.length > 0) {
for (let i = 0; i < fileList.length; i++) {
if (fileList[i].fileId === res.data.attId) {
repeatData = 1
break
}
}
if (repeatData === 0) {
fileList.push(fileObj)
fileList = JSON.stringify(fileList)
sessionStorage.setItem('fileInfo', fileList)
}
}
} else {
fileList.push(fileObj)
fileList = JSON.stringify(fileList)
sessionStorage.setItem('fileInfo', fileList)
}
window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + res.data.attId))
} else {
this.$message.error('文档未转换成功或本地读取不到该文档')
}
}, e => {
this.$message.error('文档未转换成功或本地读取不到该文档')
})
} else {
this.$message.error('没有在线预览文档权限!')
}
},
/**
* 点击 加收藏 按钮事件
* @param collectId 有值:取消收藏 无值:加收藏
*/
collectClick (collectId) {
this.isSubmit = true
if (collectId) {
// 取消收藏
this.$http.put('person/personCollect/updateByUserId', {
id: collectId,
loading: ''
}, {
_this: this
}, res => {
this.isSubmit = false
if (res.ok) {
this.msgDetails.collectId = ''
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
}, e => {
this.isSubmit = false
})
} else {
// 加收藏
let collectTitle
collectTitle = this.msgDetails.title
let personCollect = {
collectResId: this.msgDetails.id,
collectTitle: collectTitle,
collectType: 'RESOURCE_MSG'
}
this.$http.postData('person/personCollect', personCollect, {
_this: this
}, res => {
this.isSubmit = false
this.msgDetails.collectId = res.data.id
console.log('msgDetails.collectId', this.msgDetails.collectId)
}, e => {
this.isSubmit = false
})
}
},
relateDialogClose () {
this.relateDialog = false
this.relateNowList = []
},
// 关联事件-----?
relateEvent () {
this.relateDialog = true
this.$http.get('lawss/sarUpdLog/getLogList', {
sarId: this.$route.query.id,
sarType: 'INLAND_STAND'
}, {
_this: this
}, res => {
this.relateList = res.data
var i
for (i = 0; i < this.relateList.length; i++) {
let obj = {creationUserName: '', creationTime: '', content: ''}
obj.creationUserName = this.relateList[i].creationUserName
obj.creationTime = this.relateList[i].creationTime
obj.content = this.relateList[i].content
this.relateNowList.push(obj)
}
console.log('relateNowList', this.relateNowList)
}, e => {
})
},
// 返回
back () {
if (this.$store.state.detailMap !== '') {
this.$router.push(this.$store.state.detailMap)
this.$store.commit('setDetailMap', '')
} else {
let lastPathList = this.$store.getters.getLastDetailMap
let lastPath = lastPathList[lastPathList.length - 1]
this.$router.push(lastPath)
lastPathList.pop(1)
this.$store.commit('setLastDetailMap', JSON.stringify(lastPathList))
}
},
queryMsgDetailsById () {
let id = this.$route.query.id
this.$http.get('lawss/msgDynamicInfo/selectByMsgId', {
id: id
}, {
_this: this,
loading: 'loading'
}, res => {
this.title = res.data.title
this.putTime = res.data.pubTime
this.pubUserName = res.data.pubUserName
this.pubOrgName = res.data.pubOrgName || res.data.pubOrg
this.content = res.data.content
this.linkUri = res.data.linkUri
if (res.data.getFileList != null) {
this.fileList = res.data.getFileList
}
if (res.data.getPicList != null) {
this.picList = res.data.getPicList
}
if (res.data.collectId != null && res.data.collectId !== '') {
this.collectBtn = false
this.cancelCollectBtn = true
} else {
this.collectBtn = true
this.cancelCollectBtn = false
}
this.msgDetails = res.data
let releventLaws = []
let releventLawsIds = []
if (this.msgDetails.releventLaws !== null){
releventLaws = this.msgDetails.releventLaws.split(',')
}
if(this.msgDetails.releventLawsIds !== null) {
releventLawsIds = this.msgDetails.releventLawsIds.split(',')
}
let releventLawsJson = [];
let Laws = {};
for(var i = 0; i < releventLaws.length; i++){
Laws['releventLaws'] = releventLaws[i];
Laws['releventLawsIds'] = releventLawsIds[i];
releventLawsJson.push(Laws)
Laws = {};
}
this.releventLawsJson = releventLawsJson
let releventStand = []
let releventStandIds = []
if (releventStand !== null) {
releventStand = this.msgDetails.releventStand.split(',')
}
if (releventStandIds !== null) {
releventStandIds = this.msgDetails.releventStandIds.split(',')
}
let releventStandJson = [];
let Stand = {};
for(var i = 0; i < releventStand.length; i++){
Stand['releventStand'] = releventStand[i];
Stand['releventStandIds'] = releventStandIds[i];
releventStandJson.push(Stand)
Stand = {};
}
this.releventStandJson = releventStandJson
this.addPersonCookie()
}, e => {
})
},
// 相关标准
handlePreview (item) {
if (item.releventStandIds === "noJump"){
this.$message.warning('暂无相关标准')
} else {
let row = item.releventStandIds.split('/')
console.log(row)
let routeUrl = this.$router.resolve({
name: 'OtherStandardDetails',
params: {
id: row[0],
pageType: row[1]
}
})
window.open(routeUrl.href, '_blank')
}
},
// 相关政策
showLawsDetails (item) {
if (item.releventLawsIds === "noJump"){
this.$message.warning('暂无相关政策')
} else {
let row = item.releventLawsIds.split('/')
console.log(row)
let routeUrl = this.$router.resolve({
name: 'OtherLawsDetails',
params: {
id: row[0],
pageType: row[1]
}
})
window.open(routeUrl.href, '_blank')
}
},
openLinkUrl (linkUri) {
let getHttp = linkUri.substring(0, 7)
let getHttps = linkUri.substring(0, 8)
if (getHttp === 'http://' || getHttps === 'https://') {
window.open(linkUri)
} else {
window.open('https://' + linkUri)
}
},
// 新增浏览记录
addPersonCookie () {
this.personCookieEO.cookieType = this.$route.query.pageType
this.personCookieEO.resTitle = this.title
this.personCookieEO.resId = this.$route.query.id
this.$http.postData('person/personCookies/create', this.personCookieEO, {
_this: this
}, res => {
this.countPageCookie()
}, e => {
})
},
// 时间截取
getDate (date) {
return date !== undefined && date != null ? date.split(' ')[0] : ''
},
// 统计浏览总数
countPageCookie () {
this.$http.get('person/personCookies/countPageCookie', {
resId: this.$route.query.id
}, {
_this: this
}, res => {
this.countCookie = res.data
}, e => {
})
},
downloadFile (attId) {
if (attId != null && attId !== '') {
window.location.href = '/api/att/attFile/downloadFile?fileId=' + attId
} else {
this.$message.error('请选择要下载的文件')
}
},
downloadFileByWater (attId, fileSuffix) {
if (fileSuffix !== 'pdf' && fileSuffix !== 'PDF') {
this.$message.error('水印下载仅支持PDF,pdf格式文件')
} else {
if (attId != null && attId !== '') {
window.location.href = '/api/att/attFile/downloadFileForSarWaterMark?fileId=' + attId
} else {
this.$message.error('请选择要下载的文件')
}
}
},
// 转发
cancelShareLaws () {
this.drawerModal = false
this.$refs.drawerModalTree.treeReload()
},
// 树点击
selcetShareLawsTree (treeId, treeNode) {
this.shareStandardSelect = treeNode.id
},
shareStandard (item) {
this.resPk = item
this.drawerModal = true
this.$nextTick(() => {
this.$refs.drawerModalTree.clearSearch()
})
this.shareStandardSelect = ''
},
shareStandardBt () {
this.personShareEO.resType = this.$route.query.pageType
this.personShareEO.resTitle = this.title
this.personShareEO.resId = this.$route.query.id
this.personShareEO.recipientId = this.shareStandardSelect
if (this.personShareEO.recipientId == null || this.personShareEO.recipientId === '') {
this.$message.error('请选择要分享的人!')
} else {
this.$http.post('/person/personShare/savePersonShare', this.personShareEO, {
_this: this
}, res => {
this.drawerModal = false
this.$message.success('消息推送成功!')
this.$refs.drawerModalTree.treeReload()
}, e => {
this.$message.error('消息推送失败!')
})
}
}
},
components: {},
props: {},
computed: {},
watch: {},
mounted () {
this.queryMsgDetailsById()
this.tableHeight = $('.container').height() - 30
window.onresize = () => {
this.tableHeight = $('.container').height() - 30
}
}
}
</script>
<style lang="less" scoped>
@import '~@/assets/styles/mixins';
.dynamic-details-content{
padding: 0 35px 0;
width: 100%;
margin: 0 auto;
min-height: 100%;
background: white;
//display: flex;
//flex-direction: column;
//justify-content: space-between;
.details-header{
padding: 34px 0;
font-size: 20px;
font-weight: bold;
color: #555555;
text-align: center;
& > span{
width: 100%;
}
}
/deep/.details-content{
/*padding: 0 67px;*/
.details-content-modular{
//margin-bottom: 20px;
.modular-header{
display: flex;
align-items: center;
justify-content: space-between;
height: 50px;
border-bottom: 1px solid #E5E5E5;
.modular-header-title{
font-size: 18px;
font-weight: bold;
color: #3B424C;
& > .icon-modular-title{
display: inline-block;
margin-left: -28px;
width: 18px;
height: 18px;
background-size: 100% 100%;
background-position: center center;
background-image: url("~assets/images/shangqi/standardDetails/modular-title.png");
vertical-align: top;
}
& > span{
padding-left: 10px;
}
}
.modular-header-btn{
& > button{
height: 30px;
line-height: 30px;
font-size: 14px;
border-radius: 15px;
padding: 0 10px;
font-family: 'Microsoft Yahei', '\5FAE\8F6F\96C5\9ED1', Arial, sans-serif !important;
& > i{
display: inline-block;
margin-right: 3px;
width: 18px;
height: 18px;
background-repeat: no-repeat;
background-size: 100% 100%;
background-position: center center;
vertical-align: text-bottom;
}
}
.collection-btn{
padding: 0;
border: none;
i {
display: block;
color: #F2CB51;
font-size: 18px;
width: 18px;
height: 18px;
}
/*background: rgba(244, 162, 39, 0.1);*/
.icon-collection{
background-image: url("~assets/images/shangqi/standardDetails/collection.png");
background-size: 100%;
}
&:hover{
background: transparent;
}
}
.relation-btn{
color: #409EFF;
border: 1px solid #409EFF;
background: rgba(64, 158, 255, 0.1);
.icon-relation{
background-image: url("~assets/images/shangqi/standardDetails/relation.png");
}
}
}
}
.basic-information-content{
color: #333333;
font-size: 18px;
font-weight: 400;
.standard-text{
height: 50px;
line-height: 50px;
border-bottom: 1px solid #E5E5E5;
}
.span-line:hover{
text-decoration: underline;
}
}
.modular-content{
& > div{
border-bottom: 1px solid #E5E5E5;
.modular-content-p-name{
display: inline-block;
width: 220px;
height: 50px;
line-height: 50px;
font-size: 16px;
color: #333333;
vertical-align: top;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.modular-content-p-val{
display: inline-block;
width: calc(~'100% - 225px');
height: 50px;
line-height: 50px;
font-size: 16px;
color: #999999;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
}
}
.basic-information{
border-top: 2px dashed #D1D1D1;
border-bottom: 2px dashed #D1D1D1;
.modular-header{
height: 60px;
border-bottom: none;
}
.basic-information-content{
& > p{
min-height: 55px;
line-height: 55px;
}
}
}
}
}
.details-container .el-divider {
height: 1px;
background-color: #d5d8da;
}
/deep/.files-title{
height: 50px;
line-height: 50px;
font-size: 16px;
color: #409EFF;
a{
cursor: pointer;
}
i{
display: inline-block;
margin-left: 3px;
width: 18px;
height: 16px;
background-repeat: no-repeat;
background-size: 100% 100%;
background-position: center center;
vertical-align: sub;
cursor: pointer;
}
.icon-download{
background-image: url("~assets/images/shangqi/img/download.png");
}
.icon-download2{
background-image: url("~assets/images/shangqi/img/download2.png");
}
}
.dynamic-details-content{
margin-bottom: -20px;
}
::v-deep .el-drawer__header{
&>span:first-child{
outline: none!important;
}
}
::v-deep .el-drawer{
outline: none!important;
}
</style>
@@ -0,0 +1,971 @@
<!-- 本地工具 - 动态&通知管理 - 动态&通知管理新增编辑 -->
<template>
<div id="dynamicInfo">
<div style="overflow:auto;height: 100%; padding: 0.2rem 0.3rem;">
<el-form
ref="msgDynamicInfoVO"
:model="msgDynamicInfoVO"
:rules="msgDynamicInfoVOFormRules"
label-position="right"
class="label-input-form"
label-width="100px">
<el-form-item
label="资料名称"
prop="title"
class="add-form-item"
:class="{'title-input': showMsgMode}"
>
<el-input clearable v-model.trim="msgDynamicInfoVO.title" placeholder="请输入资料名称"></el-input>
</el-form-item>
<el-form-item label="资料来源" prop="pubOrg" class="add-form-item">
<el-input v-model="msgDynamicInfoVO.pubOrg" v-show="false" />
<el-popover placement="bottom" popper-class="user-dept-popper" trigger="click">
<el-input
v-model="msgDynamicInfoVO.pubOrg"
placeholder="资料来源不能为空"
@on-popper-show="selectDeptNode"
readonly
clearable
slot="reference"
id="deptBtnAdd"/>
<div class="api">
<laws-tree :zNodes="zNodes"
treeDivId="dynamicTree"
deptSelect
showRMenu
@treeDblClick="treeDblClick"
class="ztree" style="width: 200px;height: 400px;overflow: auto">
</laws-tree>
</div>
</el-popover>
</el-form-item>
<el-form-item label="相关工作组" prop="releventGroup" class="add-form-item">
<!-- <el-input v-model="msgDynamicInfoVO.releventGroup" style="width: 320px" placeholder="请输入"/>-->
<el-select clearable v-model="msgDynamicInfoVO.releventGroup" filterable>
<el-option
v-for="item in gzzxxSelectOptions"
placeholder="请选择"
:key="item.value"
:value="item.value"
:label="item.label"
></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="相关标准" prop="releventStand" class="add-form-item">-->
<!-- <el-input v-model="msgDynamicInfoVO.releventStand" style="width: 320px" placeholder="请输入相关标准"/>-->
<!-- </el-form-item>-->
<el-row>
<custom-input-for-standards
:config="{
attrName: '相关标准',
attrField: 'releventStand',
}"
class="add-form-item"
:maxlength="100"
v-model="msgDynamicInfoVO.releventStand"
></custom-input-for-standards>
</el-row>
<!-- -->
<!-- <el-form-item label="相关政策" prop="releventLaws" class="add-form-item">-->
<!-- <el-input v-model="msgDynamicInfoVO.releventLaws" style="width: 320px" placeholder="请输入相关政策"/>-->
<!-- </el-form-item>-->
<el-row>
<custom-input-for-policy
:config="{
attrName: '相关政策',
attrField: 'releventLaws',
}"
:maxlength="100"
class="add-form-item"
v-model="msgDynamicInfoVO.releventLaws"
></custom-input-for-policy>
</el-row>
<!-- <el-form-item label="资料类别" prop="msgMode" class="add-form-item">-->
<!-- <el-select clearable v-model="msgDynamicInfoVO.msgMode" filterable>-->
<!-- <el-option-->
<!-- v-for="item in msgModeOptions"-->
<!-- placeholder="请选择"-->
<!-- :key="item.value"-->
<!-- :value="item.value"-->
<!-- :label="item.label"-->
<!-- ></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="保密等级" prop="saveLevel" class="add-form-item">
<el-select clearable v-model="msgDynamicInfoVO.saveLevel" filterable>
<el-option
v-for="item in groupOptions"
placeholder="请选择"
:key="item.value"
:value="item.value"
:label="item.label"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="资料文本" prop="attInfo" class="add-form-item" style="padding: 10px 0;">
<el-upload
multiple
drag
ref="attInfo"
:action="uploadFileListPath"
show-file-list
:limit="20"
:file-list="fileInfoList"
name="file"
:on-remove="delFileInfo"
:on-success="uploadBackSuccess"
:on-exceed="exceed"
:before-upload="beforeUpload"
>
<div style="padding: 10px 100px">
<i class="el-icon-upload" style="color: #3399ff"></i>
<p>点击或拖拽文件到此处</p>
</div>
</el-upload>
</el-form-item>
<el-form-item label="发布时间" prop="pubTime" class="add-form-item">
<el-date-picker v-model="msgDynamicInfoVO.pubTime" :editable="false" value-format="yyyy-MM-dd hh:mm:ss" placeholder="请选择发布时间" :clearable="true" style="width: 200px"></el-date-picker>
</el-form-item>
<el-form-item label="标签" prop="linkUri" class="add-form-item">
<el-input clearable v-model="msgDynamicInfoVO.linkUri" placeholder="请输入标签"/>
</el-form-item>
<!--新增 正文内容、相关部门、重点通知人员字段-->
<!-- <el-form-item label="动态内容" prop="Content" class="add-form-item ueditor-style">-->
<!-- <el-input v-model="msgDynamicInfoVO.Content" v-show="false"/>-->
<!-- <UEditor :config=config ref="ueditor" @editor-onChange="uEditorChange"></UEditor>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="相关部门" prop="releventDepart" class="add-form-item">-->
<!-- <input v-model="msgDynamicInfoVO.releventDepart" type="hidden" />-->
<!-- <el-input-->
<!-- v-model="msgDynamicInfoVO.releventDepartName"-->
<!-- placeholder="请选择相关部门"-->
<!-- readonly-->
<!-- clearable-->
<!-- @click.native="handleVisibleDept"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="重点通知人员" prop="notifyPerson" class="add-form-item">
<input v-model="msgDynamicInfoVO.notifyPerson" type="hidden" />
<el-input
v-model="msgDynamicInfoVO.notifyPersonName"
placeholder="请选择重点通知人员"
readonly
clearable
@click.native="handleVisibleRole('notifyPerson', 'notifyPersonName')"
/>
</el-form-item>
<!-- <el-row>-->
<!-- <el-form-item label="重点通知人员" prop="notifyPerson" class="add-form-item">-->
<!-- <input v-model="msgDynamicInfoVO.notifyPerson" type="hidden" />-->
<!-- <el-input-->
<!-- v-model="msgDynamicInfoVO.notifyPersonName"-->
<!-- placeholder="请选择"-->
<!-- readonly-->
<!-- @click.native="handleVisibleRole('compilersUser', 'compilersUserName')"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <custom-org-->
<!-- class="add-form-item"-->
<!-- :config="{-->
<!-- attrName: '重点通知人员',-->
<!-- attrField: 'notifyPerson',-->
<!-- selVal:'USERLIST',-->
<!-- attrType:'SEL_OPTS'-->
<!-- }"-->
<!-- :zNodes="personData"-->
<!-- v-model="msgDynamicInfoVO.notifyPerson"></custom-org>-->
<!-- </el-row>-->
</el-form>
<div id="roleFormButton" class="demo-drawer-footer new-page-footer">
<el-button type="primary" class="common-button-primary" round icon="el-icon-check" :loading="saveLoading" @click="saveMsgInfo('msgDynamicInfoVO', 'save')">暂存</el-button>
<el-button type="primary" class="common-button-primary" round icon="el-icon-check" :loading="pushLoading" @click="saveMsgInfo('msgDynamicInfoVO', 'push')">发布</el-button>
<el-button round class="common-button-default" icon="el-icon-close" @click="gotoMsgInfoPage">取消</el-button>
</div>
</div>
<loading :loading="loading">数据获取中</loading>
<!-- 组织机构树 -->
<el-drawer
title="组织结构"
:visible.sync="isTreeDrawer"
@opened="drawerOpen"
>
<div class="demo-drawer-content">
<!-- :chkboxType="{ 'Y': 's', 'N': 's' }"-->
<laws-tree
v-if="checkType === 'dept' && isTreeDrawer"
:zNodes="depNode"
:chkboxType="{ 'Y': '', 'N': '' }"
deptSelect
checkEnable
treeDivId="deptTreeOrg"
@treeOnCheck="(checkedList) => treeOnDeptCheck(checkedList)"
:editable="false"
ref="deptTreeOrg"
class="ztree" style="overflow: auto">
</laws-tree>
<dept-tree
v-if="checkType === 'person' && isTreeDrawer"
treeDivId="roleTree"
ref="roleTree"
allDept
showUser
checkEnable
:editable="false"
@treeOnCheck="(checkedList) => treeOnRoleCheck(checkedList)"
style="overflow: auto">
</dept-tree>
</div>
<div class="demo-drawer-footer">
<el-button type="primary" round class="common-button-primary" icon="el-icon-check" @click="isTreeOk">确定</el-button>
<el-button round class="common-button-default" icon="el-icon-close" @click="isTreeDrawer = false">取消</el-button>
</div>
</el-drawer>
</div>
</template>
<script>
import CustomInputForStandards from '@/components/CustomFormComponents/InputForStandAndForeign'
import CustomInputForPolicy from '@/components/CustomFormComponents/InputForPolicy.vue'
import CustomSelectArray from '@/components/CustomFormComponents/SelectArray'
import CustomDepartment from '@/components/CustomFormComponents/department'
import CustomOrg from '@/components/CustomFormComponents/OrgTree'
import {dateFormat} from "@/common/date";
export default {
name: 'dynamicInfo',
components: {
CustomInputForStandards,
CustomInputForPolicy,
CustomSelectArray,
CustomDepartment,
CustomOrg
},
data () {
const validateContent = (rule, value, callback) => {
if (this.msgDynamicInfoVO.content === '') {
return callback(new Error('动态内容不能为空且不能全为空格'))
} else {
callback()
}
}
return {
saveLoading: false,
pushLoading: false,
isTreeDrawer: false,
checkType: '',
depNode: [],
treeDeptNameList: [], // 部门名称数组
treeDeptIdList: [], // 部门id数组
treeRoleNameList: [], // 人员名称数组
treeRoleIdList: [], // 人员ID数组
selectUserId: '', // 当前要选择的人员id字段
selectUserName: '', // 当前要选择的人员name字段
array: [],
inputFlag: '',
releventDepart: '',
zNodes: [],
bussionessStandNodes: [],
orgData: [],
personData: [],
msgDynamicInfoVO: {
Content: '', // 内容
releventDepart: '', // 相关部门
notifyPerson: '', // 通知人员
linkUri: '', // 标签
id: '',
pubOrg: '',
pubTime: new Date(),
content: '',
title: '',
msgMode: '',
msgType: 'RESOURCE',
isPicMsg: '',
msgFileEOList: [],
PicFileEO: {},
saveLevel: '',
releventGroup: '',
releventStand: '',
releventLaws: '',
dataText: ''
},
msgDynamicInfoVOFormRules: {
title: [
{ required: true, message: '资料名称不能为空', trigger: 'blur' },
{type: 'string', max: 100, message: '最多输入100位', trigger: 'blur'}
],
pubOrg: [
{ required: true, message: '资料来源不能为空', trigger: 'change' },
{type: 'string', validator: this.verify.checkSpecialCharacter2, trigger: 'change'},
{type: 'string', max: 500, message: '最多输入500位', trigger: 'change'}
],
linkUri: [
{type: 'string', max: 100, message: '最多输入100位', trigger: 'blur'}
// {type: 'string', validator: this.verify.checkUrl, trigger: 'blur'}
],
msgMode: [
{type: 'string', max: 1000, message: '最多输入1000位', trigger: 'blur'}
// {type: 'string', validator: this.verify.checkUrl, trigger: 'blur'}
],
dataText: [
{type: 'string', max: 200, message: '最多输入200位', trigger: 'blur'}
// {type: 'string', validator: this.verify.checkUrl, trigger: 'blur'}
],
msgType: [
{ required: true, message: '消息模块不能为空', trigger: 'change' }
]
},
msgTypeOptions: [{
label: '国内动态',
value: 'INLAND'
}, {
label: '国外动态',
value: 'FOREIGN'
}, {
label: '资料中心',
value: 'RESOURCE'
}],
showMsgMode: false,
showMode: false,
uploadFilePath: 'api/att/attFile/upload',
uploadFileListPath: 'api/att/attFile/upload',
// 附件信息集合
fileInfoList: [],
PicFile: {},
picFIleList: [],
showPicUpload: true,
// UE编辑器配置
config: {
// 可以在此处定义工具栏的内容
toolbars: [
[
'undo', // 撤销
'redo', // 重做
'bold', // 加粗
'italic', // 斜体
'underline', // 下划线
'strikethrough', // 删除线
'subscript', // 下标
'superscript', // 上标
'fontborder', // 字符边框
'fontfamily', // 字体
'fontsize', // 字号
'forecolor', // 字体颜色
// 'backcolor', // 背景色
'paragraph', // 段落格式
'customstyle', // 自定义标题
'indent', // 首行缩进
'justifyleft', // 居左对齐
'justifyright', // 居右对齐
'justifycenter', // 居中对齐
'justifyjustify', // 两端对齐
'lineheight', // 行间距,
'rowspacingtop', // 段前距
'rowspacingbottom', // 段后距
'directionalityltr', // 从左向右输入
'directionalityrtl', // 从右向左输入
'fullscreen' // 全屏
// 'anchor', // 锚点
// 'template', // 模板
// 'scrawl', // 涂鸦
// 'music', // 音乐
// 'webapp', // 百度应用
// 'wordimage', // 图片转存
// 'attachment', // 附件
// 'map', // Baidu地图
// 'gmap', // Google地图
// 'insertvideo', // 视频
// 'help', // 帮助
// 'insertimage', // 多图上传
// 'insertcode', // 代码语言
// 'print', // 打印
// 'preview', // 预览
// 'snapscreen', // 截图
],
[
'cleardoc', // 清空文档
'formatmatch', // 格式刷
'removeformat', // 清除格式
'source', // 源代码
'blockquote', // 引用
'pasteplain', // 纯文本粘贴模式
'selectall', // 全选
'horizontal', // 分隔线
'time', // 时间
'date', // 日期
'link', // 超链接
'unlink', // 取消链接
// 'background', // 背景
'simpleupload', // 单图上传
'imagenone', // 默认
'imageleft', // 左浮动
'imageright', // 右浮动
'imagecenter', // 居中
'touppercase', // 字母大写
'tolowercase', // 字母小写
'emotion', // 表情
'spechars', // 特殊字符
'searchreplace', // 查询替换
'insertunorderedlist', // 无序列表
'insertorderedlist', // 有序列表
'pagebreak', // 分页
'insertframe', // 插入Iframe
'charts', // 图表
'edittip ', // 编辑提示
'autotypeset', // 自动排版
'drafts' // 从草稿箱加载
],
[
'inserttable', // 插入表格
'deletetable', // 删除表格,
'insertparagraphbeforetable', // ”表格前插入行”
'insertrow', // 前插入行
'insertcol', // 前插入列
'mergeright', // 右合并单元格
'mergedown', // 下合并单元格
'deleterow', // 删除行
'deletecol', // 删除列
'splittorows', // 拆分成行
'splittocols', // 拆分成列
'splittocells', // 完全拆分单元格
'inserttitle', // 插入标题
'deletecaption', // 删除表格标题,
'mergecells', // 合并多个单元格
'edittable', // 表格属性
'edittd' // 单元格属性
]
],
autoHeightEnabled: false,
autoFloatEnabled: false,
initialContent: '', // 初始化编辑器的内容,也可以通过textarea/script给值,看官网例子
autoClearinitialContent: true, // 是否自动清除编辑器初始内容,注意:如果focus属性设置为true,这个也为真,那么编辑器一上来就会触发导致初始化的内容看不到了
initialFrameWidth: 900,
elementPathEnabled: false,
initialFrameHeight: 500,
maximumWords: 20000,
BaseUrl: '',
UEDITOR_HOME_URL: 'static/ueditor/'
},
loading: false,
groupOptions: [],
gzzxxSelectOptions: [],
msgModeOptions: [
{'label': '会议资料', 'value': '1'},
{'label': '知识点分享', 'value': '2'}
]
}
},
methods: {
// 请求部门结构树
getOrgTreeSourceThis () {
this.$http.get('sys/org/getTree', {}, {_this: this},
res => {
if (res.ok) {
let treeNode = []
res.data.map((item, index) => {
let treeItem = {}
for (let key in item) {
if (key === 'orgName') {
treeItem.name = item[key]
treeItem.icon = 'static/images/dept.png'
} else {
treeItem[key] = item[key]
treeItem.icon = 'static/images/dept.png'
}
}
treeNode[index] = treeItem
})
this.depNode = treeNode
}
})
},
// 选择部门
handleVisibleDept () {
this.checkType = 'dept'
this.isTreeDrawer = true
},
// 打开选择人员drawer
handleVisibleRole (selectUserId, selectUserName) {
this.checkType = 'person'
this.isTreeDrawer = true
this.selectUserId = selectUserId
this.selectUserName = selectUserName
},
// 赋值回显人员和部门
drawerOpen () {
if (this.checkType === 'dept') {
let checkedArr = this.msgDynamicInfoVO.releventDepart ? this.msgDynamicInfoVO.releventDepart.split(',') : []
if (checkedArr.length > 0) {
this.$refs.deptTreeOrg.checkedNode(checkedArr)
}
} else if (this.checkType === 'person') {
let checkedArr = this.msgDynamicInfoVO[this.selectUserId] ? this.msgDynamicInfoVO[this.selectUserId].split(',') : []
if (checkedArr.length > 0) {
setTimeout(() => {
this.$nextTick(() => {
this.$refs.roleTree.checkedNode(checkedArr)
})
}, 1500)
}
}
},
// 部门选择事件
treeOnDeptCheck (checkedList) {
this.treeDeptNameList = []
this.treeDeptIdList = []
checkedList.map((item, index) => {
if (item.oldname) {
this.treeDeptNameList.push(item.oldname)
} else {
this.treeDeptNameList.push(item.name)
}
this.treeDeptIdList.push(item.id)
})
},
// 人员选择事件
treeOnRoleCheck (checkedList) {
this.treeRoleNameList = []
this.treeRoleIdList = []
// this.qbzxdForm.treeRoleIdListAll = []
checkedList.map((item, index) => {
// this.qbzxdForm.treeRoleIdListAll.push(item.id)
if (!item.isParent) {
this.treeRoleNameList.push(item.oldname || item.name)
this.treeRoleIdList.push(item.id)
}
})
},
// 点击确定赋值部门和人员
isTreeOk () {
if (this.checkType === 'dept') {
this.msgDynamicInfoVO.releventDepartName = this.treeDeptNameList.join(',')
this.msgDynamicInfoVO.releventDepart = this.treeDeptIdList.join(',')
} else if (this.checkType === 'person') {
this.msgDynamicInfoVO.notifyPersonName = this.treeRoleNameList.join(',')
this.msgDynamicInfoVO.notifyPerson = this.treeRoleIdList.join(',')
}
this.isTreeDrawer = false
},
getDept () {
return new Promise((resolve, reject) => {
let url = 'sys/org/getTree'
this.$http.get(url, {}, {
_this: this
}, res => {
if (res.ok) {
let zNodesDept = []
res.data.map((item, i) => {
let zObj = {}
// 该节点为机构
zObj.name = item.orgName
zObj.icon = 'static/images/dept.png'
// zObj.isParent = true
zObj.shotName = item.shotName
zObj.remarks = item.remarks
zObj.id = item.id
zObj.pId = item.pId
zNodesDept[i] = zObj
})
this.orgData = zNodesDept
resolve(res.data)
}
}, e => {
reject(e)
})
})
},
getPersonId () {
return new Promise((resolve, reject) => {
let url = 'sys/org/getTree'
this.$http.get(url, {}, {
_this: this
}, res => {
if (res.ok) {
let zNodesDept = []
res.data.map((item, i) => {
let zObj = {}
// 该节点为机构
zObj.name = item.orgName
zObj.icon = 'static/images/dept.png'
// zObj.isParent = true
zObj.shotName = item.shotName
zObj.remarks = item.remarks
// zObj.id = item.id
zObj.id = item.pId
zNodesDept[i] = zObj
})
this.personData = zNodesDept
resolve(res.data)
}
}, e => {
reject(e)
})
})
},
// 相关部门
getTreeSource () {
this.$http.get('sys/org/getTree', {}, {_this: this},
res => {
if (res.ok) {
let treeNode = []
res.data.map((item, index) => {
let treeItem = {}
for (let key in item) {
if (key === 'orgName') {
treeItem.name = item[key]
} else {
treeItem[key] = item[key]
}
}
treeNode[index] = treeItem
})
this.bussionessStandNodes = JSON.parse(JSON.stringify(treeNode))
}
})
},
/**
* @author liruohao
* @date 2019/3/28
* @Description: 富文本失焦事件
*/
uEditorChange () {
this.msgDynamicInfoVO.content = this.$refs.ueditor.getUEContent()
},
msgTypeChange (value) {
if (value === 'RESOURCE') {
this.showMsgMode = true
} else {
this.showMsgMode = false
this.msgDynamicInfoVO.msgMode = ''
}
},
loadMsgInfo () {
let msgId = this.$route.params.id || ''
if (msgId !== '') {
this.$http.get('lawss/msgDynamicInfo/' + msgId, {}, {_this: this}, res => {
this.msgDynamicInfoVO = res.data
// let Date = new Date()
this.msgDynamicInfoVO.pubTime = this.$dateFormat(new Date(), 'yyyy-MM-dd')
// this.msgDynamicInfoVO.pubTime = Date
// this.msgDynamicInfoVO.linkUri = res.data.linkUri || ''
// 此处增加判断标签显示效果
// if (this.msgDynamicInfoVO.msgMode !== null && this.msgDynamicInfoVO.msgMode !== '') {
// this.showMsgMode = true
// }
// 加载 附件信息
// this.fileInfoList = res.data.msgFileEOList !== null ? res.data.msgFileEOList : []
if (this.msgDynamicInfoVO.msgFileEOList) {
for (let i = 0; i < this.msgDynamicInfoVO.msgFileEOList.length; i++) {
let obj = {name: '', response: {}}
obj.name = this.msgDynamicInfoVO.msgFileEOList[i].originFileName
obj.response.data = this.msgDynamicInfoVO.msgFileEOList[i]
this.fileInfoList.push(obj)
}
} else {
this.fileInfoList = []
}
// 加载文件信息
// this.$refs.ueditor.ready(function () {
this.$refs.ueditor.setContent(res.data.content)
// })
if (res.data.picFileEO !== null) {
this.PicFile = res.data.picFileEO
this.picFIleList.push(res.data.picFileEO)
}
}, e => {})
}
},
// 保存新闻信息
saveMsgInfo (name, type) {
let msgId = this.$route.params.id
if (msgId != null && msgId !== '' && this.msgDynamicInfoVO.saveStatus === 'push' && type === 'save') {
this.$message.warning('已发布数据不能暂存')
} else {
this.$refs[name].validate((valid) => {
if (valid) {
this.saveLoading = true
this.pushLoading = true
// 判断是否有存在附件
let FileEOList = []
if (this.fileInfoList !== undefined && this.fileInfoList.length > 0) {
for (let index = 0; index < this.fileInfoList.length; index++) {
let fileInfo = this.fileInfoList[index].response === undefined ? this.fileInfoList[index] : this.fileInfoList[index].response.data
let file = {}
file.attId = fileInfo.attId
file.fileSuffix = fileInfo.fileSuffix
file.fileName = fileInfo.oldFileName
FileEOList.push(file)
}
}
this.msgDynamicInfoVO.msgFileEOList = FileEOList
console.log(this.msgDynamicInfoVO.content);
if (this.msgDynamicInfoVO.content != null){
String.prototype.replaceAll = function(s1, s2) {
return this.replace(new RegExp(s1, "gm"), s2);
}
this.msgDynamicInfoVO.content = this.msgDynamicInfoVO.content.replace(" ","").replaceAll("\"","**")
}
let infoMsg = this.msgDynamicInfoVO;
if (this.msgDynamicInfoVO.pubTime) {
console.log(this.msgDynamicInfoVO.pubTime);
let time = dateFormat(this.msgDynamicInfoVO.pubTime, 'YYYY-MM-DD')
infoMsg.pubTime = time + ' ' + '00:00:00'
console.log(infoMsg.pubTime);
}
infoMsg.saveStatus = type
// if (!infoMsg.saveLevel) {
// infoMsg.saveLevel = ''
// }
if (this.msgDynamicInfoVO.id !== '') {
this.$http.putData('lawss/msgDynamicInfo', infoMsg,
{_this: this, loading: this.loading}, res => {
if (res.ok) {
this.saveLoading = false
this.pushLoading = false
this.$router.push('/dynamicInformationManage')
}
})
} else {
this.$http.postData('lawss/msgDynamicInfo', infoMsg, {_this: this, loading: this.loading}, res => {
if (res.ok) {
this.saveLoading = false
this.pushLoading = false
this.$router.push('/dynamicInformationManage')
}
})
}
} else {
}
})
}
},
// 获取发布机构信息
selectRoleList () {
this.$http.get('sys/org/getTree', {}, {_this: this}, res => {
let roleList = res.data
let roleOpList = []
for (let index = 0; index < roleList.length; index++) {
let role = roleList[index]
let roleOption = {}
roleOption.label = role.orgName
roleOption.value = role.id
roleOpList.push(roleOption)
}
})
},
// 获取组织机构数据
getOrgTreeSource () {
this.$http.get('sys/org/getTree', {}, {_this: this},
res => {
if (res.ok) {
let treeNode = []
res.data.map((item, index) => {
let treeItem = {}
for (let key in item) {
if (key === 'orgName') {
treeItem.name = item[key]
} else {
treeItem[key] = item[key]
}
}
treeNode[index] = treeItem
})
this.zNodes = treeNode
}
}, e => {})
},
// 所属部门选取
treeDblClick (treeId, treeNode) {
this.msgDynamicInfoVO.pubOrg = treeNode.name
$('#deptBtnAdd').click()
},
selectDeptNode () {},
// 获取资料中心模块信息
getResourceMode () {
this.$http.get('lawss/msgModule/getAll', {}, {_this: this},
res => {
if (res.ok) {
let msgModdeObj = []
let msgModeList = res.data
for (let index = 0; index < msgModeList.length; index++) {
let msgMode = {}
msgMode.label = msgModeList[index].moduleName
msgMode.value = msgModeList[index].id
msgModdeObj.push(msgMode)
}
this.msgModeOptions = msgModdeObj
}
})
},
// 获取当前登录人所在的部门信息并写入对应的参数中
getUserOrgInfo () {
let msgId = this.$route.params.id || ''
if (msgId !== '') {
} else {
let userOrg = this.$store.getters.userInfo.orgName
if (userOrg !== null && userOrg !== '' && userOrg !== undefined) {
this.msgDynamicInfoVO.pubOrg = userOrg
}
}
},
// 上传文件成功回调
// this.fileInfoList = res.data
uploadBackSuccess (res, file, fileList) {
if (res.ok) {
this.fileInfoList = fileList
this.$message.success('上传成功')
} else {
this.$message.error(res.message)
fileList.pop()
}
},
uploadPicBackSuccess (res, file, fileList) {
if (res.ok) {
this.showPicUpload = false
this.PicFile = res.data
} else {
this.$message.error(res.message)
fileList.pop()
}
},
// // 删除文件
delFileInfo (file) {
let fileInfo = file
let files = []
files = JSON.parse(JSON.stringify(this.fileInfoList))
for (let a = 0; a < files.length; a++) {
if (fileInfo.response) {
if (files[a].response.data.id === fileInfo.response.data.id) {
files.splice(a, 1)
}
}
}
this.fileInfoList = files // 移除附件重新赋值
},
delPicFileInfo (file) {
this.showPicUpload = true
this.PicFile = {}
},
clickPicFile (file) {
let type = file.type
if (!/.(gif|jpg|jpeg|png|gif|jpg|png)$/.test(type)) {
this.$message.error('图片新闻类型必须是.gif,jpeg,jpg,png中的一种')
return false
}
if (JSON.stringify(this.PicFile) !== '{}') {
this.executeError('新闻图片只能上传一张!')
return false
}
if (file.size / 1024 / 1024 > 300) {
this.$message.error('文件' + file.name + '大小不超过200M')
return false
}
return true
},
// 取消按钮
gotoMsgInfoPage () {
this.$router.push('/dynamicInformationManage')
},
// 失败弹框
executeError (message) {
this.$message.error(message)
},
// 相关附件 上传之前钩子
beforeUpload (file) {
let filename = file.name
let index1 = filename.lastIndexOf('.')
let index2 = filename.length
let fileSuffix = filename.substring(index1, index2)
//把后缀转大写
if(fileSuffix !== undefined && fileSuffix !== null){
fileSuffix = fileSuffix.toUpperCase()
}
// 判断上传文件格式
if (fileSuffix === '.PDF' || fileSuffix === '.DOC' || fileSuffix === '.DOCX' || fileSuffix === '.PPT'
|| fileSuffix === '.PPTX'|| fileSuffix === '.XLS'|| fileSuffix === '.XLSX'
|| fileSuffix === '.PNG'|| fileSuffix === '.JPG'|| fileSuffix === '.JPEG') {
return true
} else {
this.$message.error('文件' + file.name + '格式不正确,请上传pdf、doc、docx、ppt、pptx、xls、xlsx、png、jpg、jpeg等文件')
return false
}
// 判断文件上传大小
if (file.size / 1024 / 1024 > 200) {// eslint-disable-line
this.$message.error('文件' + file.name + '大小不超过200M')
return false
}
return true
},
exceed (files, fileList) {
this.$message.warning(`当前限制选择 20 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
}
},
props: {},
computed: {},
watch: {},
mounted () {
this.getOrgTreeSourceThis()
this.loadMsgInfo()
// 获取工作组信息下拉框信息
this.$http.get('lawss/sarGroupMenu/queryGroup', '', {
_this: this
}, res => {
if (res.ok) {
let gzzxxOptions = []
res.data.map(item => {
gzzxxOptions.push({
value: item.id,
label: item.menuName
})
})
this.gzzxxSelectOptions = gzzxxOptions
}
})
// this.getResourceMode()
this.selectRoleList()
this.getUserOrgInfo()
this.getOrgTreeSource()
this.getTreeSource()
this.getDept()
this.getPersonId()
// 从数据库中查询各下拉框数据
this.$http.get('sys/dictype/getDicTypeListCode', '', {
_this: this
}, res => {
this.groupOptions = res.data.MJ
}, e => {
})
}
}
</script>
<style lang="less">
@import '~@/assets/styles/mixins';
.user-dept-popper {}
#dynamicInfo{
//padding: 10px;
background: #fff;
.information-modal{
.flex();
flex: 1;
}
.search-select{
width: 200px;
}
.title-input{
input{
width: 398px;
}
}
}
</style>
<style lang="less" scoped>
/deep/.label-input-form .add-form-item .el-form-item__label {
width: 100px !important;
}
/deep/.el-form-item__content {
margin-left: 100px !important;
}
</style>
@@ -0,0 +1,458 @@
<!-- 本地工具 - 动态&通知管理 -->
<template>
<div class="dynamic-information-manage">
<div class="search-area">
<div class="left">
<el-form :model="search" inline class="label-input-form" @submit.native.prevent>
<!-- <el-form-item label="消息模块" prop="msgType" class="search-item">-->
<!-- <search-select-->
<!-- v-model="search.msgType"-->
<!-- :options="search.msgTypeOptions"-->
<!-- placeholder="根据模块查找"/>-->
<!-- </el-form-item>-->
<el-form-item label="资料名称" prop="msgTitle" class="search-item search-item-last">
<el-input v-model="search.msgTitle" clearable placeholder="根据资料名称查找" @keyup.enter.native="searchMSGPageBtn"/>
</el-form-item>
<el-form-item class="search-item btn-box">
<el-button
icon="el-icon-search"
type="primary"
class="common-button-primary"
round
@click="searchMSGPageBtn"></el-button>
</el-form-item>
<el-form-item class="search-item btn-box">
<el-button
class="common-button-default"
icon="el-icon-refresh-left"
round
@click="resetSearch"></el-button>
</el-form-item>
</el-form>
</div>
<div class="right"></div>
</div>
<div class="action-bar">
<el-button class="common-button-primary add-button"
type="primary"
round
@click="openAddMSGModal"
v-btn-permission="'HJ9NVMRSUN'"><i class="iconfont">&#xe84e;</i>新增</el-button>
<el-button class="common-button-default delete-button"
round
@click="batchMSGDel"
v-btn-permission="'LX8SLTX7TP'" ><i class="iconfont">&#xe61b;</i>批量删除</el-button>
</div>
<!-- 显示模态框 -->
<div class="container">
<loading :loading="loading">数据获取中</loading>
<!--<Table border ref="selection" :columns="dynamicTable " :data="msgList" @on-selection-change="handleRowChange" ></Table>-->
<el-table
:data="msgList"
tooltip-effect="dark"
style="width: 100%"
border
height="100%"
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}"
@selection-change="handleRowChange"
ref="selection"
>
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<!-- <el-table-column-->
<!-- prop="msgType"-->
<!-- label="消息模块">-->
<!-- <template slot-scope="scope">-->
<!-- <div v-if="scope.row.msgType === 'INLAND'">国内动态</div>-->
<!-- <div v-if="scope.row.msgType === 'FOREIGN'">国外动态</div>-->
<!-- <div v-if="scope.row.msgType === 'RESOURCE'">资料中心</div>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column
prop="title"
label="资料名称">
</el-table-column>
<el-table-column
prop="pubOrg"
label="资料来源">
</el-table-column>
<!-- <el-table-column-->
<!-- prop="msgMode"-->
<!-- label="资料类别">-->
<!-- <template slot-scope="scope">-->
<!-- <div v-if="scope.row.msgMode === '1'">会议资料</div>-->
<!-- <div v-if="scope.row.msgMode === '2'">知识点分享</div>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column
prop="pubTime"
sortable
label="发布日期">
<template slot-scope="scope">
{{ scope.row.pubTime != null && scope.row.pubTime !== '' ? scope.row.pubTime.substring(0, 10) : '' }}
</template>
</el-table-column>
<!-- <el-table-column
prop="pubUserName"
label="创建人">
</el-table-column> -->
<!-- <el-table-column :label="this.$t('m.operation')" align="center" width="200">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- class="opera-btn"-->
<!-- size="mini"-->
<!-- type="primary"-->
<!-- @click="showMsgPage(scope.row.id, scope.row.msgType)">查看</el-button>-->
<!-- <el-button-->
<!-- class="opera-btn"-->
<!-- size="mini"-->
<!-- type="warning"-->
<!-- v-btn-permission="'YS9TFZ88WK'"-->
<!-- @click="editMsg(scope.row)">编辑</el-button>-->
<!-- <el-button-->
<!-- class="opera-btn"-->
<!-- size="mini"-->
<!-- type="danger"-->
<!-- v-btn-permission="'HVGR9K778X'"-->
<!-- @click="delMsgInfo(scope.row)">删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="操作" align="center" width="50" fixed="right">
<template slot-scope="scope">
<div @click.stop style="display: inline-block">
<el-dropdown trigger="click" @command="handleCommand">
<i class="iconfont">&#xe61e;</i>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :disabled="scope.row.enable==='0'" :command="[scope.row, '查看']">查看</el-dropdown-item>
<el-dropdown-item v-btn-permission="'QTCX5EZ9UW'" :disabled="scope.row.enable==='0'" :command="[scope.row, '编辑']">编辑</el-dropdown-item>
<el-dropdown-item v-btn-permission="'LX8SLTX7TP'" :disabled="scope.row.enable==='0'" :command="[scope.row, '删除']">删除</el-dropdown-item>
<!-- <el-dropdown-item :command="[scope.row, '流程']">流程</el-dropdown-item>-->
</el-dropdown-menu>
</el-dropdown>
</div>
</template>
</el-table-column>
</el-table>
</div>
<pagination :page="pageNo" :total="total" @pageChange="pageChange" @pageSizeChange="pageSizeChange"></pagination>
<!-- 新增-->
<el-drawer
:title="modalTitle"
:wrapperClosable="false"
:visible.sync="showModal"
:destroy-on-close="true"
size="800px"
@close="closeDrawer"
>
<!-- <loading :loading="drawerLoading">正在保存</loading>-->
<div class="demo-drawer-content">
<el-form
ref="infoVO"
:model="msgDynamicInfoVO"
:rules="msgDynamicInfoVOFormRules"
class="label-input-form"
auto-complete="new-password"
label-width="150px"
>
<input v-model="msgDynamicInfoVO.id" v-show="false">
<el-form-item
label="资料名称"
prop="title"
class="add-form-item"
>
<el-input
v-model="msgDynamicInfoVO.title" placeholder="请输入资料名称"/>
</el-form-item>
</el-form>
</div>
<div id="roleFormButton" class="demo-drawer-footer">
<el-button round class="common-button-primary" icon="el-icon-check" type="primary" @click="saveMsgInfo">提交</el-button>
<el-button round class="common-button-default" icon="el-icon-close" @click="closeDrawer">取消</el-button>
</div>
</el-drawer>
</div>
</template>
<script>
export default {
name: 'DynamicInformationManage',
data () {
return {
search: {
msgType: '',
msgTitle: '',
msgTypeOptions: [{
label: '国内动态',
value: 'INLAND'
}, {
label: '国外动态',
value: 'FOREIGN'
}, {
label: '资料中心',
value: 'RESOURCE'
}]
},
// 查看对话框资料名称
dynamicTitle: '查看信息',
dynamicModal: false,
loading: false,
// 总数
total: 0,
// 当前页数
pageNo: 1,
// 单页数量
pageSize: 10,
// 选中消息列表
clickMsgList: [],
// 消息列表
msgList: [],
modalTitle: '',
msgDynamicInfoVO: {
id: '',
pubOrg: '',
pubTime: new Date(),
title: '',
msgType: '',
msgFileEOList: [],
PicFileEO: {}
},
msgDynamicInfoVOFormRules: {
title: [
{ required: true, message: '资料名称不能为空', trigger: 'blur' },
{type: 'string', max: 100, message: '最多输入100位', trigger: 'blur'}
],
pubOrg: [
{ required: true, message: '资料来源不能为空', trigger: 'change' },
{type: 'string', validator: this.verify.checkSpecialCharacter2, trigger: 'change'},
{type: 'string', max: 500, message: '最多输入500位', trigger: 'change'}
]
},
showModal: false
}
},
methods: {
// ...
handleCommand (command) {
switch (command[1]) {
case '编辑':
this.editMsg(command[0])
break
case '删除':
this.delMsgInfo(command[0])
break
case '查看':
this.showMsgPage(command[0])
break
}
},
// 搜索
searchMSGPageBtn () {
this.pageNo = 1
this.searchMSGPage()
},
// 检索查询分页
searchMSGPage () {
this.$http.get('lawss/msgDynamicInfo/queryAllByPage',
{
page: this.pageNo,
pageSize: this.$store.getters.userInfo.configContent,
msgType: this.search.msgType,
title: this.search.msgTitle
},
{_this: this, loading: 'loading'},
res => {
if (res.ok) {
this.msgList = res.data.list
this.total = res.data.count
}
})
// this.$refs.selection.selectAll(false)
},
// 新增消息
openAddMSGModal () {
this.$router.push('/dynamicInformationManage/dynamicInfomationPage')
// this.showModal = true
// this.modalTitle = '新增'
},
// 批量删除
batchMSGDel () {
// 此处获取选中的数据
if (this.clickMsgList.length > 0) {
let msgIds = []
for (let i = 0; i < this.clickMsgList.length; i++) {
let msgId = this.clickMsgList[i].id
msgIds.push(msgId)
}
let msgIdsStr = msgIds.join(',')
this.$confirm('确定删除这些数据?', '提示', {
confirmButtonText: this.$t('m.determine'),
cancelButtonText: this.$t('m.cancel'),
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.delete('lawss/msgDynamicInfo/' + msgIdsStr, {},
{ _this: this
}, res => {
if (res.ok) {
this.executeSuccess('删除成功')
this.pageNo = 1
this.searchMSGPage()
this.clickMsgList = ''
} else {
this.executeError('删除失败! 失败原因:' + res.message)
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
} else {
this.$message.warning('请选择一条数据进行删除')
}
},
// 重置检索条件
resetSearch () {
this.pageNo = 1
this.search.msgType = ''
this.search.msgTitle = ''
this.searchMSGPage()
},
// 编辑消息
editMsg (item) {
this.$router.push('/dynamicInformationManage/dynamicInfomationPage/' + item.id)
// this.modalTitle = '编辑'
// this.msgDynamicInfoVO = JSON.parse(JSON.stringify(item))
// this.showModal = true
},
// 删除消息
delMsgInfo (item) {
this.$confirm('确定删除这一条数据?', '提示', {
confirmButtonText: this.$t('m.determine'),
cancelButtonText: this.$t('m.cancel'),
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.delete('lawss/msgDynamicInfo/' + item.id, {},
{
_this: this
}, res => {
if (res.ok) {
this.executeSuccess('删除成功')
this.pageNo = 1
this.searchMSGPage()
} else {
this.executeError('删除失败! 失败原因:' + res.message)
}
}
)
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
// 查看消息内容
showMsgPage (item) {
let routeUrl = this.$router.resolve({
name: 'DynamicInfomationDetails2',
query: {
id: item.id,
pageType: item.msgType + '_MSG'
}
})
window.open(routeUrl.href, '_blank')
// this.$store.commit('setDetailMap', this.$route.path)
// this.$router.push({
// name: 'DynamicInfomationDetails',
// params: {
// id: item.id,
// pageType: item.msgType + '_MSG'
// }
// })
},
handleRowChange (selection) {
this.clickMsgList = selection
},
pageChange (page) {
this.pageNo = page
this.searchMSGPage()
},
pageSizeChange (pageSize) {
// this.pageSize = pageSize
this.searchMSGPage()
},
// 成功弹框
executeSuccess (message) {
this.$message.success(message)
},
// 失败弹框
executeError (message) {
this.$message.error(message)
},
closeDrawer () {
this.showModal = false
},
saveMsgInfo () {
let msgId = this.$route.params.id
if (msgId != null && msgId !== '' && this.msgDynamicInfoVO.saveStatus === 'push' && type === 'save') {
this.$message.warning('已发布数据不能暂存')
} else {
this.$refs['msgDynamicInfoVO'].validate((valid) => {
if (valid) {
let saveInfo = JSON.parse(JSON.stringify(this.msgDynamicInfoVO))
if (saveInfo.id !== '') {
this.$http.putData('lawss/msgDynamicInfo', saveInfo, {
_this: this,
loading: this.loading
}, res => {
if (res.ok) {
this.showModal = false
this.searchMSGPage()
}
})
} else {
this.$http.postData('lawss/msgDynamicInfo', saveInfo, {_this: this, loading: this.loading}, res => {
if (res.ok) {
this.showModal = false
this.searchMSGPage()
} else {
}
})
}
} else {
}
})
}
}
},
mounted () {
this.searchMSGPage()
}
}
</script>
<style lang="less" scoped>
.dynamic-information-manage{
height: 100%;
display: flex;
flex-direction: column;
.container{
flex: auto;
//height: calc(~'100% - 61px - 56px');
display: flex;
flex-direction: column;
}
.pagination {
position: static;
width: 100% !important;
}
}
</style>
@@ -0,0 +1,833 @@
<!-- 配置管理 - 动态信息 -->
<template>
<div class="dynamicInformations">
<div class="search-area">
<div class="left">
<el-form :model="search" inline class="label-input-form" @keyup.enter.native="getSearch">
<el-form-item label="标题" prop="msgTitle" class="search-item search-item-last">
<el-input v-model="search.msgTitle" clearable placeholder="根据标题查找"/>
</el-form-item>
<el-form-item class="search-item btn-box">
<el-button
icon="el-icon-search"
type="primary"
class="common-button-primary"
round
@click="getSearch"></el-button>
</el-form-item>
<el-form-item class="search-item btn-box">
<el-button
class="common-button-default"
icon="el-icon-refresh-left"
round
@click="resetSearch"></el-button>
</el-form-item>
</el-form>
</div>
<div class="right"></div>
</div>
<div class="action-bar">
<el-button class="common-button-primary add-button"
type="primary"
round
v-btn-permission="'QZL5DZDFNM'"
@click="openAddMSGModal(1)"><i class="iconfont">&#xe84e;</i>新增</el-button>
<el-button class="common-button-default delete-button"
round
v-btn-permission="'HVGR9K778X'"
@click="batchMSGDel(1)"><i class="iconfont">&#xe61b;</i>批量删除</el-button>
</div>
<!-- 显示模态框 -->
<div class="container">
<loading :loading="loading">数据获取中</loading>
<el-table
:data="msgList"
tooltip-effect="dark"
style="width: 100%"
border
height="100%"
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}"
ref="selection"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="title"
label="标题"
show-overflow-tooltip
align="center">
</el-table-column>
<el-table-column
prop="content"
label="内容"
show-overflow-tooltip
align="center">
</el-table-column>
<el-table-column
prop="state"
label="状态"
align="center">
</el-table-column>
<el-table-column
prop="implDate"
label="发布时间"
sortable
align="center">
</el-table-column>
<el-table-column label="操作" align="center" width="50" fixed="right">
<template slot-scope="scope">
<div @click.stop style="display: inline-block">
<el-dropdown trigger="click" @command="handleCommand">
<i class="iconfont">&#xe61e;</i>
<el-dropdown-menu slot="dropdown">
<!-- v-if="scope.row.state !== '发布'"-->
<el-dropdown-item v-btn-permission="'YS9TFZ88WK'" :command="[scope.row, '编辑']">编辑</el-dropdown-item>
<el-dropdown-item :command="[scope.row, '查看']">查看</el-dropdown-item>
<el-dropdown-item v-btn-permission="'HVGR9K778X'" :command="[scope.row, '删除']">删除</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</template>
</el-table-column>
</el-table>
</div>
<pagination :total="total" :page="pageNo" @pageChange="pageChange" @pageSizeChange="pageSizeChange"></pagination>
<el-drawer
:title="drawerTitle"
@close="closeDrawer"
size="600px"
destroy-on-close
:visible.sync="drawer">
<div class="demo-drawer-content">
<div class="el-drawer-form">
<el-form
ref="infoForm"
:model="infoForm"
class="label-input-form"
:rules="rules"
>
<el-form-item label="动态标题" prop="title" label-width="150px" class="add-form-item">
<el-input v-model="infoForm.title"
:disabled="drawerType === 3"
placeholder="请输入标题"></el-input>
</el-form-item>
<el-form-item label="动态内容" prop="content" label-width="150px" class="add-form-item">
<el-input v-model="infoForm.content"
placeholder="请输入内容"
:disabled="drawerType === 3"
resize="none"
@keydown.native="listen($event)"
type="textarea"
:autosize="{ minRows: 3, maxRows: 6 }"></el-input>
</el-form-item>
<!-- v-if="drawerTitle === '新增信息'"-->
<el-form-item label="重点通知人员" label-width="150px" class="add-form-item lineNone">
<el-input v-model="infoForm.person" type="hidden" />
<el-input
v-model="infoForm.personName"
placeholder="请选择重点通知人员"
:disabled="drawerType === 3"
readonly
clearable
@click.native="share('person', 'personName')"
/>
</el-form-item>
<el-form-item label="发布时间" prop="implDate" label-width="150px" class="add-form-item" v-if="drawerType === 3">
<el-input v-model="infoForm.implDate"
disabled></el-input>
</el-form-item>
<!-- <el-formItem label="相关附件" prop="doc" label-width="150px" class="add-form-item">-->
<!-- <el-upload-->
<!-- v-if="drawerType !== 3"-->
<!-- style="margin-top: 15px;"-->
<!-- multiple-->
<!-- drag-->
<!-- :show-file-list="showUploadlist1"-->
<!-- :on-success="uploadSuccess1"-->
<!-- :before-upload="beforeUpload1"-->
<!-- :on-remove="removeOneFile1"-->
<!-- :action="importExcelUrl"-->
<!-- name="file"-->
<!-- :file-list="defaultFileList1"-->
<!-- ref="importFileAboutStand">-->
<!-- <i class="el-icon-upload"></i>-->
<!-- <div class="el-upload__text">点击或拖拽上传文件</div>-->
<!-- </el-upload>-->
<!-- <div v-else style="line-height: 50px;">-->
<!-- <div v-if="infoForm.docList">-->
<!-- <span v-for="(docItem, docIndex) in infoForm.docList" :key="docIndex" @click="saveFile(docItem.id)" class="fileClass">-->
<!-- {{ docItem.oldFileName }}-->
<!-- </span>-->
<!-- </div>-->
<!-- <div v-else>暂无</div>-->
<!-- </div>-->
<!-- </el-formItem>-->
<!-- <el-formItem label="图片新闻" prop="tabloid" label-width="150px" class="add-form-item">-->
<!-- <el-upload-->
<!-- v-if="drawerType !== 3"-->
<!-- style="margin-top: 15px;"-->
<!-- multiple-->
<!-- drag-->
<!-- :show-file-list="showUploadlist2"-->
<!-- :on-success="uploadSuccess2"-->
<!-- :before-upload="beforeUpload2"-->
<!-- :on-remove="removeOneFile2"-->
<!-- :action="importExcelUrl"-->
<!-- name="file"-->
<!-- :file-list="defaultFileList2"-->
<!-- ref="importFileAboutStand">-->
<!-- <i class="el-icon-upload"></i>-->
<!-- <div class="el-upload__text">点击或拖拽上传文件</div>-->
<!-- </el-upload>-->
<!-- <div v-else style="line-height: 50px;">-->
<!-- <div v-if="infoForm.tabloidList">-->
<!-- <span v-for="(tabloidItem, tabloidIndex) in infoForm.tabloidList" :key="tabloidIndex" @click="saveFile(tabloidItem.id)" class="fileClass">-->
<!-- {{ tabloidItem.oldFileName }}-->
<!-- </span>-->
<!-- </div>-->
<!-- <div v-else>暂无</div>-->
<!-- </div>-->
<!-- </el-formItem>-->
</el-form>
</div>
</div>
<div class="demo-drawer-footer" v-if="drawerType !== 3">
<el-button round v-if="infoForm.state !== '发布'" class="common-button-primary" icon="el-icon-check" type="primary" :loading="submitLoading" @click="submit(1)">暂存</el-button>
<!-- <el-button round class="common-button-primary" icon="el-icon-check" type="primary" @click="share()">发布</el-button>-->
<el-button round class="common-button-primary" v-if="drawerType === 2" icon="el-icon-check" type="primary" :loading="drawerLoading" @click="submit(2)">发布</el-button>
<el-button round class="common-button-default" icon="el-icon-close" @click="closeDrawer">取消</el-button>
</div>
</el-drawer>
<el-drawer title="重点通知人员" :visible.sync="drawerModal" size="300px" :styles="drawerModalstyles" @close="treeCancel" @opened="drawerOpen">
<div class="demo-drawer-content">
<dept-tree treeDivId="drawerModalTree"
ref="drawerModalTree"
@treeOnCheck="(checkedList) => treeOnCheck(checkedList)"
allDept
check-enable
showUser
:editable="false"
style="padding: 0 15px">
</dept-tree>
</div>
<div class="demo-drawer-footer">
<el-button type="primary" round class="common-button-primary" icon="el-icon-check" :loading="submitLoading" @click="savePerson">确定</el-button>
<el-button round class="common-button-default" icon="el-icon-close" @click="treeCancel">取消</el-button>
</div>
</el-drawer>
</div>
</template>
<script>
export default {
name: 'DynamicInformations',
data () {
return {
drawerLoading: false,
submitLoading: false,
shareStandardSelect: [],
shareStandardSelectName: [],
drawerModalstyles: {
height: 'calc(100% - 55px)',
overflow: 'auto',
paddingBottom: '53px',
position: 'static'
},
drawerModal: false,
idList: '',
id: '',
showUploadlist1: true,
importExcelUrl: 'api/att/attFile/upload',
defaultFileList1: [],
showUploadlist2: true,
defaultFileList2: [],
infoForm: {
title: '',
doc: '',
content: '',
tabloid: '',
implDate: '',
person: '',
personName: ''
},
rules: {
title: [
{ required: true, message: '请输入标题', trigger: 'blur' },
{ min: 1, max: 100, message: '长度在100个字符以内', trigger: 'blur' }
],
content: [
{ required: true, message: '请输入内容', trigger: 'blur' },
{ min: 1, max: 2000, message: '长度在2000个字符以内', trigger: 'blur' }
]
},
drawerType: '',
drawerTitle: '',
drawer: false,
msgList: [],
search: {
msgTitle: ''
},
loading: false,
// 总数
total: 0,
// 当前页数
pageNo: 1,
// 单页数量
pageSize: 10
}
},
methods: {
listen (event) {
if (event.keyCode === 13) {
event.preventDefault() // 阻止浏览器默认换行操作
return false
}
},
// 点击查询按钮
getSearch () {
this.pageNo = 1
this.getList()
},
//选择重点通知人员
savePerson () {
this.infoForm.person = this.shareStandardSelect.join(',')
this.infoForm.personName = this.shareStandardSelectName.join(',')
this.drawerModal = false
},
treeOnCheck (checkedList) {
this.shareStandardSelect = []
this.shareStandardSelectName = []
checkedList.map((item, index) => {
if (!item.isParent) {
this.shareStandardSelect.push(item.id)
this.shareStandardSelectName.push(item.oldname)
}
})
},
// 赋值回显人员
drawerOpen () {
let checkedArr = this.infoForm.person ? this.infoForm.person.split(',') : []
if (checkedArr.length > 0) {
this.$refs.drawerModalTree.checkedNode(checkedArr)
}
},
// 取消分享
treeCancel () {
this.shareStandardSelect = []
this.drawerModal = false
this.$refs.drawerModalTree.treeReload()
},
saveFile (attId) {
if (attId != null && attId !== '') {
window.location.href = '/api/att/attFile/downloadFileForSar?fileId=' + attId
} else {
this.$message.error('请选择要下载的文件')
}
},
handleSelectionChange (val) {
let list = []
val.map((item, index) => {
list.push(item.id)
})
this.idList = list.toString()
},
// 关闭drawer
closeDrawer () {
this.$refs['infoForm'].clearValidate()
this.infoForm = {}
this.id = ''
this.drawer = false
this.defaultFileList1 = []
this.defaultFileList2 = []
},
// 点击重点通知人员
share (selectUserId, selectUserName) {
if (this.drawerType === 3) {
} else {
this.$refs['infoForm'].validate((valid) => {
if (valid) {
this.drawerModal = true
// this.selectUserId = selectUserId
// this.shareStandardSelectName = selectUserName
} else {
}
})
}
// this.$http.post('/lawss/sarNotice/release', {
// id: this.id,
// department: this.$store.getters.userInfo.orgId
// }, {
// _this: this
// }, res => {
// this.getList()
// }, e => {
// this.$message.error('发布失败!')
// })
},
// 发布
shareStandardBt () {
this.submitLoading = true
if (this.drawerType === 1) {
// -----(之前的发布)
this.$refs['infoForm'].validate((valid) => {
if (valid) {
this.$http.postData('/lawss/sarNotice/saveNoticeANdRelease', {
id: this.id,
title: this.infoForm.title,
content: this.infoForm.content,
createTime: this.infoForm.pubTime,
link: 'DetailsJump/',
department: this.$store.getters.userInfo.orgId,
userIds: this.shareStandardSelect.toString()
}, {
_this: this
}, res => {
if (res.ok) {
this.drawerModal = false
this.shareStandardSelect = []
this.$refs.drawerModalTree.treeReload()
this.closeDrawer()
this.getList()
}
this.submitLoading = false
this.drawer = false
})
}
})
} else if (this.drawerType === 2) {
// 编辑时发布
this.$refs['infoForm'].validate((valid) => {
if (valid) {
this.$http.post('/lawss/sarNotice/release', {
id: this.id,
department: this.$store.getters.userInfo.orgId,
userIds: this.shareStandardSelect
}, {
_this: this
}, res => {
if (res.ok) {
this.drawerModal = false
this.shareStandardSelect = []
this.$refs.drawerModalTree.treeReload()
this.getList()
}
this.submitLoading = false
this.drawer = false
}, e => {
this.$message.error('发布失败!')
})
}
})
} else if (this.drawerType === 3) {
this.$http.post('/lawss/sarNotice/release', {
id: this.id,
department: this.$store.getters.userInfo.orgId,
userIds: this.shareStandardSelect
}, {
_this: this
}, res => {
if (res.ok) {
this.drawerModal = false
this.shareStandardSelect = []
this.$refs.drawerModalTree.treeReload()
this.getList()
}
this.submitLoading = false
this.drawer = false
}, e => {
this.$message.error('发布失败!')
})
}
},
// 提交
submit (flag) {
if (flag === 1){
// 暂存
//-------- 3/22 暂存是新增了一条未发布状态的信息(infoForm 多加了 person personName);编辑时再发布 状态改为发布
//-----(之前的暂存)
this.$refs['infoForm'].validate((valid) => {
if (valid) {
this.submitLoading = true
this.$http.postData('/lawss/sarNotice/saveNotice', {
id: this.id,
title: this.infoForm.title,
content: this.infoForm.content,
// doc: this.infoForm.doc,
// tabloid: this.infoForm.tabloid,
createTime: this.infoForm.pubTime,
link: 'DetailsJump/',
person: this.infoForm.person,
personName: this.infoForm.personName,
}, {
_this: this
}, res => {
if (res.ok) {
this.closeDrawer()
this.getList(1)
}
this.submitLoading = false
})
}
})
} else {
// 发布
// -----(之前的发布)
this.$refs['infoForm'].validate((valid) => {
if (valid) {
this.drawerLoading = true
this.$http.postData('/lawss/sarNotice/saveNoticeANdRelease', {
id: this.id,
title: this.infoForm.title,
content: this.infoForm.content,
createTime: this.infoForm.pubTime,
link: 'DetailsJump/',
department: this.$store.getters.userInfo.orgId,
// userIds: this.shareStandardSelect.toString()
userIds: this.infoForm.person,
userIdsName: this.infoForm.personName,
}, {
_this: this
}, res => {
if (res.ok) {
this.drawerLoading = false
this.drawer = false
this.getList(1)
this.drawerModal = false
this.shareStandardSelect = []
this.$refs.drawerModalTree.treeReload()
this.closeDrawer()
}
})
}
})
}
},
// 附件上传
beforeUpload1 (file) {
var filename = file.name
var index1 = filename.lastIndexOf('.')
var index2 = filename.length
var fileSuffix = filename.substring(index1, index2)
if (fileSuffix === '.xlsx' || fileSuffix === '.doc' || fileSuffix === '.docx' || fileSuffix === '.PDF') {
return true
} else {
this.$message.error('文件' + file.name + '格式不正确,请上传xlsx、doc、docx或PDF文件')
return false
}
// 判断文件上传大小
if (file.size / 1024 / 1024 <= 200) {// eslint-disable-line
return true
} else {
this.$message.error('文件' + file.name + '大小不超过200M')
return false
}
return true
},
uploadSuccess1 (res, file, fileList) {
if (res.ok) {
if (this.infoForm.doc) {
this.infoForm.doc += res.data.id + ','
} else {
this.infoForm.doc = res.data.id
}
this.$message({
message: '文件上传成功',
type: 'success'
})
} else {
this.$Message.error(res.message)
}
},
removeOneFile1 (file, fileList) {
let ids = this.infoForm.doc.split(',')
let fileIds = file.response.data.id
let newIdList = this.removeAaary(ids, fileIds)
let newStr = ''
if (newIdList != null && newIdList.length > 0) {
for (let i = 0; i < newIdList.length; i++) {
if (newIdList[i] !== '') {
newStr += newIdList[i] + ','
}
}
this.infoForm.doc = newStr
} else {
this.infoForm.doc = ''
}
},
// 图片上传
beforeUpload2 (file) {
var filename = file.name
var index1 = filename.lastIndexOf('.')
var index2 = filename.length
var fileSuffix = filename.substring(index1, index2)
if (fileSuffix === '.jpg' || fileSuffix === '.png') {
return true
} else {
this.$message.error('图片' + file.name + '格式不正确,请上传png或jpg格式')
return false
}
// 判断文件上传大小
if (file.size / 1024 / 1024 <= 200) {// eslint-disable-line
return true
} else {
this.$message.error('图片' + file.name + '大小不超过200M')
return false
}
return true
},
uploadSuccess2 (res, file, fileList) {
if (res.ok) {
if (this.infoForm.tabloid) {
this.infoForm.tabloid += res.data.id + ','
} else {
this.infoForm.tabloid = res.data.id
}
this.$message({
message: '文件上传成功',
type: 'success'
})
} else {
this.$Message.error(res.message)
}
},
removeOneFile2 (file, fileList) {
let ids = this.infoForm.tabloid.split(',')
let fileIds = file.response.data.id
let newIdList = this.removeAaary(ids, fileIds)
let newStr = ''
if (newIdList != null && newIdList.length > 0) {
for (let i = 0; i < newIdList.length; i++) {
if (newIdList[i] !== '') {
newStr += newIdList[i] + ','
}
}
this.infoForm.tabloid = newStr
} else {
this.infoForm.tabloid = ''
}
},
// 删除数组中的某个对象
removeAaary (_arr, _obj) {
var length = _arr.length
for (var i = 0; i < length; i++) {
if (_arr[i] === _obj) {
if (i === 0) {
_arr.shift() // 删除并返回数组的第一个元素
return _arr
} else if (i === length - 1) {
_arr.pop() // 删除并返回数组的最后一个元素
return _arr
} else {
_arr.splice(i, 1) // 删除下标为i的元素
return _arr
}
}
}
},
// 更多
handleCommand (command) {
switch (command[1]) {
case '查看':
this.openAddMSGModal(3, command[0])
break
case '编辑':
this.openAddMSGModal(2, command[0])
break
case '删除':
this.batchMSGDel(2, command[0])
break
}
},
// 重置
resetSearch () {
this.search.msgTitle = ''
this.getList()
},
// 查询数据
getList (flag) {
if (flag === 1) {
this.pageNo = 1
}
this.$http.get('/lawss/sarNotice/page', {
page: this.pageNo,
pageSize: this.$store.getters.userInfo.configContent,
title: this.search.msgTitle
}, {
_this: this
}, res => {
if (res.ok) {
this.msgList = res.data.list
this.msgList.map((item) => {
if (item.implDate) {
item.implDate = this.$moment(item.implDate).format('YYYY-MM-DD')
if (item.userIds){
item.person = item.userIds
}
if (item.userIdsName) {
item.personName = item.userIdsName
}
}
})
this.total = res.data.count
}
})
},
// 新增消息
openAddMSGModal (type, row) {
if (type === 1) {
this.drawerType = type
this.drawerTitle = '新增信息'
} else if (type === 2) {
this.drawerType = type
this.drawerTitle = '编辑信息'
this.id = row.id
this.infoForm = {...row}
if (row.docList) {
if (row.docList != null && row.docList.length > 0) {
for (let i = 0; i < row.docList.length; i++) {
let obj1 = {name: '', response: {}}
obj1.name = row.docList[i].oldFileName
obj1.response.data = row.docList[i]
this.defaultFileList1.push(obj1)
}
}
}
if (row.tabloidList) {
if (row.tabloidList != null && row.tabloidList.length > 0) {
for (let i = 0; i < row.tabloidList.length; i++) {
let obj = {name: '', response: {}}
obj.name = row.tabloidList[i].oldFileName
obj.response.data = row.tabloidList[i]
this.defaultFileList2.push(obj)
}
}
}
} else if (type === 3) {
this.id = row.id
this.drawerType = type
this.drawerTitle = '查看信息'
this.infoForm = {...row}
}
this.drawer = true
},
// 批量删除
batchMSGDel (type, row) {
if (type === 2) {
this.$confirm('是否删除此数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.postData('lawss/sarNotice/deleteData', {
id: row.id
}, {
_this: this
}, res => {
if (res.ok) {
this.pageChange(1)
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
} else if (type === 1) {
if (this.idList === '') {
this.$message.warning('请选择要删除的数据')
} else {
this.$confirm('是否删除已选择数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.postData('/lawss/sarNotice/deleteData', {
id: this.idList
}, {
_this: this
}, res => {
if (res.ok) {
this.pageChange(1)
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
}
}
},
pageChange (page) {
this.pageNo = page
this.getList()
},
pageSizeChange (pageSize) {
this.pageSize = pageSize
this.getList()
}
},
mounted () {
this.getList()
}
}
</script>
<style lang="less">
.dynamicInformations{
height: 100%;
display: flex;
flex-direction: column;
/deep/.is-disabled {
.el-input__inner {
color: #333;
}
.el-textarea__inner {
color: #333;
}
}
.fileClass {
cursor: pointer;
}
.fileClass:hover {
color: #0c91e5;
}
.container{
//height: calc(~'100% - 61px - 56px');
flex: auto;
display: flex;
flex-direction: column;
}
.pagination {
position: static;
width: 100% !important;
}
.dialog-drawerModal {
display: flex;
align-items: center;
padding-right: 10px;
padding-left: 10px;
height: 50px;
color: #c6d0d6;
}
/deep/.lineNone {
.el-form-item__content {
line-height: 0!important;
.el-input--suffix {
padding-right: 0!important;
}
}
}
}
</style>
@@ -0,0 +1,425 @@
<!-- 企标编号管理体系 -->
<template>
<div class="dynamicInformations">
<div class="action-bar">
<el-button class="common-button-primary add-button"
type="primary"
round
@click="openAddMSGModal(1)" v-btn-permission="'W8VY4K4XNPH6GABQBG82'"><i class="iconfont">&#xe84e;</i>新增</el-button>
<el-button class="common-button-default delete-button"
round
@click="batchMSGDel(1)" v-btn-permission="'58URKBHGS4QDHSKXG4SS'"><i class="iconfont">&#xe61b;</i>批量删除</el-button>
<el-button class="common-button-default delete-button"
round
@click="basicTree()" v-btn-permission="'R2L3AUA3WPKP86NW783G'"><i class="iconfont"></i>体系基础数据库</el-button>
</div>
<!-- 显示模态框 -->
<div class="container">
<loading :loading="submitLoading">数据获取中</loading>
<el-table
:data="msgList"
tooltip-effect="dark"
style="width: 100%"
border
height="100%"
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}"
ref="selection"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="qbCode"
label="编码"
show-overflow-tooltip
align="center">
</el-table-column>
<el-table-column
prop="qbCname"
label="中文名称"
show-overflow-tooltip
align="center">
</el-table-column>
<el-table-column
prop="qbEname"
label="英文名称"
align="center">
</el-table-column>
<el-table-column label="操作" align="center" width="50" fixed="right">
<template slot-scope="scope">
<div @click.stop style="display: inline-block">
<el-dropdown trigger="click" @command="handleCommand">
<i class="iconfont">&#xe61e;</i>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-btn-permission="'YD83SYAYGTM377DEC8UP'" :command="[scope.row, '编辑']">编辑</el-dropdown-item>
<el-dropdown-item v-btn-permission="'TKCKN2Q88XTHPAUEQBL7'" :command="[scope.row, '查看']">查看</el-dropdown-item>
<el-dropdown-item v-btn-permission="'YMWHSZSCV6DP5RA38GTY'" :command="[scope.row, '删除']">删除</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</template>
</el-table-column>
</el-table>
</div>
<pagination :total="total" @pageChange="pageChange" @pageSizeChange="pageSizeChange"></pagination>
<el-drawer
:title="drawerTitle"
@close="closeDrawer"
size="600px"
destroy-on-close
:visible.sync="drawer">
<div class="demo-drawer-content">
<div class="el-drawer-form">
<el-form
ref="infoForm"
:model="infoForm"
class="label-input-form"
:rules="rules"
>
<el-form-item label="编码" prop="qbCode" label-width="150px" class="add-form-item">
<el-input v-model="infoForm.qbCode"
placeholder="请输入编码" :disabled="addOrEdit === 2"></el-input>
</el-form-item>
<el-form-item label="中文名称" prop="qbCname" label-width="150px" class="add-form-item">
<el-input v-model="infoForm.qbCname"
placeholder="请输入中文名称"></el-input>
</el-form-item>
<el-form-item label="英文名称" prop="qbEname" label-width="150px" class="add-form-item">
<el-input v-model="infoForm.qbEname" placeholder="请输入英文名称"></el-input>
</el-form-item>
<el-formItem label="数据类型" prop="qbDataType" label-width="150px" class="add-form-item">
<!--<el-input v-model="sarBussionessStandEO.standSort" :disabled="formdisableflag"></el-input>-->
<el-select v-model="infoForm.qbDataType" placeholder="请输入数据类型">
<el-option v-for="opt in infoOptions" :value="opt.value" :key="opt.value" :label="opt.label">{{ opt.label}}</el-option>
</el-select>
</el-formItem>
<el-form-item label="排序序号" prop="qbSort" label-width="150px" class="add-form-item">
<el-input v-model="infoForm.qbSort" placeholder="请输入排序序号"></el-input>
</el-form-item>
</el-form>
</div>
</div>
<div class="demo-drawer-footer">
<el-button round class="common-button-primary" icon="el-icon-check" type="primary" @click="share()">提交</el-button>
<el-button round class="common-button-default" icon="el-icon-close" @click="closeDrawer">取消</el-button>
</div>
</el-drawer>
</div>
</template>
<script>
export default {
name: 'DynamicInformations',
data () {
return {
addOrEdit:'',
submitLoading: false,
shareStandardSelect: [],
drawerModalstyles: {
height: 'calc(100% - 55px)',
overflow: 'auto',
paddingBottom: '53px',
position: 'static'
},
drawerModal: false,
idList: '',
id: '',
showUploadlist1: true,
importExcelUrl: 'api/att/attFile/upload',
defaultFileList1: [],
showUploadlist2: true,
defaultFileList2: [],
infoForm: {
qbCode: '',
qbCname: '',
qbEname: '',
qbDataType: '',
qbSort: ''
},
infoOptions:[
{
label: '自定义',
value: '1'
},
{
label: '基础体系库',
value: '2'
}
],
rules: {
qbCode: [
{ required: true, message: '请输入编码', trigger: 'blur' },
{ type: 'string', validator: this.verify.validateCode, trigger: 'blur' },
{ type: 'string', max: 3, message: '最多输入3位', trigger: 'blur'}
],
qbSort: [
{ required: true, message: '请输入排序序号', trigger: 'blur' },
{ type: 'string', validator: this.verify.validateStandarOrder, trigger: 'blur' }
],
qbDataType: [
{ required: true, message: '请输入数据类型', trigger: 'blur' }
]
},
drawerType: '',
drawerTitle: '',
id: '',
drawer: false,
msgList: [],
search: {
msgTitle: ''
},
loading: false,
// 总数
total: 0,
// 当前页数
pageNo: 1,
// 单页数量
pageSize: 10
}
},
methods: {
treeOnCheck (checkedList) {
this.shareStandardSelect = []
checkedList.map((item, index) => {
if (!item.isParent) {
this.shareStandardSelect.push(item.id)
}
})
},
handleSelectionChange (val) {
let list = []
val.map((item, index) => {
list.push(item.id)
})
this.idList = list.toString()
},
// 关闭drawer
closeDrawer () {
this.$refs['infoForm'].clearValidate()
this.infoForm = {}
this.id = ''
this.drawer = false
this.defaultFileList1 = []
this.defaultFileList2 = []
},
// 提交
share () {
this.$refs['infoForm'].validate((valid) => {
if (valid) {
this.submitLoading = true
if (this.addOrEdit === 1){
this.$http.postData('/lawss/sarBussRecordsCode/addSarBussRecordsCodeEO', {
qbCode: this.infoForm.qbCode,
qbCname: this.infoForm.qbCname,
qbEname: this.infoForm.qbEname,
qbDataType: this.infoForm.qbDataType,
qbSort: this.infoForm.qbSort,
}, {
_this: this
}, res => {
if (res.ok) {
this.closeDrawer()
this.getList()
// this.submitLoading = false
}
})
} else {
// 编辑
this.$http.putData('lawss/sarBussRecordsCode/updateSarBussRecordsCodeEO', {
id: this.id,
qbCode: this.infoForm.qbCode,
qbCname: this.infoForm.qbCname,
qbEname: this.infoForm.qbEname,
qbDataType: this.infoForm.qbDataType,
qbSort: this.infoForm.qbSort,
}, {
_this: this
}, res => {
if (res.ok) {
this.closeDrawer()
this.getList()
}
})
}
} else {
}
})
},
// 更多
handleCommand (command) {
switch (command[1]) {
case '查看':
this.openAddMSGModal(3, command[0])
break
case '编辑':
this.openAddMSGModal(2, command[0])
break
case '删除':
this.batchMSGDel(2, command[0])
break
}
},
// 批量删除
batchMSGDel (type, row) {
console.log(row);
if (type === 2) {
this.$confirm('是否删除此数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.submitLoading = true
this.$http.post('lawss/sarBussRecordsCode/deleteSarBussRecordsCodeEO', {
ids: row.id
}, {
_this: this
}, res => {
if (res.ok) {
this.getList()
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
} else if (type === 1) {
if (this.idList === '') {
this.$message.warning('请选择要删除的数据')
} else {
this.$confirm('是否删除已选择数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.submitLoading = true
this.$http.post('lawss/sarBussRecordsCode/deleteSarBussRecordsCodeEO', {
ids: this.idList
}, {
_this: this
}, res => {
if (res.ok) {
this.getList()
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
}
}
},
// 重置
resetSearch () {
this.search.msgTitle = ''
this.getList()
},
// 查询数据
getList () {
this.$http.get('lawss/sarBussRecordsCode/page', {
page: this.pageNo,
pageSize: this.$store.getters.userInfo.configContent
}, {
_this: this
}, res => {
if (res.ok) {
this.submitLoading = false
this.msgList = res.data.list
this.total = res.data.count
}
})
},
// 新增消息
openAddMSGModal (type, row) {
if (type === 1) {
this.drawerType = type
this.drawerTitle = '新增信息'
this.addOrEdit = 1
} else if (type === 2) {
this.drawerType = type
this.id = row.id
this.drawerTitle = '编辑信息'
this.addOrEdit = 2
this.infoForm = {...row}
} else if (type === 3) {
// 查看
// 如果为自定义类型,可再当前结构树中手动维护,添加删除编辑等,
// 如果为基础体系库则是查看基础库中的数据。不可编辑删除操作。
console.log(row)
this.$store.commit('setDetailMap', this.$route.path)
this.$router.push({
name: 'managementTree',
query: {
qbDataType: row.qbDataType,
qbBaseId: row.id
}
})
}
this.drawer = true
},
basicTree(){
this.$store.commit('setDetailMap', this.$route.path)
this.$router.push({
name: 'managementTree',
query: {
qbDataType: '3'
}
})
},
pageChange (page) {
this.pageNo = page
this.getList()
},
pageSizeChange (pageSize) {
this.pageSize = pageSize
this.getList()
}
},
mounted () {
this.getList()
}
}
</script>
<style lang="less">
.dynamicInformations{
height: 100%;
display: flex;
flex-direction: column;
/deep/.is-disabled {
.el-input__inner {
color: #333;
}
.el-textarea__inner {
color: #333;
}
}
.fileClass {
cursor: pointer;
}
.fileClass:hover {
color: #0c91e5;
}
.container{
height: calc(~'100% - 61px');
/*flex: auto;*/
display: flex;
flex-direction: column;
}
.pagination {
position: static;
width: 100% !important;
}
}
</style>
@@ -0,0 +1,700 @@
<template>
<div class="managementTree">
<div class="back" title="返回" @click="back">
<i class="el-icon-back"></i>
</div>
<span>
<!-- <el-button v-if="thirdTree"-->
<!-- class="common-button-primary add-button"-->
<!-- type="primary"-->
<!-- round-->
<!-- @click="clickAddTree"><i class="iconfont">&#xe84e;</i>新增</el-button>-->
</span>
<div class="tree">
<laws-tree :zNodes="zNodes"
ref="domesticTree"
:loading="firstLoading"
treeDivId="domesticTree"
showRMenu
deptSelect
autoSelect
drag-bind=".drag-table"
drag-dom="drag-row"
:hideRMenuNode="['gxhbq', 'wdsc']"
@treeAdd="(treeId, treeNode) => clickDropMenu('newMenu', treeNode)"
@treeEdit="(treeId, treeNode) => clickDropMenu('editMenu', treeNode)"
@treeRemove="(treeId, treeNode) => clickDropMenu('deleteMenu', treeNode)"
@treeClick="(treeId, treeNode) => treeClick(treeNode)"
@treeRightClick="(treeId, treeNode) => treeRightClick(treeNode)"
v-if="firstTree"
></laws-tree>
<!-- add-id="Q8SLTYESAL"-->
<!-- edit-id="94V5KRZUJF"-->
<!-- remove-id="5F7U4B2Q24"-->
<!-- @drag="drag"-->
<!-- 基础体系库 -->
<laws-tree
v-if="secondTree"
:zNodes="zNodes"
treeDivId="SVPPSID"
@treeOnCheck="handleOnCheck"
:editable="false"
:checkIdList="checkIdList"
:chkboxType="{ 'Y': '', 'N': '' }"
ref="SVPPSID"
:loading="svppsLoading"
class="ztree" style="height: 100%;overflow: auto"
/>
<!-- 按钮基础体系库 前三级-->
<!-- :editable="operationAuthority"-->
<laws-tree
v-if="thirdTree"
:zNodes="zNodes"
treeDivId="svppsTree"
:checkIdList="checkIdList"
:chkboxType="{ 'Y': '', 'N': '' }"
ref="svppsTree"
:loading="threeLoading"
showRMenu
drag-bind=".drag-table"
drag-dom="drag-row"
@treeClick="(treeId, treeNode) => treeClickThree(treeNode)"
@treeRightClick="(treeId, treeNode) => treeRightClickThree(treeNode)"
@treeAdd="(treeId, treeNode) => clickDropMenuThree('newMenu', treeNode)"
@treeEdit="(treeId, treeNode) => clickDropMenuThree('editMenu', treeNode)"
@treeRemove="(treeId, treeNode) => clickDropMenuThree('deleteMenu', treeNode)"
/>
</div>
<!-- 表格树---新增二级菜单模态窗 -->
<el-dialog
:visible.sync="menuModalFlag"
width="500px"
:title="menuModalTitle"
destroy-on-close
:close-on-click-modal="false"
>
<el-form ref="addMenuForm" :model="sarMenu" :rules="sarMenuRules" class="label-input-form" label-width="130px">
<el-formItem label="编码" prop="number" class="add-form-item">
<el-input v-model="sarMenu.number" placeholder="请输入编码" maxlength="3"></el-input>
</el-formItem>
<el-formItem label="中文名称" prop="name" class="add-form-item">
<el-input v-model="sarMenu.name" placeholder="请输入中文名称"></el-input>
</el-formItem>
<el-formItem label="英文名称" prop="ename" class="add-form-item">
<el-input v-model="sarMenu.ename" placeholder="请输入英文名称"></el-input>
</el-formItem>
<el-formItem label="排序序号" prop="seqNum" class="add-form-item">
<el-input v-model="sarMenu.seqNum" placeholder="请输入排序序号"></el-input>
</el-formItem>
</el-form>
<div slot="footer" class="demo-drawer-footer">
<el-button type="primary" round class="common-button-primary" icon="el-icon-check" :loading="isSubmit" @click="newMenu">提交</el-button>
<el-button round class="common-button-default" icon="el-icon-close" @click="resetTreeDialog">取消</el-button>
</div>
</el-dialog>
<!-- 体系基础树-新增 -->
<el-dialog
:visible.sync="modalFlag"
width="500px"
:title="modalTitle"
destroy-on-close
>
<el-form ref="addMenu" :model="addMenu" :rules="addMenuRules" class="label-input-form" label-width="130px">
<el-formItem label="编码" prop="selfCode" class="add-form-item">
<el-input v-model="addMenu.selfCode" placeholder="请输入编码" maxlength="3"></el-input>
</el-formItem>
<el-formItem label="中文名称" prop="selfName" class="add-form-item">
<el-input v-model="addMenu.selfName" placeholder="请输入中文名称"></el-input>
</el-formItem>
<el-formItem label="英文名称" prop="selfEname" class="add-form-item">
<el-input v-model="addMenu.selfEname" placeholder="请输入英文名称"></el-input>
</el-formItem>
<el-formItem label="排序序号" prop="selfSort" class="add-form-item">
<el-input v-model="addMenu.selfSort" placeholder="请输入排序序号"></el-input>
</el-formItem>
</el-form>
<div slot="footer" class="demo-drawer-footer">
<el-button type="primary" round class="common-button-primary" icon="el-icon-check" :loading="isSubmit" @click="submit">提交</el-button>
<el-button round class="common-button-default" icon="el-icon-close" @click="cancel">取消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'managementTree',
components: {
},
props: {
},
data () {
return {
treeCheckNode: [],
checkIdList: [],
dataList:[],
dataListThree:[],
zNodes:[],
selectSarMenu: {}, // 用来记录当前选中的二级菜单对象
selectTree: {}, // 用来记录当前选中的二级菜单对象
menuModalTitle: '',
modalTitle: '',
firstLoading: false,
svppsLoading: false,
threeLoading: false,
menuModalFlag: false,
operationAuthority: false,
modalFlag: false,
firstTree: false,
secondTree: false,
thirdTree: false,
menuAddOrUpdateFlag: 1, // 新增:1, 修改:2
threeFlag: 1, // 三级树-新增:1, 修改:2
deleteMenuModal: false,
sarMenuRules: {
number: [
{required: true, message: '编码不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validateCode, trigger: 'blur'}
],
name: [
{required: true, message: '中文名称不能为空', trigger: 'blur'},
{type: 'string', max: 100, message: '中文名称不能超过100个字符', trigger: 'change'}
]
// seqNum: [
// {type: 'string', max: 100, message: '排序序号不能超过100个字符', trigger: 'change'}
// ]
},
addMenuRules:{
selfCode: [
{required: true, message: '编码不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validateCode, trigger: 'blur'}
],
selfName: [
{required: true, message: '中文名称不能为空', trigger: 'blur'},
{type: 'string', max: 100, message: '中文名称不能超过100个字符', trigger: 'change'}
],
selfEname: [
{required: true, message: '英文名称不能为空', trigger: 'blur'},
{type: 'string', max: 1000, message: '英文名称不能超过1000个字符', trigger: 'change'}
],
},
sarMenu: {
pid: '',
name: '',
ename: '',
number: '',
seqNum: '',
rootNum: '',
}, // 二级菜单对象,主要用于新增和修改
addMenu: {
pid: '',
selfCode: '',
selfName: '',
selfEname: '',
selfSort: ''
}, // 二级菜单对象,主要用于新增和修改
baseDataId:'',
// 提交状态
isSubmit: false,
}
},
methods: {
// 选择SVPPS事件
handleOnCheck (treeCheckNode) {
this.treeCheckNode = treeCheckNode
},
// 返回
back () {
if (this.$store.state.detailMap !== '') {
this.$router.push(this.$store.state.detailMap)
this.$store.commit('setDetailMap', '')
} else {
let lastPathList = this.$store.getters.getLastDetailMap
let lastPath = lastPathList[lastPathList.length - 1]
this.$router.push(lastPath)
lastPathList.pop(1)
this.$store.commit('setLastDetailMap', JSON.stringify(lastPathList))
}
},
// 自定义-树
selectMenu () {
this.firstLoading = true
//查询根节点
this.$http.get('/sys/bussClassCode/getList', {rootNum:this.baseDataId}, {
_this: this
}, res => {
this.firstLoading = false
if (res.ok) {
let treeNode = []
this.dataList = res.data
res.data.map((item, index) => {
let treeItem = {
name: item.number + ' ' + item.name,
pId: item.pid,
id: item.id,
number: item.number,
rootNum: item.rootNum,
rank: item.rank
}
treeNode[index] = treeItem
})
this.zNodes = treeNode
}
})
},
// 基础体系库-树
getSvpps () {
this.svppsLoading = true
this.$http.get('/lawss/otSvpps/selectTreeThree', {}, {
_this: this
}, res => {
this.svppsLoading = false
if (res.ok) {
let treeNode = []
res.data.map((item, index) => {
let treeItem = {
name: item.svppsCode + ' ' + item.svppsCnName + ' ' + item.svppsEnName,
pId: item.pid,
id: item.id,
svppsCode: item.svppsCode,
snum: item.snum,
fnum: item.fnum,
tnum: item.tnum
}
treeNode[index] = treeItem
})
this.zNodes = treeNode
}
})
},
getThreeSvpps () {
this.threeLoading = true
this.$http.get('/lawss/otSvpps/selectTreeThree', {}, {
_this: this
}, res => {
this.threeLoading = false
if (res.ok) {
let treeNode = []
this.dataListThree = res.data
res.data.map((item, index) => {
let treeItem = {
name: item.svppsCode + ' ' + item.svppsCnName + ' ' + item.svppsEnName,
pId: item.pid,
id: item.id,
svppsCode: item.svppsCode,
snum: item.snum,
fnum: item.fnum,
tnum: item.tnum,
selfFlag: item.selfFlag
}
treeNode[index] = treeItem
})
this.zNodes = treeNode
}
})
},
treeClick (treeNode) {
this.selectSarMenu = treeNode // 记录当前选中的二级菜单
},
treeRightClick (treeNode) {
this.selectSarMenu = treeNode // 记录当前选中的二级菜单
},
treeClickThree (treeNode) {
this.selectTree = treeNode // 记录当前选中的二级菜单
console.log('选择的树', this.selectTree)
},
treeRightClickThree (treeNode) {
this.selectTree = treeNode // 记录当前选中的二级菜单
if (treeNode.selfFlag === '2'){
this.operationAuthority = true
console.log('ok');
} else {
this.operationAuthority = false
}
console.log('右击选择的树', this.selectTree)
},
// 二级菜单新建,编辑,删除
clickDropMenu (name, treeNode) {
this.selectSarMenu = JSON.parse(JSON.stringify(treeNode))
console.log('点击',this.selectSarMenu);
if (undefined !== this.selectSarMenu.id) { // 当前有选中节点
if (name === 'newMenu') {
this.menuModalTitle = '新增目录'
this.menuModalFlag = true
this.menuAddOrUpdateFlag = 1
this.sarMenu = {
pid: '',
name: '',
ename: '',
number: '',
seqNum: '',
rootNum:this.baseDataId
}
} else if (name === 'editMenu') {
console.log('treeNode',treeNode);
this.menuModalTitle = '编辑目录'
this.menuModalFlag = true
this.menuAddOrUpdateFlag = 2
this.sarMenu.id = treeNode.id
let selectNode = []
this.dataList.map((item, index) => {
if (this.sarMenu.id === item.id) {
selectNode.push(item)
this.sarMenu.pid = selectNode[0].pid
this.sarMenu.name = selectNode[0].name
this.sarMenu.ename = selectNode[0].ename
this.sarMenu.number = selectNode[0].number
this.sarMenu.seqNum = selectNode[0].seqNum
this.sarMenu.rootNum = selectNode[0].rootNum
}
})
} else {
if (this.selectSarMenu.pId == null) { // 如果父id为null 说明是根目录
this.$message({
title: '提示',
content: '根目录不可删除!'
})
} else {
// deleteMenu 删除二级菜单,先判断是否选中,选中项目,然后调用删除方法
// 先判断目录下是否有菜单
this.$http.post('sys/bussClassCode/judgequeryMenuByPid', {id:this.selectSarMenu.id}, {
_this: this, loading: 'loading'
}, res => {
if (res.data) {
// this.deleteMenuModal = true
this.$confirm('该节点下有记录,确定删除?', '提示', {
confirmButtonText: '确定',
confirmButtonClass: 'common-button-primary',
cancelButtonText: '取消',
type: 'warning',
roundButton: true
}).then(() => {
this.$http.post('sys/bussClassCode/deleteBussClassCode', this.selectSarMenu, {
_this: this, loading: 'loading'
}, res => {
this.selectMenu() // 删除成功后,更新二级菜单
// 获取下一个节点
let currentNode = this.$refs.domesticTree.getNextNode()
let nodeId = ''
// 如果这个节点为null, 本次删除了最后一个节点
if (currentNode === null) {
// 选中根节点
this.$refs.domesticTree.selectRootNode()
} else {
nodeId = currentNode.id
}
// this.getDomesticStandardTable(nodeId)
}, e => {
})
}).catch(() => {
// 取消删除,清空选择
// this.$refs.selections.clearSelection()
})
} else {
this.sureDeleteSarMenu()
}
}, e => {
})
}
}
} else {
this.$Modal.info({
title: '提示',
content: '请选择节点!'
})
}
},
// 体系基础数据库 -树新增
clickAddTree(){
this.modalTitle = '新增目录'
this.modalFlag = true
// this.menuAddOrUpdateFlag = 1
this.addMenu = {
selfCode: '',
selfName: '',
selfEname: '',
selfSort: ''
}
},
// 体系基础数据库-新建,编辑,删除
clickDropMenuThree (name, treeNode) {
this.selectSarMenu = JSON.parse(JSON.stringify(treeNode))
console.log('点击',this.selectSarMenu);
if (undefined !== this.selectSarMenu.id) { // 当前有选中节点
if (name === 'newMenu') {
this.modalTitle = '新增目录'
this.modalFlag = true
this.threeFlag = 1
this.addMenu = {
// pid: '',
selfCode: '',
selfName: '',
selfEname: '',
selfSort: ''
}
} else if (name === 'editMenu') {
console.log('treeNode',treeNode);
this.modalTitle = '编辑目录'
this.modalFlag = true
this.threeFlag = 2
this.addMenu.id = treeNode.id
let selectNode = []
this.dataListThree.map((item, index) => {
if (this.addMenu.id === item.id) {
selectNode.push(item)
console.log('编辑的selectNode', selectNode)
this.addMenu.pid = selectNode[0].pid
this.addMenu.selfCode = selectNode[0].svppsCode
this.addMenu.selfName = selectNode[0].svppsCnName
this.addMenu.selfEname = selectNode[0].svppsEnName
this.addMenu.selfSort = selectNode[0].selfSort
}
})
} else {
if (this.selectSarMenu.pId == null) { // 如果父id为null 说明是根目录
this.$message({
title: '提示',
content: '根目录不可删除!'
})
} else {
// deleteMenu 删除二级菜单,先判断是否选中,选中项目,然后调用删除方法
// 先判断目录下是否有菜单
this.$http.post('sys/bussClassCode/judgequeryMenuByPid', {id:this.selectSarMenu.id}, {
_this: this, loading: 'loading'
}, res => {
if (res.data) {
// this.deleteMenuModal = true
this.$confirm('该节点下有记录,确定删除?', '提示', {
confirmButtonText: '确定',
confirmButtonClass: 'common-button-primary',
cancelButtonText: '取消',
type: 'warning',
roundButton: true
}).then(() => {
this.$http.post('lawss/otSvppsSelfdata/deleteById', {id: this.selectSarMenu.id}, {
_this: this, loading: 'loading'
}, res => {
this.getThreeSvpps() // 删除成功后,更新二级菜单
this.$message({
type: 'success',
message: '删除成功!'
})
// 获取下一个节点
let currentNode = this.$refs.svppsTree.getNextNode()
let nodeId = ''
// 如果这个节点为null, 本次删除了最后一个节点
if (currentNode === null) {
// 选中根节点
this.$refs.svppsTree.selectRootNode()
} else {
nodeId = currentNode.id
}
}, e => {
})
}).catch(() => {
// 取消删除,清空选择
// this.$refs.selections.clearSelection()
})
} else {
this.sureDeleteSarMenuThree()
}
}, e => {
})
}
}
} else {
this.$Modal.info({
title: '提示',
content: '请选择节点!'
})
}
},
// 树-删除
sureDeleteSarMenu () {
this.$confirm('是否删除?', '提示', {
confirmButtonText: '确定',
confirmButtonClass: 'common-button-primary',
cancelButtonText: '取消',
roundButton: true,
type: 'warning'
}).then(() => {
this.$http.post('sys/bussClassCode/deleteBussClassCode', this.selectSarMenu, {
_this: this, loading: 'loading'
}, res => {
this.selectMenu() // 删除成功后,更新二级菜单
// 获取下一个节点
let currentNode = this.$refs.domesticTree.getNextNode()
let nodeId = ''
// 如果这个节点为null, 本次删除了最后一个节点
if (currentNode === null) {
// 选中根节点
this.$refs.domesticTree.selectRootNode()
} else {
nodeId = currentNode.id
}
// this.getDomesticStandardTable(nodeId)
}, e => {
})
}).catch(() => {
// 取消删除,清空选择
// this.$refs.selections.clearSelection()
})
},
// 三级树-删除
sureDeleteSarMenuThree () {
this.$confirm('是否删除?', '提示', {
confirmButtonText: '确定',
confirmButtonClass: 'common-button-primary',
cancelButtonText: '取消',
roundButton: true,
type: 'warning'
}).then(() => {
this.$http.post('lawss/otSvppsSelfdata/deleteById', {id: this.selectSarMenu.id}, {
_this: this, loading: 'loading'
}, res => {
this.getThreeSvpps() // 删除成功后,更新二级菜单
this.$message({
type: 'success',
message: '删除成功!'
})
// 获取下一个节点
let currentNode = this.$refs.svppsTree.getNextNode()
let nodeId = ''
// 如果这个节点为null, 本次删除了最后一个节点
if (currentNode === null) {
// 选中根节点
this.$refs.svppsTree.selectRootNode()
} else {
nodeId = currentNode.id
}
}, e => {
})
}).catch(() => {
// 取消删除,清空选择
// this.$refs.selections.clearSelection()
})
},
// 点击二级菜单新增模态框中的保存
newMenu () {
this.$refs['addMenuForm'].validate((valid) => {
if (valid) {
if (this.menuAddOrUpdateFlag === 1) {
this.sarMenu.pid = this.selectSarMenu.id
console.log(this.selectSarMenu.id)
// if (this.selectSarMenu.parentIds != null) {
// this.sarMenu.parentIds = this.selectSarMenu.parentIds + ',' + this.selectSarMenu.id
// } else {
// this.sarMenu.parentIds = this.selectSarMenu.id
// }
this.$http.postData('sys/bussClassCode/addBussClassCode', this.sarMenu, {
_this: this, loading: 'isSubmit'
}, res => {
this.selectMenu() // 新增成功后,更新二级菜单
this.menuModalFlag = false
}, e => {
})
} else {
this.$http.putData('sys/bussClassCode/updateBussClassCode', this.sarMenu, {
_this: this, loading: 'isSubmit'
}, res => {
this.selectMenu() // 修改成功后,更新二级菜单
this.selectSarMenu = res.data
this.menuModalFlag = false
}, e => {
})
}
} else {
this.$message.warning('请检查表单是否填写正确')
}
})
},
// 按钮树-点击保存
submit () {
this.$refs['addMenu'].validate((valid) => {
if (valid) {
if (this.threeFlag === 1) {
this.addMenu.pid = this.selectSarMenu.id
this.addMenu.rootNum = this.baseDataId
this.$http.postData('lawss/otSvppsSelfdata/addOtSvppsSelfdata', this.addMenu, {
_this: this, loading: 'isSubmit'
}, res => {
this.getThreeSvpps() // 新增成功后,更新二级菜单
this.modalFlag = false
}, e => {
})
} else {
this.$http.putData('lawss/otSvppsSelfdata/updateById', this.addMenu, {
_this: this, loading: 'isSubmit'
}, res => {
this.getThreeSvpps() // 修改成功后,更新二级菜单
this.selectSarMenu = res.data
this.modalFlag = false
}, e => {
})
}
} else {
this.$message.warning('请检查表单是否填写正确')
}
})
},
cancel(){
this.modalFlag = false
this.$refs['addMenu'].resetFields()
},
resetTreeDialog () {
this.menuModalFlag = false
this.$refs['addMenuForm'].resetFields()
},
},
watch: {
operationAuthority(newValue) {
console.log('newValue',newValue)
// this.operationAuthority = newValue
this.$nextTick(() => {
this.operationAuthority = newValue
console.log('this.operationAuthority',this.operationAuthority)
this.$forceUpdate()
})
}
},
computed: {
},
mounted () {
console.log('this.$route.params.qbDataType',this.$route.query.qbDataType)
console.log('this.$route.params.qbBaseId',this.$route.query.qbBaseId)
this.baseDataId =this.$route.query.qbBaseId
switch (this.$route.query.qbDataType) {
case '1':
// 自定义
this.selectMenu()
this.firstTree = true
break
case '2':
// 基础体系库
this.secondTree = true
this.getSvpps()
break
case '3':
// 体系基础数据库
this.thirdTree = true
this.getThreeSvpps()
break
}
// document.addEventListener('mousedown',function(e){
// if(e.button === 2){
// console.log('你按下了鼠标右键!')
// this.clickAddTree('newMenu')
// }
// e.preventDefault();
// })
}
}
</script>
<style scoped lang="less">
.managementTree{
height: 100%;
}
</style>
File diff suppressed because it is too large Load Diff
+489
View File
@@ -0,0 +1,489 @@
<!-- 权限菜单管理 -->
<template>
<div id="permission-menu-manage">
<div class="permission-menu-manage-left">
<laws-tree
ref="permissionManage"
treeDivId="permissionManage"
:zNodes="zNodes"
autoSelect
deptSelect
showRMenu
@treeClick="(treeId, treeNode) => handleClick(treeId, treeNode)"
@treeAdd="(treeId, treeNode) => handleAdd(treeId, treeNode)"
@treeEdit="(treeId, treeNode) => handleEdit(treeId, treeNode)"
@treeRightClick="(treeId, treeNode) => treeRightClick(treeId, treeNode)"
@treeRemove="(treeId, treeNode) => handleRemove(treeId, treeNode)"
></laws-tree>
</div>
<div class="permission-menu-manage-right" v-if="showSarMenuInfoFlag">
<div class="permission-content">
<el-form ref="sarMenuForm" :model="sarMenuEO" :rules="sarMenuRules" class="label-input-form">
<el-row>
<el-col :span="6">
<span style="color: #fff">1</span>
</el-col>
<el-col :span="18">
<el-form-item label="ID" prop="id" label-width="130px" class="standards-info-item">
<el-input v-model="sarMenuEO.id" :disabled="formdisableflag" class="permission-input"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<span style="color: #fff">1</span>
</el-col>
<el-col :span="18">
<el-form-item label="名称" prop="name" label-width="130px" class="standards-info-item">
<el-input v-model="sarMenuEO.name" class="permission-input"></el-input>
</el-form-item>
</el-col>
</el-row>
<Row>
<el-col :span="6">
<span style="color: #fff">1</span>
</el-col>
<el-col :span="18">
<el-form-item label="父节点ID" prop="pId" label-width="130px" class="standards-info-item">
<el-input v-model="sarMenuEO.pId" :disabled="formdisableflag" class="permission-input"></el-input>
</el-form-item>
</el-col>
</Row>
<Row>
<el-col :span="6">
<span style="color: #fff">1</span>
</el-col>
<el-col :span="18">
<el-form-item label="前台页面地址" prop="href" label-width="130px" class="standards-info-item">
<el-input v-model="sarMenuEO.href" class="permission-input"></el-input>
</el-form-item>
</el-col>
</Row>
<Row>
<el-col :span="6">
<span style="color: #fff">1</span>
</el-col>
<el-col :span="18">
<el-form-item label="排序号" prop="isShow" label-width="130px" class="standards-info-item">
<el-input v-model="sarMenuEO.isShow" maxlength="2" class="permission-input"></el-input>
</el-form-item>
</el-col>
</Row>
<Row>
<el-col :span="6">
<span style="color: #fff">1</span>
</el-col>
<el-col :span="18">
<el-form-item label="后台接口权限" prop="permission" label-width="130px" class="standards-info-item">
<el-input v-model="sarMenuEO.permission" class="permission-input"></el-input>
</el-form-item>
</el-col>
</Row>
</el-form>
</div>
<div class="permission-btn" v-if="submitBtnFlag">
<el-button type="primary" :loading="isSubmit" @click="saveMenuInfo">提交</el-button>
</div>
</div>
</div>
</template>
<script>
import 'zTree/js/jquery.ztree.core.js'
import 'zTree/js/jquery.ztree.excheck.js'
import 'zTree/js/jquery.ztree.exedit.js'
export default {
name: 'permission-menu-manage',
data () {
return {
formdisableflag: true,
zNodes: [],
sarMenuEO: {
id: '',
name: '',
pId: '',
href: '',
isShow: '',
permission: '',
parentId: ''
},
sarMenuRules: {
name: [
{ required: true, message: '不能为空', trigger: 'blur' }
]
// isShow: [
// { type: 'string', required: true, message: '不能为空', trigger: 'blur' }
// ]
},
isSubmit: false,
showSarMenuInfoFlag: false,
submitBtnFlag: false,
saveClickNodeInfo: '',
clickType: '' // 1为新增,2为修改
}
},
methods: {
getTree () {
return new Promise((resolve, reject) => {
this.$http.get('sys/menu/listAllMenu', {}, {
_this: this
}, res => {
if (res.ok) {
let zNodes = []
for (let i = 0; i < res.data.length; i++) {
let zObj = {}
zObj.id = res.data[i].id
zObj.pId = res.data[i].parentId
zObj.name = res.data[i].name
zObj.href = res.data[i].href
zObj.isShow = res.data[i].isShow
zObj.permission = res.data[i].permission
zObj.remarks = res.data[i].remarks
zNodes[i] = zObj
if (res.data[i].parentIds !== null) {}
}
this.zNodes = zNodes
}
resolve()
}, e => {
reject(e)
})
})
},
/**
* @description: 树节点点击
* @author: chenxiaoxi
* @date: 2018-09-25 16:13:25
*/
handleClick (treeId, treeNode) {
this.submitBtnFlag = false
this.showSarMenuInfoFlag = true
this.sarMenuEO = treeNode
if (treeNode.href == null || treeNode.href === '' || treeNode.href === 'null') {
this.sarMenuEO.href = ''
}
if (treeNode.permission == null || treeNode.permission === '' || treeNode.permission === 'null') {
this.sarMenuEO.permission = ''
}
},
/**
* @description: 树节点添加
* @author: chenxiaoxi
* @date: 2018/12/26 15:39:22
*/
handleAdd (treeId, treeNode) {
this.resetForm()
this.submitBtnFlag = true
this.clickType = '1'
this.showSarMenuInfoFlag = true
this.sarMenuEO.pId = treeNode.id
},
/**
* @description: 树节点删除
* @author: chenxiaoxi
* @date: 2018-09-25 14:05:25
*/
handleRemove (treeId, treeNode) {
if (treeNode.pId == null || treeNode.pId === '') {
this.$Message.error('不能删除根级节点')
} else {
this.$http.get('sys/menu/judgeContentChild', {
id: treeNode.id
}, {
_this: this
}, res => {
if (res.data != null && res.data.length > 0) {
this.$message.error('该节点包含子节点,不能删除')
} else {
this.sureDeleteMenu(treeNode)
}
}, e => {})
}
},
sureDeleteMenu (treeNode) {
this.$confirm('确认删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
if (treeNode.id != null && treeNode.id !== '') {
this.$http.put('sys/menu/deleteMenuById', {
id: treeNode.id
}, {
_this: this
}, res => {
if (res.data != null) {
this.getTree()
this.showSarMenuInfoFlag = false
this.resetForm()
}
}, e => {
})
} else {
this.$message.warning('没有获取到所选节点id')
}
})
},
/**
* @description: 节点编辑
* @author: chenxiaoxi
* @date: 2018/12/26 15:29:46
*/
handleEdit (treeId, treeNode) {
this.submitBtnFlag = true
this.clickType = '2'
this.showSarMenuInfoFlag = true
this.saveClickNodeInfo = treeNode
this.sarMenuEO = treeNode
if (treeNode.href == null || treeNode.href === '' || treeNode.href === 'null') {
this.sarMenuEO.href = ''
}
if (treeNode.permission == null || treeNode.permission === '' || treeNode.permission === 'null') {
this.sarMenuEO.permission = ''
}
},
treeRightClick (treeId, treeNode) {
},
resetForm () {
this.sarMenuEO.id = ''
this.sarMenuEO.pId = ''
this.sarMenuEO.name = ''
this.sarMenuEO.href = ''
this.sarMenuEO.isShow = ''
this.sarMenuEO.permission = ''
},
saveMenuInfo () {
if (this.sarMenuEO.isShow != null && this.sarMenuEO.isShow !== '') {
this.isSubmit = true
this.$refs['sarMenuForm'].validate((valid) => {
if (valid) {
this.sarMenuEO.parentId = this.sarMenuEO.pId
let menuEO = JSON.parse(JSON.stringify(this.sarMenuEO))
if (this.clickType === '1') {
this.$http.post('sys/menu/addMenu', menuEO, {
_this: this,
loading: 'isSubmit'
}, res => {
if (res.ok) {
this.isSubmit = false
this.submitBtnFlag = false
this.getTree()
}
}, e => {
this.isSubmit = false
})
} else {
this.$http.put('sys/menu/updateMenu', this.sarMenuEO, {
_this: this,
loading: 'isSubmit'
}, res => {
this.isSubmit = false
this.submitBtnFlag = false
this.getTree()
}, e => {
this.isSubmit = false
})
}
} else {
this.isSubmit = false
this.$message.error('请检查表单是否填写正确!')
}
})
} else {
this.$message.warning('排序号不能为空!')
}
}
},
props: {
sideClose: {
type: Boolean
}
},
computed: {},
watch: {},
mounted () {
this.getTree()
}
}
</script>
<style lang="less">
//@import '~styles/mixins';
#permission-menu-manage{
display: flex;
//.flex();
background: #FFF;
.permission-menu-manage-left{
width: 240px;
height: 100%;
border-right: 1px solid #DDD;
position: relative;
overflow-x: auto;
padding: 5px;
.node_name{
display: inline-block;
max-width: 200px;
//.ellipsis();
}
}
.permission-menu-manage-right{
width: calc(~'100% - 240px');
display: inline-block;
height: 100%;
padding: 10px;
position: relative;
.content{
height: calc(~'100% - 150px');
background: #CCC;
.hasNoData{
background: #FFF;
width: 100%;
height: 100%;
.no-data-icon{
width: 150px;
}
}
}
.ivu-table-overflowX{
overflow-x: auto;
}
.pagination{
.ivu-divider{
margin-bottom: 0;
}
}
.syncInfo{
padding-bottom: 0.2rem;
//.flex();
flex: 1;
align-items: center;
}
.permission-content{
padding-top: 30px;
.permission-input{
width: 300px;
}
}
.permission-btn{
text-align: center;
}
}
.ivu-tree-children{
.ivu-tree-arrow{
margin-right: 5px;
}
}
.content .btn-group{
margin-bottom: 0.5rem;
}
.permission-menu-manage-right-search{
.ivu-form-item-label{
padding: 0;
}
.ivu-form-item-content{
width: calc(~'100% - 60px');
.ivu-select{
width: 100%;
}
}
.ivu-form-item{
margin: 0;
}
.ivu-btn{
position: relative;
top: 1px;
}
}
.ivu-divider-horizontal{
margin: 8px 0;
}
.ivu-table-body{
overflow-x: auto;
}
.ivu-table-tip{
width: 100%;
height: calc(~'100% - 41px');
table{
display: block;
tbody,tr,td{
display: block;
width: 100% !important;
height: 100%;
}
td{
//.flex();
justify-content: center;
align-items: center;
}
}
}
.hasNoData{
background: #FFF;
.no-data-icon{
width: 85px;
}
}
.ivu-table-fixed,
.ivu-table-fixed-right{
height: 100%;
.ivu-table-fixed-body{
height: calc(~'100% - 41px');
}
}
.ivu-select-item{
max-width: 200px;
//.ellipsis();
}
.demo-drawer-footer{
width: 100%;
position: absolute;
bottom: 0;
left: 0;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
background: #fff;
}
.btn-show{
display: inline-block !important;
}
.btn-hide{
display: none !important;
}
.ivu-tag{
cursor: default;
}
}
.role-setting-form{
.ivu-modal-body{
overflow-y: inherit;
}
}
.demo-drawer-profile{
font-size: 14px;
}
.demo-drawer-profile .ivu-col{
margin-bottom: 12px;
}
.user-info-text{
color: #A59D9D;
}
.mechanism-tree-modal{
.ivu-modal{
width: 350px !important;
.form-content{
width: 300px;
margin: 0 auto;
.ivu-form-item{
//.flex();
.ivu-form-item-content{
flex: 1;
}
}
}
}
}
</style>
@@ -0,0 +1,147 @@
<!-- 权限管理 -->
<template>
<div class="permission-menu-manage v-class">
<el-table
:data="tableData"
style="width: 100%"
border
tooltip-effect="dark"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}">
<el-table-column
label="序号"
width="55"
type="index"
align="center">
</el-table-column>
<el-table-column
label="公司名称"
align="center"
prop="orgName">
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
v-if="scope.row.flag === 0"
@click="givePower(scope.$index, scope.row)">指派权限</el-button>
<el-button
size="mini"
type="danger"
v-if="scope.row.flag === 1"
@click="resetPower(scope.$index, scope.row)">取消权限</el-button>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
export default {
name: 'PermissionMenuManage',
data () {
return {
tableData: [],
data: [],
loading: false,
// 传给后台的id
id: ''
// 判断显示取消指派还是指派
}
},
methods: {
// 查询当前所有子公司
getCompanyList () {
this.$http.get('/sys/org/getOrgRootTree', {}, {
_this: this,
loading: 'loading'
}, res => {
const tableData = res.data
tableData.map((item) => {
if (this.data.length > 0) {
this.data.map((obj) => {
if (item.id === obj.orgId) {
item.flag = 1
} else {
item.flag = 0
}
})
} else {
item.flag = 0
}
})
this.tableData = tableData
})
},
// 获取已经获得权限的子公司id
getAlreadyHasPersmssionCompany () {
this.$http.get('lawss/orgMenu/getqueryOage', {}, {
_this: this,
loading: 'loading'
}, res => {
this.data = res.data
this.getCompanyList()
})
},
// 指派权限
givePower (index, row) {
const data = {}
data.orgRootId = this.id
data.orgId = row.id
this.$http.get('lawss/orgMenu/getOrgRoot', data, {
_this: this,
loading: 'loading'
}, res => {
if (res.ok) {
this.$message({
message: '指派成功!',
type: 'success'
})
// 查询已被指派的公司
this.getAlreadyHasPersmssionCompany()
} else {
this.$message.error(res.message)
}
})
},
resetPower (index, row) {
const data = {}
data.orgRootId = this.id
data.orgId = row.id
this.$http.get('lawss/orgMenu/upOrgRootId', data, {
_this: this,
loading: 'loading'
}, res => {
if (res.ok) {
this.$message({
message: '取消指派成功!',
type: 'success'
})
// 查询已被指派的公司
this.getAlreadyHasPersmssionCompany()
// 查看所有子公司
// this.getCompanyList()
} else {
this.$message.error(res.message)
}
})
}
},
mounted () {
// 查询当前公司是否有权限查看页面
this.$http.get('lawss/orgMenu/getOrgParentid', {}, {
_this: this,
loading: 'loading'
}, res => {
this.id = res
// 查询已被指派的公司
this.getAlreadyHasPersmssionCompany()
})
}
}
</script>
<style lang="less" scoped>
.permission-menu-manage{
height: 100%;
padding: 15px;
}
</style>
@@ -0,0 +1,125 @@
<template>
<el-dialog
:visible="visible"
:title="title"
@close="closeDialog"
width="400px"
>
<div>
<el-form
ref="form"
:model="formData"
:rules="formRules"
class="label-input-form"
label-width="100px"
inline
>
<el-form-item label="流程类型" prop="category" class="add-form-item">
<el-select v-model="formData.category" placeholder="请选择流程类型" clearable>
<el-option v-for="opt in typeList" :value="opt.value" :key="opt.value" :label="opt.label">{{ opt.label}}</el-option>
</el-select>
</el-form-item>
</el-form>
</div>
<div slot="footer">
<el-button round class="common-button-default" icon="el-icon-close" @click="closeDialog">{{$t('m.cancel')}}</el-button>
<el-button round class="common-button-primary" icon="el-icon-check" type="primary" @click="confirmDialog">{{$t('m.confirm')}}</el-button>
</div>
</el-dialog>
</template>
<script>
const formData = {
category: '',
}
export default {
name: 'EditProcessClassification',
props: ['data', 'visible'],
data() {
return {
formData: {},
formRules: {},
typeList: [] // 类型下拉框
}
},
computed: {
title() {
return !!this.data ? '编辑' : '新增'
}
},
watch: {
data(newValue) {
this.formData = newValue || {...formData}
},
visible(newValue) {
this.formData = this.data || {...formData}
}
},
mounted() {
this.formData = this.data || {...formData}
},
created() {
this.queryTablePage()
},
methods: {
// 查询、加载表格
queryTablePage () {
const formData = {
// page: this.pageNo,
// pageSize: this.$store.getters.userInfo.configContent,
// standNumber: this.searchForm.standardKey
}
this.$http.get('lawss/activiti/categoryList',
formData,
{
_this: this,
loading: 'tableDataLoading'
},
res => {
this.typeList = res.result.map(item => {
return {
label: item.type,
value: item.objectId
}
})
// this.total = res.data.count
}, e => {})
},
closeDialog() {
// this.visible = false
this.$emit('close')
this.formData = {}
},
confirmDialog() {
const url = !this.data ? 'lawss/activiti/addCategory' : 'lawss/activiti/updatModel'
const formData = {
modelId: this.formData.id,
categoryId: this.formData.category
}
this.$http.get(url, formData, {
_this: this
}, res => {
if (res.success) {
console.log('新增/编辑成功')
this.$emit('success')
this.$emit('close')
}
}, e => {
})
}
}
}
</script>
<style lang="" scoped>
</style>
@@ -0,0 +1,103 @@
<template>
<el-dialog
:visible="visible"
:title="title"
:before-close="closeDialog"
width="400px"
>
<div>
<el-form
ref="formData"
:model="formData"
:rules="formRules"
class="label-input-form"
label-width="100px"
inline
>
<el-form-item label="流程类型名称" prop="type" class="add-form-item">
<el-input v-model.trim="formData.type" placeholder="请输入流程类型名称" ></el-input>
</el-form-item>
</el-form>
</div>
<div slot="footer">
<el-button round class="common-button-default" icon="el-icon-close" @click="closeDialog">{{$t('m.cancel')}}</el-button>
<el-button round class="common-button-primary" icon="el-icon-check" type="primary" @click="confirmDialog">{{$t('m.confirm')}}</el-button>
</div>
</el-dialog>
</template>
<script>
const formData = {
type: '',
}
export default {
name: 'EditProcessClassification',
props: ['data', 'visible'],
data() {
return {
formData: {},
formRules: {
type: [
{ required: true, message: '请输入流程类型名称', trigger: 'change' }
]
}
}
},
computed: {
title() {
return !!this.data ? '编辑' : '新增'
}
},
watch: {
data(newValue) {
this.formData = newValue || {...formData}
this.$refs['formData'].resetFields()
},
visible(newValue) {
this.formData = this.data || {...formData}
}
},
mounted() {
this.formData = this.data || {...formData}
},
methods: {
closeDialog() {
// this.visible = false
this.$refs['formData'].resetFields()
this.$emit('close')
this.formData = {}
},
confirmDialog() {
const url = !this.data ? 'lawss/activiti/addCategory' : 'lawss/activiti/editCategory'
const formData = {
objectId: this.formData.objectId,
type: this.formData.type
}
this.$refs['formData'].validate((valid) => {
if (valid) {
this.$http.postData(url, formData, {
_this: this
}, res => {
if (res.success) {
console.log('新增/编辑成功')
this.$emit('success')
this.$emit('close')
}
}, e => {
})
}
})
}
}
}
</script>
<style lang="" scoped>
</style>
@@ -0,0 +1,269 @@
<template>
<div style="height: 100%;background-color: #fff;position: relative;">
<div style="height: 100%;">
<!--<table-tools-bar>-->
<!-- <div slot="left">-->
<!-- <div class="search-area">-->
<!-- <el-form :model="searchForm" inline class="label-input-form">-->
<!-- <el-form-item :label="$t('m.standardNumAndName')" prop="standardKey" class="search-item">-->
<!-- <el-input-->
<!-- v-model="searchForm.standardKey"-->
<!-- :placeholder="$t('m.standardNumAndNameTips')"-->
<!-- clearable-->
<!-- :maxlength="100"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item class="search-item btn-box">-->
<!-- <el-button-->
<!-- icon="el-icon-search"-->
<!-- type="primary"-->
<!-- class="common-button-primary"-->
<!-- round-->
<!-- @click="searchBtn"-->
<!-- ></el-button>-->
<!-- </el-form-item>-->
<!-- <el-form-item class="search-item btn-box">-->
<!-- <el-button-->
<!-- class="common-button-default"-->
<!-- icon="el-icon-refresh-left"-->
<!-- round-->
<!-- @click="resetSearchForm">{{$t('m.clearQuery')}}</el-button>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<!-- </div>-->
<!-- </div>-->
<!--</table-tools-bar>-->
<div class="content">
<!--<div class="action-bar">-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- class="common-button-primary add-button"-->
<!-- round-->
<!-- @click="addRow"-->
<!-- v-btn-permission="'XBRKH5BP5K'"-->
<!-- ><i class="iconfont">&#xe84e;</i>新增</el-button>-->
<!--</div>-->
<loading :loading="tableDataLoading">{{$t('m.dataProcessing')}}</loading>
<el-table
border
ref="selection"
:data="tableList"
tooltip-effect="dark"
style="width: 100%;"
height="100%"
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}"
row-key="id"
>
<el-table-column
type="index"
width="55"
label="序号"
align="center">
</el-table-column>
<el-table-column
prop="name"
label="流程名称"
>
</el-table-column>
<el-table-column
prop="categoryName"
label="流程类型"
>
</el-table-column>
<el-table-column
prop="createTime"
label="创建时间">
<template slot-scope="scope">
<span>{{$moment(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss')}}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="50" fixed="right">
<template slot-scope="scope">
<div @click.stop style="display: inline-block">
<el-dropdown trigger="click" @command="handleCommand">
<i class="iconfont">&#xe61e;</i>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-btn-permission="'VTY972T56Q'" :command="[scope.row, '编辑']">{{$t('m.edit')}}</el-dropdown-item>
<!--<el-dropdown-item v-btn-permission="'UCDDYPWEFT'" :command="[scope.row, '删除']">{{$t('m.delete')}}</el-dropdown-item>-->
</el-dropdown-menu>
</el-dropdown>
</div>
</template>
</el-table-column>
</el-table>
</div>
<pagination :total="total" @pageChange="pageChange" @pageSizeChange="pageSizeChange"></pagination>
<edit-process
:visible="editRowDialogVisible"
:data="editRowDialogData"
@close="handleEditRowDialogClose"
@success="handleEditRowDialogSuccess"
></edit-process>
</div>
</div>
</template>
<script>
import EditProcess from '@/pages/config/pages/processManage/components/EditProcess'
export default {
name: 'ProcessClassification',
components: {EditProcess},
data () {
return {
tableDataLoading: false,
total: 0,
selectRoleId: '',
searchForm: {
standardKey: '',
},
pageNo: 1,
pageSize: 10,
tableList: [],
editRowDialogVisible: false,
editRowDialogData: undefined // 新增时为 undefined null 或者 false 即可
}
},
methods: {
// 根据条件查询信息
searchBtn () {
this.resetPageNo()
this.queryTablePage()
},
/**
* 重置搜索表单并重新加载表格数据
*/
resetSearchForm () {
this.searchForm.standardKey = ''
// this.resetSearchForm()
this.queryTablePage()
},
pageChange (page) {
this.pageNo = page
this.queryTablePage()
},
pageSizeChange () {
this.queryTablePage()
},
resetPageNo() {
this.pageNo = 1
},
// 查询、加载表格
queryTablePage () {
const formData = {
current: this.pageNo,
size: this.$store.getters.userInfo.configContent
// standNumber: this.searchForm.standardKey
}
this.$http.get('lawss/activiti/modelListPage',
formData,
{
_this: this,
loading: 'tableDataLoading'
},
res => {
this.tableList = res.result.records
this.total = res.result.total
}, e => {})
},
// 点击查看
handlePreview (item) {
console.log('item', item)
let routeUrl = this.$router.resolve({
name: 'OtherStandardDetails',
params: {
id: item.id,
pageType: 'INLAND_STAND'
}
})
window.open(routeUrl.href, '_blank')
},
// 表格行 - 点击更多 事件
handleCommand (command) {
switch (command[1]) {
case '编辑':
this.editRow(command[0])
break
case '删除':
this.deleteRow(command[0])
break
}
},
// 删除
deleteRow (row) {
this.$confirm('确认删除该条数据?', '确认删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
confirmButtonClass: 'common-button-primary',
roundButton: true,
type: 'warning'
}).then(() => {
const id = row.objectId
this.$http.get('lawss/activiti/deleteCategory', {
objectId: id
}, {
_this: this
}, res => {
console.log('删除成功')
this.$message.warning(res.message)
this.queryTablePage()
}, e => {
})
}).catch(() => {})
},
editRow(row) {
this.editRowDialogData = { ...row }
this.editRowDialogVisible = true
},
handleEditRowDialogClose() {
this.editRowDialogVisible = false
},
handleEditRowDialogSuccess() {
this.queryTablePage()
},
addRow() {
this.editRowDialogData = undefined
this.editRowDialogVisible = true
}
},
created() {
this.queryTablePage()
}
}
</script>
<style lang="less" scoped>
.content {
padding: 0 10px;
height: calc(~'100% - 55px - 50px');
}
.el-divider-low {
margin: 15px 0;
}
.search-area {
padding: 0;
}
.btn-group {
position: absolute;
bottom: 20px;
right: 20px;
background: #ffffff;
z-index: 999;
}
</style>
@@ -0,0 +1,269 @@
<template>
<div style="height: 100%;background-color: #fff;position: relative;">
<div style="height: 100%;">
<!--<table-tools-bar>-->
<!-- <div slot="left">-->
<!-- <div class="search-area">-->
<!-- <el-form :model="searchForm" inline class="label-input-form">-->
<!-- <el-form-item :label="$t('m.standardNumAndName')" prop="standardKey" class="search-item">-->
<!-- <el-input-->
<!-- v-model="searchForm.standardKey"-->
<!-- :placeholder="$t('m.standardNumAndNameTips')"-->
<!-- clearable-->
<!-- :maxlength="100"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item class="search-item btn-box">-->
<!-- <el-button-->
<!-- icon="el-icon-search"-->
<!-- type="primary"-->
<!-- class="common-button-primary"-->
<!-- round-->
<!-- @click="searchBtn"-->
<!-- ></el-button>-->
<!-- </el-form-item>-->
<!-- <el-form-item class="search-item btn-box">-->
<!-- <el-button-->
<!-- class="common-button-default"-->
<!-- icon="el-icon-refresh-left"-->
<!-- round-->
<!-- @click="resetSearchForm">{{$t('m.clearQuery')}}</el-button>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<!-- </div>-->
<!-- </div>-->
<!--</table-tools-bar>-->
<div class="content">
<div class="action-bar">
<el-button
type="primary"
class="common-button-primary add-button"
round
@click="addRow"
v-btn-permission="'XBRKH5BP5K'"
><i class="iconfont">&#xe84e;</i>新增</el-button>
</div>
<loading :loading="tableDataLoading">{{$t('m.dataProcessing')}}</loading>
<el-table
border
ref="selection"
:data="tableList"
tooltip-effect="dark"
style="width: 100%;"
height="100%"
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}"
row-key="id"
>
<el-table-column
type="index"
width="55"
label="序号"
align="center">
</el-table-column>
<el-table-column
prop="type"
label="流程类型"
>
</el-table-column>
<el-table-column
prop="createTime"
label="创建时间">
</el-table-column>
<el-table-column label="操作" align="center" width="50" fixed="right">
<template slot-scope="scope">
<div @click.stop style="display: inline-block">
<el-dropdown trigger="click" @command="handleCommand">
<i class="iconfont">&#xe61e;</i>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-btn-permission="'VTY972T56Q'" :command="[scope.row, '编辑']">{{$t('m.edit')}}</el-dropdown-item>
<el-dropdown-item v-btn-permission="'UCDDYPWEFT'" :command="[scope.row, '删除']">{{$t('m.delete')}}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</template>
</el-table-column>
</el-table>
</div>
<pagination :total="total" @pageChange="pageChange" @pageSizeChange="pageSizeChange"></pagination>
<edit-process-classification
:visible="editRowDialogVisible"
:data="editRowDialogData"
@close="handleEditRowDialogClose"
@success="handleEditRowDialogSuccess"
></edit-process-classification>
</div>
</div>
</template>
<script>
import EditProcessClassification from '@/pages/config/pages/processManage/components/EditProcessClassification'
export default {
name: 'ProcessClassification',
components: {EditProcessClassification},
data () {
return {
tableDataLoading: false,
total: 0,
selectRoleId: '',
searchForm: {
standardKey: '',
},
pageNo: 1,
pageSize: 10,
tableList: [],
editRowDialogVisible: false,
editRowDialogData: undefined // 新增时为 undefined null 或者 false 即可
}
},
methods: {
// 根据条件查询信息
searchBtn () {
this.resetPageNo()
this.queryTablePage()
},
/**
* 重置搜索表单并重新加载表格数据
*/
resetSearchForm () {
this.searchForm.standardKey = ''
// this.resetSearchForm()
this.queryTablePage()
},
pageChange (page) {
this.pageNo = page
this.queryTablePage()
},
pageSizeChange () {
this.queryTablePage()
},
resetPageNo() {
this.pageNo = 1
},
// 查询、加载表格
queryTablePage () {
const formData = {
page: this.pageNo,
pageSize: this.$store.getters.userInfo.configContent,
// standNumber: this.searchForm.standardKey
}
this.$http.get('lawss/activiti/categoryList',
formData,
{
_this: this,
loading: 'tableDataLoading'
},
res => {
this.tableList = res.result
this.total = res.result.length
}, e => {})
},
// 点击查看
handlePreview (item) {
console.log('item', item)
let routeUrl = this.$router.resolve({
name: 'OtherStandardDetails',
params: {
id: item.id,
pageType: 'INLAND_STAND'
}
})
window.open(routeUrl.href, '_blank')
},
// 表格行 - 点击更多 事件
handleCommand (command) {
switch (command[1]) {
case '编辑':
this.editRow(command[0])
break
case '删除':
this.deleteRow(command[0])
break
}
},
// 删除
deleteRow (row) {
this.$confirm('确认删除该条数据?', '确认删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
confirmButtonClass: 'common-button-primary',
roundButton: true,
type: 'warning'
}).then(() => {
const id = row.objectId
this.$http.get('lawss/activiti/deleteCategory', {
objectId: id
}, {
_this: this
}, res => {
if (res.code === 200) {
this.$message.success(res.message)
this.queryTablePage()
} else {
this.$message.warning(res.message)
}
}, e => {
})
}).catch(() => {})
},
editRow(row) {
this.editRowDialogData = { ...row }
this.editRowDialogVisible = true
},
handleEditRowDialogClose() {
this.editRowDialogVisible = false
},
handleEditRowDialogSuccess() {
this.queryTablePage()
},
addRow() {
this.editRowDialogData = undefined
this.editRowDialogVisible = true
}
},
created() {
this.queryTablePage()
}
}
</script>
<style lang="less" scoped>
.content {
padding: 0 10px;
height: calc(~'100% - 55px - 50px');
}
.el-divider-low {
margin: 15px 0;
}
.search-area {
padding: 0;
}
.btn-group {
position: absolute;
bottom: 20px;
right: 20px;
background: #ffffff;
z-index: 999;
}
::v-deep .el-form-item__error{
top: 53px!important;
right: 25px!important;
}
</style>
@@ -0,0 +1,798 @@
<!-- 区域-->
<template>
<div id="area" class="v-class">
<el-form :inline="true" :model="standardForm" ref="ruleForm" class="label-input-form">
<el-form-item
:label="this.$t('m.option')"
class="serch-form-item">
<el-input
v-model.trim="standardForm.standName"
:placeholder="$t('m.pleaseEnterOptions')"
:maxlength="100"
clearable
@keyup.enter.native="selecteAreaBtn"></el-input>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
icon="el-icon-search"
type="primary"
class="searchAngNewBtn"
@click="selecteAreaBtn"></el-button>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
type="primary"
class="searchAngNewBtn"
@click="resetSelect">{{$t('m.clearQuery')}}</el-button>
</el-form-item>
</el-form>
<div class="content">
<div class="action-bar">
<el-button
type="primary"
size="mini"
@click="classAdd(1, null)"
>{{$t('m.add')}}</el-button>
<el-button
type="danger"
size="mini"
@click="areaBatchDel"
>{{$t('m.delete')}}</el-button>
</div>
<el-table
ref="selectionArea"
:data="regionData"
tooltip-effect="dark"
style="width: 100%"
border
:height="tableHeight"
row-key="id"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="dicTypeName"
:label="this.$t('m.option')"
width="400"
align="center"
>
</el-table-column>
<el-table-column
prop="describes"
:label="this.$t('m.describe')"
width="400"
align="center">
</el-table-column>
<el-table-column
:label="this.$t('m.operation')"
align="center">
<template slot-scope="scope">
<el-button
class="opera-btn"
size="mini"
type="primary"
@click="classAdd(3, scope.row)">{{$t('m.see')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="warning"
@click="classAdd(2, scope.row)">{{$t('m.edit')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="danger"
@click="classDel(scope.row)">{{$t('m.delete')}}</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!--分页-->
<pagination
class="tabpagination"
:page="page"
:total="total"
@pageChange="pageChange"
@pageSizeChange="pageSizeChange"></pagination>
<loading :loading="loading">数据获取中</loading>
<!--新增抽屉-->
<el-drawer
:title="title"
:visible.sync="dialogState"
ref="drawer"
size="800px"
:before-close="handleClose"
>
<div class="demo-drawer__content" v-if="this.oprState === 1 || this.oprState === 2">
<el-form :model="areaModelAdd" ref="areaModelAdd" :rules="regionRules" class="label-input-form">
<el-row>
<el-col :span="12">
<el-form-item :label="this.$t('m.option')"
:label-width="formLabelWidth"
prop="dicTypeName"
:disabled = 'this.oprState === 2'
class="add-form-item">
<el-input
v-model.trim="areaModelAdd.dicTypeName"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.sortNumber')"
prop="showIndex"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
type="number"
oninput="if(value.length>4)value=value.slice(0,4)"
v-model.number="areaModelAdd.showIndex"
@mousewheel.native.prevent
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.describe')"
prop="describes"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
v-model.trim="areaModelAdd.describes"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="demo-drawer-footer">
<el-button size="mini" @click="closeModal('areaModelAdd')">{{$t('m.cancel')}}</el-button>
<el-button size="mini" type="primary" @click="saveClass('areaModelAdd')">{{$t('m.submit')}}</el-button>
</div>
</div>
<div class="demo-drawer__content" v-else>
<div class="search-area1">
<el-form :inline="true" :model="standardForm" ref="ruleForm" class="label-input-form">
<div class="search-area-item">
<el-form-item class="serch-form-item btn-box">
<el-button
type="primary"
class="searchAngNewBtn"
@click="countryAdd(1, null)"
>{{$t('m.add')}}</el-button>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
type="danger"
class="searchAngNewBtn"
@click="countriseDel">{{$t('m.delete')}}</el-button>
</el-form-item>
</div>
</el-form>
</div>
<!-- :height="tableHeight"-->
<div class="content1 drawer-content">
<el-table
ref="selection"
:data="areaData1"
tooltip-effect="dark"
style="width: 100%"
border
row-key="id"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="handleAreaSelectionChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="dicTypeName"
:label="this.$t('m.nationalArea')"
width="260"
align="center"
>
</el-table-column>
<el-table-column :label="this.$t('m.option')" align="center">
<template slot-scope="scope">
<el-button
class="opera-btn"
size="mini"
type="primary"
@click="countryAdd(2, scope.row)">{{$t('m.see')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="danger"
@click="coutryDel(scope.row)">{{$t('m.delete')}}</el-button>
</template>
</el-table-column>
</el-table>
</div>
<loading :loading="loading">数据获取中</loading>
<pagination :page="areaPage" :total="areaTotal" @pageChange="areaPageChange" @pageSizeChange="areaPageSizeChange"></pagination>
</div>
<el-drawer
:title="areaTitle"
:append-to-body="true"
:before-close="handlCountryClose"
destroy-on-close
:visible.sync="innerDrawer">
<div class="area-content" v-if="this.inDrawState === 1">
<el-form :model="countryModelAdd" ref="countryModelAdd" :rules="countryModelAddRules" class="label-input-form">
<el-form-item :label="this.$t('m.nationalArea')"
:label-width="formLabelWidth"
prop="selectStandCategory"
class="add-form-item">
<search-select
v-model="countryModelAdd.selectStandCategory"
:options="countryList"
@on-change="getSelectCate"
clearable
/>
</el-form-item>
<el-form-item :label="this.$t('m.sortNumber')"
prop="showIndex"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
oninput="if(value.length>4)value=value.slice(0,4)"
type="number"
v-model.number="countryModelAdd.showIndex"
@mousewheel.native.prevent
autocomplete="off" clearable></el-input>
</el-form-item>
</el-form>
<div class="demo-drawer__footer">
<el-button size="mini" @click="closeCountryModal('countryModelAdd')">{{$t('m.cancel')}}</el-button>
<el-button size="mini" type="primary" @click="saveCountry('countryModelAdd')">{{$t('m.submit')}}</el-button>
</div>
</div>
<div class="area-content" v-else>
<div class="check-item-row">
<div class="check-item-col1">
<div class="check-item-label"> 选项:</div>
<el-tooltip v-if="countryModelAdd.dicTypeName" class="item" effect="dark" :content="countryModelAdd.dicTypeName" placement="top">
<div slot="content" class="toolip-content">{{countryModelAdd.dicTypeName}}</div>
<div class="check-item-value">{{countryModelAdd.dicTypeName}}</div>
</el-tooltip>
<div v-else class="check-item-value">{{countryModelAdd.dicTypeName}}</div>
</div>
<div class="check-item-col1">
<div class="check-item-label">排序号:</div>
<div class="check-item-value">{{countryModelAdd.showIndex}}</div>
</div>
</div>
</div>
</el-drawer>
</el-drawer>
</div>
</template>
<script>
export default {
name: 'Area',
data () {
return {
// 查询条件
standardForm: {
// 选项
standName: '',
// 数据编码
standCode: '',
// 描述
describes: ''
},
total: 0,
page: 1,
rows: 10,
loading: false,
// 列表数据
regionData: [],
// 抽屉打开
dialogState: false,
// form-item label宽度
formLabelWidth: '80px',
// 新增弹窗数据
areaModelAdd: {
// 数据信息
dicTypeName: '',
showIndex: '',
// 数据编码
dicTypeCode: '',
// 描述
describes: '',
// 唯一辨识
dicId: 'MDSKFJJKK'
},
// 弹窗标题
title: '',
// 表单验证
regionRules: {
dicTypeName: [
{required: true, message: '选项不能为空', trigger: 'blur'},
{type: 'string', max: 100, message: '最多输入100位', trigger: 'blur'}
],
showIndex: [
{required: true, message: '排序号不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
],
describes: [
{type: 'string', max: 500, message: '最多输入500位', trigger: 'blur'}
]
},
// 中间变量
standName1: '',
describes1: '',
standCode1: '',
// 判断是新增or 编辑 or 查看
oprState: 0,
// 多选时接收选中行数据
selectNum: [],
areaData1: [],
// 内部弹窗标题
areaTitle: '',
// 判断内部弹窗是新建or 查看
inDrawState: 0,
innerDrawer: false,
// 内部新增rules
countryModelAddRules: {
selectStandCategory: [
{ required: true, message: '国家/地区不能为空', trigger: 'change' }
],
showIndex: [
{required: true, message: '排序号不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
]
},
// 内联抽屉信息
countryModelAdd: {
dicTypeName: '',
dicTypeCode: '',
showIndex: '',
describes: '',
parentId: '',
classifyCode: '',
selectStandCategory: '',
dicId: 'MDSKFJJKK'
},
// 内部分页,计数
// 子类分类
areaPage: 1,
areaTotal: 0,
areaRows: 10,
// 标准类别表,下拉框里的数据
countryList: [],
// 不重复
newAreaModelAdd: {},
countyrRow: '',
areaSelectNum: [],
tableHeight: null
}
},
methods: {
// 条件查询
selecteAreaBtn () {
this.standName1 = this.standardForm.standName
this.describes1 = this.standardForm.describes
this.standCode1 = this.standardForm.standCode
this.page = 1
this.selectArea()
},
// 清空查询
resetSelect (formName) {
this.standName1 = ''
this.describes1 = ''
this.standardForm.standName = ''
this.standardForm.describes = ''
this.page = 1
this.selectArea()
},
// 分页加载列表页列表
selectArea () {
let DicTypeEOPage = {
page: this.page,
pageSize: this.$store.getters.userInfo.configContent,
dicTypeName: this.standName1,
// dicTypeCode: this.standCode1,
describes: this.describes1,
dicId: 'MDSKFJJKK'
}
this.$http.get('sys/dictype/pageCountry', DicTypeEOPage, {
_this: this,
loading: 'loading'
}, res => {
this.regionData = res.data.list
this.total = res.data.count
}, e => {
})
// this.$refs.selection.selectAll(false)
},
// 新增弹窗打开
classAdd (oprState, row) {
this.oprState = oprState
if (this.oprState === 1) {
this.title = '新增信息'
this.dialogState = true
} else if (this.oprState === 2) {
this.title = '编辑信息'
this.areaModelAdd = row
this.dialogState = true
} else {
this.title = '查看信息'
this.areaModelAdd = row
this.countyrRow = row.id
this.countryModelAdd.parentId = row.id
this.getArea(row.id)
this.dialogState = true
}
},
// 新增弹窗提交
saveClass (formName) {
let data = this.areaModelAdd
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.oprState === 1) {
this.$http.postData('sys/dictype/create', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {})
} else if (this.oprState === 2) {
this.$http.putData('sys/dictype', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {
})
}
} else {
// ('error submit!!')
// return false
}
})
},
// 查看弹窗关闭
handleClose () {
this.page = 1
this.selectArea()
this.areaModelAdd.dicTypeName = ''
this.areaModelAdd.showIndex = ''
this.areaModelAdd.describes = ''
if (this.$refs['areaModelAdd']) {
this.$refs['areaModelAdd'].resetFields()
}
this.dialogState = false
},
// 新增弹窗关闭
closeModal (formName) {
this.page = 1
this.selectArea()
this.areaModelAdd.dicTypeName = ''
this.areaModelAdd.showIndex = ''
this.areaModelAdd.describes = ''
this.$nextTick(() => {
this.$refs['areaModelAdd'].resetFields()
})
this.dialogState = false
},
//
areaBatchDel () {
if (this.selectNum === '' || this.selectNum.length === 0) {
this.$confirm('请选择一条数据进行删除', '提示', {
showCancelButton: false,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
} else {
(
this.$confirm('确认删除这些数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let delIds = []
let delTypeCodes = []
for (let i = 0; i < this.selectNum.length; i++) {
delIds.push(this.selectNum[i].id)
delTypeCodes.push(this.selectNum[i].dicTypeCode)
}
delIds = delIds.join(',')
delTypeCodes = delTypeCodes.join(',')
let data = {}
data.ids = delIds
data.dicTypeCodes = delTypeCodes
this.$http.delete('sys/dictype/deleteArr', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
}
})
}).catch(() => {
// 取消删除,清空选择
this.$refs.selectionArea.clearSelection()
})
)
}
},
// 删除
classDel (row) {
let data = {}
data.dicTypeEOId = row.id
data.dicTypeCode = row.dicTypeCode
if (data.id !== '' && data.dicTypeCode !== '') {
this.$confirm('确认删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http.delete('sys/dictype/delete', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
} else {
}
}).catch(() => {
})
})
}
},
// 多选
handleSelectionChange (val) {
this.selectNum = val
},
pageChange (page) {
this.page = page
this.selectArea()
},
pageSizeChange (pageSize) {
this.rows = pageSize
this.selectArea()
},
// 内联表格加载
getArea (id) {
this.$http.get('sys/dictype/page', {
page: this.areaPage,
pageSize: this.$store.getters.userInfo.configContent,
id: id
}, {
_this: this,
loading: 'areaLoading'
}, res => {
this.areaTotal = res.data.count
this.areaData1 = res.data.list
}, e => {})
},
// 新增查看弹窗打开
countryAdd (inDrawState, row) {
this.inDrawState = inDrawState
if (this.inDrawState === 1) {
this.areaTitle = '新建信息'
this.getCountryList()
this.innerDrawer = true
this.$nextTick(() => {
this.$refs['countryModelAdd'].resetFields()
})
} else {
this.countryModelAdd = row
this.areaTitle = '查看信息'
this.innerDrawer = true
}
},
// 获取标准类别List数据
getCountryList () {
this.$http.get('sys/dictype/getDicTypeListCode', {}, {_this: this}, res => {
this.countryList = res.data.COUNTRY
})
},
// 下拉列表变化
getSelectCate () {
for (let index = 0; index < this.countryList.length; index++) {
let standCategory = this.countryList[index]
// (standCategory)
if (standCategory.value === this.countryModelAdd.selectStandCategory) {
this.selectCountryListNum = index
break
}
}
},
// 新增国家区域确定
saveCountry (name) {
this.$refs[name].validate((valid) => {
if (valid) {
let countryList = this.countryList[this.selectCountryListNum]
this.countryModelAdd.dicTypeName = countryList.label
this.countryModelAdd.dicTypeCode = countryList.value
this.newAreaModelAdd.dicTypeCode = this.countryModelAdd.dicTypeCode
this.newAreaModelAdd.dicTypeName = this.countryModelAdd.dicTypeName
this.newAreaModelAdd.parentId = this.countryModelAdd.parentId
this.newAreaModelAdd.showIndex = this.countryModelAdd.showIndex
this.newAreaModelAdd.dicId = ''
// if (this.areaType === 1) {
this.$http.postData('sys/dictype/create', this.newAreaModelAdd, {
_this: this
}, res => {
if (res.ok) {
this.closeCountryModal()
// this.innerDrawer = false
}
}, e => {
})
// }
}
})
},
// 关闭弹窗
handlCountryClose () {
this.areaPage = 1
this.getArea(this.countyrRow)
this.countryModelAdd.showIndex = ''
this.countryModelAdd.dicTypeName = ''
this.countryModelAdd.dicTypeCode = ''
this.newAreaModelAdd.dicTypeCode = ''
this.newAreaModelAdd.dicTypeName = ''
this.newAreaModelAdd.parentId = ''
if (this.$refs['countryModelAdd']) {
this.$nextTick(() => {
this.$refs['countryModelAdd'].resetFields()
})
}
this.innerDrawer = false
},
// 关闭新增弹窗
closeCountryModal (formName) {
this.areaPage = 1
this.getArea(this.countyrRow)
this.countryModelAdd.showIndex = ''
this.countryModelAdd.dicTypeName = ''
this.countryModelAdd.dicTypeCode = ''
this.newAreaModelAdd.dicTypeCode = ''
this.newAreaModelAdd.dicTypeName = ''
this.newAreaModelAdd.parentId = ''
this.$nextTick(() => {
this.$refs['countryModelAdd'].resetFields()
})
this.innerDrawer = false
},
// 删除
coutryDel (row) {
let data = {}
data.dicTypeEOId = row.id
data.dicTypeCode = row.dicTypeCode
if (data.id !== '' && data.dicTypeCode !== '') {
this.$confirm('确认删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http.delete('sys/dictype/delete', data, {
_this: this
}, res => {
if (res.ok) {
this.getArea(this.countyrRow)
} else {
}
}).catch(() => {
})
})
}
},
// 内联
countriseDel () {
if (this.areaSelectNum === '' || this.areaSelectNum.length === 0) {
this.$confirm('请选择一条数据进行删除', '提示', {
showCancelButton: false,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
} else {
(
this.$confirm('确认删除这些数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let delIds = []
let delTypeCodes = []
for (let i = 0; i < this.areaSelectNum.length; i++) {
delIds.push(this.areaSelectNum[i].id)
delTypeCodes.push(this.areaSelectNum[i].dicTypeCode)
}
delIds = delIds.join(',')
delTypeCodes = delTypeCodes.join(',')
let data = {}
data.ids = delIds
data.dicTypeCodes = delTypeCodes
this.$http.delete('sys/dictype/deleteArr', data, {
_this: this
}, res => {
if (res.ok) {
this.getArea(this.countyrRow)
}
})
}).catch(() => {
// 取消删除,清空选择
this.$refs.selection.clearSelection()
})
)
}
},
// 多选
handleAreaSelectionChange (val) {
this.areaSelectNum = val
},
// 子类分页
areaPageChange (page) {
this.areaPage = page
this.getArea(this.countyrRow)
},
areaPageSizeChange (pageSize) {
this.areaRows = pageSize
this.getArea(this.countyrRow)
}
},
mounted () {
this.selectArea()
this.tableHeight = $('.content').height() - 44
window.onresize = () => {
this.tableHeight = $('.content').height() - 44
}
},
computed: {
}
}
</script>
<style lang="less" scoped>
#area{
position: relative;
height: 100%;
padding: 0 10px;
background: #fff;
.el-drawer__wrapper{
.drawer-content{
height: calc(~'100% - 200px');
}
}
.content{
height: calc(~'100% - 45px - 56px');
overflow-y: auto;
}
.el-ma
.tabpagination{
position: relative;
}
.demo-drawer__content {
// padding: 0 15px;
.search-area1 {
text-align: right;
border-bottom: 1px solid #e8eaec;
padding-bottom: 10px;
margin-bottom: 23px;
}
.label-input-form {
display: inline-block;
}
}
.toolip-content{
display: inline-block;
max-width: 200px;
}
}
.area-content{
padding: 0 15px;
}
</style>
@@ -0,0 +1,477 @@
<!-- 总成分类 -->
<template>
<div class="standard-classification v-class">
<el-form :inline="true" :model="standardForm" ref="ruleForm" class="label-input-form">
<el-form-item :label="this.$t('m.option')" class="serch-form-item">
<el-input
v-model.trim="standardForm.standName"
:placeholder="$t('m.pleaseEnterOptions')"
:maxlength="100"
clearable
@keyup.enter.native="selectClassBtn"></el-input>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
icon="el-icon-search"
type="primary"
class="searchAngNewBtn"
@click="selectClassBtn"></el-button>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
type="primary"
class="searchAngNewBtn"
@click="resetSelect">{{$t('m.clearQuery')}}</el-button>
</el-form-item>
</el-form>
<div class="content">
<div class="action-bar">
<el-button
type="primary"
size="mini"
@click="classAdd(1, null)"
v-btn-permission="'SDXRQ8LV6K'"
>{{$t('m.add')}}</el-button>
<el-button
type="danger"
size="mini"
@click="classBatchDel"
v-btn-permission="'ATBANPLHCM'">{{$t('m.delete')}}</el-button>
</div>
<el-table
:height="tableHeight"
ref="selection"
:data="classData"
tooltip-effect="dark"
style="width: 100%"
border
row-key="id"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="dicTypeName"
:label="this.$t('m.option')"
width="400"
align="center"
>
</el-table-column>
<el-table-column
prop="describes"
:label="this.$t('m.describe')"
width="400"
align="center">
</el-table-column>
<el-table-column
:label="this.$t('m.operation')"
align="center">
<template slot-scope="scope">
<el-button
class="opera-btn"
size="mini"
type="primary"
@click="classAdd(3, scope.row)">{{$t('m.see')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="warning"
@click="classAdd(2, scope.row)">{{$t('m.edit')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="danger"
@click="classDel(scope.row)">{{$t('m.delete')}}</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!--分页-->
<pagination
:page="page"
:total="total"
@pageChange="pageChange"
@pageSizeChange="pageSizeChange"></pagination>
<loading :loading="loading">数据获取中</loading>
<!--新增抽屉-->
<el-drawer
:title="title"
:visible.sync="dialogState"
direction="rtl"
custom-class="demo-drawer"
ref="drawer"
size="800px"
:class="classObject"
:before-close="handleClose"
>
<div class="demo-drawer__content" v-if="this.oprState === 1 || this.oprState === 2">
<el-form :model="classModelAdd" ref="classModelAdd" :rules="classRules" class="label-input-form">
<el-row>
<el-col :span="12">
<el-form-item :label="this.$t('m.option')"
:label-width="formLabelWidth"
prop="dicTypeName"
:disabled = 'this.oprState === 2'
class="add-form-item">
<el-input
v-model.trim="classModelAdd.dicTypeName"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.sortNumber')"
prop="showIndex"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
type="number"
oninput="if(value.length>4)value=value.slice(0,4)"
v-model.number="classModelAdd.showIndex"
@mousewheel.native.prevent
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.describe')"
prop="describes"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
v-model.trim="classModelAdd.describes"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="demo-drawer-footer">
<el-button size="mini" @click="closeModal('classModelAdd')">{{$t('m.cancel')}}</el-button>
<el-button size="mini" type="primary" @click="saveClass('classModelAdd')">{{$t('m.submit')}}</el-button>
</div>
</div>
<div class="demo-drawer__content" v-else>
<div class="check-item-row">
<div class="check-item-col1">
<div class="check-item-label"> 选项:</div>
<el-tooltip class="item" effect="dark" :content="classModelAdd.dicTypeName" placement="top">
<div slot="content" class="toolip-content">{{classModelAdd.dicTypeName}}</div>
<div class="check-item-value">{{classModelAdd.dicTypeName}}</div>
</el-tooltip>
<div class="check-item-value">{{classModelAdd.dicTypeName}}</div>
</div>
<div class="check-item-col1">
<div class="check-item-label">排序号:</div>
<div class="check-item-value">{{classModelAdd.showIndex}}</div>
</div>
</div>
<div class="check-item-row">
<div class="check-item-col2">
<div class="check-item-label">描述:</div>
<div class="check-item-value">{{classModelAdd.describes}}</div>
</div>
<div class="check-item-col2">
<div class="check-item-label"></div>
<div class="check-item-value"></div>
</div>
</div>
</div>
</el-drawer>
</div>
</template>
<script>
export default {
name: 'AssemblyClassification',
data () {
return {
// 查询条件
standardForm: {
// 选项
standName: '',
// 数据编码
standCode: '',
// 描述
describes: ''
},
total: 0,
page: 1,
rows: 10,
loading: false,
// 列表数据
classData: [],
// 抽屉打开
dialogState: false,
// form-item label宽度
formLabelWidth: '80px',
// 新增弹窗数据
classModelAdd: {
// 数据信息
dicTypeName: '',
showIndex: '',
// 数据编码
dicTypeCode: '',
// 描述
describes: '',
// 唯一辨识
dicId: 'NLJKSFHLUJ'
},
// 弹窗标题
title: '',
// 表单验证
classRules: {
dicTypeName: [
{required: true, message: '选项不能为空', trigger: 'blur'},
{type: 'string', max: 100, message: '最多输入100位', trigger: 'blur'}
],
showIndex: [
{required: true, message: '排序号不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
],
describes: [
{type: 'string', max: 500, message: '最多输入500位', trigger: 'blur'}
]
},
// 中间变量
standName1: '',
describes1: '',
standCode1: '',
// 判断是新增or 编辑 or 查看
oprState: 0,
// 多选时接收选中行数据
selectNum: [],
tableHeight: null
}
},
methods: {
// 条件查询
selectClassBtn () {
this.standName1 = this.standardForm.standName
this.describes1 = this.standardForm.describes
this.standCode1 = this.standardForm.standCode
this.page = 1
this.selectClass()
},
// 清空查询
resetSelect (formName) {
this.standName1 = ''
this.standCode1 = ''
this.describes1 = ''
this.standardForm.standName = ''
this.standardForm.standCode = ''
this.standardForm.describes = ''
this.page = 1
this.selectClass()
},
// 分页加载列表
selectClass () {
let DicTypeEOPage = {
page: this.page,
pageSize: this.$store.getters.userInfo.configContent,
dicTypeName: this.standName1,
dicTypeCode: this.standCode1,
describes: this.describes1,
dicId: 'NLJKSFHLUJ'
}
this.$http.get('sys/dictype/page', DicTypeEOPage, {
_this: this,
loading: 'loading'
}, res => {
this.classData = res.data.list
this.total = res.data.count
}, e => {
})
// this.$refs.selection.selectAll(false)
},
// 新增弹窗打开
classAdd (oprState, row) {
this.oprState = oprState
if (this.oprState === 1) {
this.title = '新增信息'
this.dialogState = true
} else if (this.oprState === 2) {
this.title = '编辑信息'
this.classModelAdd = row
this.dialogState = true
} else {
this.title = '查看信息'
this.classModelAdd = row
this.dialogState = true
}
},
// 新增弹窗提交
saveClass (formName) {
let data = this.classModelAdd
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.oprState === 1) {
this.classModelAdd.dicTypeCode = this.classModelAdd.dicTypeName
this.$http.postData('sys/dictype/create', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {})
} else if (this.oprState === 2) {
this.$http.putData('sys/dictype', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {
})
}
} else {
return false
}
})
},
// 查看弹窗关闭
handleClose () {
this.page = 1
this.selectClass()
this.classModelAdd.dicTypeName = ''
this.classModelAdd.showIndex = ''
this.classModelAdd.describes = ''
if (this.$refs['classModelAdd']) {
this.$refs['classModelAdd'].resetFields()
}
this.dialogState = false
},
// 新增弹窗关闭
closeModal (formName) {
this.page = 1
this.selectClass()
this.classModelAdd.dicTypeName = ''
this.classModelAdd.showIndex = ''
this.classModelAdd.describes = ''
this.$refs['classModelAdd'].resetFields()
this.dialogState = false
},
// 批量删除
classBatchDel () {
if (this.selectNum === '' || this.selectNum.length === 0) {
this.$confirm('请选择一条数据进行删除', '提示', {
showCancelButton: false,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
})
} else {
(
this.$confirm('确认删除这些数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
let delIds = []
let delTypeCodes = []
for (let i = 0; i < this.selectNum.length; i++) {
delIds.push(this.selectNum[i].id)
delTypeCodes.push(this.selectNum[i].dicTypeCode)
}
delIds = delIds.join(',')
delTypeCodes = delTypeCodes.join(',')
let data = {}
data.ids = delIds
data.dicTypeCodes = delTypeCodes
this.$http.delete('sys/dictype/deleteArr', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
}
})
}).catch(() => {
// 取消删除,清空选择
this.$refs.selection.clearSelection()
})
)
}
},
// 删除
classDel (row) {
let data = {}
data.dicTypeEOId = row.id
data.dicTypeCode = row.dicTypeCode
if (data.id !== '' && data.dicTypeCode !== '') {
this.$confirm('确认删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.delete('sys/dictype/delete', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
} else {
}
}).catch(() => {
})
})
}
},
// 多选
handleSelectionChange (val) {
this.selectNum = val
},
pageChange (page) {
this.page = page
this.selectClass()
},
pageSizeChange (pageSize) {
this.rows = pageSize
this.selectClass()
}
},
mounted () {
this.selectClass()
this.tableHeight = $('.content').height() - 44
window.onresize = () => {
this.tableHeight = $('.content').height() - 44
}
},
computed: {
classObject () {
return {
'check-draw': this.oprState === 3
}
}
}
}
</script>
<style lang="less" scoped>
.standard-classification{
position: relative;
height: 100%;
padding: 0 10px;
background: #fff;
.content{
height: calc(~'100% - 45px - 56px');
overflow-y: auto;
}
.demo-drawer__content{
// border: 1px solid #ccc;
padding: 0 15px;
}
}
</style>
@@ -0,0 +1,819 @@
<!--配置文件--关联总成-->
<template>
<div id="national-area" class="v-class">
<el-form :inline="true" :model="assemblyForm" ref="ruleForm" class="label-input-form">
<el-form-item :label="this.$t('m.option')" class="serch-form-item">
<el-input
v-model.trim="assemblyForm.standName"
:placeholder="$t('m.pleaseEnterOptions')"
:maxlength="100"
clearable
@keyup.enter.native="selecteRgionBtn"></el-input>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
icon="el-icon-search"
type="primary"
class="searchAngNewBtn"
@click="selecteRgionBtn"></el-button>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
type="primary"
class="searchAngNewBtn"
@click="resetSelect">{{$t('m.clearQuery')}}</el-button>
</el-form-item>
</el-form>
<div class="content">
<div class="action-bar">
<el-button
type="primary"
size="mini"
@click="associatedAdd(1, null)"
v-btn-permission="'H94JEVB2SN'"
>{{$t('m.add')}}</el-button>
<el-button
type="danger"
size="mini"
@click="regionBatchDel"
v-btn-permission="'JT4GYJGZNB'">{{$t('m.delete')}}</el-button>
</div>
<el-table
:height="tableHeight"
ref="selection"
:data="assemblyData"
tooltip-effect="dark"
style="width: 100%"
border
row-key="id"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="dicTypeName"
:label="this.$t('m.option')"
width="400"
align="center"
>
</el-table-column>
<el-table-column
prop="describes"
:label="this.$t('m.describe')"
width="400"
align="center">
</el-table-column>
<el-table-column :label="this.$t('m.operation')"
align="center">
<template slot-scope="scope">
<el-button
class="opera-btn"
size="mini"
type="primary"
@click="associatedAdd(3, scope.row)">{{$t('m.see')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="warning"
v-btn-permission="'D63XW3MAHS'"
@click="associatedAdd(2, scope.row)">{{$t('m.edit')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="danger"
v-btn-permission="'RTWLGX593N'"
@click="classDel(scope.row)">{{$t('m.delete')}}</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!--分页-->
<pagination
:page="page"
:total="total"
@pageChange="pageChange"
@pageSizeChange="pageSizeChange"></pagination>
<loading :loading="loading">数据获取中</loading>
<!--新增抽屉-->
<el-drawer
:title="title"
:visible.sync="dialogState"
direction="rtl"
custom-class="demo-drawer"
ref="drawer"
size="800px"
:before-close="handleClose"
>
<div class="demo-drawer__content" v-if="this.oprState === 1 || this.oprState === 2">
<el-form :model="regionModelAdd" ref="regionModelAdd" :rules="regionRules" class="label-input-form">
<el-row>
<el-col :span="12">
<el-form-item :label="this.$t('m.option')"
:label-width="formLabelWidth"
prop="dicTypeName"
:disabled = 'this.oprState === 2'
class="add-form-item">
<el-input
v-model.trim="regionModelAdd.dicTypeName"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.sortNumber')"
prop="showIndex"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
oninput="if(value.length>4)value=value.slice(0,4)"
type="number"
v-model.number="regionModelAdd.showIndex"
@mousewheel.native.prevent
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.describe')"
prop="describes"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
v-model.trim="regionModelAdd.describes"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="系统"
prop="parentId"
:label-width="formLabelWidth"
class="add-form-item"
>
<el-select v-model="regionModelAdd.parentId">
<el-option
v-for="(item, index) in systemList"
:key="index"
:label="item.dicTypeName"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="demo-drawer-footer">
<el-button size="mini" @click="closeModal('regionModelAdd')">{{$t('m.cancel')}}</el-button>
<el-button size="mini" type="primary" @click="saveClass('regionModelAdd')">{{$t('m.submit')}}</el-button>
</div>
</div>
<div class="demo-drawer__content" v-else>
<div class="search-area1 v-calss">
<el-form :inline="true" :model="assemblyForm" ref="ruleForm" class="label-input-form">
<div class="search-area-item">
<!--<el-form-item class="serch-form-item btn-box">-->
<!--<el-button-->
<!--type="primary"-->
<!--class="searchAngNewBtn"-->
<!--@click="areaAdd(1, null)"-->
<!--&gt;{{$t('m.add')}}</el-button>-->
<!--</el-form-item>-->
<el-form-item class="serch-form-item btn-box">
<el-button
type="danger"
class="searchAngNewBtn"
@click="areaBatchDel"
>{{$t('m.delete')}}</el-button>
</el-form-item>
</div>
</el-form>
</div>
<div class="content1">
<el-table
ref="selection"
:data="areaData"
tooltip-effect="dark"
style="width: 100%"
border
row-key="id"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="handleAreaSelectionChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="dicTypeCode"
:label="this.$t('m.associatedComponents')"
width="260"
align="center"
>
</el-table-column>
<el-table-column :label="this.$t('m.options')" align="center">
<template slot-scope="scope">
<el-button
class="opera-btn"
size="mini"
type="primary"
@click="areaAdd(2, scope.row)">{{$t('m.see')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="danger"
@click="regionAreaDel(scope.row)">{{$t('m.delete')}}</el-button>
</template>
</el-table-column>
</el-table>
</div>
<loading :loading="loading">数据获取中</loading>
<pagination :page="areaPage" :total="areaTotal" @pageChange="areaPageChange" @pageSizeChange="areaPageSizeChange"></pagination>
</div>
<el-drawer
:title="areaTitle"
:append-to-body="true"
:before-close="handleAreaClose"
destroy-on-close
:visible.sync="innerDrawer"
>
<div class="area-content" v-if="this.inDrawState === 1">
<el-form :model="assemblyModelAdd" ref="assemblyModelAdd" :rules="assemblyModelRules" class="label-input-form">
<el-form-item :label="this.$t('m.associatedComponents')"
:label-width="formLabelWidth"
prop="selectStandCategory"
class="add-form-item">
<search-select
v-model="assemblyModelAdd.selectStandCategory"
:options="standCategoryList"
@on-change="getSelectCate"
clearable
/>
</el-form-item>
<el-form-item :label="this.$t('m.sortNumber')"
prop="showIndex"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
oninput="if(value.length>4)value=value.slice(0,4)"
type="number"
v-model.number="assemblyModelAdd.showIndex"
@mousewheel.native.prevent
autocomplete="off" clearable></el-input>
</el-form-item>
</el-form>
<div class="demo-drawer-footer">
<el-button size="mini" @click="closeAreaModal('assemblyModelAdd')">{{$t('m.cancel')}}</el-button>
<el-button size="mini" type="primary" @click="saveArea('assemblyModelAdd')">{{$t('m.submit')}}</el-button>
</div>
</div>
<div class="area-content" v-else>
<div class="check-item-row">
<div class="check-item-col1">
<div class="check-item-label"> 选项:</div>
<el-tooltip class="item" effect="dark" :content="assemblyModelAdd.dicTypeName" placement="top">
<div slot="content" class="toolip-content">{{assemblyModelAdd.dicTypeName}}</div>
<div class="check-item-value">{{assemblyModelAdd.dicTypeName}}</div>
</el-tooltip>
</div>
<div class="check-item-col1">
<div class="check-item-label">排序号:</div>
<div class="check-item-value">{{assemblyModelAdd.showIndex}}</div>
</div>
</div>
</div>
</el-drawer>
</el-drawer>
</div>
</template>
<script>
export default {
name: 'AssociatedAssembly',
data () {
return {
// 查询条件
assemblyForm: {
// 选项
standName: '',
// 数据编码
standCode: '',
// 描述
describes: ''
},
total: 0,
page: 1,
rows: 10,
loading: false,
// 列表数据
assemblyData: [],
// 抽屉打开
dialogState: false,
// form-item label宽度
formLabelWidth: '80px',
// 新增弹窗数据
regionModelAdd: {
// 数据信息
dicTypeName: '',
showIndex: '',
// 数据编码
dicTypeCode: '',
// 描述
describes: '',
// 唯一辨识
dicId: 'SMILEBEAUTY',
parentId: '' // 父级ID
},
// 弹窗标题
title: '',
// 表单验证
regionRules: {
dicTypeName: [
{required: true, message: '选项不能为空', trigger: 'blur'},
{type: 'string', max: 100, message: '最多输入100位', trigger: 'blur'}
],
showIndex: [
{required: true, message: '排序号不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
],
describes: [
{type: 'string', max: 500, message: '最多输入500位', trigger: 'blur'}
],
parentId: [
{required: true, message: '系统不能为空', trigger: 'blur'}
]
},
// 中间变量
standName1: '',
describes1: '',
standCode1: '',
// 判断是新增or 编辑 or 查看
oprState: 0,
// 主页多选时接收选中行数据
selectNum: [],
// 查看内列表数据
areaData: [],
// 内部弹窗标题
areaTitle: '',
// 判断内部弹窗是新建or 查看
inDrawState: 0,
innerDrawer: false,
// 内部新增rules
assemblyModelRules: {
selectStandCategory: [
{ required: true, message: '关联部件不能为空', trigger: 'change' }
],
showIndex: [
{required: true, message: '排序号不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
]
},
// 内联抽屉信息
assemblyModelAdd: {
dicTypeName: '',
dicTypeCode: '',
showIndex: '',
describes: '',
parentId: '',
classifyCode: '',
selectStandCategory: '',
dicId: 'SMILEBEAUTY'
},
// 内部分页,计数
// 子类分类
areaPage: 1,
areaTotal: 0,
areaRows: 10,
// 关联部件表,下拉框里的数据
standCategoryList: [],
// 不重复
newAreaModelAdd: {},
areaRow: '',
areaSelectNum: [],
tableHeight: null,
systemList: [] // 系统数组
}
},
methods: {
// 条件查询
selecteRgionBtn () {
this.standName1 = this.assemblyForm.standName
this.describes1 = this.assemblyForm.describes
this.standCode1 = this.assemblyForm.standCode
this.page = 1
this.selectClass()
},
// 清空查询
resetSelect (formName) {
this.standName1 = ''
// this.standCode1 = ''
this.describes1 = ''
this.assemblyForm.standName = ''
// this.assemblyForm.standCode = ''
this.assemblyForm.describes = ''
this.page = 1
this.selectClass()
},
// 分页加载列表页列表
selectClass () {
let DicTypeEOPage = {
page: this.page,
pageSize: this.$store.getters.userInfo.configContent,
dicTypeName: this.standName1,
describes: this.describes1,
dicId: 'SMILEBEAUTY'
}
this.$http.get('sys/dictype/pageRelateAssem', DicTypeEOPage, {
_this: this,
loading: 'loading'
}, res => {
this.assemblyData = res.data.list
this.total = res.data.count
}, e => {
})
// this.$refs.selection.selectAll(false)
},
// 新增弹窗打开
associatedAdd (oprState, row) {
this.oprState = oprState
if (this.oprState === 1) {
this.title = '新增信息'
this.dialogState = true
} else if (this.oprState === 2) {
this.title = '编辑信息'
this.regionModelAdd = row
this.dialogState = true
} else {
this.title = '查看信息'
this.regionModelAdd = row
this.areaRow = row.id
this.assemblyModelAdd.parentId = row.id
this.selectArea(row.id)
this.dialogState = true
}
},
// 新增弹窗提交
saveClass (formName) {
let data = this.regionModelAdd
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.oprState === 1) {
this.$http.postData('sys/dictype/createChild', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {})
} else if (this.oprState === 2) {
this.$http.putData('sys/dictype', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {
})
}
} else {
}
})
},
// 查看弹窗关闭
handleClose () {
this.page = 1
this.selectClass()
this.regionModelAdd.dicTypeName = ''
this.regionModelAdd.showIndex = ''
this.regionModelAdd.describes = ''
if (this.$refs['regionModelAdd']) {
this.$refs['regionModelAdd'].resetFields()
}
this.dialogState = false
},
// 新增弹窗关闭
closeModal (formName) {
this.page = 1
this.selectClass()
this.regionModelAdd.dicTypeName = ''
this.regionModelAdd.showIndex = ''
this.regionModelAdd.describes = ''
this.$refs['regionModelAdd'].resetFields()
this.dialogState = false
},
// 批量删除
regionBatchDel () {
if (this.selectNum === '' || this.selectNum.length === 0) {
this.$confirm('请选择一条数据进行删除', '提示', {
showCancelButton: false,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
} else {
(
this.$confirm('确认删除这些数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let delIds = []
let delTypeCodes = []
for (let i = 0; i < this.selectNum.length; i++) {
delIds.push(this.selectNum[i].id)
delTypeCodes.push(this.selectNum[i].dicTypeCode)
}
delIds = delIds.join(',')
delTypeCodes = delTypeCodes.join(',')
let data = {}
data.ids = delIds
data.dicTypeCodes = delTypeCodes
this.$http.delete('sys/dictype/deleteArr', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
}
})
}).catch(() => {
// 取消删除,清空选择
this.$refs.selection.clearSelection()
})
)
}
},
// 删除
classDel (row) {
let data = {}
data.dicTypeEOId = row.id
data.dicTypeCode = row.dicTypeCode
if (data.id !== '' && data.dicTypeCode !== '') {
this.$confirm('确认删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http.delete('sys/dictype/delete', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
} else {
}
}).catch(() => {
})
})
}
},
// 多选
handleSelectionChange (val) {
this.selectNum = val
},
pageChange (page) {
this.page = page
this.selectClass()
},
pageSizeChange (pageSize) {
this.rows = pageSize
this.selectClass()
},
// 内联表格加载
selectArea (id) {
this.$http.get('sys/dictype/page', {
page: this.areaPage,
pageSize: this.$store.getters.userInfo.configContent,
dicId: 'SMILEBEAUTY',
id: id
}, {
_this: this,
loading: 'areaLoading'
}, res => {
this.areaTotal = res.data.count
this.areaData = res.data.list
}, e => {})
},
// 打开内部弹窗
areaAdd (inDrawState, row, id) {
this.inDrawState = inDrawState
if (this.inDrawState === 1) {
this.areaTitle = '新建信息'
this.getStandCategory()
this.$nextTick(() => {
this.$refs['assemblyModelAdd'].resetFields()
})
// this.$refs['assemblyModelAdd'].resetFields()
// this.assemblyModelAdd.selectStandCategory = ''
this.innerDrawer = true
} else {
this.assemblyModelAdd = row
this.areaTitle = '查看信息'
this.innerDrawer = true
}
},
// 关闭弹窗
handleAreaClose () {
this.areaPage = 1
this.selectArea(this.areaRow)
this.assemblyModelAdd.showIndex = ''
this.assemblyModelAdd.dicTypeName = ''
this.assemblyModelAdd.dicTypeCode = ''
this.newAreaModelAdd.dicTypeCode = ''
this.newAreaModelAdd.dicTypeName = ''
this.newAreaModelAdd.parentId = ''
if (this.$refs['assemblyModelAdd']) {
this.$refs['assemblyModelAdd'].resetFields()
}
this.innerDrawer = false
},
// 关闭新增弹窗
closeAreaModal (formName) {
this.areaPage = 1
this.selectArea(this.areaRow)
this.assemblyModelAdd.showIndex = ''
this.assemblyModelAdd.dicTypeName = ''
this.assemblyModelAdd.dicTypeCode = ''
this.newAreaModelAdd.dicTypeCode = ''
this.newAreaModelAdd.dicTypeName = ''
this.newAreaModelAdd.parentId = ''
this.$refs['assemblyModelAdd'].resetFields()
this.innerDrawer = false
},
// 获取关联部件List数据
getStandCategory () {
this.$http.get('sys/dictype/getDicTypeListCode', {
}, {_this: this}, res => {
this.standCategoryList = res.data.RELATEPARTS
})
},
// 下拉列表变化
getSelectCate () {
for (let index = 0; index < this.standCategoryList.length; index++) {
let standCategory = this.standCategoryList[index]
if (standCategory.value === this.assemblyModelAdd.selectStandCategory) {
this.selectStandCategoryNum = index
break
}
}
},
// 新增关联部件确定
saveArea (formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
let standCategory = this.standCategoryList[this.selectStandCategoryNum]
this.assemblyModelAdd.dicTypeName = standCategory.label
this.assemblyModelAdd.dicTypeCode = standCategory.value
this.newAreaModelAdd.dicTypeCode = this.assemblyModelAdd.dicTypeCode
this.newAreaModelAdd.dicTypeName = this.assemblyModelAdd.dicTypeName
this.newAreaModelAdd.parentId = this.assemblyModelAdd.parentId
this.newAreaModelAdd.showIndex = this.assemblyModelAdd.showIndex
this.newAreaModelAdd.dicId = 'SMILEBEAUTY'
// if (this.areaType === 1) {
this.$http.postData('sys/dictype/create', this.newAreaModelAdd, {
_this: this
}, res => {
if (res.ok) {
this.closeAreaModal()
}
}, e => {
})
// }
}
})
},
// 删除
regionAreaDel (row) {
let data = {}
data.dicTypeEOId = row.id
data.dicTypeCode = row.dicTypeCode
if (data.id !== '' && data.dicTypeCode !== '') {
this.$confirm('确认删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http.delete('sys/dictype/delete', data, {
_this: this
}, res => {
if (res.ok) {
this.selectArea(this.areaRow)
} else {
}
}).catch(() => {
})
})
}
},
areaBatchDel () {
if (this.areaSelectNum === '' || this.areaSelectNum.length === 0) {
this.$confirm('请选择一条数据进行删除', '提示', {
showCancelButton: false,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
} else {
(
this.$confirm('确认删除这些数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let delIds = []
let delTypeCodes = []
for (let i = 0; i < this.areaSelectNum.length; i++) {
delIds.push(this.areaSelectNum[i].id)
delTypeCodes.push(this.areaSelectNum[i].dicTypeCode)
}
delIds = delIds.join(',')
delTypeCodes = delTypeCodes.join(',')
let data = {}
data.ids = delIds
data.dicTypeCodes = delTypeCodes
this.$http.delete('sys/dictype/deleteArr', data, {
_this: this
}, res => {
if (res.ok) {
this.selectArea(this.areaRow)
}
})
}).catch(() => {
// 取消删除,清空选择
this.$refs.selection.clearSelection()
})
)
}
},
// 多选
handleAreaSelectionChange (val) {
this.areaSelectNum = val
},
// 子类分页
areaPageChange (page) {
this.areaPage = page
this.selectArea(this.areaRow)
},
areaPageSizeChange (pageSize) {
this.areaRows = pageSize
this.selectArea(this.areaRow)
},
// 查询所有系统
getSystem () {
let DicTypeEOPage = {
page: 1,
pageSize: 9999,
dicId: 'JQZYWFOVER'
}
this.$http.get('sys/dictype/pageCountry', DicTypeEOPage, {
_this: this,
loading: 'loading'
}, res => {
this.systemList = res.data.list
}, e => {
})
}
},
mounted () {
this.selectClass()
this.getSystem()
this.tableHeight = $('.content').height() - 44
window.onresize = () => {
this.tableHeight = $('.content').height() - 44
}
},
computed: {}
}
</script>
<style lang="less" scoped>
#national-area{
position: relative;
height: 100%;
padding: 0 10px;
background: #fff;
.content{
height: calc(~'100% - 45px - 56px');
overflow-y: auto;
}
.demo-drawer__content {
// padding: 0 15px;
.search-area1 {
text-align: right;
border-bottom: 1px solid #e8eaec;
padding-bottom: 10px;
margin-bottom: 23px;
}
.label-input-form {
display: inline-block;
}
}
}
.area-content{
padding: 0 15px;
}
</style>
@@ -0,0 +1,510 @@
<!--配置管理--关联部件-->
<template>
<div class="enterprise-standard-category v-class">
<el-form :inline="true" :model="componentsForm" ref="ruleForm" class="label-input-form">
<el-form-item :label="this.$t('m.option')" class="serch-form-item">
<el-input
v-model.trim="componentsForm.standName"
:placeholder="$t('m.pleaseEnterOptions')"
:maxlength="100"
clearable
@keyup.enter.native="selectcomponentsBtn"></el-input>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
icon="el-icon-search"
type="primary"
class="searchAngNewBtn"
@click="selectcomponentsBtn"></el-button>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
type="primary"
class="searchAngNewBtn"
@click="resetSelect">{{$t('m.clearQuery')}}</el-button>
</el-form-item>
</el-form>
<div class="content">
<div class="action-bar">
<el-button
type="primary"
size="mini"
@click="componentsAdd(1, null)"
v-btn-permission="'CXRPGWHNSF'"
>{{$t('m.add')}}</el-button>
<el-button
type="danger"
size="mini"
@click="classBatchDel"
v-btn-permission="'R24ALH4Q89'">{{$t('m.delete')}}</el-button>
</div>
<el-table
:height="tableHeight"
ref="selection"
:data="categoryData"
tooltip-effect="dark"
style="width: 100%"
border
row-key="id"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="dicTypeName"
:label="this.$t('m.option')"
width="400"
align="center"
>
</el-table-column>
<el-table-column
prop="describes"
:label="this.$t('m.describe')"
width="400"
align="center">
</el-table-column>
<el-table-column :label="this.$t('m.operation')"
align="center">
<template slot-scope="scope">
<el-button
class="opera-btn"
size="mini"
type="primary"
@click="componentsAdd(3, scope.row)">{{$t('m.see')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="warning"
v-btn-permission="'ZL86999VLW'"
@click="componentsAdd(2, scope.row)">{{$t('m.edit')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="danger"
v-btn-permission="'7C7567JU9G'"
@click="classDel(scope.row)">{{$t('m.delete')}}</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!--分页-->
<pagination
:page="page"
:total="total"
@pageChange="pageChange"
@pageSizeChange="pageSizeChange"></pagination>
<loading :loading="loading">数据获取中</loading>
<!--新增抽屉-->
<el-drawer
:title="title"
:visible.sync="dialogState"
direction="rtl"
custom-class="demo-drawer"
ref="drawer"
size="800px"
:class="classObject"
:before-close="handleClose"
>
<div class="demo-drawer__content" v-if="this.oprState === 1 || this.oprState === 2">
<el-form :model="componentsModelAdd" ref="componentsModelAdd" :rules="classRules" class="label-input-form">
<el-row>
<el-col :span="12">
<el-form-item :label="this.$t('m.option')"
:label-width="formLabelWidth"
prop="dicTypeName"
:disabled = 'this.oprState === 2'
class="add-form-item">
<el-input
v-model.trim="componentsModelAdd.dicTypeName"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.sortNumber')"
prop="showIndex"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
type="number"
oninput="if(value.length>4)value=value.slice(0,4)"
v-model.number="componentsModelAdd.showIndex"
@mousewheel.native.prevent
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.describe')"
prop="describes"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
v-model.trim="componentsModelAdd.describes"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="总成"
prop="parentId"
:label-width="formLabelWidth"
class="add-form-item"
>
<el-select v-model="componentsModelAdd.parentId">
<el-option
v-for="(item, index) in assemblyList"
:key="index"
:label="item.dicTypeName"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="demo-drawer-footer">
<el-button size="mini" @click="closeModal('componentsModelAdd')">{{$t('m.cancel')}}</el-button>
<el-button size="mini" type="primary" @click="saveCategory('componentsModelAdd')">{{$t('m.submit')}}</el-button>
</div>
</div>
<div class="demo-drawer__content" v-else>
<div class="check-item-row">
<div class="check-item-col1">
<div class="check-item-label"> 选项:</div>
<div class="check-item-value">{{componentsModelAdd.dicTypeName}}</div>
</div>
<div class="check-item-col1">
<div class="check-item-label">排序号:</div>
<div class="check-item-value">{{componentsModelAdd.showIndex}}</div>
</div>
</div>
<div class="check-item-row">
<div class="check-item-col2">
<div class="check-item-label">描述:</div>
<div class="check-item-value">{{componentsModelAdd.describes}}</div>
</div>
<div class="check-item-col2">
<div class="check-item-label"></div>
<div class="check-item-value"></div>
</div>
</div>
</div>
</el-drawer>
</div>
</template>
<script>
export default {
name: 'AssociatedComponents',
data () {
return {
// 查询条件
componentsForm: {
// 选项
standName: '',
// 数据编码
standCode: '',
// 描述
describes: ''
},
total: 0,
page: 1,
rows: 10,
loading: false,
// 列表数据
categoryData: [],
// 抽屉打开
dialogState: false,
// form-item label宽度
formLabelWidth: '80px',
// 新增弹窗数据
componentsModelAdd: {
// 数据信息
dicTypeName: '',
showIndex: '',
// 数据编码
dicTypeCode: '',
// 描述
describes: '',
// 唯一辨识
dicId: 'NAVITYLOA',
parentId: '' // 父级ID
},
// 弹窗标题
title: '',
// 表单验证
classRules: {
dicTypeName: [
{required: true, message: '选项不能为空', trigger: 'blur'},
{type: 'string', max: 100, message: '最多输入100位', trigger: 'blur'}
],
showIndex: [
{required: true, message: '排序号不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
],
describes: [
{type: 'string', max: 500, message: '最多输入500位', trigger: 'blur'}
],
parentId: [
{required: true, message: '总成不能为空', trigger: 'blur'}
]
},
// 中间变量
standName1: '',
describes1: '',
standCode1: '',
// 判断是新增or 编辑 or 查看
oprState: 0,
// 多选时接收选中行数据
selectNum: [],
tableHeight: null,
assemblyList: [] // 总成数组
}
},
methods: {
// 条件查询
selectcomponentsBtn () {
this.standName1 = this.componentsForm.standName
this.describes1 = this.componentsForm.describes
this.standCode1 = this.componentsForm.standCode
this.page = 1
this.selectcomponents()
},
// 清空查询
resetSelect (formName) {
this.standName1 = ''
this.standCode1 = ''
this.describes1 = ''
this.componentsForm.standName = ''
this.componentsForm.standCode = ''
this.componentsForm.describes = ''
this.page = 1
this.selectcomponents()
},
// 分页加载列表
selectcomponents () {
let DicTypeEOPage = {
page: this.page,
pageSize: this.$store.getters.userInfo.configContent,
dicTypeName: this.standName1,
dicTypeCode: this.standCode1,
describes: this.describes1,
dicId: 'NAVITYLOA'
}
this.$http.get('sys/dictype/pageRelateAssem', DicTypeEOPage, {
_this: this,
loading: 'loading'
}, res => {
this.categoryData = res.data.list
this.total = res.data.count
}, e => {
})
// this.$refs.selection.selectAll(false)
},
// 新增弹窗打开
componentsAdd (oprState, row) {
this.oprState = oprState
if (this.oprState === 1) {
this.title = '新增信息'
this.dialogState = true
} else if (this.oprState === 2) {
this.title = '编辑信息'
this.componentsModelAdd = row
this.dialogState = true
} else {
this.title = '查看信息'
this.componentsModelAdd = row
this.dialogState = true
}
},
// 新增弹窗提交
saveCategory (formName) {
let data = this.componentsModelAdd
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.oprState === 1) {
this.componentsModelAdd.dicTypeCode = this.componentsModelAdd.dicTypeName
this.$http.postData('sys/dictype/createChild', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {})
} else if (this.oprState === 2) {
this.$http.putData('sys/dictype', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {
})
}
} else {
return false
}
})
},
// 查看弹窗关闭
handleClose () {
this.page = 1
this.selectcomponents()
this.componentsModelAdd.dicTypeName = ''
this.componentsModelAdd.showIndex = ''
this.componentsModelAdd.describes = ''
if (this.$refs['componentsModelAdd']) {
this.$refs['componentsModelAdd'].resetFields()
}
this.dialogState = false
},
// 新增弹窗关闭
closeModal (formName) {
this.page = 1
this.selectcomponents()
this.componentsModelAdd.dicTypeName = ''
this.componentsModelAdd.showIndex = ''
this.componentsModelAdd.describes = ''
this.$refs['componentsModelAdd'].resetFields()
this.dialogState = false
},
// 批量删除
classBatchDel () {
if (this.selectNum === '' || this.selectNum.length === 0) {
this.$confirm('请选择一条数据进行删除', '提示', {
showCancelButton: false,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
})
} else {
(
this.$confirm('确认删除这些数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
let delIds = []
let delTypeCodes = []
for (let i = 0; i < this.selectNum.length; i++) {
delIds.push(this.selectNum[i].id)
delTypeCodes.push(this.selectNum[i].dicTypeCode)
}
delIds = delIds.join(',')
delTypeCodes = delTypeCodes.join(',')
let data = {}
data.ids = delIds
data.dicTypeCodes = delTypeCodes
this.$http.delete('sys/dictype/deleteArr', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
}
})
}).catch(() => {
// 取消删除,清空选择
this.$refs.selection.clearSelection()
})
)
}
},
// 删除
classDel (row) {
let data = {}
data.dicTypeEOId = row.id
data.dicTypeCode = row.dicTypeCode
if (data.id !== '' && data.dicTypeCode !== '') {
this.$confirm('确认删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.delete('sys/dictype/delete', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
} else {
}
}).catch(() => {
})
})
}
},
// 多选
handleSelectionChange (val) {
this.selectNum = val
},
pageChange (page) {
this.page = page
this.selectcomponents()
},
pageSizeChange (pageSize) {
this.rows = pageSize
this.selectcomponents()
},
// 查询所有总成
getAssembly () {
let DicTypeEOPage = {
page: 1,
pageSize: 9999,
dicId: 'SMILEBEAUTY'
}
this.$http.get('sys/dictype/pageRelateAssem', DicTypeEOPage, {
_this: this,
loading: 'loading'
}, res => {
this.assemblyList = res.data.list
}, e => {
})
}
},
mounted () {
this.selectcomponents()
this.getAssembly()
this.tableHeight = $('.content').height() - 44
window.onresize = () => {
this.tableHeight = $('.content').height() - 44
}
},
computed: {
classObject () {
return {
'check-draw': this.oprState === 3
}
}
}
}
</script>
<style lang="less" scoped>
.enterprise-standard-category{
position: relative;
height: 100%;
padding: 0 10px;
background: #fff;
.content{
height: calc(~'100% - 45px - 56px');
overflow-y: auto;
}
.demo-drawer__content{
// border: 1px solid #ccc;
padding: 0 15px;
}
}
</style>
@@ -0,0 +1,787 @@
<!-- 配置管理--关联系统-->
<template>
<div id="area" class="v-class">
<el-form :inline="true" :model="standardForm" ref="ruleForm" class="label-input-form">
<el-form-item :label="this.$t('m.option')" class="serch-form-item">
<el-input
v-model.trim="standardForm.standName"
:placeholder="$t('m.pleaseEnterOptions')"
:maxlength="100"
clearable
@keyup.enter.native="selecteAreaBtn"></el-input>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
icon="el-icon-search"
type="primary"
class="searchAngNewBtn"
@click="selecteAreaBtn"></el-button>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
type="primary"
class="searchAngNewBtn"
@click="resetSelect">{{$t('m.clearQuery')}}</el-button>
</el-form-item>
</el-form>
<div class="content">
<div class="action-bar">
<el-button
type="primary"
size="mini"
@click="classAdd(1, null)"
>{{$t('m.add')}}</el-button>
<el-button
type="danger"
size="mini"
@click="areaBatchDel"
>{{$t('m.delete')}}</el-button>
</div>
<el-table
:height="tableHeight"
ref="selectionArea"
:data="regionData"
tooltip-effect="dark"
style="width: 100%"
border
row-key="id"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="dicTypeName"
:label="this.$t('m.option')"
width="400"
align="center"
>
</el-table-column>
<el-table-column
prop="describes"
:label="this.$t('m.describe')"
width="400"
align="center">
</el-table-column>
<el-table-column :label="this.$t('m.operation')"
align="center">
<template slot-scope="scope">
<el-button
class="opera-btn"
size="mini"
type="primary"
@click="classAdd(3, scope.row)">{{$t('m.see')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="warning"
@click="classAdd(2, scope.row)">{{$t('m.edit')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="danger"
@click="classDel(scope.row)">{{$t('m.delete')}}</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!--分页-->
<pagination
:page="page"
:total="total"
@pageChange="pageChange"
@pageSizeChange="pageSizeChange"></pagination>
<loading :loading="loading">数据获取中</loading>
<!--新增抽屉-->
<el-drawer
:title="title"
:visible.sync="dialogState"
direction="rtl"
custom-class="demo-drawer"
ref="drawer"
size="800px"
:before-close="handleClose"
>
<div class="demo-drawer__content" v-if="this.oprState === 1 || this.oprState === 2">
<el-form :model="areaModelAdd" ref="areaModelAdd" :rules="regionRules" class="label-input-form">
<el-row>
<el-col :span="12">
<el-form-item :label="this.$t('m.option')"
:label-width="formLabelWidth"
prop="dicTypeName"
:disabled = 'this.oprState === 2'
class="add-form-item">
<el-input
v-model.trim="areaModelAdd.dicTypeName"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.sortNumber')"
prop="showIndex"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
type="number"
oninput="if(value.length>4)value=value.slice(0,4)"
v-model.number="areaModelAdd.showIndex"
@mousewheel.native.prevent
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.describe')"
prop="describes"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
v-model.trim="areaModelAdd.describes"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="demo-drawer-footer">
<el-button size="mini" @click="closeModal('areaModelAdd')">{{$t('m.cancel')}}</el-button>
<el-button size="mini" type="primary" @click="saveClass('areaModelAdd')">{{$t('m.submit')}}</el-button>
</div>
</div>
<div class="demo-drawer__content" v-else>
<div class="search-area1">
<el-form :inline="true" :model="standardForm" ref="ruleForm" class="label-input-form">
<div class="search-area-item">
<!--<el-form-item class="serch-form-item btn-box">-->
<!--<el-button-->
<!--type="primary"-->
<!--class="searchAngNewBtn"-->
<!--@click="countryAdd(1, null)"-->
<!--&gt;{{$t('m.add')}}</el-button>-->
<!--</el-form-item>-->
<el-form-item class="serch-form-item btn-box">
<el-button
type="danger"
class="searchAngNewBtn"
@click="countriseDel">{{$t('m.delete')}}</el-button>
</el-form-item>
</div>
</el-form>
</div>
<div class="content1">
<el-table
ref="selection"
:data="areaData1"
tooltip-effect="dark"
style="width: 100%"
border
row-key="id"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="handleAreaSelectionChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="dicTypeName"
:label="this.$t('m.systemAssembly')"
width="260"
align="center"
>
</el-table-column>
<el-table-column :label="this.$t('m.operation')" align="center">
<template slot-scope="scope">
<el-button
class="opera-btn"
size="mini"
type="primary"
@click="countryAdd(2, scope.row)">{{$t('m.see')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="danger"
@click="coutryDel(scope.row)">{{$t('m.delete')}}</el-button>
</template>
</el-table-column>
</el-table>
</div>
<loading :loading="loading">数据获取中</loading>
<pagination :page="areaPage" :total="areaTotal" @pageChange="areaPageChange" @pageSizeChange="areaPageSizeChange"></pagination>
</div>
<el-drawer
:title="areaTitle"
:append-to-body="true"
:before-close="handlCountryClose"
destroy-on-close
:visible.sync="innerDrawer">
<div class="area-content" v-if="this.inDrawState === 1">
<el-form :model="countryModelAdd" ref="countryModelAdd" :rules="countryModelAddRules" class="label-input-form">
<el-form-item :label="this.$t('m.systemAssembly')"
:label-width="formLabelWidth"
prop="selectStandCategory"
class="add-form-item">
<search-select
v-model="countryModelAdd.selectStandCategory"
:options="countryList"
@on-change="getSelectCate"
clearable
/>
</el-form-item>
<el-form-item :label="this.$t('m.sortNumber')"
prop="showIndex"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
oninput="if(value.length>4)value=value.slice(0,4)"
type="number"
v-model.number="countryModelAdd.showIndex"
@mousewheel.native.prevent
autocomplete="off" clearable></el-input>
</el-form-item>
</el-form>
<div class="demo-drawer-footer">
<el-button size="mini" @click="closeCountryModal('countryModelAdd')">{{$t('m.cancel')}}</el-button>
<el-button size="mini" type="primary" @click="saveCountry('countryModelAdd')">{{$t('m.submit')}}</el-button>
</div>
</div>
<div class="area-content" v-else>
<div class="check-item-row">
<div class="check-item-col1">
<div class="check-item-label"> 选项:</div>
<el-tooltip class="item" effect="dark" :content="countryModelAdd.dicTypeName" placement="top">
<div slot="content" class="toolip-content">{{countryModelAdd.dicTypeName}}</div>
<div class="check-item-value">{{countryModelAdd.dicTypeName}}</div>
</el-tooltip>
<!-- <div class="check-item-value">{{countryModelAdd.dicTypeName}}</div>-->
</div>
<div class="check-item-col1">
<div class="check-item-label">排序号:</div>
<div class="check-item-value">{{countryModelAdd.showIndex}}</div>
</div>
</div>
</div>
</el-drawer>
</el-drawer>
</div>
</template>
<script>
export default {
name: 'AssociatedSystem',
data () {
return {
// 查询条件
standardForm: {
// 选项
standName: '',
// 数据编码
standCode: '',
// 描述
describes: ''
},
total: 0,
page: 1,
rows: 10,
loading: false,
// 列表数据
regionData: [],
// 抽屉打开
dialogState: false,
// form-item label宽度
formLabelWidth: '80px',
// 新增弹窗数据
areaModelAdd: {
// 数据信息
dicTypeName: '',
showIndex: '',
// 数据编码
dicTypeCode: '',
// 描述
describes: '',
// 唯一辨识
dicId: 'JQZYWFOVER'
},
// 弹窗标题
title: '',
// 表单验证
regionRules: {
dicTypeName: [
{required: true, message: '选项不能为空', trigger: 'blur'},
{type: 'string', max: 100, message: '最多输入100位', trigger: 'blur'}
],
showIndex: [
{required: true, message: '排序号不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
],
describes: [
{type: 'string', max: 500, message: '最多输入500位', trigger: 'blur'}
]
},
// 中间变量
standName1: '',
describes1: '',
standCode1: '',
// 判断是新增or 编辑 or 查看
oprState: 0,
// 多选时接收选中行数据
selectNum: [],
areaData1: [],
// 内部弹窗标题
areaTitle: '',
// 判断内部弹窗是新建or 查看
inDrawState: 0,
innerDrawer: false,
// 内部新增rules
countryModelAddRules: {
selectStandCategory: [
{ required: true, message: '系统总成不能为空', trigger: 'change' }
],
showIndex: [
{required: true, message: '排序号不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
]
},
// 内联抽屉信息
countryModelAdd: {
dicTypeName: '',
dicTypeCode: '',
showIndex: '',
describes: '',
parentId: '',
classifyCode: '',
selectStandCategory: '',
dicId: 'JQZYWFOVER'
},
// 内部分页,计数
// 子类分类
areaPage: 1,
areaTotal: 0,
areaRows: 10,
// 标准类别表,下拉框里的数据
countryList: [],
// 不重复
newAreaModelAdd: {},
countyrRow: '',
areaSelectNum: [],
tableHeight: null
}
},
methods: {
// 条件查询
selecteAreaBtn () {
this.standName1 = this.standardForm.standName
this.describes1 = this.standardForm.describes
this.standCode1 = this.standardForm.standCode
this.page = 1
this.selectArea()
},
// 清空查询
resetSelect (formName) {
this.standName1 = ''
this.describes1 = ''
this.standardForm.standName = ''
this.standardForm.describes = ''
this.page = 1
this.selectArea()
},
// 分页加载列表页列表
selectArea () {
let DicTypeEOPage = {
page: this.page,
pageSize: this.$store.getters.userInfo.configContent,
dicTypeName: this.standName1,
// dicTypeCode: this.standCode1,
describes: this.describes1,
dicId: 'JQZYWFOVER'
}
this.$http.get('sys/dictype/pageCountry', DicTypeEOPage, {
_this: this,
loading: 'loading'
}, res => {
this.regionData = res.data.list
this.total = res.data.count
}, e => {
})
// this.$refs.selection.selectAll(false)
},
// 新增弹窗打开
classAdd (oprState, row) {
this.oprState = oprState
if (this.oprState === 1) {
this.title = '新增信息'
this.dialogState = true
} else if (this.oprState === 2) {
this.title = '编辑信息'
this.areaModelAdd = row
this.dialogState = true
} else {
this.title = '查看信息'
this.areaModelAdd = row
this.countyrRow = row.id
this.countryModelAdd.parentId = row.id
this.getArea(row.id)
this.dialogState = true
}
},
// 新增弹窗提交
saveClass (formName) {
let data = this.areaModelAdd
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.oprState === 1) {
this.$http.postData('sys/dictype/create', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {})
} else if (this.oprState === 2) {
this.$http.putData('sys/dictype', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {
})
}
} else {
// ('error submit!!')
// return false
}
})
},
// 查看弹窗关闭
handleClose () {
this.page = 1
this.selectArea()
this.areaModelAdd.dicTypeName = ''
this.areaModelAdd.showIndex = ''
this.areaModelAdd.describes = ''
if (this.$refs['areaModelAdd']) {
this.$refs['areaModelAdd'].resetFields()
}
this.dialogState = false
},
// 新增弹窗关闭
closeModal (formName) {
this.page = 1
this.selectArea()
this.areaModelAdd.dicTypeName = ''
this.areaModelAdd.showIndex = ''
this.areaModelAdd.describes = ''
this.$refs['areaModelAdd'].resetFields()
this.dialogState = false
},
// 批量删除
areaBatchDel () {
if (this.selectNum === '' || this.selectNum.length === 0) {
this.$confirm('请选择一条数据进行删除', '提示', {
showCancelButton: false,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
})
} else {
(
this.$confirm('确认删除这些数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
let delIds = []
let delTypeCodes = []
for (let i = 0; i < this.selectNum.length; i++) {
delIds.push(this.selectNum[i].id)
delTypeCodes.push(this.selectNum[i].dicTypeCode)
}
delIds = delIds.join(',')
delTypeCodes = delTypeCodes.join(',')
let data = {}
data.ids = delIds
data.dicTypeCodes = delTypeCodes
this.$http.delete('sys/dictype/deleteArr', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
}
})
}).catch(() => {
// 取消删除,清空选择
this.$refs.selectionArea.clearSelection()
})
)
}
},
// 删除
classDel (row) {
let data = {}
data.dicTypeEOId = row.id
data.dicTypeCode = row.dicTypeCode
if (data.id !== '' && data.dicTypeCode !== '') {
this.$confirm('确认删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.delete('sys/dictype/delete', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
} else {
}
}).catch(() => {
})
})
}
},
// 多选
handleSelectionChange (val) {
this.selectNum = val
},
pageChange (page) {
this.page = page
this.selectArea()
},
pageSizeChange (pageSize) {
this.rows = pageSize
this.selectArea()
},
// 内联表格加载
getArea (id) {
this.$http.get('sys/dictype/page', {
page: this.areaPage,
pageSize: this.$store.getters.userInfo.configContent,
id: id
}, {
_this: this,
loading: 'areaLoading'
}, res => {
this.areaTotal = res.data.count
this.areaData1 = res.data.list
}, e => {})
},
// 新增查看弹窗打开
countryAdd (inDrawState, row) {
this.inDrawState = inDrawState
if (this.inDrawState === 1) {
this.areaTitle = '新建信息'
this.getCountryList()
this.innerDrawer = true
this.$nextTick(() => {
this.$refs['countryModelAdd'].resetFields()
})
} else {
this.countryModelAdd = row
this.areaTitle = '查看信息'
this.innerDrawer = true
}
},
// 获取标准类别List数据
getCountryList () {
this.$http.get('sys/dictype/getDicTypeListCode', {}, {_this: this}, res => {
this.countryList = res.data.RELATEASSEM
})
},
// 下拉列表变化
getSelectCate () {
for (let index = 0; index < this.countryList.length; index++) {
let standCategory = this.countryList[index]
if (standCategory.value === this.countryModelAdd.selectStandCategory) {
this.selectCountryListNum = index
break
}
}
},
// 新增系统总成确定
saveCountry (name) {
this.$refs[name].validate((valid) => {
if (valid) {
let countryList = this.countryList[this.selectCountryListNum]
this.countryModelAdd.dicTypeName = countryList.label
this.countryModelAdd.dicTypeCode = countryList.value
this.newAreaModelAdd.dicTypeCode = this.countryModelAdd.dicTypeCode
this.newAreaModelAdd.dicTypeName = this.countryModelAdd.dicTypeName
this.newAreaModelAdd.parentId = this.countryModelAdd.parentId
this.newAreaModelAdd.showIndex = this.countryModelAdd.showIndex
// this.newAreaModelAdd.dicId = 'MDSKFJJKK'
// if (this.areaType === 1) {
this.$http.postData('sys/dictype/create', this.newAreaModelAdd, {
_this: this
}, res => {
if (res.ok) {
this.closeCountryModal()
// this.innerDrawer = false
}
}, e => {
})
// }
}
})
},
// 关闭弹窗
handlCountryClose () {
this.areaPage = 1
this.getArea(this.countyrRow)
this.countryModelAdd.showIndex = ''
this.countryModelAdd.dicTypeName = ''
this.countryModelAdd.dicTypeCode = ''
this.newAreaModelAdd.dicTypeCode = ''
this.newAreaModelAdd.dicTypeName = ''
this.newAreaModelAdd.parentId = ''
if (this.$refs['countryModelAdd']) {
this.$refs['countryModelAdd'].resetFields()
}
this.innerDrawer = false
},
// 关闭新增弹窗
closeCountryModal (formName) {
this.areaPage = 1
this.getArea(this.countyrRow)
this.countryModelAdd.showIndex = ''
this.countryModelAdd.dicTypeName = ''
this.countryModelAdd.dicTypeCode = ''
this.newAreaModelAdd.dicTypeCode = ''
this.newAreaModelAdd.dicTypeName = ''
this.newAreaModelAdd.parentId = ''
this.$refs['countryModelAdd'].resetFields()
this.innerDrawer = false
},
// 删除
coutryDel (row) {
let data = {}
data.dicTypeEOId = row.id
data.dicTypeCode = row.dicTypeCode
if (data.id !== '' && data.dicTypeCode !== '') {
this.$confirm('确认删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.delete('sys/dictype/delete', data, {
_this: this
}, res => {
if (res.ok) {
this.getArea(this.countyrRow)
} else {
}
}).catch(() => {
})
})
}
},
// 内联批量删除
countriseDel () {
if (this.areaSelectNum === '' || this.areaSelectNum.length === 0) {
this.$confirm('请选择一条数据进行删除', '提示', {
showCancelButton: false,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
})
} else {
(
this.$confirm('确认删除这些数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
let delIds = []
let delTypeCodes = []
for (let i = 0; i < this.areaSelectNum.length; i++) {
delIds.push(this.areaSelectNum[i].id)
delTypeCodes.push(this.areaSelectNum[i].dicTypeCode)
}
delIds = delIds.join(',')
delTypeCodes = delTypeCodes.join(',')
let data = {}
data.ids = delIds
data.dicTypeCodes = delTypeCodes
this.$http.delete('sys/dictype/deleteArr', data, {
_this: this
}, res => {
if (res.ok) {
this.getArea(this.countyrRow)
}
})
}).catch(() => {
// 取消删除,清空选择
this.$refs.selection.clearSelection()
})
)
}
},
// 多选
handleAreaSelectionChange (val) {
this.areaSelectNum = val
},
// 子类分页
areaPageChange (page) {
this.areaPage = page
this.getArea(this.countyrRow)
},
areaPageSizeChange (pageSize) {
this.areaRows = pageSize
this.getArea(this.countyrRow)
}
},
mounted () {
this.selectArea()
this.tableHeight = $('.content').height() - 44
window.onresize = () => {
this.tableHeight = $('.content').height() - 44
}
},
computed: {
}
}
</script>
<style lang="less" scoped>
#area{
position: relative;
height: 100%;
padding: 0 10px;
background: #fff;
.content{
height: calc(~'100% - 45px - 56px');
overflow-y: auto;
}
.demo-drawer__content {
// padding: 0 15px;
.search-area1 {
text-align: right;
border-bottom: 1px solid #e8eaec;
padding-bottom: 10px;
margin-bottom: 23px;
}
.label-input-form {
display: inline-block;
}
}
}
.area-content{
padding: 0 15px;
}
</style>
@@ -0,0 +1,484 @@
<!-- 适用认证 -->
<template>
<div id="authentication-type" class="v-class">
<el-form :inline="true" :model="standardForm" ref="ruleForm" class="label-input-form">
<el-form-item :label="this.$t('m.option')" class="serch-form-item">
<el-input
v-model.trim="standardForm.standName"
:placeholder="$t('m.pleaseEnterOptions')"
:maxlength="100"
clearable
@keyup.enter.native="selectAuthenticationBtn"></el-input>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
icon="el-icon-search"
type="primary"
class="searchAngNewBtn"
@click="selectAuthenticationBtn"></el-button>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
type="primary"
class="searchAngNewBtn"
@click="resetSelect">{{$t('m.clearQuery')}}</el-button>
</el-form-item>
</el-form>
<div class="content">
<div class="action-bar">
<el-button
type="primary"
size="mini"
@click="classAdd(1, null)"
v-btn-permission="'T33SNXMZE7'"
>{{$t('m.add')}}</el-button>
<el-button
type="danger"
size="mini"
@click="classBatchDel"
v-btn-permission="'YMJC6LHRNM'">{{$t('m.delete')}}</el-button>
</div>
<el-table
:height="tableHeight"
ref="selection"
:data="authenticationData"
tooltip-effect="dark"
style="width: 100%"
border
row-key="id"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="dicTypeName"
:label="this.$t('m.option')"
width="400"
align="center"
>
</el-table-column>
<el-table-column
prop="describes"
:label="this.$t('m.describe')"
width="400"
align="center">
</el-table-column>
<el-table-column
:label="this.$t('m.operation')"
align="center">
<template slot-scope="scope">
<el-button
class="opera-btn"
size="mini"
type="primary"
@click="classAdd(3, scope.row)">{{$t('m.see')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="warning"
v-btn-permission="'JRKQWE4ZZP'"
@click="classAdd(2, scope.row)">{{$t('m.edit')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="danger"
v-btn-permission="'GDYNES92QC'"
@click="classDel(scope.row)">{{$t('m.delete')}}</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!--分页-->
<pagination
:page="page"
:total="total"
@pageChange="pageChange"
@pageSizeChange="pageSizeChange"></pagination>
<loading :loading="loading">数据获取中</loading>
<!--新增抽屉-->
<el-drawer
:title="title"
:visible.sync="dialogState"
direction="rtl"
custom-class="demo-drawer"
ref="drawer"
size="800px"
:class="classObject"
:before-close="handleClose"
>
<div class="demo-drawer__content" v-if="this.oprState === 1 || this.oprState === 2">
<el-form :model="authenticationModelAdd" ref="authenticationModelAdd" :rules="classRules" class="label-input-form">
<el-row>
<el-col :span="12">
<el-form-item :label="this.$t('m.option')"
:label-width="formLabelWidth"
prop="dicTypeName"
:disabled = 'this.oprState === 2'
class="add-form-item">
<el-input
v-model.trim="authenticationModelAdd.dicTypeName"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.sortNumber')"
prop="showIndex"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
type="number"
oninput="if(value.length>4)value=value.slice(0,4)"
v-model.number="authenticationModelAdd.showIndex"
@mousewheel.native.prevent
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.describe')"
prop="describes"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
v-model.trim="authenticationModelAdd.describes"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="demo-drawer-footer">
<el-button size="mini" @click="closeModal('authenticationModelAdd')">{{$t('m.cancel')}}</el-button>
<el-button size="mini" type="primary" @click="saveAuthentication('authenticationModelAdd')">{{$t('m.submit')}}</el-button>
</div>
</div>
<div class="demo-drawer__content" v-else>
<div class="check-item-row">
<div class="check-item-col1">
<div class="check-item-label"> 选项:</div>
<div class="check-item-value">{{authenticationModelAdd.dicTypeName}}</div>
</div>
<div class="check-item-col1">
<div class="check-item-label">排序号:</div>
<div class="check-item-value">{{authenticationModelAdd.showIndex}}</div>
</div>
</div>
<div class="check-item-row">
<div class="check-item-col2">
<div class="check-item-label">描述:</div>
<div class="check-item-value">{{authenticationModelAdd.describes}}</div>
</div>
<div class="check-item-col2">
<div class="check-item-label"></div>
<div class="check-item-value"></div>
</div>
</div>
</div>
</el-drawer>
</div>
</template>
<script>
export default {
name: 'AuthenticationType',
data () {
return {
// 查询条件
standardForm: {
// 选项
standName: '',
// 数据编码
standCode: '',
// 描述
describes: ''
},
total: 0,
page: 1,
rows: 10,
loading: false,
// 列表数据
authenticationData: [],
// 抽屉打开
dialogState: false,
// form-item label宽度
formLabelWidth: '80px',
// 新增弹窗数据
authenticationModelAdd: {
// 数据信息
dicTypeName: '',
showIndex: '',
// 数据编码
dicTypeCode: '',
// 描述
describes: '',
// 唯一辨识
dicId: 'BNGHNMHJH'
},
// 弹窗标题
title: '',
// 表单验证
classRules: {
dicTypeName: [
{required: true, message: '选项不能为空', trigger: 'blur'},
{type: 'string', max: 100, message: '最多输入100位', trigger: 'blur'}
],
showIndex: [
{required: true, message: '排序号不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
],
describes: [
{type: 'string', max: 500, message: '最多输入500位', trigger: 'blur'}
]
},
// 中间变量
standName1: '',
describes1: '',
standCode1: '',
// 判断是新增or 编辑 or 查看
oprState: 0,
// 多选时接收选中行数据
selectNum: [],
tableHeight: null
}
},
methods: {
// 条件查询
selectAuthenticationBtn () {
this.standName1 = this.standardForm.standName
this.describes1 = this.standardForm.describes
this.standCode1 = this.standardForm.standCode
this.page = 1
this.selectAuthentication()
},
// 清空查询
resetSelect (formName) {
this.standName1 = ''
this.standCode1 = ''
this.describes1 = ''
this.standardForm.standName = ''
this.standardForm.standCode = ''
this.standardForm.describes = ''
this.page = 1
this.selectAuthentication()
},
// 分页加载列表
selectAuthentication () {
let DicTypeEOPage = {
page: this.page,
pageSize: this.$store.getters.userInfo.configContent,
dicTypeName: this.standName1,
dicTypeCode: this.standCode1,
describes: this.describes1,
dicId: 'BNGHNMHJH'
}
this.$http.get('sys/dictype/page', DicTypeEOPage, {
_this: this,
loading: 'loading'
}, res => {
this.authenticationData = res.data.list
this.total = res.data.count
}, e => {
})
// this.$refs.selection.selectAll(false)
},
// 新增弹窗打开
classAdd (oprState, row) {
this.oprState = oprState
if (this.oprState === 1) {
this.title = '新增信息'
this.dialogState = true
} else if (this.oprState === 2) {
this.title = '编辑信息'
this.authenticationModelAdd = row
this.dialogState = true
} else {
this.title = '查看信息'
this.authenticationModelAdd = row
this.dialogState = true
}
},
// 新增弹窗提交
saveAuthentication (formName) {
let data = this.authenticationModelAdd
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.oprState === 1) {
// this.authenticationModelAdd.dicTypeCode = this.authenticationModelAdd.dicTypeName
this.$http.postData('sys/dictype/create', data, {
_this: this,
loading: 'loading'
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {})
} else if (this.oprState === 2) {
this.$http.putData('sys/dictype', data, {
_this: this,
loading: 'loading'
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {
})
}
} else {
return false
}
})
},
// 查看弹窗关闭
handleClose () {
this.page = 1
this.selectAuthentication()
this.authenticationModelAdd.dicTypeName = ''
this.authenticationModelAdd.showIndex = ''
this.authenticationModelAdd.describes = ''
if (this.$refs['authenticationModelAdd']) {
this.$refs['authenticationModelAdd'].resetFields()
}
this.dialogState = false
},
// 新增弹窗关闭
closeModal (formName) {
this.page = 1
this.selectAuthentication()
this.authenticationModelAdd.dicTypeName = ''
this.authenticationModelAdd.showIndex = ''
this.authenticationModelAdd.describes = ''
this.$refs['authenticationModelAdd'].resetFields()
this.dialogState = false
},
// 批量删除
classBatchDel () {
if (this.selectNum === '' || this.selectNum.length === 0) {
this.$confirm('请选择一条数据进行删除', '提示', {
showCancelButton: false,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
})
} else {
(
this.$confirm('确认删除这些数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
let delIds = []
let delTypeCodes = []
for (let i = 0; i < this.selectNum.length; i++) {
delIds.push(this.selectNum[i].id)
delTypeCodes.push(this.selectNum[i].dicTypeCode)
}
delIds = delIds.join(',')
delTypeCodes = delTypeCodes.join(',')
let data = {}
data.ids = delIds
data.dicTypeCodes = delTypeCodes
this.$http.delete('sys/dictype/deleteArr', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
}
})
}).catch(() => {
// 取消删除,清空选择
this.$refs.selection.clearSelection()
})
)
}
},
// 删除
classDel (row) {
let data = {}
data.dicTypeEOId = row.id
data.dicTypeCode = row.dicTypeCode
if (data.id !== '' && data.dicTypeCode !== '') {
this.$confirm('确认删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.delete('sys/dictype/delete', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
} else {
}
}).catch(() => {
// this.$message({
// type: 'info',
// message: '已取消删除'
// });
})
})
}
},
// 多选
handleSelectionChange (val) {
this.selectNum = val
},
// 取消多选
clearSelection () {
},
pageChange (page) {
this.page = page
this.selectAuthentication()
},
pageSizeChange (pageSize) {
this.rows = pageSize
this.selectAuthentication()
}
},
mounted () {
this.selectAuthentication()
this.tableHeight = $('.content').height() - 44
window.onresize = () => {
this.tableHeight = $('.content').height() - 44
}
},
computed: {
classObject () {
return {
'check-draw': this.oprState === 3
}
}
}
}
</script>
<style lang="less" scoped>
#authentication-type{
position: relative;
height: 100%;
padding: 0 10px;
background: #fff;
.content{
height: calc(~'100% - 45px - 56px');
overflow-y: auto;
}
.demo-drawer__content{
// border: 1px solid #ccc;
padding: 0 15px;
}
}
</style>
@@ -0,0 +1,476 @@
<!-- 所属专业领域 -->
<template>
<div class="classification v-class">
<el-form :inline="true" :model="standardForm" ref="ruleForm" class="label-input-form">
<el-form-item :label="this.$t('m.option')" class="serch-form-item">
<el-input
v-model.trim="standardForm.standName"
:placeholder="$t('m.pleaseEnterOptions')"
:maxlength="100"
clearable
@keyup.enter.native="selectClassificationBtn"></el-input>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
icon="el-icon-search"
type="primary"
class="searchAngNewBtn"
@click="selectClassificationBtn"></el-button>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
type="primary"
class="searchAngNewBtn"
@click="resetSelect">{{$t('m.clearQuery')}}</el-button>
</el-form-item>
</el-form>
<!-- :reserve-selection="true" -->
<div class="content">
<div class="action-bar">
<el-button
type="primary"
size="mini"
@click="classAdd(1, null)"
v-btn-permission="'RKG5SZJFAF'"
>{{$t('m.add')}}</el-button>
<el-button
type="danger"
size="mini"
@click="classBatchDel"
v-btn-permission="'DMQ3BBGW6Y'">{{$t('m.delete')}}</el-button>
</div>
<el-table
:height="tableHeight"
ref="selection"
:data="classificationData"
tooltip-effect="dark"
style="width: 100%"
border
row-key="id"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="dicTypeName"
:label="this.$t('m.option')"
width="400"
align="center"
>
</el-table-column>
<el-table-column
prop="describes"
:label="this.$t('m.describe')"
width="400"
align="center">
</el-table-column>
<el-table-column :label="this.$t('m.operation')" align="center">
<template slot-scope="scope">
<el-button
class="opera-btn"
size="mini"
type="primary"
@click="classAdd(3, scope.row)">{{$t('m.see')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="warning"
v-btn-permission="'GDGJFCE2BH'"
@click="classAdd(2, scope.row)">{{$t('m.edit')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="danger"
v-btn-permission="'KTQ39F6DW9'"
@click="classDel(scope.row)">{{$t('m.delete')}}</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!--分页-->
<pagination
:page="page"
:total="total"
@pageChange="pageChange"
@pageSizeChange="pageSizeChange"></pagination>
<loading :loading="loading">数据获取中</loading>
<!--新增抽屉-->
<el-drawer
:title="title"
:visible.sync="dialogState"
direction="rtl"
custom-class="demo-drawer"
ref="drawer"
size="800px"
:class="classObject"
:before-close="handleClose"
>
<div class="demo-drawer__content" v-if="this.oprState === 1 || this.oprState === 2">
<el-form :model="classificationModelAdd" ref="classificationModelAdd" :rules="classRules" class="label-input-form">
<el-row>
<el-col :span="12">
<el-form-item :label="this.$t('m.option')"
:label-width="formLabelWidth"
prop="dicTypeName"
:disabled = 'this.oprState === 2'
class="add-form-item">
<el-input
v-model.trim="classificationModelAdd.dicTypeName"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.sortNumber')"
prop="showIndex"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
oninput="if(value.length>4)value=value.slice(0,4)"
type="number"
v-model.number="classificationModelAdd.showIndex"
@mousewheel.native.prevent
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.describe')"
prop="describes"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
v-model.trim="classificationModelAdd.describes"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="demo-drawer-footer">
<el-button size="mini" @click="closeModal('classificationModelAdd')">{{$t('m.cancel')}}</el-button>
<el-button size="mini" type="primary" @click="saveClass('classificationModelAdd')">{{$t('m.submit')}}</el-button>
</div>
</div>
<div class="demo-drawer__content" v-else>
<div class="check-item-row">
<div class="check-item-col1">
<div class="check-item-label"> 选项:</div>
<div class="check-item-value">{{classificationModelAdd.dicTypeName}}</div>
</div>
<div class="check-item-col1">
<div class="check-item-label">排序号:</div>
<div class="check-item-value">{{classificationModelAdd.showIndex}}</div>
</div>
</div>
<div class="check-item-row">
<div class="check-item-col2">
<div class="check-item-label">描述:</div>
<div class="check-item-value">{{classificationModelAdd.describes}}</div>
</div>
<div class="check-item-col2">
<div class="check-item-label"></div>
<div class="check-item-value"></div>
</div>
</div>
</div>
</el-drawer>
</div>
</template>
<script>
export default {
name: 'Category',
data () {
return {
// 查询条件
standardForm: {
// 选项
standName: '',
// 数据编码
standCode: '',
// 描述
describes: ''
},
total: 0,
page: 1,
rows: 10,
loading: false,
// 列表数据
classificationData: [],
// 抽屉打开
dialogState: false,
// form-item label宽度
formLabelWidth: '80px',
// 新增弹窗数据
classificationModelAdd: {
// 数据信息
dicTypeName: '',
showIndex: '',
// 数据编码
dicTypeCode: '',
// 描述
describes: '',
// 唯一辨识
dicId: 'VBMNHTGHG'
},
// 弹窗标题
title: '',
// 表单验证
classRules: {
dicTypeName: [
{required: true, message: '选项不能为空', trigger: 'blur'},
{type: 'string', max: 100, message: '最多输入100位', trigger: 'blur'}
],
showIndex: [
{required: true, message: '排序号不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
],
describes: [
{type: 'string', max: 500, message: '最多输入500位', trigger: 'blur'}
]
},
// 中间变量
standName1: '',
describes1: '',
standCode1: '',
// 判断是新增or 编辑 or 查看
oprState: 0,
// 多选时接收选中行数据
selectNum: [],
tableHeight: null
}
},
methods: {
// 条件查询
selectClassificationBtn () {
this.standName1 = this.standardForm.standName
this.describes1 = this.standardForm.describes
this.standCode1 = this.standardForm.standCode
this.page = 1
this.selectIfication()
},
// 清空查询
resetSelect (formName) {
this.standName1 = ''
this.standCode1 = ''
this.describes1 = ''
this.standardForm.standName = ''
this.standardForm.standCode = ''
this.standardForm.describes = ''
this.page = 1
this.selectIfication()
},
// 分页加载列表
selectIfication () {
let DicTypeEOPage = {
page: this.page,
pageSize: this.$store.getters.userInfo.configContent,
dicTypeName: this.standName1,
dicTypeCode: this.standCode1,
describes: this.describes1,
dicId: 'VBMNHTGHG'
}
this.$http.get('sys/dictype/page', DicTypeEOPage, {
_this: this,
loading: 'loading'
}, res => {
this.classificationData = res.data.list
this.total = res.data.count
}, e => {
})
// this.$refs.selection.selectAll(false)
},
// 新增弹窗打开
classAdd (oprState, row) {
this.oprState = oprState
if (this.oprState === 1) {
this.title = '新增信息'
this.dialogState = true
} else if (this.oprState === 2) {
this.title = '编辑信息'
this.classificationModelAdd = row
this.dialogState = true
} else {
this.title = '查看信息'
this.classificationModelAdd = row
this.dialogState = true
}
},
// 新增弹窗提交
saveClass (formName) {
let data = this.classificationModelAdd
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.oprState === 1) {
this.classificationModelAdd.dicTypeCode = this.classificationModelAdd.dicTypeName
this.$http.postData('sys/dictype/create', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {})
} else if (this.oprState === 2) {
this.$http.putData('sys/dictype', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {
})
}
} else {
return false
}
})
},
// 查看弹窗关闭
handleClose () {
this.page = 1
this.selectIfication()
this.classificationModelAdd.dicTypeName = ''
this.classificationModelAdd.showIndex = ''
this.classificationModelAdd.describes = ''
if (this.$refs['classificationModelAdd']) {
this.$refs['classificationModelAdd'].resetFields()
}
this.dialogState = false
},
// 新增弹窗关闭
closeModal (formName) {
this.page = 1
this.selectIfication()
this.classificationModelAdd.dicTypeName = ''
this.classificationModelAdd.showIndex = ''
this.classificationModelAdd.describes = ''
this.$refs['classificationModelAdd'].resetFields()
this.dialogState = false
},
// 批量删除
classBatchDel () {
if (this.selectNum === '' || this.selectNum.length === 0) {
this.$confirm('请选择一条数据进行删除', '提示', {
showCancelButton: false,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
})
} else {
(
this.$confirm('确认删除这些数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
let delIds = []
let delTypeCodes = []
for (let i = 0; i < this.selectNum.length; i++) {
delIds.push(this.selectNum[i].id)
delTypeCodes.push(this.selectNum[i].dicTypeCode)
}
delIds = delIds.join(',')
delTypeCodes = delTypeCodes.join(',')
let data = {}
data.ids = delIds
data.dicTypeCodes = delTypeCodes
this.$http.delete('sys/dictype/deleteArr', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
}
})
}).catch(() => {
// 取消删除,清空选择
this.$refs.selection.clearSelection()
})
)
}
},
// 删除
classDel (row) {
let data = {}
data.dicTypeEOId = row.id
data.dicTypeCode = row.dicTypeCode
if (data.id !== '' && data.dicTypeCode !== '') {
this.$confirm('确认删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.delete('sys/dictype/delete', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
} else {
}
}).catch(() => {
})
})
}
},
// 多选
handleSelectionChange (val) {
this.selectNum = val
},
// 取消多选
clearSelection () {
},
pageChange (page) {
this.page = page
this.selectIfication()
},
pageSizeChange (pageSize) {
this.rows = pageSize
this.selectIfication()
}
},
mounted () {
this.selectIfication()
this.tableHeight = $('.content').height() - 44
window.onresize = () => {
this.tableHeight = $('.content').height() - 44
}
},
computed: {
classObject () {
return {
'check-draw': this.oprState === 3
}
}
}
}
</script>
<style lang="less" scoped>
.classification{
position: relative;
height: 100%;
padding: 0 10px;
background: #fff;
.content{
height: calc(~'100% - 45px - 56px');
overflow-y: auto;
}
.demo-drawer__content{
// border: 1px solid #ccc;
padding: 0 15px;
}
}
</style>
@@ -0,0 +1,478 @@
<!-- 采标程度 -->
<template>
<div id="degree-standard" class="v-class">
<el-form :inline="true" :model="standardForm" ref="ruleForm" class="label-input-form">
<div class="search-area-item">
<el-form-item :label="this.$t('m.option')" class="serch-form-item">
<el-input
v-model.trim="standardForm.standName"
:placeholder="$t('m.pleaseEnterOptions')"
:maxlength="100"
clearable
@keyup.enter.native="selectCollectionBtn"></el-input>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
icon="el-icon-search"
type="primary"
class="searchAngNewBtn"
@click="selectCollectionBtn"></el-button>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
type="primary"
class="searchAngNewBtn"
@click="resetSelect">{{$t('m.clearQuery')}}</el-button>
</el-form-item>
</div>
</el-form>
<div class="content">
<div class="action-bar">
<el-button
type="primary"
size="mini"
@click="classAdd(1, null)"
v-btn-permission="'Y2AP6G5H34'"
>{{$t('m.add')}}</el-button>
<el-button
type="danger"
size="mini"
@click="classBatchDel"
v-btn-permission="'5W8PRGD8QZ'">{{$t('m.delete')}}</el-button>
</div>
<el-table
:height="tableHeight"
ref="selection"
:data="collectionData"
tooltip-effect="dark"
style="width: 100%"
border
row-key="id"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="dicTypeName"
:label="this.$t('m.option')"
width="400"
align="center"
>
</el-table-column>
<el-table-column
prop="describes"
:label="this.$t('m.describe')"
width="400"
align="center">
</el-table-column>
<el-table-column :label="this.$t('m.operation')" align="center">
<template slot-scope="scope">
<el-button
class="opera-btn"
size="mini"
type="primary"
@click="classAdd(3, scope.row)">{{$t('m.see')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="warning"
v-btn-permission="'2RBGXVXKFY'"
@click="classAdd(2, scope.row)">{{$t('m.edit')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="danger"
v-btn-permission="'R9QQYHJ5HP'"
@click="classDel(scope.row)">{{$t('m.delete')}}</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!--分页-->
<pagination
:page="page"
:total="total"
@pageChange="pageChange"
@pageSizeChange="pageSizeChange"></pagination>
<loading :loading="loading">数据获取中</loading>
<!--新增抽屉-->
<el-drawer
:title="title"
:visible.sync="dialogState"
direction="rtl"
custom-class="demo-drawer"
ref="drawer"
size="800px"
:class="classObject"
:before-close="handleClose"
>
<div class="demo-drawer__content" v-if="this.oprState === 1 || this.oprState === 2">
<el-form :model="collectionModelAdd" ref="collectionModelAdd" :rules="classRules" class="label-input-form">
<el-row>
<el-col :span="12">
<el-form-item :label="this.$t('m.option')"
:label-width="formLabelWidth"
prop="dicTypeName"
:disabled = 'this.oprState === 2'
class="add-form-item">
<el-input
v-model.trim="collectionModelAdd.dicTypeName"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.sortNumber')"
prop="showIndex"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
type="number"
oninput="if(value.length>4)value=value.slice(0,4)"
v-model.number="collectionModelAdd.showIndex"
@mousewheel.native.prevent
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.describe')"
prop="describes"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
v-model.trim="collectionModelAdd.describes"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="demo-drawer-footer">
<el-button size="mini" @click="closeModal('collectionModelAdd')">{{$t('m.cancel')}}</el-button>
<el-button size="mini" type="primary" @click="saveClass('collectionModelAdd')">{{$t('m.submit')}}</el-button>
</div>
</div>
<div class="demo-drawer__content" v-else>
<div class="check-item-row">
<div class="check-item-col1">
<div class="check-item-label"> 选项:</div>
<div class="check-item-value">{{collectionModelAdd.dicTypeName}}</div>
</div>
<div class="check-item-col1">
<div class="check-item-label">排序号:</div>
<div class="check-item-value">{{collectionModelAdd.showIndex}}</div>
</div>
</div>
<div class="check-item-row">
<div class="check-item-col2">
<div class="check-item-label">描述:</div>
<div class="check-item-value">{{collectionModelAdd.describes}}</div>
</div>
<div class="check-item-col2">
<div class="check-item-label"></div>
<div class="check-item-value"></div>
</div>
</div>
</div>
</el-drawer>
</div>
</template>
<script>
export default {
name: 'DegreeStandard',
data () {
return {
// 查询条件
standardForm: {
// 选项
standName: '',
// 数据编码
standCode: '',
// 描述
describes: ''
},
total: 0,
page: 1,
rows: 10,
loading: false,
// 列表数据
collectionData: [],
// 抽屉打开
dialogState: false,
// form-item label宽度
formLabelWidth: '80px',
// 新增弹窗数据
collectionModelAdd: {
// 数据信息
dicTypeName: '',
showIndex: '',
// 数据编码
dicTypeCode: '',
// 描述
describes: '',
// 唯一辨识
dicId: 'VBERTFDGGF'
},
// 弹窗标题
title: '',
// 表单验证
classRules: {
dicTypeName: [
{required: true, message: '选项不能为空', trigger: 'blur'},
{type: 'string', max: 100, message: '最多输入100位', trigger: 'blur'}
],
showIndex: [
{required: true, message: '排序号不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
],
describes: [
{type: 'string', max: 500, message: '最多输入500位', trigger: 'blur'}
]
},
// 中间变量
standName1: '',
describes1: '',
standCode1: '',
// 判断是新增or 编辑 or 查看
oprState: 0,
// 多选时接收选中行数据
selectNum: [],
tableHeight: null
}
},
methods: {
// 条件查询
selectCollectionBtn () {
this.standName1 = this.standardForm.standName
this.describes1 = this.standardForm.describes
this.standCode1 = this.standardForm.standCode
this.page = 1
this.selectCollection()
},
// 清空查询
resetSelect (formName) {
this.standName1 = ''
this.standCode1 = ''
this.describes1 = ''
this.standardForm.standName = ''
this.standardForm.standCode = ''
this.standardForm.describes = ''
this.page = 1
this.selectCollection()
},
// 分页加载列表
selectCollection () {
let DicTypeEOPage = {
page: this.page,
pageSize: this.$store.getters.userInfo.configContent,
dicTypeName: this.standName1,
dicTypeCode: this.standCode1,
describes: this.describes1,
dicId: 'VBERTFDGGF'
}
this.$http.get('sys/dictype/page', DicTypeEOPage, {
_this: this,
loading: 'loading'
}, res => {
this.collectionData = res.data.list
this.total = res.data.count
}, e => {
})
// this.$refs.selection.selectAll(false)
},
// 新增弹窗打开
classAdd (oprState, row) {
this.oprState = oprState
if (this.oprState === 1) {
this.title = '新增信息'
this.dialogState = true
} else if (this.oprState === 2) {
this.title = '编辑信息'
this.collectionModelAdd = row
this.dialogState = true
} else {
this.title = '查看信息'
this.collectionModelAdd = row
this.dialogState = true
}
},
// 新增弹窗提交
saveClass (formName) {
let data = this.collectionModelAdd
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.oprState === 1) {
this.collectionModelAdd.dicTypeCode = this.collectionModelAdd.dicTypeName
this.$http.postData('sys/dictype/create', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {})
} else if (this.oprState === 2) {
this.$http.putData('sys/dictype', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {
})
}
} else {
return false
}
})
},
// 查看弹窗关闭
handleClose () {
this.page = 1
this.selectCollection()
this.collectionModelAdd.dicTypeName = ''
this.collectionModelAdd.showIndex = ''
this.collectionModelAdd.describes = ''
if (this.$refs['collectionModelAdd']) {
this.$refs['collectionModelAdd'].resetFields()
}
this.dialogState = false
},
// 新增弹窗关闭
closeModal (formName) {
this.page = 1
this.selectCollection()
this.collectionModelAdd.dicTypeName = ''
this.collectionModelAdd.showIndex = ''
this.collectionModelAdd.describes = ''
this.$refs['collectionModelAdd'].resetFields()
this.dialogState = false
},
// 批量删除
classBatchDel () {
if (this.selectNum === '' || this.selectNum.length === 0) {
this.$confirm('请选择一条数据进行删除', '提示', {
showCancelButton: false,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
})
} else {
(
this.$confirm('确认删除这些数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
let delIds = []
let delTypeCodes = []
for (let i = 0; i < this.selectNum.length; i++) {
delIds.push(this.selectNum[i].id)
delTypeCodes.push(this.selectNum[i].dicTypeCode)
}
delIds = delIds.join(',')
delTypeCodes = delTypeCodes.join(',')
let data = {}
data.ids = delIds
data.dicTypeCodes = delTypeCodes
this.$http.delete('sys/dictype/deleteArr', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
}
})
}).catch(() => {
// 取消删除,清空选择
this.$refs.selection.clearSelection()
})
)
}
},
// 删除
classDel (row) {
let data = {}
data.dicTypeEOId = row.id
data.dicTypeCode = row.dicTypeCode
if (data.id !== '' && data.dicTypeCode !== '') {
this.$confirm('确认删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.delete('sys/dictype/delete', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
} else {
}
}).catch(() => {
})
})
}
},
// 多选
handleSelectionChange (val) {
this.selectNum = val
},
// 取消多选
clearSelection () {
},
pageChange (page) {
this.page = page
this.selectCollection()
},
pageSizeChange (pageSize) {
this.rows = pageSize
this.selectCollection()
}
},
mounted () {
this.selectCollection()
this.tableHeight = $('.content').height() - 44
window.onresize = () => {
this.tableHeight = $('.content').height() - 44
}
},
computed: {
classObject () {
return {
'check-draw': this.oprState === 3
}
}
}
}
</script>
<style lang="less" scoped>
#degree-standard{
position: relative;
height: 100%;
padding: 0 10px;
background: #fff;
.content{
height: calc(~'100% - 45px - 56px');
overflow-y: auto;
}
.demo-drawer__content{
// border: 1px solid #ccc;
padding: 0 15px;
}
}
</style>
@@ -0,0 +1,478 @@
<!-- 能源种类 -->
<template>
<div id="energy-types" class="v-class">
<el-form :inline="true" :model="standardForm" ref="ruleForm" class="label-input-form">
<el-form-item :label="$t('m.option')" class="serch-form-item">
<el-input
v-model.trim="standardForm.standName"
:placeholder="$t('m.pleaseEnterOptions')"
:maxlength="100"
clearable
@keyup.enter.native="selectEnergyBtn"></el-input>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
icon="el-icon-search"
type="primary"
class="searchAngNewBtn"
@click="selectEnergyBtn"></el-button>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
type="primary"
class="searchAngNewBtn"
@click="resetSelect">{{$t('m.clearQuery')}}</el-button>
</el-form-item>
</el-form>
<div class="content">
<div class="action-bar">
<el-button
type="primary"
size="mini"
@click="classAdd(1, null)"
v-btn-permission="'ET53D6BKVW'"
>{{$t('m.add')}}</el-button>
<el-button
type="danger"
size="mini"
@click="classBatchDel"
v-btn-permission="'7XJWCU9DDH'">{{$t('m.delete')}}</el-button>
</div>
<el-table
:height="tableHeight"
ref="selection"
:data="classData"
tooltip-effect="dark"
style="width: 100%"
border
row-key="id"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="dicTypeName"
:label="this.$t('m.option')"
width="400"
align="center"
>
</el-table-column>
<el-table-column
prop="describes"
:label="this.$t('m.describe')"
width="400"
align="center">
</el-table-column>
<el-table-column
:label="this.$t('m.operation')"
align="center">
<template slot-scope="scope">
<el-button
class="opera-btn"
size="mini"
type="primary"
@click="classAdd(3, scope.row)">{{$t('m.see')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="warning"
v-btn-permission="'N9GDXYBVFX'"
@click="classAdd(2, scope.row)">{{$t('m.edit')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="danger"
v-btn-permission="'PJ5TP3NZHU'"
@click="classDel(scope.row)">{{$t('m.delete')}}</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!--分页-->
<pagination
:page="page"
:total="total"
@pageChange="pageChange"
@pageSizeChange="pageSizeChange"></pagination>
<loading :loading="loading">{{$t('m.dataAcquisition')}}</loading>
<!--新增抽屉-->
<el-drawer
:title="title"
:visible.sync="dialogState"
direction="rtl"
custom-class="demo-drawer"
ref="drawer"
size="800px"
:class="classObject"
:before-close="handleClose"
>
<div class="demo-drawer__content" v-if="this.oprState === 1 || this.oprState === 2">
<el-form :model="energyModelAdd" ref="energyModelAdd" :rules="classRules" class="label-input-form">
<el-row>
<el-col :span="12">
<el-form-item :label="$t('m.option')"
:label-width="formLabelWidth"
prop="dicTypeName"
:disabled = 'this.oprState === 2'
class="add-form-item">
<el-input
v-model.trim="energyModelAdd.dicTypeName"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('m.sortNumber')"
prop="showIndex"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
type="number"
oninput="if(value.length>4)value=value.slice(0,4)"
v-model.number="energyModelAdd.showIndex"
@mousewheel.native.prevent
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('m.describe')"
prop="describes"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
v-model.trim="energyModelAdd.describes"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="demo-drawer-footer">
<el-button size="mini" @click="closeModal('energyModelAdd')">{{$t('m.cancel')}}</el-button>
<el-button size="mini" type="primary" @click="saveClass('energyModelAdd')">{{$t('m.submit')}}</el-button>
</div>
</div>
<div class="demo-drawer__content" v-else>
<div class="check-item-row">
<div class="check-item-col1">
<div class="check-item-label"> {{$t('m.option')}}:</div>
<div class="check-item-value">{{energyModelAdd.dicTypeName}}</div>
</div>
<div class="check-item-col1">
<div class="check-item-label">{{$t('m.sortNumber')}}:</div>
<div class="check-item-value">{{energyModelAdd.showIndex}}</div>
</div>
</div>
<div class="check-item-row">
<div class="check-item-col2">
<div class="check-item-label">{{$t('m.describe')}}:</div>
<div class="check-item-value">{{energyModelAdd.describes}}</div>
</div>
<div class="check-item-col2">
<div class="check-item-label"></div>
<div class="check-item-value"></div>
</div>
</div>
</div>
</el-drawer>
</div>
</template>
<script>
export default {
name: 'EnergyTypes',
data () {
return {
// 查询条件
standardForm: {
// 选项
standName: '',
// 数据编码
standCode: '',
// 描述
describes: ''
},
total: 0,
page: 1,
rows: 10,
loading: false,
// 列表数据
classData: [],
// 抽屉打开
dialogState: false,
// form-item label宽度
formLabelWidth: '80px',
// 新增弹窗数据
energyModelAdd: {
// 数据信息
dicTypeName: '',
showIndex: '',
// 数据编码
dicTypeCode: '',
// 描述
describes: '',
// 唯一辨识
dicId: 'VBMNNTHJG'
},
// 弹窗标题
title: '',
// 表单验证
classRules: {
dicTypeName: [
{required: true, message: '选项不能为空', trigger: 'blur'},
{type: 'string', max: 100, message: '最多输入100位', trigger: 'blur'}
],
showIndex: [
{required: true, message: '排序号不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
],
describes: [
{type: 'string', max: 500, message: '最多输入500位', trigger: 'blur'}
]
},
// 中间变量
standName1: '',
describes1: '',
standCode1: '',
// 判断是新增or 编辑 or 查看
oprState: 0,
// 多选时接收选中行数据
selectNum: [],
tableHeight: null
}
},
methods: {
// 条件查询
selectEnergyBtn () {
this.standName1 = this.standardForm.standName
this.describes1 = this.standardForm.describes
this.standCode1 = this.standardForm.standCode
this.page = 1
this.selectEnergy()
},
// 清空查询
resetSelect (formName) {
this.standName1 = ''
this.standCode1 = ''
this.describes1 = ''
this.standardForm.standName = ''
this.standardForm.standCode = ''
this.standardForm.describes = ''
this.page = 1
this.selectEnergy()
},
// 分页加载列表
selectEnergy () {
let DicTypeEOPage = {
page: this.page,
pageSize: this.$store.getters.userInfo.configContent,
dicTypeName: this.standName1,
dicTypeCode: this.standCode1,
describes: this.describes1,
dicId: 'VBMNNTHJG'
}
this.$http.get('sys/dictype/page', DicTypeEOPage, {
_this: this,
loading: 'loading'
}, res => {
this.classData = res.data.list
this.total = res.data.count
}, e => {
})
// this.$refs.selection.selectAll(false)
},
// 新增弹窗打开
classAdd (oprState, row) {
this.oprState = oprState
if (this.oprState === 1) {
this.title = '新增信息'
this.dialogState = true
} else if (this.oprState === 2) {
this.title = '编辑信息'
this.energyModelAdd = row
this.dialogState = true
} else {
this.title = '查看信息'
this.energyModelAdd = row
this.dialogState = true
}
},
// 新增弹窗提交
saveClass (formName) {
let data = this.energyModelAdd
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.oprState === 1) {
this.energyModelAdd.dicTypeCode = this.energyModelAdd.dicTypeName
this.$http.postData('sys/dictype/create', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {})
} else if (this.oprState === 2) {
this.$http.putData('sys/dictype', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {
})
}
} else {
return false
}
})
},
// 查看弹窗关闭
handleClose () {
this.page = 1
this.selectEnergy()
this.energyModelAdd.dicTypeName = ''
this.energyModelAdd.showIndex = ''
this.energyModelAdd.describes = ''
if (this.$refs['energyModelAdd']) {
this.$refs['energyModelAdd'].resetFields()
}
this.dialogState = false
},
// 新增弹窗关闭
closeModal (formName) {
this.page = 1
this.selectEnergy()
this.energyModelAdd.dicTypeName = ''
this.energyModelAdd.showIndex = ''
this.energyModelAdd.describes = ''
this.$refs['energyModelAdd'].resetFields()
this.dialogState = false
},
// 批量删除
classBatchDel () {
if (this.selectNum === '' || this.selectNum.length === 0) {
this.$confirm('请选择一条数据进行删除', '提示', {
showCancelButton: false,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
})
} else {
(
this.$confirm('确认删除这些数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
let delIds = []
let delTypeCodes = []
for (let i = 0; i < this.selectNum.length; i++) {
delIds.push(this.selectNum[i].id)
delTypeCodes.push(this.selectNum[i].dicTypeCode)
}
delIds = delIds.join(',')
delTypeCodes = delTypeCodes.join(',')
let data = {}
data.ids = delIds
data.dicTypeCodes = delTypeCodes
this.$http.delete('sys/dictype/deleteArr', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
}
})
}).catch(() => {
// 取消删除,清空选择
this.$refs.selection.clearSelection()
})
)
}
},
// 删除
classDel (row) {
let data = {}
data.dicTypeEOId = row.id
data.dicTypeCode = row.dicTypeCode
if (data.id !== '' && data.dicTypeCode !== '') {
this.$confirm('确认删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.delete('sys/dictype/delete', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
} else {
}
}).catch(() => {
})
})
}
},
// 多选
handleSelectionChange (val) {
this.selectNum = val
},
// 取消多选
clearSelection () {
},
pageChange (page) {
this.page = page
this.selectEnergy()
},
pageSizeChange (pageSize) {
this.rows = pageSize
this.selectEnergy()
}
},
mounted () {
this.selectEnergy()
this.tableHeight = $('.content').height() - 44
window.onresize = () => {
this.tableHeight = $('.content').height() - 44
}
},
computed: {
classObject () {
return {
'check-draw': this.oprState === 3
}
}
}
}
</script>
<style lang="less" scoped>
#energy-types{
position: relative;
height: 100%;
padding: 0 10px;
background: #fff;
.content{
height: calc(~'100% - 45px - 56px');
overflow-y: auto;
}
.demo-drawer__content{
// border: 1px solid #ccc;
padding: 0 15px;
}
}
</style>
@@ -0,0 +1,861 @@
<!-- 企标分类-->
<template>
<div id="EnterpriseCategory" class="v-class">
<el-form :inline="true" :model="standardForm" ref="ruleForm" class="label-input-form">
<el-form-item :label="this.$t('m.option')" class="serch-form-item">
<el-input
v-model.trim="standardForm.standName"
:placeholder="$t('m.pleaseEnterOptions')"
:maxlength="100"
clearable
@keyup.enter.native="selectEnterpriseBtn"></el-input>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
icon="el-icon-search"
type="primary"
class="searchAngNewBtn"
@click="selectEnterpriseBtn"></el-button>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
type="primary"
class="searchAngNewBtn"
@click="resetSelect">{{$t('m.clearQuery')}}</el-button>
</el-form-item>
</el-form>
<div class="content">
<div class="action-bar">
<el-button
type="primary"
size="mini"
@click="classAdd(1, null)"
v-btn-permission="'45ZNDML8AN'"
>{{$t('m.add')}}</el-button>
<el-button
type="danger"
size="mini"
@click="classBatchDel"
v-btn-permission="'NLP3P6APLJ'">{{$t('m.delete')}}</el-button>
</div>
<el-table
:height="tableHeight"
ref="selection"
:data="enterpriseData"
tooltip-effect="dark"
style="width: 100%"
border
row-key="id"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="dicTypeName"
:label="this.$t('m.option')"
width="400"
align="center"
>
</el-table-column>
<el-table-column
prop="describes"
:label="this.$t('m.describe')"
width="400"
align="center">
</el-table-column>
<el-table-column :label="this.$t('m.operation')"
align="center">
<template slot-scope="scope">
<el-button
class="opera-btn"
size="mini"
type="primary"
v-btn-permission="'R4LZWSAVMY'"
@click="classAdd(3, scope.row)">{{$t('m.see')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="warning"
v-btn-permission="'LJ7P9PAK9Y'"
@click="classAdd(2, scope.row)">{{$t('m.edit')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="danger"
v-btn-permission="'EMVUYWU7H3'"
@click="classDel(scope.row)">{{$t('m.delete')}}</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!--分页-->
<pagination
:page="page"
:total="total"
@pageChange="pageChange"
@pageSizeChange="pageSizeChange"></pagination>
<loading :loading="loading">数据获取中</loading>
<!--新增抽屉-->
<el-drawer
:title="title"
:visible.sync="dialogState"
direction="rtl"
custom-class="demo-drawer"
ref="drawer"
size="800px"
:before-close="handleClose"
>
<div class="demo-drawer__content" v-if="this.oprState === 1 || this.oprState === 2">
<el-form :model="enterpriseModelAdd" ref="enterpriseModelAdd" :rules="classRules" class="label-input-form">
<el-row>
<el-col :span="12">
<el-form-item :label="this.$t('m.option')"
:label-width="formLabelWidth"
prop="dicTypeName"
:disabled = 'this.oprState === 2'
class="add-form-item">
<el-input
v-model.trim="enterpriseModelAdd.dicTypeName"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.sortNumber')"
prop="showIndex"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
type="number"
oninput="if(value.length>4)value=value.slice(0,4)"
v-model.number="enterpriseModelAdd.showIndex"
@mousewheel.native.prevent
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.describe')"
prop="describes"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
v-model.trim="enterpriseModelAdd.describes"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.enterpriseClassificationCode')"
:label-width="formLabelWidth"
prop="dicCodeName"
class="add-form-item">
<el-input
v-model.trim="enterpriseModelAdd.dicCodeName"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="demo-drawer-footer">
<el-button size="mini" @click="closeModal('enterpriseModelAdd')">{{$t('m.cancel')}}</el-button>
<el-button size="mini" type="primary" @click="saveEnterprise('enterpriseModelAdd')">{{$t('m.submit')}}</el-button>
</div>
</div>
<div class="demo-drawer__content" v-else>
<div class="search-area1 v-calss">
<el-form :inline="true" :model="standardForm" ref="ruleForm" class="label-input-form">
<div class="search-area-item">
<el-form-item class="serch-form-item btn-box">
<el-button
type="primary"
class="searchAngNewBtn"
@click="subClassAdd(1, null)"
>{{$t('m.add')}}</el-button>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
type="danger"
class="searchAngNewBtn"
@click="subClassesDel"
>{{$t('m.delete')}}</el-button>
</el-form-item>
</div>
</el-form>
</div>
<div class="content1">
<el-table
ref="selection1"
:data="subClassData"
tooltip-effect="dark"
style="width: 100%"
border
row-key="id"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="handleAreaSelectionChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="dicTypeName"
:label="this.$t('m.option')"
width="140"
align="center"
>
</el-table-column>
<el-table-column
prop="describes"
:label="this.$t('m.describe')"
width="140"
align="center"
>
</el-table-column>
<el-table-column :label="this.$t('m.operation')" align="center">
<template slot-scope="scope">
<el-button
class="opera-btn"
size="mini"
type="warning"
@click="subClassAdd(3, scope.row)">{{$t('m.see')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="primary"
@click="subClassAdd(2, scope.row)">{{$t('m.edit')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="danger"
@click="subClassDel(scope.row)">{{$t('m.delete')}}</el-button>
</template>
</el-table-column>
</el-table>
</div>
<loading :loading="loading">数据获取中</loading>
<pagination :page="enterprisePage" :total="enterpriseTotal" @pageChange="enterprisePageChange" @pageSizeChange="enterprisePageSizeChange"></pagination>
</div>
<el-drawer
:title="subClassTitle"
:append-to-body="true"
:before-close="handlelSubClassClose"
:visible.sync="innerDrawer"
:class="classObject">
<div class="area-content" v-if="this.subClassState === 1 || this.subClassState === 2">
<el-form :model="subClassModelAdd" ref="subClassModelAdd" :rules="enterpriseRules" class="label-input-form">
<el-form-item :label="this.$t('m.option')"
:label-width="formLabelWidth"
prop="dicTypeName"
class="add-form-item">
<el-input
v-model.trim="subClassModelAdd.dicTypeName"
autocomplete="off" clearable></el-input>
</el-form-item>
<el-form-item :label="this.$t('m.ClassificationCode')"
prop="classifyCode"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
v-model.trim="subClassModelAdd.classifyCode"
autocomplete="off" clearable></el-input>
</el-form-item>
<el-form-item :label="this.$t('m.sortNumber')"
prop="showIndex"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
oninput="if(value.length>4)value=value.slice(0,4)"
type="number"
v-model.number="subClassModelAdd.showIndex"
@mousewheel.native.prevent
autocomplete="off" clearable></el-input>
</el-form-item>
<el-form-item label="描述"
prop="describes"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
v-model.trim="subClassModelAdd.describes"
maxlength="500"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-form>
<div class="demo-drawer__footer">
<el-button size="mini" @click="closeSubClassModal('subClassModelAdd')">{{$t('m.cancel')}}</el-button>
<el-button size="mini" type="primary" @click="saveSubClass('subClassModelAdd')">{{$t('m.submit')}}</el-button>
</div>
</div>
<div class="area-content" v-else>
<div class="check-item-row">
<div class="check-item-col1">
<div class="check-item-label"> 选项:</div>
<el-tooltip class="item" effect="dark" :content="subClassModelAdd.dicTypeName" placement="top">
<div slot="content" style="width: 200px; display: inline-block">{{subClassModelAdd.dicTypeName}}</div>
<div class="check-item-value">{{subClassModelAdd.dicTypeName}}</div>
</el-tooltip>
</div>
<div class="check-item-col1">
<div class="check-item-label">排序号:</div>
<div class="check-item-value">{{subClassModelAdd.showIndex}}</div>
</div>
</div>
<div class="check-item-row">
<div class="check-item-col2">
<div class="check-item-label">描述:</div>
<el-tooltip class="item" effect="dark" placement="top">
<div slot="content" style="width: 200px; display: inline-block">{{subClassModelAdd.describes}}</div>
<div class="check-item-value">{{subClassModelAdd.describes}}</div>
</el-tooltip>
</div>
<div class="check-item-col2">
<div class="check-item-label"></div>
<div class="check-item-value"></div>
</div>
</div>
</div>
</el-drawer>
</el-drawer>
</div>
</template>
<script>
export default {
name: 'EnterpriseCategory',
data () {
return {
// 查询条件
standardForm: {
// 选项
standName: '',
// 数据编码
standCode: '',
// 描述
describes: ''
},
total: 0,
page: 1,
rows: 10,
loading: false,
// 列表数据
enterpriseData: [],
// 抽屉打开
dialogState: false,
// form-item label宽度
formLabelWidth: '100px',
// 新增弹窗数据
enterpriseModelAdd: {
// 企业分类代号
dicCodeName: '',
// 数据信息
dicTypeName: '',
showIndex: '',
// 数据编码
dicTypeCode: '',
// 描述
describes: '',
// 唯一辨识
dicId: 'WEWXFSYUJBNG'
},
// 弹窗标题
title: '',
// 表单验证
classRules: {
dicTypeName: [
{required: true, message: '选项不能为空', trigger: 'blur'},
{type: 'string', max: 100, message: '最多输入100位', trigger: 'blur'}
],
showIndex: [
{required: true, message: '排序号不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
],
describes: [
{type: 'string', max: 500, message: '最多输入500位', trigger: 'blur'}
],
dicCodeName: [
{required: true, message: '企业分类代号不能为空', trigger: 'blur'},
{type: 'string', max: 10, message: '最多输入10位', trigger: 'blur'}
]
},
// 中间变量
standName1: '',
describes1: '',
standCode1: '',
// 判断是新增or 编辑 or 查看
oprState: 0,
// 多选时接收选中行数据
selectNum: [],
// 内部表格数据
subClassData: [],
// 判断是内部的新增,查看,编辑
subClassState: 0,
// 打开内部新增,编辑,查看弹窗
innerDrawer: false,
// 新增,编辑表单验证
enterpriseRules: {
dicTypeName: [
{required: true, message: '选项不能为空', trigger: 'blur'},
{type: 'string', max: 100, message: '最多输入100位', trigger: 'blur'}
],
showIndex: [
{type: 'number', required: true, message: '排序号不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
],
describes: [
{type: 'string', max: 500, message: '最多输入500位', trigger: 'blur'}
]
},
// 内联抽屉信息
subClassModelAdd: {
dicTypeName: '',
describes: '',
showIndex: '',
classifyCode: '',
parentId: '',
dicId: 'FGFBTYGHGHMB'
},
subClassLoading: false,
enterprisePage: 1,
enterpriseTotal: 0,
enterpriseRows: 10,
// 列表数据id
subClassRow: '',
// 内部操作多选数组
SubClassSelectNum: [],
// 内部弹窗标题
subClassTitle: '',
// 不重复
newSubClassAdd: {},
tableHeight: null
}
},
methods: {
// 条件查询
selectEnterpriseBtn () {
this.standName1 = this.standardForm.standName
this.describes1 = this.standardForm.describes
this.standCode1 = this.standardForm.standCode
this.page = 1
this.selectEnterprise()
},
// 清空查询
resetSelect (formName) {
this.standName1 = ''
this.standCode1 = ''
this.describes1 = ''
this.standardForm.standName = ''
this.standardForm.standCode = ''
this.standardForm.describes = ''
this.page = 1
this.selectEnterprise()
},
// 分页加载列表
selectEnterprise () {
let DicTypeEOPage = {
page: this.page,
pageSize: this.$store.getters.userInfo.configContent,
dicTypeName: this.standName1,
dicTypeCode: this.standCode1,
describes: this.describes1,
dicId: 'WEWXFSYUJBNG'
}
this.$http.get('sys/dictype/page', DicTypeEOPage, {
_this: this,
loading: 'loading'
}, res => {
this.enterpriseData = res.data.list
this.total = res.data.count
}, e => {
})
// this.$refs.selection.selectAll(false)
},
// 新增弹窗打开
classAdd (oprState, row) {
this.oprState = oprState
if (this.oprState === 1) {
this.title = '新增信息'
this.dialogState = true
} else if (this.oprState === 2) {
this.title = '编辑信息'
this.enterpriseModelAdd = row
this.dialogState = true
} else {
this.title = '查看信息'
this.enterpriseModelAdd = row
this.subClassRow = row.id
this.subClassModelAdd.parentId = row.id
this.selectSubClass(this.subClassRow)
this.dialogState = true
}
},
// 新增弹窗提交
saveEnterprise (formName) {
let data = this.enterpriseModelAdd
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.oprState === 1) {
this.enterpriseModelAdd.dicTypeCode = this.enterpriseModelAdd.dicTypeName
this.$http.postData('sys/dictype/create', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {})
} else if (this.oprState === 2) {
this.$http.putData('sys/dictype', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {
})
}
} else {
// console.log('error submit!!')
return false
}
})
},
// 查看弹窗关闭
handleClose () {
this.page = 1
this.selectEnterprise()
this.enterpriseModelAdd.dicTypeName = ''
this.enterpriseModelAdd.showIndex = ''
this.enterpriseModelAdd.describes = ''
if (this.$refs['enterpriseModelAdd']) {
this.$refs['enterpriseModelAdd'].resetFields()
}
this.dialogState = false
},
// 新增弹窗关闭
closeModal (formName) {
this.page = 1
this.selectEnterprise()
this.enterpriseModelAdd.dicTypeName = ''
this.enterpriseModelAdd.showIndex = ''
this.enterpriseModelAdd.describes = ''
this.$refs['enterpriseModelAdd'].resetFields()
this.dialogState = false
},
// 批量删除
classBatchDel () {
if (this.selectNum === '' || this.selectNum.length === 0) {
this.$confirm('请选择一条数据进行删除', '提示', {
showCancelButton: false,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
})
} else {
(
this.$confirm('确认删除这些数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
let delIds = []
let delTypeCodes = []
for (let i = 0; i < this.selectNum.length; i++) {
delIds.push(this.selectNum[i].id)
delTypeCodes.push(this.selectNum[i].dicTypeCode)
}
delIds = delIds.join(',')
delTypeCodes = delTypeCodes.join(',')
let data = {}
data.ids = delIds
data.dicTypeCodes = delTypeCodes
this.$http.delete('sys/dictype/deleteArr', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
}
})
}).catch(() => {
// 取消删除,清空选择
this.$refs.selection.clearSelection()
})
)
}
},
// 删除
classDel (row) {
let data = {}
data.dicTypeEOId = row.id
data.dicTypeCode = row.dicTypeCode
if (data.id !== '' && data.dicTypeCode !== '') {
this.$confirm('确认删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.delete('sys/dictype/delete', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
} else {
}
}).catch(() => {
})
})
}
},
// 多选
handleSelectionChange (val) {
this.selectNum = val
},
pageChange (page) {
this.page = page
this.selectEnterprise()
},
pageSizeChange (pageSize) {
this.rows = pageSize
this.selectEnterprise()
},
// 打开内部新增弹窗
subClassAdd (subClassState, row) {
this.subClassState = subClassState
if (this.subClassState === 1) {
this.subClassTitle = '新建信息'
// this.getStandCategory()
this.$nextTick(() => {
this.$refs['enterpriseModelAdd'].resetFields()
})
this.innerDrawer = true
} else if (this.subClassState === 2) {
this.subClassModelAdd = row
this.subClassTitle = '编辑信息'
this.innerDrawer = true
} else {
this.subClassModelAdd = row
this.subClassTitle = '查看企业细类'
this.innerDrawer = true
}
},
// x号关闭内部弹窗
handlelSubClassClose () {
this.enterprisePage = 1
this.selectSubClass(this.subClassRow)
this.subClassModelAdd.showIndex = ''
this.subClassModelAdd.dicTypeName = ''
this.subClassModelAdd.dicTypeCode = ''
this.newSubClassAdd.dicTypeCode = ''
this.newSubClassAdd.dicTypeName = ''
this.newSubClassAdd.parentId = ''
if (this.$refs['subClassModelAdd']) {
this.$refs['subClassModelAdd'].resetFields()
}
this.innerDrawer = false
this.newSubClassAdd.describes = ''
this.newSubClassAdd.classifyCode = ''
this.subClassModelAdd.describes = ''
this.subClassModelAdd.classifyCode = ''
},
// 关闭弹窗
closeSubClassModal (formName) {
this.enterprisePage = 1
this.selectSubClass(this.subClassRow)
this.subClassModelAdd.showIndex = ''
this.subClassModelAdd.dicTypeName = ''
this.subClassModelAdd.dicTypeCode = ''
this.newSubClassAdd.dicTypeCode = ''
this.newSubClassAdd.dicTypeName = ''
this.newSubClassAdd.parentId = ''
this.newSubClassAdd.describes = ''
this.newSubClassAdd.classifyCode = ''
this.subClassModelAdd.describes = ''
this.subClassModelAdd.classifyCode = ''
this.$refs['subClassModelAdd'].resetFields()
this.innerDrawer = false
},
// 内联表格加载
selectSubClass (id) {
this.$http.get('sys/dictype/page', {
page: this.enterprisePage,
pageSize: this.$store.getters.userInfo.configContent,
id: id,
dicId: 'FGFBTYGHGHMB'
}, {
_this: this,
loading: 'subClassLoading'
}, res => {
this.enterpriseTotal = res.data.count
this.subClassData = res.data.list
}, e => {})
},
// 内联表格新增
saveSubClass (formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.newSubClassAdd.classifyCode = this.subClassModelAdd.classifyCode
this.newSubClassAdd.describes = this.subClassModelAdd.describes
this.newSubClassAdd.dicId = this.subClassModelAdd.dicId
this.newSubClassAdd.dicTypeName = this.subClassModelAdd.dicTypeName
this.newSubClassAdd.parentId = this.subClassModelAdd.parentId
this.newSubClassAdd.showIndex = this.subClassModelAdd.showIndex
if (this.subClassState === 1) {
this.$http.postData('sys/dictype/createEnterpriseStandard', this.newSubClassAdd
, {
_this: this
}, res => {
this.closeSubClassModal()
}, e => {
})
} else if (this.subClassState === 2) {
this.$http.putData('sys/dictype', this.subClassModelAdd, {
_this: this
}, res => {
this.closeSubClassModal()
}, e => {
})
}
} else {
}
})
},
// 删除
subClassDel (row) {
let data = {}
data.dicTypeEOId = row.id
data.dicTypeCode = row.dicTypeCode
if (data.id !== '' && data.dicTypeCode !== '') {
this.$confirm('确认删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.delete('sys/dictype/delete', data, {
_this: this
}, res => {
if (res.ok) {
this.selectSubClass(this.subClassRow)
} else {
}
}).catch(() => {
})
})
}
},
// 批量删除
subClassesDel () {
if (this.SubClassSelectNum === '' || this.SubClassSelectNum.length === 0) {
this.$confirm('请选择一条数据进行删除', '提示', {
showCancelButton: false,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
})
} else {
(
this.$confirm('确认删除这些数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
let delIds = []
// let delTypeCodes = []
for (let i = 0; i < this.SubClassSelectNum.length; i++) {
delIds.push(this.SubClassSelectNum[i].id)
// delTypeCodes.push(this.SubClassSelectNum[i].dicTypeCode)
}
delIds = delIds.join(',')
// delTypeCodes = delTypeCodes.join(',')
let data = {}
data.ids = delIds
// data.dicTypeCodes = delTypeCodes
this.$http.delete('sys/dictype/deleteArr', data, {
_this: this
}, res => {
if (res.ok) {
this.selectSubClass(this.subClassRow)
}
})
}).catch(() => {
// 取消删除,清空选择
this.$refs.selection1.clearSelection()
})
)
}
},
// 操作多选
handleAreaSelectionChange (val) {
this.SubClassSelectNum = val
},
// 子类分页
enterprisePageChange (page) {
this.enterprisePage = page
this.selectSubClass(this.subClassRow)
},
enterprisePageSizeChange (pageSize) {
this.enterpriseRows = pageSize
this.selectSubClass(this.subClassRow)
}
},
mounted () {
this.selectEnterprise()
this.tableHeight = $('.content').height() - 44
window.onresize = () => {
this.tableHeight = $('.content').height() - 44
}
},
computed: {
classObject () {
return {
'check-draw': this.subClassState === 3
}
}
}
}
</script>
<style lang="less" scoped>
#EnterpriseCategory{
position: relative;
height: 100%;
padding: 0 10px;
background: #fff;
.content{
height: calc(~'100% - 45px - 56px');
overflow-y: auto;
}
.demo-drawer__content{
// border: 1px solid #ccc;
padding: 0 15px;
.search-area1 {
text-align: right;
border-bottom: 1px solid #e8eaec;
padding-bottom: 10px;
margin-bottom: 23px;
}
.label-input-form {
display: inline-block;
}
}
}
.area-content{
padding: 0 15px;
}
</style>
@@ -0,0 +1,475 @@
<!--企业标准类别-->
<template>
<div class="enterprise-standard-category v-class">
<el-form :inline="true" :model="standardForm" ref="ruleForm" class="label-input-form">
<div class="search-area-item">
<el-form-item :label="this.$t('m.option')" class="serch-form-item">
<el-input
v-model.trim="standardForm.standName"
:placeholder="$t('m.pleaseEnterOptions')"
:maxlength="100"
clearable
@keyup.enter.native="selectCategoryBtn"></el-input>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
icon="el-icon-search"
type="primary"
class="searchAngNewBtn"
@click="selectCategoryBtn"></el-button>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
type="primary"
class="searchAngNewBtn"
@click="resetSelect">{{$t('m.clearQuery')}}</el-button>
</el-form-item>
</div>
</el-form>
<div class="content">
<div class="action-bar">
<el-button
type="primary"
size="mini"
@click="classAdd(1, null)"
v-btn-permission="'CXRPGWHNSF'"
>{{$t('m.add')}}</el-button>
<el-button
type="danger"
size="mini"
@click="classBatchDel"
v-btn-permission="'R24ALH4Q89'">{{$t('m.delete')}}</el-button>
</div>
<el-table
:height="tableHeight"
ref="selection"
:data="categoryData"
tooltip-effect="dark"
style="width: 100%"
border
row-key="id"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="dicTypeName"
:label="this.$t('m.option')"
width="400"
align="center"
>
</el-table-column>
<el-table-column
prop="describes"
:label="this.$t('m.describe')"
width="400"
align="center">
</el-table-column>
<el-table-column :label="this.$t('m.operation')"
align="center">
<template slot-scope="scope">
<el-button
class="opera-btn"
size="mini"
type="primary"
@click="classAdd(3, scope.row)">{{$t('m.see')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="warning"
v-btn-permission="'ZL86999VLW'"
@click="classAdd(2, scope.row)">{{$t('m.edit')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="danger"
v-btn-permission="'7C7567JU9G'"
@click="classDel(scope.row)">{{$t('m.delete')}}</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!--分页-->
<pagination
:page="page"
:total="total"
@pageChange="pageChange"
@pageSizeChange="pageSizeChange"></pagination>
<loading :loading="loading">数据获取中</loading>
<!--新增抽屉-->
<el-drawer
:title="title"
:visible.sync="dialogState"
direction="rtl"
custom-class="demo-drawer"
ref="drawer"
size="800px"
:class="classObject"
:before-close="handleClose"
>
<div class="demo-drawer__content" v-if="this.oprState === 1 || this.oprState === 2">
<el-form :model="categoryModelAdd" ref="categoryModelAdd" :rules="classRules" class="label-input-form">
<el-row>
<el-col :span="12">
<el-form-item :label="this.$t('m.option')"
:label-width="formLabelWidth"
prop="dicTypeName"
:disabled = 'this.oprState === 2'
class="add-form-item">
<el-input
v-model.trim="categoryModelAdd.dicTypeName"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.sortNumber')"
prop="showIndex"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
type="number"
oninput="if(value.length>4)value=value.slice(0,4)"
v-model.number="categoryModelAdd.showIndex"
@mousewheel.native.prevent
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.describe')"
prop="describes"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
v-model.trim="categoryModelAdd.describes"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="demo-drawer-footer">
<el-button size="mini" @click="closeModal('categoryModelAdd')">{{$t('m.cancel')}}</el-button>
<el-button size="mini" type="primary" @click="saveCategory('categoryModelAdd')">{{$t('m.submit')}}</el-button>
</div>
</div>
<div class="demo-drawer__content" v-else>
<div class="check-item-row">
<div class="check-item-col1">
<div class="check-item-label"> 选项:</div>
<div class="check-item-value">{{categoryModelAdd.dicTypeName}}</div>
</div>
<div class="check-item-col1">
<div class="check-item-label">排序号:</div>
<div class="check-item-value">{{categoryModelAdd.showIndex}}</div>
</div>
</div>
<div class="check-item-row">
<div class="check-item-col2">
<div class="check-item-label">描述:</div>
<div class="check-item-value">{{categoryModelAdd.describes}}</div>
</div>
<div class="check-item-col2">
<div class="check-item-label"></div>
<div class="check-item-value"></div>
</div>
</div>
</div>
</el-drawer>
</div>
</template>
<script>
export default {
name: 'EnterpriseStandardCategory',
data () {
return {
// 查询条件
standardForm: {
// 选项
standName: '',
// 数据编码
standCode: '',
// 描述
describes: ''
},
total: 0,
page: 1,
rows: 10,
loading: false,
// 列表数据
categoryData: [],
// 抽屉打开
dialogState: false,
// form-item label宽度
formLabelWidth: '80px',
// 新增弹窗数据
categoryModelAdd: {
// 数据信息
dicTypeName: '',
showIndex: '',
// 数据编码
dicTypeCode: '',
// 描述
describes: '',
// 唯一辨识
dicId: 'NGETEMDJDI'
},
// 弹窗标题
title: '',
// 表单验证
classRules: {
dicTypeName: [
{required: true, message: '选项不能为空', trigger: 'blur'},
{type: 'string', max: 100, message: '最多输入100位', trigger: 'blur'}
],
showIndex: [
{required: true, message: '排序号不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
],
describes: [
{type: 'string', max: 500, message: '最多输入500位', trigger: 'blur'}
]
},
// 中间变量
standName1: '',
describes1: '',
standCode1: '',
// 判断是新增or 编辑 or 查看
oprState: 0,
// 多选时接收选中行数据
selectNum: [],
tableHeight: null
}
},
methods: {
// 条件查询
selectCategoryBtn () {
this.standName1 = this.standardForm.standName
this.describes1 = this.standardForm.describes
this.standCode1 = this.standardForm.standCode
this.page = 1
this.selectCategory()
},
// 清空查询
resetSelect (formName) {
this.standName1 = ''
this.standCode1 = ''
this.describes1 = ''
this.standardForm.standName = ''
this.standardForm.standCode = ''
this.standardForm.describes = ''
this.page = 1
this.selectCategory()
},
// 分页加载列表
selectCategory () {
let DicTypeEOPage = {
page: this.page,
pageSize: this.$store.getters.userInfo.configContent,
dicTypeName: this.standName1,
dicTypeCode: this.standCode1,
describes: this.describes1,
dicId: 'NGETEMDJDI'
}
this.$http.get('sys/dictype/page', DicTypeEOPage, {
_this: this,
loading: 'loading'
}, res => {
this.categoryData = res.data.list
this.total = res.data.count
}, e => {
})
// this.$refs.selection.selectAll(false)
},
// 新增弹窗打开
classAdd (oprState, row) {
this.oprState = oprState
if (this.oprState === 1) {
this.title = '新增信息'
this.dialogState = true
} else if (this.oprState === 2) {
this.title = '编辑信息'
this.categoryModelAdd = row
this.dialogState = true
} else {
this.title = '查看信息'
this.categoryModelAdd = row
this.dialogState = true
}
},
// 新增弹窗提交
saveCategory (formName) {
let data = this.categoryModelAdd
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.oprState === 1) {
this.categoryModelAdd.dicTypeCode = this.categoryModelAdd.dicTypeName
this.$http.postData('sys/dictype/create', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {})
} else if (this.oprState === 2) {
this.$http.putData('sys/dictype', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {
})
}
} else {
return false
}
})
},
// 查看弹窗关闭
handleClose () {
this.page = 1
this.selectCategory()
this.categoryModelAdd.dicTypeName = ''
this.categoryModelAdd.showIndex = ''
this.categoryModelAdd.describes = ''
if (this.$refs['categoryModelAdd']) {
this.$refs['categoryModelAdd'].resetFields()
}
this.dialogState = false
},
// 新增弹窗关闭
closeModal (formName) {
this.page = 1
this.selectCategory()
this.categoryModelAdd.dicTypeName = ''
this.categoryModelAdd.showIndex = ''
this.categoryModelAdd.describes = ''
this.$refs['categoryModelAdd'].resetFields()
this.dialogState = false
},
// 批量删除
classBatchDel () {
if (this.selectNum === '' || this.selectNum.length === 0) {
this.$confirm('请选择一条数据进行删除', '提示', {
showCancelButton: false,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
})
} else {
(
this.$confirm('确认删除这些数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
let delIds = []
let delTypeCodes = []
for (let i = 0; i < this.selectNum.length; i++) {
delIds.push(this.selectNum[i].id)
delTypeCodes.push(this.selectNum[i].dicTypeCode)
}
delIds = delIds.join(',')
delTypeCodes = delTypeCodes.join(',')
let data = {}
data.ids = delIds
data.dicTypeCodes = delTypeCodes
this.$http.delete('sys/dictype/deleteArr', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
}
})
}).catch(() => {
// 取消删除,清空选择
this.$refs.selection.clearSelection()
})
)
}
},
// 删除
classDel (row) {
let data = {}
data.dicTypeEOId = row.id
data.dicTypeCode = row.dicTypeCode
if (data.id !== '' && data.dicTypeCode !== '') {
this.$confirm('确认删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.delete('sys/dictype/delete', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
} else {
}
}).catch(() => {
})
})
}
},
// 多选
handleSelectionChange (val) {
this.selectNum = val
},
pageChange (page) {
this.page = page
this.selectCategory()
},
pageSizeChange (pageSize) {
this.rows = pageSize
this.selectCategory()
}
},
mounted () {
this.selectCategory()
this.tableHeight = $('.content').height() - 44
window.onresize = () => {
this.tableHeight = $('.content').height() - 44
}
},
computed: {
classObject () {
return {
'check-draw': this.oprState === 3
}
}
}
}
</script>
<style lang="less" scoped>
.enterprise-standard-category{
position: relative;
height: 100%;
padding: 0 10px;
background: #fff;
.content{
height: calc(~'100% - 45px - 56px');
overflow-y: auto;
}
.demo-drawer__content{
// border: 1px solid #ccc;
padding: 0 15px;
}
}
</style>
@@ -0,0 +1,474 @@
<!-- 标准/文件状态 -->
<template>
<div id="file-state" class="v-class">
<el-form :inline="true" :model="standardForm" ref="ruleForm" class="label-input-form">
<el-form-item :label="this.$t('m.option')" class="serch-form-item">
<el-input
v-model.trim="standardForm.standName"
:placeholder="$t('m.pleaseEnterOptions')"
:maxlength="100"
clearable
@keyup.enter.native="selectProductBtn"></el-input>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
icon="el-icon-search"
type="primary"
class="searchAngNewBtn"
@click="selectProductBtn"></el-button>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
type="primary"
class="searchAngNewBtn"
@click="resetSelect">{{$t('m.clearQuery')}}</el-button>
</el-form-item>
</el-form>
<div class="content">
<div class="action-bar">
<el-button
type="primary"
size="mini"
@click="classAdd(1, null)"
v-btn-permission="'Z865MZTGMM'"
>{{$t('m.add')}}</el-button>
<el-button
type="danger"
size="mini"
@click="productBatchDel"
v-btn-permission="'APRRXC5Z3N'">{{$t('m.delete')}}</el-button>
</div>
<el-table
:height="tableHeight"
ref="selection"
:data="classData"
tooltip-effect="dark"
style="width: 100%"
border
row-key="id"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="dicTypeName"
:label="this.$t('m.option')"
width="400"
align="center"
>
</el-table-column>
<el-table-column
prop="describes"
:label="this.$t('m.describe')"
width="400"
align="center">
</el-table-column>
<el-table-column :label="this.$t('m.operation')" align="center">
<template slot-scope="scope">
<el-button
class="opera-btn"
size="mini"
type="primary"
@click="classAdd(3, scope.row)">{{$t('m.see')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="warning"
v-btn-permission="'6KH765G3KV'"
@click="classAdd(2, scope.row)">{{$t('m.edit')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="danger"
v-btn-permission="'4BBVFTPJAN'"
@click="classDel(scope.row)">{{$t('m.delete')}}</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!--分页-->
<pagination
:page="page"
:total="total"
@pageChange="pageChange"
@pageSizeChange="pageSizeChange"></pagination>
<loading :loading="loading">数据获取中</loading>
<!--新增抽屉-->
<el-drawer
:title="title"
:visible.sync="dialogState"
direction="rtl"
custom-class="demo-drawer"
ref="drawer"
size="800px"
:class = "classObject"
:before-close="handleClose"
>
<div class="demo-drawer__content" v-if="this.oprState === 1 || this.oprState === 2">
<el-form :model="productModelAdd" ref="productModelAdd" :rules="classRules" class="label-input-form">
<el-row>
<el-col :span="12">
<el-form-item :label="this.$t('m.option')"
:label-width="formLabelWidth"
prop="dicTypeName"
:disabled = 'this.oprState === 2'
class="add-form-item">
<el-input
v-model.trim="productModelAdd.dicTypeName"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.sortNumber')"
prop="showIndex"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
type="number"
oninput="if(value.length>4)value=value.slice(0,4)"
v-model.number="productModelAdd.showIndex"
@mousewheel.native.prevent
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.describe')"
prop="describes"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
v-model.trim="productModelAdd.describes"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="demo-drawer-footer">
<el-button size="mini" @click="closeModal('productModelAdd')">{{$t('m.cancel')}}</el-button>
<el-button size="mini" type="primary" @click="saveClass('productModelAdd')">{{$t('m.submit')}}</el-button>
</div>
</div>
<div class="demo-drawer__content" v-else>
<div class="check-item-row">
<div class="check-item-col1">
<div class="check-item-label"> 选项:</div>
<div class="check-item-value">{{productModelAdd.dicTypeName}}</div>
</div>
<div class="check-item-col1">
<div class="check-item-label">排序号:</div>
<div class="check-item-value">{{productModelAdd.showIndex}}</div>
</div>
</div>
<div class="check-item-row">
<div class="check-item-col2">
<div class="check-item-label">描述:</div>
<div class="check-item-value">{{productModelAdd.describes}}</div>
</div>
<div class="check-item-col2">
<div class="check-item-label"></div>
<div class="check-item-value"></div>
</div>
</div>
</div>
</el-drawer>
</div>
</template>
<script>
export default {
name: 'FileState',
data () {
return {
// 查询条件
standardForm: {
// 选项
standName: '',
// 数据编码
standCode: '',
// 描述
describes: ''
},
total: 0,
page: 1,
rows: 10,
loading: false,
// 列表数据
classData: [],
// 抽屉打开
dialogState: false,
// form-item label宽度
formLabelWidth: '80px',
// 新增弹窗数据
productModelAdd: {
// 数据信息
dicTypeName: '',
showIndex: '',
// 数据编码
dicTypeCode: '',
// 描述
describes: '',
// 唯一辨识
dicId: 'ERDFGHGGJJ'
},
// 弹窗标题
title: '',
// 表单验证
classRules: {
dicTypeName: [
{required: true, message: '选项不能为空', trigger: 'blur'},
{type: 'string', max: 100, message: '最多输入100位', trigger: 'blur'}
],
showIndex: [
{required: true, message: '排序号不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
],
describes: [
{type: 'string', max: 500, message: '最多输入500位', trigger: 'blur'}
]
},
// 中间变量
standName1: '',
describes1: '',
standCode1: '',
// 判断是新增or 编辑 or 查看
oprState: 0,
// 多选时接收选中行数据
selectNum: [],
tableHeight: null
}
},
methods: {
// 条件查询
selectProductBtn () {
this.standName1 = this.standardForm.standName
this.describes1 = this.standardForm.describes
this.standCode1 = this.standardForm.standCode
this.page = 1
this.selectClass()
},
// 清空查询
resetSelect (formName) {
this.standName1 = ''
this.standCode1 = ''
this.describes1 = ''
this.standardForm.standName = ''
this.standardForm.standCode = ''
this.standardForm.describes = ''
this.page = 1
this.selectClass()
},
// 分页加载列表
selectClass () {
let DicTypeEOPage = {
page: this.page,
pageSize: this.$store.getters.userInfo.configContent,
dicTypeName: this.standName1,
dicTypeCode: this.standCode1,
describes: this.describes1,
dicId: 'ERDFGHGGJJ'
}
this.$http.get('sys/dictype/page', DicTypeEOPage, {
_this: this,
loading: 'loading'
}, res => {
this.classData = res.data.list
this.total = res.data.count
}, e => {
})
// this.$refs.selection.selectAll(false)
},
// 新增弹窗打开
classAdd (oprState, row) {
this.oprState = oprState
if (this.oprState === 1) {
this.title = '新增信息'
this.dialogState = true
} else if (this.oprState === 2) {
this.title = '编辑信息'
this.productModelAdd = row
this.dialogState = true
} else {
this.title = '查看信息'
this.productModelAdd = row
this.dialogState = true
}
},
// 新增弹窗提交
saveClass (formName) {
let data = this.productModelAdd
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.oprState === 1) {
this.$http.postData('sys/dictype/create', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {})
} else if (this.oprState === 2) {
this.$http.putData('sys/dictype', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {
})
}
} else {
return false
}
})
},
handleClose () {
this.page = 1
this.selectClass()
this.productModelAdd.dicTypeName = ''
this.productModelAdd.showIndex = ''
this.productModelAdd.describes = ''
if (this.$refs['productModelAdd']) {
this.$refs['productModelAdd'].resetFields()
}
this.dialogState = false
},
// 新增弹窗关闭
closeModal (formName) {
this.page = 1
this.selectClass()
this.productModelAdd.dicTypeName = ''
this.productModelAdd.showIndex = ''
this.productModelAdd.describes = ''
this.$refs['productModelAdd'].resetFields()
this.dialogState = false
},
// 批量删除
productBatchDel () {
if (this.selectNum === '' || this.selectNum.length === 0) {
this.$confirm('请选择一条数据进行删除', '提示', {
showCancelButton: false,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
})
} else {
(
this.$confirm('确认删除这些数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
let delIds = []
let delTypeCodes = []
for (let i = 0; i < this.selectNum.length; i++) {
delIds.push(this.selectNum[i].id)
delTypeCodes.push(this.selectNum[i].dicTypeCode)
}
delIds = delIds.join(',')
delTypeCodes = delTypeCodes.join(',')
let data = {}
data.ids = delIds
data.dicTypeCodes = delTypeCodes
this.$http.delete('sys/dictype/deleteArr', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
}
})
}).catch(() => {
// 取消删除,清空选择
this.$refs.selection.clearSelection()
})
)
}
},
// 删除
classDel (row) {
let data = {}
data.dicTypeEOId = row.id
data.dicTypeCode = row.dicTypeCode
if (data.id !== '' && data.dicTypeCode !== '') {
this.$confirm('确认删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.delete('sys/dictype/delete', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
} else {
}
}).catch(() => {
})
})
}
},
// 多选
handleSelectionChange (val) {
this.selectNum = val
},
// 取消多选
clearSelection () {
},
pageChange (page) {
this.page = page
this.selectClass()
},
pageSizeChange (pageSize) {
this.rows = pageSize
this.selectClass()
}
},
mounted () {
this.selectClass()
this.tableHeight = $('.content').height() - 44
window.onresize = () => {
this.tableHeight = $('.content').height() - 44
}
},
computed: {
classObject () {
return {
'check-draw': this.oprState === 3
}
}
}
}
</script>
<style lang="less" scoped>
#file-state{
position: relative;
height: 100%;
padding: 0 10px;
background: #fff;
.content{
height: calc(~'100% - 45px - 56px');
overflow-y: auto;
}
.demo-drawer__content{
// border: 1px solid #ccc;
padding: 0 15px;
}
}
</style>
@@ -0,0 +1,794 @@
<!-- 国家/地区-->
<template>
<div id="national-area" class="v-class">
<el-form :inline="true" :model="standardForm" ref="ruleForm" class="label-input-form">
<el-form-item :label="this.$t('m.option')" class="serch-form-item">
<el-input
v-model.trim="standardForm.standName"
:placeholder="$t('m.pleaseEnterOptions')"
:maxlength="100"
clearable
@keyup.enter.native="selecteRgionBtn"></el-input>
</el-form-item>
<el-form-item class="serch-form-item">
<el-button
icon="el-icon-search"
type="primary"
class="searchAngNewBtn"
@click="selecteRgionBtn"></el-button>
</el-form-item>
<el-form-item class="serch-form-item">
<el-button
type="primary"
class="searchAngNewBtn"
@click="resetSelect">{{$t('m.clearQuery')}}</el-button>
</el-form-item>
</el-form>
<div class="content">
<div class="action-bar">
<el-button
type="primary"
size="mini"
@click="classAdd(1, null)"
v-btn-permission="'H94JEVB2SN'"
>{{$t('m.add')}}</el-button>
<el-button
type="danger"
size="mini"
@click="regionBatchDel"
v-btn-permission="'JT4GYJGZNB'">{{$t('m.delete')}}</el-button>
</div>
<el-table
:height="tableHeight"
ref="selection"
:data="regionData"
tooltip-effect="dark"
style="width: 100%"
border
row-key="id"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="dicTypeName"
:label="this.$t('m.option')"
width="400"
align="center"
>
</el-table-column>
<el-table-column
prop="describes"
:label="this.$t('m.describe')"
width="400"
align="center">
</el-table-column>
<el-table-column
:label="this.$t('m.operation')"
align="center">
<template slot-scope="scope">
<el-button
class="opera-btn"
size="mini"
type="primary"
@click="classAdd(3, scope.row)">{{$t('m.see')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="warning"
v-btn-permission="'D63XW3MAHS'"
@click="classAdd(2, scope.row)">{{$t('m.edit')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="danger"
v-btn-permission="'RTWLGX593N'"
@click="classDel(scope.row)">{{$t('m.delete')}}</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!--分页-->
<pagination
:page="page"
:total="total"
@pageChange="pageChange"
@pageSizeChange="pageSizeChange"></pagination>
<loading :loading="loading">数据获取中</loading>
<!--新增抽屉-->
<el-drawer
:title="title"
:visible.sync="dialogState"
ref="drawer"
size="800px"
:before-close="handleClose"
>
<div class="demo-drawer__content" v-if="this.oprState === 1 || this.oprState === 2">
<el-form :model="regionModelAdd" ref="regionModelAdd" :rules="regionRules" class="label-input-form">
<el-row>
<el-col :span="12">
<el-form-item :label="this.$t('m.option')"
:label-width="formLabelWidth"
prop="dicTypeName"
:disabled = 'this.oprState === 2'
class="add-form-item">
<el-input
v-model.trim="regionModelAdd.dicTypeName"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.sortNumber')"
prop="showIndex"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
oninput="if(value.length>4)value=value.slice(0,4)"
type="number"
v-model.number="regionModelAdd.showIndex"
@mousewheel.native.prevent
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.describe')"
prop="describes"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
v-model.trim="regionModelAdd.describes"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="demo-drawer-footer">
<el-button size="mini" @click="closeModal('regionModelAdd')">{{$t('m.cancel')}}</el-button>
<el-button size="mini" type="primary" @click="saveClass('regionModelAdd')">{{$t('m.submit')}}</el-button>
</div>
</div>
<div class="demo-drawer__content" v-else>
<div class="search-area1 v-calss">
<el-form :inline="true" :model="standardForm" ref="ruleForm" class="label-input-form">
<div class="search-area-item">
<el-form-item class="serch-form-item">
<el-button
type="primary"
class="searchAngNewBtn"
@click="areaAdd(1, null)"
>{{$t('m.add')}}</el-button>
</el-form-item>
<el-form-item class="serch-form-item">
<el-button
type="danger"
class="searchAngNewBtn"
@click="areaBatchDel"
>{{$t('m.delete')}}</el-button>
</el-form-item>
</div>
</el-form>
</div>
<div class="content1">
<el-table
ref="selection"
:data="areaData"
tooltip-effect="dark"
style="width: 100%"
border
row-key="id"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="handleAreaSelectionChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="dicTypeName"
:label="this.$t('m.standardCategory')"
width="260"
align="center"
>
</el-table-column>
<el-table-column :label="this.$t('m.operation')" align="center">
<template slot-scope="scope">
<el-button
class="opera-btn"
size="mini"
type="primary"
@click="areaAdd(2, scope.row)">{{$t('m.see')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="danger"
@click="regionAreaDel(scope.row)">{{$t('m.delete')}}</el-button>
</template>
</el-table-column>
</el-table>
</div>
<loading :loading="loading">数据获取中</loading>
<pagination :page="areaPage" :total="areaTotal" @pageChange="areaPageChange" @pageSizeChange="areaPageSizeChange"></pagination>
</div>
<el-drawer
:title="areaTitle"
:append-to-body="true"
:before-close="handleAreaClose"
destroy-on-close
:visible.sync="innerDrawer"
>
<div class="area-content" v-if="this.inDrawState === 1">
<el-form :model="areaModelAdd" ref="areaModelAdd" :rules="areaModelRules" class="label-input-form">
<el-form-item :label="this.$t('m.standardCategory')"
:label-width="formLabelWidth"
prop="selectStandCategory"
class="add-form-item">
<search-select
v-model="areaModelAdd.selectStandCategory"
:options="standCategoryList"
@on-change="getSelectCate"
clearable
/>
</el-form-item>
<el-form-item :label="this.$t('m.sortNumber')"
prop="showIndex"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
oninput="if(value.length>4)value=value.slice(0,4)"
type="number"
v-model.number="areaModelAdd.showIndex"
@mousewheel.native.prevent
autocomplete="off" clearable></el-input>
</el-form-item>
</el-form>
<div class="demo-drawer__footer">
<el-button size="mini" @click="closeAreaModal('areaModelAdd')">{{$t('m.cancel')}}</el-button>
<el-button size="mini" type="primary" @click="saveArea('areaModelAdd')">{{$t('m.submit')}}</el-button>
</div>
</div>
<div class="area-content" v-else>
<div class="check-item-row">
<div class="check-item-col1">
<div class="check-item-label"> 选项:</div>
<el-tooltip class="item" effect="dark" :content="areaModelAdd.dicTypeName" placement="top">
<div slot="content" class="toolip-content">{{areaModelAdd.dicTypeName}}</div>
<div class="check-item-value">{{areaModelAdd.dicTypeName}}</div>
</el-tooltip>
</div>
<div class="check-item-col1">
<div class="check-item-label">排序号:</div>
<div class="check-item-value" >{{areaModelAdd.showIndex}}</div>
</div>
</div>
</div>
</el-drawer>
</el-drawer>
</div>
</template>
<script>
export default {
name: 'nationalArea',
data () {
return {
// 查询条件
standardForm: {
// 选项
standName: '',
// 数据编码
standCode: '',
// 描述
describes: ''
},
total: 0,
page: 1,
rows: 10,
loading: false,
// 列表数据
regionData: [],
// 抽屉打开
dialogState: false,
// form-item label宽度
formLabelWidth: '80px',
// 新增弹窗数据
regionModelAdd: {
// 数据信息
dicTypeName: '',
showIndex: '',
// 数据编码
dicTypeCode: '',
// 描述
describes: '',
// 唯一辨识
dicId: 'RFRFRFSCXVB'
},
// 弹窗标题
title: '',
// 表单验证
regionRules: {
dicTypeName: [
{required: true, message: '选项不能为空', trigger: 'blur'},
{type: 'string', max: 100, message: '最多输入100位', trigger: 'blur'}
],
showIndex: [
{required: true, message: '排序号不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
],
describes: [
{type: 'string', max: 500, message: '最多输入500位', trigger: 'blur'}
]
},
// 中间变量
standName1: '',
describes1: '',
standCode1: '',
// 判断是新增or 编辑 or 查看
oprState: 0,
// 主页多选时接收选中行数据
selectNum: [],
// 查看内列表数据
areaData: [],
// 内部弹窗标题
areaTitle: '',
// 判断内部弹窗是新建or 查看
inDrawState: 0,
innerDrawer: false,
// 内部新增rules
areaModelRules: {
selectStandCategory: [
{ required: true, message: '标准类别不能为空', trigger: 'change' }
],
showIndex: [
{required: true, message: '排序号不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
]
},
// 内联抽屉信息
areaModelAdd: {
dicTypeName: '',
dicTypeCode: '',
showIndex: '',
describes: '',
parentId: '',
classifyCode: '',
selectStandCategory: '',
dicId: 'RFRFRFSCXVB'
},
// 内部分页,计数
// 子类分类
areaPage: 1,
areaTotal: 0,
areaRows: 10,
// 标准类别表,下拉框里的数据
standCategoryList: [],
// 不重复
newAreaModelAdd: {},
areaRow: '',
areaSelectNum: [],
tableHeight: null
}
},
methods: {
// 条件查询
selecteRgionBtn () {
this.standName1 = this.standardForm.standName
this.describes1 = this.standardForm.describes
this.standCode1 = this.standardForm.standCode
this.page = 1
this.selectClass()
},
// 清空查询
resetSelect (formName) {
this.standName1 = ''
// this.standCode1 = ''
this.describes1 = ''
this.standardForm.standName = ''
// this.standardForm.standCode = ''
this.standardForm.describes = ''
this.page = 1
this.selectClass()
},
// 分页加载列表页列表
selectClass () {
let DicTypeEOPage = {
page: this.page,
pageSize: this.$store.getters.userInfo.configContent,
dicTypeName: this.standName1,
describes: this.describes1,
dicId: 'RFRFRFSCXVB'
}
this.$http.get('sys/dictype/pageCountry', DicTypeEOPage, {
_this: this,
loading: 'loading'
}, res => {
this.regionData = res.data.list
this.total = res.data.count
}, e => {
})
// this.$refs.selection.selectAll(false)
},
// 新增弹窗打开
classAdd (oprState, row) {
this.oprState = oprState
if (this.oprState === 1) {
this.title = '新增信息'
this.dialogState = true
} else if (this.oprState === 2) {
this.title = '编辑信息'
this.regionModelAdd = row
this.dialogState = true
} else {
this.title = '查看信息'
this.regionModelAdd = row
this.areaRow = row.id
this.areaModelAdd.parentId = row.id
this.selectArea(row.id)
this.dialogState = true
}
},
// 新增弹窗提交
saveClass (formName) {
let data = this.regionModelAdd
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.oprState === 1) {
this.$http.postData('sys/dictype/create', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {})
} else if (this.oprState === 2) {
this.$http.putData('sys/dictype', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {
})
}
} else {
}
})
},
// 查看弹窗关闭
handleClose () {
this.page = 1
this.selectClass()
this.regionModelAdd.dicTypeName = ''
this.regionModelAdd.showIndex = ''
this.regionModelAdd.describes = ''
if (this.$refs['regionModelAdd']) {
this.$refs['regionModelAdd'].resetFields()
}
this.dialogState = false
},
// 新增弹窗关闭
closeModal (formName) {
this.page = 1
this.selectClass()
this.regionModelAdd.dicTypeName = ''
this.regionModelAdd.showIndex = ''
this.regionModelAdd.describes = ''
this.$refs['regionModelAdd'].resetFields()
this.dialogState = false
},
// 批量删除
regionBatchDel () {
if (this.selectNum === '' || this.selectNum.length === 0) {
this.$confirm('请选择一条数据进行删除', '提示', {
showCancelButton: false,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
})
} else {
(
this.$confirm('确认删除这些数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
let delIds = []
let delTypeCodes = []
for (let i = 0; i < this.selectNum.length; i++) {
delIds.push(this.selectNum[i].id)
delTypeCodes.push(this.selectNum[i].dicTypeCode)
}
delIds = delIds.join(',')
delTypeCodes = delTypeCodes.join(',')
let data = {}
data.ids = delIds
data.dicTypeCodes = delTypeCodes
this.$http.delete('sys/dictype/deleteArr', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
}
})
}).catch(() => {
// 取消删除,清空选择
this.$refs.selection.clearSelection()
})
)
}
},
// 删除
classDel (row) {
let data = {}
data.dicTypeEOId = row.id
data.dicTypeCode = row.dicTypeCode
if (data.id !== '' && data.dicTypeCode !== '') {
this.$confirm('确认删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.delete('sys/dictype/delete', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
} else {
}
}).catch(() => {
})
})
}
},
// 多选
handleSelectionChange (val) {
this.selectNum = val
},
pageChange (page) {
this.page = page
this.selectClass()
},
pageSizeChange (pageSize) {
this.rows = pageSize
this.selectClass()
},
// 内联表格加载
selectArea (id) {
this.$http.get('sys/dictype/page', {
page: this.areaPage,
pageSize: this.$store.getters.userInfo.configContent,
dicId: 'RFRFRFSCXVB',
id: id
}, {
_this: this,
loading: 'areaLoading'
}, res => {
this.areaTotal = res.data.count
this.areaData = res.data.list
}, e => {})
},
// 打开内部弹窗
areaAdd (inDrawState, row, id) {
this.inDrawState = inDrawState
if (this.inDrawState === 1) {
this.areaTitle = '新建信息'
this.getStandCategory()
this.$nextTick(() => {
this.$refs['areaModelAdd'].resetFields()
})
// this.$refs['areaModelAdd'].resetFields()
// this.areaModelAdd.selectStandCategory = ''
this.innerDrawer = true
} else {
this.areaModelAdd = row
this.areaTitle = '查看信息'
this.innerDrawer = true
}
},
// 关闭弹窗
handleAreaClose () {
this.areaPage = 1
this.selectArea(this.areaRow)
this.areaModelAdd.showIndex = ''
this.areaModelAdd.dicTypeName = ''
this.areaModelAdd.dicTypeCode = ''
this.newAreaModelAdd.dicTypeCode = ''
this.newAreaModelAdd.dicTypeName = ''
this.newAreaModelAdd.parentId = ''
if (this.$refs['areaModelAdd']) {
this.$refs['areaModelAdd'].resetFields()
}
this.innerDrawer = false
},
// 关闭新增弹窗
closeAreaModal (formName) {
this.areaPage = 1
this.selectArea(this.areaRow)
this.areaModelAdd.showIndex = ''
this.areaModelAdd.dicTypeName = ''
this.areaModelAdd.dicTypeCode = ''
this.newAreaModelAdd.dicTypeCode = ''
this.newAreaModelAdd.dicTypeName = ''
this.newAreaModelAdd.parentId = ''
this.$refs['areaModelAdd'].resetFields()
this.innerDrawer = false
},
// 获取标准类别List数据
getStandCategory () {
this.$http.get('sys/dictype/getDicTypeListCode', {}, {_this: this}, res => {
this.standCategoryList = res.data.STANDCLASSIFY
})
},
// 下拉列表变化
getSelectCate () {
for (let index = 0; index < this.standCategoryList.length; index++) {
let standCategory = this.standCategoryList[index]
if (standCategory.value === this.areaModelAdd.selectStandCategory) {
this.selectStandCategoryNum = index
break
}
}
},
// 新增标准类别确定
saveArea (formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
let standCategory = this.standCategoryList[this.selectStandCategoryNum]
this.areaModelAdd.dicTypeName = standCategory.label
this.areaModelAdd.dicTypeCode = standCategory.value
this.newAreaModelAdd.dicTypeCode = this.areaModelAdd.dicTypeCode
this.newAreaModelAdd.dicTypeName = this.areaModelAdd.dicTypeName
this.newAreaModelAdd.parentId = this.areaModelAdd.parentId
this.newAreaModelAdd.showIndex = this.areaModelAdd.showIndex
this.newAreaModelAdd.dicId = 'RFRFRFSCXVB'
// if (this.areaType === 1) {
this.$http.postData('sys/dictype/create', this.newAreaModelAdd, {
_this: this
}, res => {
if (res.ok) {
this.closeAreaModal()
}
}, e => {
})
// }
}
})
},
// 删除
regionAreaDel (row) {
let data = {}
data.dicTypeEOId = row.id
data.dicTypeCode = row.dicTypeCode
if (data.id !== '' && data.dicTypeCode !== '') {
this.$confirm('确认删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.delete('sys/dictype/delete', data, {
_this: this
}, res => {
if (res.ok) {
this.selectArea(this.areaRow)
} else {
}
}).catch(() => {
})
})
}
},
areaBatchDel () {
if (this.areaSelectNum === '' || this.areaSelectNum.length === 0) {
this.$confirm('请选择一条数据进行删除', '提示', {
showCancelButton: false,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
})
} else {
(
this.$confirm('确认删除这些数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
let delIds = []
let delTypeCodes = []
for (let i = 0; i < this.areaSelectNum.length; i++) {
delIds.push(this.areaSelectNum[i].id)
delTypeCodes.push(this.areaSelectNum[i].dicTypeCode)
}
delIds = delIds.join(',')
delTypeCodes = delTypeCodes.join(',')
let data = {}
data.ids = delIds
data.dicTypeCodes = delTypeCodes
this.$http.delete('sys/dictype/deleteArr', data, {
_this: this
}, res => {
if (res.ok) {
this.selectArea(this.areaRow)
}
})
}).catch(() => {
// 取消删除,清空选择
this.$refs.selection.clearSelection()
})
)
}
},
// 多选
handleAreaSelectionChange (val) {
this.areaSelectNum = val
},
// 子类分页
areaPageChange (page) {
this.areaPage = page
this.selectArea(this.areaRow)
},
areaPageSizeChange (pageSize) {
this.areaRows = pageSize
this.selectArea(this.areaRow)
}
},
mounted () {
this.selectClass()
this.tableHeight = $('.content').height() - 44
window.onresize = () => {
this.tableHeight = $('.content').height() - 44
}
},
computed: {}
}
</script>
<style lang="less" scoped>
#national-area{
position: relative;
height: 100%;
padding: 0 10px;
background: #fff;
.content{
height: calc(~'100% - 45px - 56px');
overflow-y: auto;
}
.demo-drawer__content {
// padding: 0 15px;
.search-area1 {
text-align: right;
border-bottom: 1px solid #e8eaec;
padding-bottom: 10px;
margin-bottom: 23px;
}
.label-input-form {
display: inline-block;
}
}
.toolip-content{
display: inline-block;
max-width: 200px;
}
}
.area-content{
padding: 0 15px;
}
</style>
@@ -0,0 +1,474 @@
<!-- 适用车型 -->
<template>
<div id="product-product" class="v-class">
<el-form :inline="true" :model="standardForm" ref="ruleForm" class="label-input-form">
<el-form-item :label="this.$t('m.option')" class="serch-form-item">
<el-input
v-model.trim="standardForm.standName"
:placeholder="$t('m.pleaseEnterOptions')"
:maxlength="100"
clearable
@keyup.enter.native="selectProductBtn"></el-input>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
icon="el-icon-search"
type="primary"
class="searchAngNewBtn"
@click="selectProductBtn"></el-button>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
type="primary"
class="searchAngNewBtn"
@click="resetSelect">{{$t('m.clearQuery')}}</el-button>
</el-form-item>
</el-form>
<div class="content">
<div class="action-bar">
<el-button
type="primary"
size="mini"
@click="classAdd(1, null)"
v-btn-permission="'D2R3Q34K9V'"
>{{$t('m.add')}}</el-button>
<el-button
type="danger"
size="mini"
@click="productBatchDel"
v-btn-permission="'Z7B38BES59'">{{$t('m.delete')}}</el-button>
</div>
<el-table
:height="tableHeight"
ref="selection"
:data="classData"
tooltip-effect="dark"
style="width: 100%"
border
row-key="id"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="dicTypeName"
:label="this.$t('m.option')"
width="400"
align="center"
>
</el-table-column>
<el-table-column
prop="describes"
:label="this.$t('m.describe')"
width="400"
align="center">
</el-table-column>
<el-table-column :label="this.$t('m.operation')" align="center">
<template slot-scope="scope">
<el-button
class="opera-btn"
size="mini"
type="primary"
@click="classAdd(3, scope.row)">{{$t('m.see')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="warning"
v-btn-permission="'CAXXDRF4HS'"
@click="classAdd(2, scope.row)">{{$t('m.edit')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="danger"
v-btn-permission="'R5Q38R4Y8Y'"
@click="classDel(scope.row)">{{$t('m.delete')}}</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!--分页-->
<pagination
:page="page"
:total="total"
@pageChange="pageChange"
@pageSizeChange="pageSizeChange"></pagination>
<loading :loading="loading">数据获取中</loading>
<!--新增抽屉-->
<el-drawer
:title="title"
:visible.sync="dialogState"
direction="rtl"
custom-class="demo-drawer"
ref="drawer"
size="800px"
:class = "classObject"
:before-close="handleClose"
>
<div class="demo-drawer__content" v-if="this.oprState === 1 || this.oprState === 2">
<el-form :model="productModelAdd" ref="productModelAdd" :rules="classRules" class="label-input-form">
<el-row>
<el-col :span="12">
<el-form-item :label="this.$t('m.option')"
:label-width="formLabelWidth"
prop="dicTypeName"
:disabled = 'this.oprState === 2'
class="add-form-item">
<el-input
v-model.trim="productModelAdd.dicTypeName"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.sortNumber')"
prop="showIndex"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
oninput="if(value.length>4)value=value.slice(0,4)"
type="number"
v-model.number="productModelAdd.showIndex"
@mousewheel.native.prevent
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.describe')"
prop="describes"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
v-model.trim="productModelAdd.describes"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="demo-drawer-footer">
<el-button size="mini" @click="closeModal('productModelAdd')">{{$t('m.cancel')}}</el-button>
<el-button size="mini" type="primary" @click="saveClass('productModelAdd')">{{$t('m.submit')}}</el-button>
</div>
</div>
<div class="demo-drawer__content" v-else>
<div class="check-item-row">
<div class="check-item-col1">
<div class="check-item-label"> 选项:</div>
<div class="check-item-value">{{productModelAdd.dicTypeName}}</div>
</div>
<div class="check-item-col1">
<div class="check-item-label">排序号:</div>
<div class="check-item-value">{{productModelAdd.showIndex}}</div>
</div>
</div>
<div class="check-item-row">
<div class="check-item-col2">
<div class="check-item-label">描述:</div>
<div class="check-item-value">{{productModelAdd.describes}}</div>
</div>
<div class="check-item-col2">
<div class="check-item-label"></div>
<div class="check-item-value"></div>
</div>
</div>
</div>
</el-drawer>
</div>
</template>
<script>
export default {
name: 'ProductCategory',
data () {
return {
// 查询条件
standardForm: {
// 选项
standName: '',
// 数据编码
standCode: '',
// 描述
describes: ''
},
total: 0,
page: 1,
rows: 10,
loading: false,
// 列表数据
classData: [],
// 抽屉打开
dialogState: false,
// form-item label宽度
formLabelWidth: '80px',
// 新增弹窗数据
productModelAdd: {
// 数据信息
dicTypeName: '',
showIndex: '',
// 数据编码
dicTypeCode: '',
// 描述
describes: '',
// 唯一辨识
dicId: 'QSXCVSDWEF'
},
// 弹窗标题
title: '',
// 表单验证
classRules: {
dicTypeName: [
{required: true, message: '选项不能为空', trigger: 'blur'},
{type: 'string', max: 100, message: '最多输入100位', trigger: 'blur'}
],
showIndex: [
{required: true, message: '排序号不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
],
describes: [
{type: 'string', max: 500, message: '最多输入500位', trigger: 'blur'}
]
},
// 中间变量
standName1: '',
describes1: '',
standCode1: '',
// 判断是新增or 编辑 or 查看
oprState: 0,
// 多选时接收选中行数据
selectNum: [],
tableHeight: null
}
},
methods: {
// 条件查询
selectProductBtn () {
this.standName1 = this.standardForm.standName
this.describes1 = this.standardForm.describes
this.standCode1 = this.standardForm.standCode
this.page = 1
this.selectClass()
},
// 清空查询
resetSelect (formName) {
this.standName1 = ''
this.standCode1 = ''
this.describes1 = ''
this.standardForm.standName = ''
this.standardForm.standCode = ''
this.standardForm.describes = ''
this.page = 1
this.selectClass()
},
// 分页加载列表
selectClass () {
let DicTypeEOPage = {
page: this.page,
pageSize: this.$store.getters.userInfo.configContent,
dicTypeName: this.standName1,
dicTypeCode: this.standCode1,
describes: this.describes1,
dicId: 'QSXCVSDWEF'
}
this.$http.get('sys/dictype/page', DicTypeEOPage, {
_this: this,
loading: 'loading'
}, res => {
this.classData = res.data.list
this.total = res.data.count
}, e => {
})
// this.$refs.selection.selectAll(false)
},
// 新增弹窗打开
classAdd (oprState, row) {
this.oprState = oprState
if (this.oprState === 1) {
this.title = '新增信息'
this.dialogState = true
} else if (this.oprState === 2) {
this.title = '编辑信息'
this.productModelAdd = row
this.dialogState = true
} else {
this.title = '查看信息'
this.productModelAdd = row
this.dialogState = true
}
},
// 新增弹窗提交
saveClass (formName) {
let data = this.productModelAdd
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.oprState === 1) {
this.$http.postData('sys/dictype/create', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {})
} else if (this.oprState === 2) {
this.$http.putData('sys/dictype', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {
})
}
} else {
return false
}
})
},
handleClose () {
this.page = 1
this.selectClass()
this.productModelAdd.dicTypeName = ''
this.productModelAdd.showIndex = ''
this.productModelAdd.describes = ''
if (this.$refs['productModelAdd']) {
this.$refs['productModelAdd'].resetFields()
}
this.dialogState = false
},
// 新增弹窗关闭
closeModal (formName) {
this.page = 1
this.selectClass()
this.productModelAdd.dicTypeName = ''
this.productModelAdd.showIndex = ''
this.productModelAdd.describes = ''
this.$refs['productModelAdd'].resetFields()
this.dialogState = false
},
// 批量删除
productBatchDel () {
if (this.selectNum === '' || this.selectNum.length === 0) {
this.$confirm('请选择一条数据进行删除', '提示', {
showCancelButton: false,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
})
} else {
(
this.$confirm('确认删除这些数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
let delIds = []
let delTypeCodes = []
for (let i = 0; i < this.selectNum.length; i++) {
delIds.push(this.selectNum[i].id)
delTypeCodes.push(this.selectNum[i].dicTypeCode)
}
delIds = delIds.join(',')
delTypeCodes = delTypeCodes.join(',')
let data = {}
data.ids = delIds
data.dicTypeCodes = delTypeCodes
this.$http.delete('sys/dictype/deleteArr', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
}
})
}).catch(() => {
// 取消删除,清空选择
this.$refs.selection.clearSelection()
})
)
}
},
// 删除
classDel (row) {
let data = {}
data.dicTypeEOId = row.id
data.dicTypeCode = row.dicTypeCode
if (data.id !== '' && data.dicTypeCode !== '') {
this.$confirm('确认删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.delete('sys/dictype/delete', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
} else {
}
}).catch(() => {
})
})
}
},
// 多选
handleSelectionChange (val) {
this.selectNum = val
},
// 取消多选
clearSelection () {
},
pageChange (page) {
this.page = page
this.selectClass()
},
pageSizeChange (pageSize) {
this.rows = pageSize
this.selectClass()
}
},
mounted () {
this.selectClass()
this.tableHeight = $('.content').height() - 44
window.onresize = () => {
this.tableHeight = $('.content').height() - 44
}
},
computed: {
classObject () {
return {
'check-draw': this.oprState === 3
}
}
}
}
</script>
<style lang="less" scoped>
#product-product{
position: relative;
height: 100%;
padding: 0 10px;
background: #fff;
.content{
height: calc(~'100% - 45px - 56px');
overflow-y: auto;
}
.demo-drawer__content{
// border: 1px solid #ccc;
padding: 0 15px;
}
}
</style>
@@ -0,0 +1,482 @@
<!-- 专业分类 -->
<template>
<div class="ProfessionalClassification v-class">
<el-form :inline="true" :model="standardForm" ref="ruleForm" class="label-input-form">
<el-form-item :label="this.$t('m.option')" class="serch-form-item">
<el-input
v-model.trim="standardForm.standName"
:placeholder="$t('m.pleaseEnterOptions')"
:maxlength="100"
clearable
@keyup.enter.native="selectClassBtn"></el-input>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
icon="el-icon-search"
type="primary"
class="searchAngNewBtn"
@click="selectClassBtn"></el-button>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
type="primary"
class="searchAngNewBtn"
@click="resetSelect">{{$t('m.clearQuery')}}</el-button>
</el-form-item>
</el-form>
<div class="content">
<div class="action-bar">
<el-button
type="primary"
size="mini"
@click="classAdd(1, null)"
v-btn-permission="'SDXRQ8LV6K'"
>{{$t('m.add')}}</el-button>
<el-button
type="danger"
size="mini"
@click="classBatchDel"
v-btn-permission="'ATBANPLHCM'">{{$t('m.delete')}}</el-button>
</div>
<el-table
:height="tableHeight"
ref="selection"
:data="classData"
tooltip-effect="dark"
style="width: 100%"
border
row-key="id"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="dicTypeName"
:label="this.$t('m.option')"
width="400"
align="center"
>
</el-table-column>
<el-table-column
prop="describes"
:label="this.$t('m.describe')"
width="400"
align="center">
</el-table-column>
<el-table-column :label="this.$t('m.operation')" align="center">
<template slot-scope="scope">
<el-button
class="opera-btn"
size="mini"
type="primary"
@click="classAdd(3, scope.row)">{{$t('m.see')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="warning"
@click="classAdd(2, scope.row)">{{$t('m.edit')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="danger"
@click="classDel(scope.row)">{{$t('m.delete')}}</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!--分页-->
<pagination
:page="page"
:total="total"
@pageChange="pageChange"
@pageSizeChange="pageSizeChange"></pagination>
<loading :loading="loading">数据获取中</loading>
<!--新增抽屉-->
<el-drawer
:title="title"
:visible.sync="dialogState"
ref="drawer"
size="800px"
:class="classObject"
:before-close="handleClose"
>
<div class="demo-drawer__content" v-if="this.oprState === 1 || this.oprState === 2">
<el-form :model="classModelAdd" ref="classModelAdd" :rules="classRules" class="label-input-form">
<el-row>
<el-col :span="12">
<el-form-item :label="this.$t('m.option')"
:label-width="formLabelWidth"
prop="dicTypeName"
:disabled = 'this.oprState === 2'
class="add-form-item">
<el-input
v-model.trim="classModelAdd.dicTypeName"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.sortNumber')"
prop="showIndex"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
type="number"
oninput="if(value.length>4)value=value.slice(0,4)"
v-model.number="classModelAdd.showIndex"
@mousewheel.native.prevent
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.describe')"
prop="describes"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
v-model.trim="classModelAdd.describes"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.majorClassificationCode')"
prop="dicCodeName"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
v-model="classModelAdd.dicCodeName"
maxlength='10'
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="demo-drawer-footer">
<el-button size="mini" @click="closeModal('classModelAdd')">{{$t('m.cancel')}}</el-button>
<el-button size="mini" type="primary" @click="saveClass('classModelAdd')">{{$t('m.submit')}}</el-button>
</div>
</div>
<div class="demo-drawer__content" v-else>
<div class="check-item-row">
<div class="check-item-col1">
<div class="check-item-label"> 选项:</div>
<div class="check-item-value">{{classModelAdd.dicTypeName}}</div>
</div>
<div class="check-item-col1">
<div class="check-item-label">排序号:</div>
<div class="check-item-value">{{classModelAdd.showIndex}}</div>
</div>
</div>
<div class="check-item-row">
<div class="check-item-col2">
<div class="check-item-label">描述:</div>
<div class="check-item-value">{{classModelAdd.describes}}</div>
</div>
<div class="check-item-col2">
<div class="check-item-label" style="width: 110px">专业分类代号:</div>
<div class="check-item-value">{{classModelAdd.dicCodeName}}</div>
</div>
</div>
</div>
</el-drawer>
</div>
</template>
<script>
export default {
name: 'ProfessionalClassification',
data () {
return {
// 查询条件
standardForm: {
// 选项
standName: '',
// 数据编码
standCode: '',
// 描述
describes: ''
},
total: 0,
page: 1,
rows: 10,
loading: false,
// 列表数据
classData: [],
// 抽屉打开
dialogState: false,
// form-item label宽度
formLabelWidth: '100px',
// 新增弹窗数据
classModelAdd: {
// 专业分类代号
dicCodeName: '',
// 数据信息
dicTypeName: '',
showIndex: '',
// 数据编码
dicTypeCode: '',
// 描述
describes: '',
// 唯一辨识
dicId: 'DGXFQKAQZ'
},
// 弹窗标题
title: '',
// 表单验证
classRules: {
dicTypeName: [
{required: true, message: '选项不能为空', trigger: 'blur'},
{type: 'string', max: 100, message: '最多输入100位', trigger: 'blur'}
],
showIndex: [
{required: true, message: '排序号不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
],
describes: [
{type: 'string', max: 500, message: '最多输入500位', trigger: 'blur'}
],
dicCodeName: [
{required: true, message: '专业分类代号不能为空', trigger: 'blur'},
{type: 'string', max: 10, message: '最多输入10位', trigger: 'blur'}
]
},
// 中间变量
standName1: '',
describes1: '',
standCode1: '',
// 判断是新增or 编辑 or 查看
oprState: 0,
// 多选时接收选中行数据
selectNum: [],
tableHeight: null
}
},
methods: {
// 条件查询
selectClassBtn () {
this.standName1 = this.standardForm.standName
this.describes1 = this.standardForm.describes
this.standCode1 = this.standardForm.standCode
this.page = 1
this.selectClass()
},
// 清空查询
resetSelect (formName) {
this.standName1 = ''
this.standCode1 = ''
this.describes1 = ''
this.standardForm.standName = ''
this.standardForm.standCode = ''
this.standardForm.describes = ''
this.page = 1
this.selectClass()
},
// 分页加载列表
selectClass () {
let DicTypeEOPage = {
page: this.page,
pageSize: this.$store.getters.userInfo.configContent,
dicTypeName: this.standName1,
dicTypeCode: this.standCode1,
describes: this.describes1,
dicId: 'DGXFQKAQZ'
}
this.$http.get('sys/dictype/page', DicTypeEOPage, {
_this: this,
loading: 'loading'
}, res => {
this.classData = res.data.list
this.total = res.data.count
}, e => {
})
// this.$refs.selection.selectAll(false)
},
// 新增弹窗打开
classAdd (oprState, row) {
this.oprState = oprState
if (this.oprState === 1) {
this.title = '新增信息'
this.dialogState = true
} else if (this.oprState === 2) {
this.title = '编辑信息'
this.classModelAdd = row
this.dialogState = true
} else {
this.title = '查看信息'
this.classModelAdd = row
this.dialogState = true
}
},
// 新增弹窗提交
saveClass (formName) {
let data = this.classModelAdd
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.oprState === 1) {
this.classModelAdd.dicTypeCode = this.classModelAdd.dicTypeName
this.$http.postData('sys/dictype/create', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {})
} else if (this.oprState === 2) {
this.$http.putData('sys/dictype', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {
})
}
} else {
return false
}
})
},
// 查看弹窗关闭
handleClose () {
this.page = 1
this.selectClass()
this.classModelAdd.dicTypeName = ''
this.classModelAdd.showIndex = ''
this.classModelAdd.describes = ''
if (this.$refs['classModelAdd']) {
this.$refs['classModelAdd'].resetFields()
}
this.dialogState = false
},
// 新增弹窗关闭
closeModal (formName) {
this.page = 1
this.selectClass()
this.classModelAdd.dicTypeName = ''
this.classModelAdd.showIndex = ''
this.classModelAdd.describes = ''
this.$refs['classModelAdd'].resetFields()
this.dialogState = false
},
// 批量删除
classBatchDel () {
if (this.selectNum === '' || this.selectNum.length === 0) {
this.$confirm('请选择一条数据进行删除', '提示', {
showCancelButton: false,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
} else {
(
this.$confirm('确认删除这些数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let delIds = []
let delTypeCodes = []
for (let i = 0; i < this.selectNum.length; i++) {
delIds.push(this.selectNum[i].id)
delTypeCodes.push(this.selectNum[i].dicTypeCode)
}
delIds = delIds.join(',')
delTypeCodes = delTypeCodes.join(',')
let data = {}
data.ids = delIds
data.dicTypeCodes = delTypeCodes
this.$http.delete('sys/dictype/deleteArr', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
}
})
}).catch(() => {
// 取消删除,清空选择
this.$refs.selection.clearSelection()
})
)
}
},
// 删除
classDel (row) {
let data = {}
data.dicTypeEOId = row.id
data.dicTypeCode = row.dicTypeCode
if (data.id !== '' && data.dicTypeCode !== '') {
this.$confirm('确认删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http.delete('sys/dictype/delete', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
} else {
}
}).catch(() => {
})
})
}
},
// 多选
handleSelectionChange (val) {
this.selectNum = val
},
pageChange (page) {
this.page = page
this.selectClass()
},
pageSizeChange (pageSize) {
this.rows = pageSize
this.selectClass()
}
},
mounted () {
this.selectClass()
this.tableHeight = $('.content').height() - 44
window.onresize = () => {
this.tableHeight = $('.content').height() - 44
}
},
computed: {
classObject () {
return {
'check-draw': this.oprState === 3
}
}
}
}
</script>
<style lang="less" scoped>
.ProfessionalClassification{
position: relative;
height: 100%;
padding: 0 10px;
background: #fff;
.content{
height: calc(~'100% - 45px - 56px');
overflow-y: auto;
}
.demo-drawer__content{
// border: 1px solid #ccc;
padding: 0 15px;
.check-item-label{
min-width: 50px;
}
}
}
</style>
@@ -0,0 +1,478 @@
<!-- 配置管理-标准类别 -->
<template>
<div class="standard-category v-class">
<el-form :inline="true" :model="standardForm" ref="ruleForm" class="label-input-form">
<el-form-item :label="this.$t('m.option')" class="serch-form-item">
<el-input
v-model.trim="standardForm.standName"
:placeholder="$t('m.pleaseEnterOptions')"
:maxlength="100"
clearable
@keyup.enter.native="selectCategoryBtn"></el-input>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
icon="el-icon-search"
type="primary"
class="searchAngNewBtn"
@click="selectCategoryBtn"></el-button>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
type="primary"
class="searchAngNewBtn"
@click="resetSelect">{{$t('m.clearQuery')}}</el-button>
</el-form-item>
</el-form>
<div class="content">
<div class="action-bar">
<el-button
type="primary"
size="mini"
@click="classAdd(1, null)"
v-btn-permission="'CXRPGWHNSF'"
>{{$t('m.add')}}</el-button>
<el-button
type="danger"
size="mini"
@click="classBatchDel"
v-btn-permission="'R24ALH4Q89'">{{$t('m.delete')}}</el-button>
</div>
<el-table
ref="selection"
:data="categoryData"
tooltip-effect="dark"
:height="tableHeight"
style="width: 100%"
border
row-key="id"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="dicTypeName"
:label="this.$t('m.option')"
width="400"
align="center"
>
</el-table-column>
<el-table-column
prop="describes"
:label="this.$t('m.describe')"
width="400"
align="center">
</el-table-column>
<el-table-column :label="this.$t('m.operation')" align="center">
<template slot-scope="scope">
<el-button
class="opera-btn"
size="mini"
type="primary"
@click="classAdd(3, scope.row)">{{$t('m.see')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="warning"
v-btn-permission="'ZL86999VLW'"
@click="classAdd(2, scope.row)">{{$t('m.edit')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="danger"
v-btn-permission="'7C7567JU9G'"
@click="classDel(scope.row)">{{$t('m.delete')}}</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!--分页-->
<pagination
:page="page"
:total="total"
@pageChange="pageChange"
@pageSizeChange="pageSizeChange"></pagination>
<loading :loading="loading">数据获取中</loading>
<!--新增抽屉-->
<el-drawer
:title="title"
:visible.sync="dialogState"
ref="drawer"
size="800px"
:class = "classObject"
:before-close="handleClose"
>
<div class="demo-drawer__content" v-if="this.oprState === 1 || this.oprState === 2">
<el-form :model="categoryModelAdd" ref="categoryModelAdd" :rules="categoryModelAddRules" class="label-input-form">
<el-row>
<el-col :span="12">
<el-form-item :label="this.$t('m.option')"
:label-width="formLabelWidth"
prop="dicTypeName"
class="add-form-item">
<el-input
v-model.trim="categoryModelAdd.dicTypeName"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.sortNumber')"
prop="showIndex"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
type="number"
oninput="if(value.length>4)value=value.slice(0,4)"
v-model.number="categoryModelAdd.showIndex"
@mousewheel.native.prevent
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.describe')"
prop="describes"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
v-model.trim="categoryModelAdd.describes"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="demo-drawer-footer">
<el-button size="mini" @click="closeModal('categoryModelAdd')">{{$t('m.cancel')}}</el-button>
<el-button size="mini" type="primary" @click="saveClass('categoryModelAdd')">{{$t('m.submit')}}</el-button>
</div>
</div>
<div class="demo-drawer__content" v-else>
<div class="check-item-row">
<div class="check-item-col1">
<div class="check-item-label"> 选项:</div>
<el-tooltip v-if="categoryModelAdd.dicTypeName" class="item" effect="dark" :content="categoryModelAdd.dicTypeName" placement="top">
<div slot="content" class="toolip-content">{{categoryModelAdd.dicTypeName}}</div>
<div class="check-item-value">{{categoryModelAdd.dicTypeName}}</div>
</el-tooltip>
<div v-else class="check-item-value">{{categoryModelAdd.dicTypeName}}</div>
</div>
<div class="check-item-col1">
<div class="check-item-label">排序号:</div>
<div class="check-item-value">{{categoryModelAdd.showIndex}}</div>
</div>
</div>
<div class="check-item-row">
<div class="check-item-col2">
<div class="check-item-label">描述:</div>
<el-tooltip v-if="categoryModelAdd.describes" class="item" effect="dark" :content="categoryModelAdd.describes" placement="top">
<div slot="content" class="toolip-content">{{categoryModelAdd.describes}}</div>
<div class="check-item-value">{{categoryModelAdd.describes}}</div>
</el-tooltip>
<div v-else class="check-item-value">{{categoryModelAdd.describes}}</div>
</div>
<div class="check-item-col2">
<div class="check-item-label"></div>
<div class="check-item-value"></div>
</div>
</div>
</div>
</el-drawer>
</div>
</template>
<script>
export default {
name: 'StandardCategory',
data () {
return {
// 查询条件
standardForm: {
// 选项
standName: '',
// 数据编码
standCode: '',
// 描述
describes: ''
},
total: 0,
page: 1,
rows: 10,
loading: false,
// 列表数据
categoryData: [],
// 抽屉打开
dialogState: false,
// form-item label宽度
formLabelWidth: '80px',
// 新增弹窗数据
categoryModelAdd: {
// 模态框信息
dicTypeName: '',
showIndex: '',
// 数据编码
dicTypeCode: '',
// 唯一辨识
dicId: 'JKSADFH564S',
// 描述
describes: ''
},
// 弹窗标题
title: '',
// 表单验证
categoryModelAddRules: {
dicTypeName: [
{required: true, message: '选项不能为空', trigger: 'blur'},
{type: 'string', max: 100, message: '最多输入100位', trigger: 'blur'}
],
showIndex: [
{required: true, message: '排序号不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
],
describes: [
{type: 'string', max: 500, message: '最多输入500位', trigger: 'blur'}
]
},
// 中间变量
standName1: '',
describes1: '',
standCode1: '',
// 判断是新增or 编辑 or 查看
oprState: 0,
// 多选时接收选中行数据
selectNum: [],
tableHeight: null
}
},
methods: {
// 条件查询
selectCategoryBtn () {
this.standName1 = this.standardForm.standName
this.describes1 = this.standardForm.describes
this.standCode1 = this.standardForm.standCode
this.page = 1
this.selectCategory()
},
// 清空查询
resetSelect (formName) {
this.standName1 = ''
this.standCode1 = ''
this.describes1 = ''
this.standardForm.standName = ''
this.standardForm.standCode = ''
this.standardForm.describes = ''
this.selectCategory()
this.$refs[formName].resetFields()
},
// 分页加载列表
selectCategory () {
let DicTypeEOPage = {
page: this.page,
pageSize: this.$store.getters.userInfo.configContent,
dicTypeName: this.standName1,
dicTypeCode: this.standCode1,
describes: this.describes1,
dicId: 'JKSADFH564S'
}
this.$http.get('sys/dictype/page', DicTypeEOPage, {
_this: this,
loading: 'loading'
}, res => {
this.categoryData = res.data.list
this.total = res.data.count
}, e => {
})
// this.$refs.selection.selectAll(false)
},
// 新增弹窗打开
classAdd (oprState, row) {
this.oprState = oprState
if (this.oprState === 1) {
this.title = '新增信息'
this.dialogState = true
} else if (this.oprState === 2) {
this.title = '编辑信息'
this.categoryModelAdd = row
this.dialogState = true
} else {
this.title = '查看信息'
this.categoryModelAdd = row
this.dialogState = true
}
},
// 新增弹窗提交
saveClass (formName) {
let data = this.categoryModelAdd
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.oprState === 1) {
this.categoryModelAdd.dicTypeCode = this.categoryModelAdd.dicTypeName
this.$http.postData('sys/dictype/create', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {})
} else if (this.oprState === 2) {
this.$http.putData('sys/dictype', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {
})
}
} else {
return false
}
})
},
// 查看弹窗关闭
handleClose () {
this.page = 1
this.selectCategory()
this.categoryModelAdd.dicTypeName = ''
this.categoryModelAdd.showIndex = ''
this.categoryModelAdd.describes = ''
if (this.$refs['categoryModelAdd']) {
this.$refs['categoryModelAdd'].resetFields()
}
this.dialogState = false
},
// 新增弹窗关闭
closeModal (formName) {
this.page = 1
this.selectCategory()
this.categoryModelAdd.dicTypeName = ''
this.categoryModelAdd.showIndex = ''
this.categoryModelAdd.describes = ''
this.dialogState = false
this.$refs['categoryModelAdd'].resetFields()
},
// 批量删除
classBatchDel () {
if (this.selectNum === '' || this.selectNum.length === 0) {
this.$confirm('请选择一条数据进行删除', '提示', {
showCancelButton: false,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
})
} else {
(
this.$confirm('确认删除这些数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
let delIds = []
let delTypeCodes = []
for (let i = 0; i < this.selectNum.length; i++) {
delIds.push(this.selectNum[i].id)
delTypeCodes.push(this.selectNum[i].dicTypeCode)
}
delIds = delIds.join(',')
delTypeCodes = delTypeCodes.join(',')
let data = {}
data.ids = delIds
data.dicTypeCodes = delTypeCodes
this.$http.delete('sys/dictype/deleteArr', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
}
})
}).catch(() => {
// 取消删除,清空选择
this.$refs.selection.clearSelection()
})
)
}
},
// 删除
classDel (row) {
let data = {}
data.dicTypeEOId = row.id
data.dicTypeCode = row.dicTypeCode
if (data.id !== '' && data.dicTypeCode !== '') {
this.$confirm('确认删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.delete('sys/dictype/delete', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
} else {
}
}).catch(() => {
// this.$message({
// type: 'info',
// message: '已取消删除'
// });
})
})
}
},
// 多选
handleSelectionChange (val) {
this.selectNum = val
},
// 取消多选
clearSelection () {
},
pageChange (page) {
this.page = page
this.selectCategory()
},
pageSizeChange (pageSize) {
this.rows = pageSize
this.selectCategory()
}
},
mounted () {
this.selectCategory()
this.tableHeight = $('.content').height() - 44
window.onresize = () => {
this.tableHeight = $('.content').height() - 44
}
},
computed: {
classObject () {
return {
'check-draw': this.oprState === 3
}
}
}
}
</script>
<style lang="less">
.standard-category {
position: relative;
height: 100%;
padding: 0 10px;
background: #fff;
.content{
height: calc(~'100% - 45px - 56px');
overflow-y: auto;
}
}
</style>
@@ -0,0 +1,477 @@
<!-- 标准/文件性质 -->
<template>
<div class="standard-classification v-class">
<el-form :inline="true" :model="standardForm" ref="ruleForm" class="label-input-form">
<el-form-item :label="$t('m.option')" class="serch-form-item">
<el-input
v-model.trim="standardForm.standName"
:placeholder="$t('m.pleaseEnterTheOption')"
:maxlength="100"
clearable
@keyup.enter.native="selectClassBtn"></el-input>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
icon="el-icon-search"
type="primary"
class="searchAngNewBtn"
@click="selectClassBtn"></el-button>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
type="primary"
class="searchAngNewBtn"
@click="resetSelect">{{$t('m.clearQuery')}}</el-button>
</el-form-item>
</el-form>
<div class="content">
<div class="action-bar">
<el-button
type="primary"
size="mini"
@click="classAdd(1, null)"
v-btn-permission="'SDXRQ8LV6K'"
>{{$t('m.add')}}</el-button>
<el-button
type="danger"
size="mini"
@click="classBatchDel"
v-btn-permission="'ATBANPLHCM'">{{$t('m.delete')}}</el-button>
</div>
<el-table
:height="tableHeight"
ref="selection"
:data="classData"
tooltip-effect="dark"
style="width: 100%"
border
row-key="id"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="dicTypeName"
:label="$t('m.option')"
width="400"
align="center"
>
</el-table-column>
<el-table-column
prop="describes"
:label="$t('m.describe')"
width="400"
align="center">
</el-table-column>
<el-table-column :label="$t('m.operation')" align="center">
<template slot-scope="scope">
<el-button
class="opera-btn"
size="mini"
type="primary"
@click="classAdd(3, scope.row)">{{$t('m.see')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="warning"
v-btn-permission="'VWUD78DHGM'"
@click="classAdd(2, scope.row)">{{$t('m.edit')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="danger"
v-btn-permission="'GAPG2L7CWP'"
@click="classDel(scope.row)">{{$t('m.delete')}}</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!--分页-->
<pagination
class="tabpagination"
:page="page"
:total="total"
@pageChange="pageChange"
@pageSizeChange="pageSizeChange"></pagination>
<loading :loading="loading">{{$t('m.dataAcquisition')}}</loading>
<!--新增抽屉-->
<el-drawer
:title="title"
:visible.sync="dialogState"
direction="rtl"
custom-class="demo-drawer"
ref="drawer"
size="800px"
:class="classObject"
:before-close="handleClose"
>
<div class="demo-drawer__content" v-if="this.oprState === 1 || this.oprState === 2">
<el-form :model="classModelAdd" ref="classModelAdd" :rules="classRules" class="label-input-form">
<el-row>
<el-col :span="12">
<el-form-item :label="$t('m.option')"
:label-width="formLabelWidth"
prop="dicTypeName"
:disabled = 'this.oprState === 2'
class="add-form-item">
<el-input
v-model.trim="classModelAdd.dicTypeName"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('m.sortNumber')"
prop="showIndex"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
type="number"
oninput="if(value.length>4)value=value.slice(0,4)"
v-model.number="classModelAdd.showIndex"
@mousewheel.native.prevent
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('m.describe')"
prop="describes"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
v-model.trim="classModelAdd.describes"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="demo-drawer-footer">
<el-button size="mini" @click="closeModal('classModelAdd')">{{$t('m.cancel')}}</el-button>
<el-button size="mini" type="primary" @click="saveClass('classModelAdd')">{{$t('m.submit')}}</el-button>
</div>
</div>
<div class="demo-drawer__content" v-else>
<div class="check-item-row">
<div class="check-item-col1">
<div class="check-item-label">{{$t('m.option')}}</div>
<el-tooltip v-if="classModelAdd.dicTypeName" class="item" effect="dark" :content="classModelAdd.dicTypeName" placement="top">
<div slot="content" class="toolip-content">{{classModelAdd.dicTypeName}}</div>
<div class="check-item-value">{{classModelAdd.dicTypeName}}</div>
</el-tooltip>
<div v-else class="check-item-value">{{classModelAdd.dicTypeName}}</div>
</div>
<div class="check-item-col1">
<div class="check-item-label">{{$t('m.sortNumber')}}</div>
<div class="check-item-value">{{classModelAdd.showIndex}}</div>
</div>
</div>
<div class="check-item-row">
<div class="check-item-col2">
<div class="check-item-label">{{$t('m.describe')}}</div>
<el-tooltip v-if="classModelAdd.describes" class="item" effect="dark" :content="classModelAdd.describes" placement="top">
<div slot="content" class="toolip-content">{{classModelAdd.describes}}</div>
<div class="check-item-value">{{classModelAdd.describes}}</div>
</el-tooltip>
<div v-else class="check-item-value">{{classModelAdd.describes}}</div>
</div>
<div class="check-item-col2">
<div class="check-item-label"></div>
<div class="check-item-value"></div>
</div>
</div>
</div>
</el-drawer>
</div>
</template>
<script>
export default {
name: 'standardClassification',
data () {
return {
// 查询条件
standardForm: {
// 选项
standName: '',
// 数据编码
standCode: '',
// 描述
describes: ''
},
total: 0,
page: 1,
rows: 10,
loading: false,
// 列表数据
classData: [],
// 抽屉打开
dialogState: false,
// form-item label宽度
formLabelWidth: '80px',
// 新增弹窗数据
classModelAdd: {
// 数据信息
dicTypeName: '',
showIndex: '',
// 数据编码
dicTypeCode: '',
// 描述
describes: '',
// 唯一辨识
dicId: 'FDFDFDVFTGR'
},
// 弹窗标题
title: '',
// 表单验证
classRules: {
dicTypeName: [
{required: true, message: '选项不能为空', trigger: 'blur'},
{type: 'string', max: 100, message: '最多输入100位', trigger: 'blur'}
],
showIndex: [
{required: true, message: '排序号不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
],
describes: [
{type: 'string', max: 500, message: '最多输入500位', trigger: 'blur'}
]
},
// 中间变量
standName1: '',
describes1: '',
standCode1: '',
// 判断是新增or 编辑 or 查看
oprState: 0,
// 多选时接收选中行数据
selectNum: [],
tableHeight: null
}
},
methods: {
// 条件查询
selectClassBtn () {
this.standName1 = this.standardForm.standName
this.describes1 = this.standardForm.describes
this.standCode1 = this.standardForm.standCode
this.page = 1
this.selectClass()
},
// 清空查询
resetSelect (formName) {
this.standName1 = ''
this.standCode1 = ''
this.describes1 = ''
this.standardForm.standName = ''
this.standardForm.standCode = ''
this.standardForm.describes = ''
this.page = 1
this.selectClass()
},
// 分页加载列表
selectClass () {
let DicTypeEOPage = {
page: this.page,
pageSize: this.$store.getters.userInfo.configContent,
dicTypeName: this.standName1,
dicTypeCode: this.standCode1,
describes: this.describes1,
dicId: 'FDFDFDVFTGR'
}
this.$http.get('sys/dictype/page', DicTypeEOPage, {
_this: this,
loading: 'loading'
}, res => {
this.classData = res.data.list
this.total = res.data.count
}, e => {
})
// this.$refs.selection.selectAll(false)
},
// 新增弹窗打开
classAdd (oprState, row) {
this.oprState = oprState
if (this.oprState === 1) {
this.title = this.$t('m.newInformation')
this.dialogState = true
} else if (this.oprState === 2) {
this.title = this.$t('m.editInformation')
this.classModelAdd = row
this.dialogState = true
} else {
this.title = this.$t('m.seeInformation')
this.classModelAdd = row
this.dialogState = true
}
},
// 新增弹窗提交
saveClass (formName) {
let data = this.classModelAdd
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.oprState === 1) {
this.classModelAdd.dicTypeCode = this.classModelAdd.dicTypeName
this.$http.postData('sys/dictype/create', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {})
} else if (this.oprState === 2) {
this.$http.putData('sys/dictype', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {
})
}
} else {
return false
}
})
},
// 查看弹窗关闭
handleClose () {
this.page = 1
this.selectClass()
this.classModelAdd.dicTypeName = ''
this.classModelAdd.showIndex = ''
this.classModelAdd.describes = ''
if (this.$refs['classModelAdd']) {
this.$refs['classModelAdd'].resetFields()
}
this.dialogState = false
},
// 新增弹窗关闭
closeModal (formName) {
this.page = 1
this.selectClass()
this.classModelAdd.dicTypeName = ''
this.classModelAdd.showIndex = ''
this.classModelAdd.describes = ''
this.$refs['classModelAdd'].resetFields()
this.dialogState = false
},
// 批量删除
classBatchDel () {
if (this.selectNum === '' || this.selectNum.length === 0) {
this.$confirm('请选择一条数据进行删除', '提示', {
showCancelButton: false,
confirmButtonText: this.$t('m.determine'),
cancelButtonText: this.$t('m.cancel'),
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
})
} else {
(
this.$confirm('确认删除这些数据?', '提示', {
confirmButtonText: this.$t('m.determine'),
cancelButtonText: this.$t('m.cancel'),
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
let delIds = []
let delTypeCodes = []
for (let i = 0; i < this.selectNum.length; i++) {
delIds.push(this.selectNum[i].id)
delTypeCodes.push(this.selectNum[i].dicTypeCode)
}
delIds = delIds.join(',')
delTypeCodes = delTypeCodes.join(',')
let data = {}
data.ids = delIds
data.dicTypeCodes = delTypeCodes
this.$http.delete('sys/dictype/deleteArr', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
}
})
}).catch(() => {
// 取消删除,清空选择
this.$refs.selection.clearSelection()
})
)
}
},
// 删除
classDel (row) {
let data = {}
data.dicTypeEOId = row.id
data.dicTypeCode = row.dicTypeCode
if (data.id !== '' && data.dicTypeCode !== '') {
this.$confirm('确认删除该条数据?', '提示', {
confirmButtonText: this.$t('m.determine'),
cancelButtonText: this.$t('m.cancel'),
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.delete('sys/dictype/delete', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
} else {
}
}).catch(() => {
})
})
}
},
// 多选
handleSelectionChange (val) {
this.selectNum = val
},
pageChange (page) {
this.page = page
this.selectClass()
},
pageSizeChange (pageSize) {
this.rows = pageSize
this.selectClass()
}
},
mounted () {
this.selectClass()
this.tableHeight = $('.content').height() - 44
window.onresize = () => {
this.tableHeight = $('.content').height() - 44
}
},
computed: {
classObject () {
return {
'check-draw': this.oprState === 3
}
}
}
}
</script>
<style lang="less" scoped>
.standard-classification{
position: relative;
height: 100%;
padding: 0 10px;
background: #fff;
.content{
height: calc(~'100% - 45px - 56px');
overflow-y: auto;
}
}
</style>
@@ -0,0 +1,801 @@
<!-- 隐藏的页面-->
<template>
<div id="national-area" class="v-class">
<div class="search-area">
<el-form :inline="true" :model="standardForm" ref="ruleForm" class="label-input-form">
<div class="search-area-item">
<el-form-item :label="this.$t('m.option')" class="serch-form-item">
<el-input
v-model.trim="standardForm.standName"
:placeholder="$t('m.pleaseEnterOptions')"
:maxlength="100"
clearable
@keyup.enter.native="selecteRgionBtn"></el-input>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
icon="el-icon-search"
type="primary"
class="searchAngNewBtn"
@click="selecteRgionBtn"></el-button>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
type="primary"
class="searchAngNewBtn"
@click="resetSelect">{{$t('m.clearQuery')}}</el-button>
</el-form-item>
</div>
<div class="search-area-item">
<el-form-item class="serch-form-item btn-box">
<el-button
type="primary"
class="searchAngNewBtn"
@click="classAdd(1, null)"
v-btn-permission="'H94JEVB2SN'"
>{{$t('m.add')}}</el-button>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
type="danger"
class="searchAngNewBtn"
@click="regionBatchDel"
v-btn-permission="'JT4GYJGZNB'">{{$t('m.delete')}}</el-button>
</el-form-item>
</div>
</el-form>
</div>
<!-- :reserve-selection="true" -->
<div class="content">
<el-table
ref="selection"
:data="regionData"
tooltip-effect="dark"
style="width: 100%"
border
row-key="id"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="dicTypeName"
:label="this.$t('m.option')"
width="400"
align="center"
>
</el-table-column>
<el-table-column
prop="describes"
:label="this.$t('m.describe')"
width="400"
align="center">
</el-table-column>
<el-table-column :label="this.$t('m.operation')" align="center">
<template slot-scope="scope">
<el-button
class="opera-btn"
size="mini"
type="primary"
@click="classAdd(3, scope.row)">{{$t('m.see')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="warning"
v-btn-permission="'D63XW3MAHS'"
@click="classAdd(2, scope.row)">{{$t('m.edit')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="danger"
v-btn-permission="'RTWLGX593N'"
@click="classDel(scope.row)">{{$t('m.delete')}}</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!--分页-->
<pagination
class="tabpagination"
:page="page"
:total="total"
@pageChange="pageChange"
@pageSizeChange="pageSizeChange"></pagination>
<loading :loading="loading">数据获取中</loading>
<!--新增抽屉-->
<el-drawer
:title="title"
:visible.sync="dialogState"
direction="rtl"
custom-class="demo-drawer"
ref="drawer"
size="800px"
:before-close="handleClose"
>
<div class="demo-drawer__content" v-if="this.oprState === 1 || this.oprState === 2">
<el-form :model="regionModelAdd" ref="regionModelAdd" :rules="regionRules" class="label-input-form">
<el-row>
<el-col :span="12">
<el-form-item :label="this.$t('m.option')"
:label-width="formLabelWidth"
prop="dicTypeName"
:disabled = 'this.oprState === 2'
class="add-form-item">
<el-input
v-model.trim="regionModelAdd.dicTypeName"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.sortNumber')"
prop="showIndex"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
oninput="if(value.length>4)value=value.slice(0,4)"
type="number"
v-model.number="regionModelAdd.showIndex"
@mousewheel.native.prevent
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.describe')"
prop="describes"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
v-model.trim="regionModelAdd.describes"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="demo-drawer__footer">
<el-button size="mini" @click="closeModal('regionModelAdd')">{{$t('m.cancel')}}</el-button>
<el-button size="mini" type="primary" @click="saveClass('regionModelAdd')">{{$t('m.submit')}}</el-button>
</div>
</div>
<div class="demo-drawer__content" v-else>
<div class="search-area1 v-calss">
<el-form :inline="true" :model="standardForm" ref="ruleForm" class="label-input-form">
<div class="search-area-item">
<el-form-item class="serch-form-item btn-box">
<el-button
type="primary"
class="searchAngNewBtn"
@click="areaAdd(1, null)"
>{{$t('m.add')}}</el-button>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
type="danger"
class="searchAngNewBtn"
@click="areaBatchDel"
>{{$t('m.delete')}}</el-button>
</el-form-item>
</div>
</el-form>
</div>
<div class="content1">
<el-table
ref="selection"
:data="areaData"
tooltip-effect="dark"
style="width: 100%"
border
row-key="id"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="handleAreaSelectionChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="dicTypeName"
:label="this.$t('m.subfield')"
width="260"
align="center"
>
</el-table-column>
<el-table-column :label="this.$t('m.operation')" align="center">
<template slot-scope="scope">
<el-button
class="opera-btn"
size="mini"
type="primary"
@click="areaAdd(2, scope.row)">{{$t('m.see')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="danger"
@click="regionAreaDel(scope.row)">{{$t('m.delete')}}</el-button>
</template>
</el-table-column>
</el-table>
</div>
<loading :loading="loading">数据获取中</loading>
<pagination :page="areaPage" :total="areaTotal" @pageChange="areaPageChange" @pageSizeChange="areaPageSizeChange"></pagination>
</div>
<el-drawer
:title="areaTitle"
:append-to-body="true"
:before-close="handleAreaClose"
destroy-on-close
:visible.sync="innerDrawer"
>
<div class="area-content" v-if="this.inDrawState === 1">
<el-form :model="areaModelAdd" ref="areaModelAdd" :rules="areaModelRules" class="label-input-form">
<el-form-item :label="this.$t('m.subfield')"
:label-width="formLabelWidth"
prop="selectStandCategory"
class="add-form-item">
<search-select
v-model="areaModelAdd.selectStandCategory"
:options="standCategoryList"
@on-change="getSelectCate"
clearable
/>
</el-form-item>
<el-form-item :label="this.$t('m.sortNumber')"
prop="showIndex"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
oninput="if(value.length>4)value=value.slice(0,4)"
type="number"
v-model.number="areaModelAdd.showIndex"
@mousewheel.native.prevent
autocomplete="off" clearable></el-input>
</el-form-item>
</el-form>
<div class="demo-drawer__footer">
<el-button size="mini" @click="closeAreaModal('areaModelAdd')">{{$t('m.cancel')}}</el-button>
<el-button size="mini" type="primary" @click="saveArea('areaModelAdd')">{{$t('m.submit')}}</el-button>
</div>
</div>
<div class="area-content" v-else>
<div class="check-item-row">
<div class="check-item-col1">
<div class="check-item-label"> 选项:</div>
<div class="check-item-value">{{areaModelAdd.dicTypeName}}</div>
</div>
<div class="check-item-col1">
<div class="check-item-label">排序号:</div>
<div class="check-item-value">{{areaModelAdd.showIndex}}</div>
</div>
</div>
</div>
</el-drawer>
</el-drawer>
</div>
</template>
<script>
export default {
name: 'nationalArea',
data () {
return {
// 查询条件
standardForm: {
// 选项
standName: '',
// 数据编码
standCode: '',
// 描述
describes: ''
},
total: 0,
page: 1,
rows: 10,
loading: false,
// 列表数据
regionData: [],
// 抽屉打开
dialogState: false,
// form-item label宽度
formLabelWidth: '80px',
// 新增弹窗数据
regionModelAdd: {
// 数据信息
dicTypeName: '',
showIndex: '',
// 数据编码
dicTypeCode: '',
// 描述
describes: '',
// 唯一辨识
dicId: 'ZRAREASAW'
},
// 弹窗标题
title: '',
// 表单验证
regionRules: {
dicTypeName: [
{required: true, message: '选项不能为空', trigger: 'blur'},
{type: 'string', max: 100, message: '最多输入100位', trigger: 'blur'}
],
showIndex: [
{required: true, message: '排序号不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
],
describes: [
{type: 'string', max: 500, message: '最多输入500位', trigger: 'blur'}
]
},
// 中间变量
standName1: '',
describes1: '',
standCode1: '',
// 判断是新增or 编辑 or 查看
oprState: 0,
// 主页多选时接收选中行数据
selectNum: [],
// 查看内列表数据
areaData: [],
// 内部弹窗标题
areaTitle: '',
// 判断内部弹窗是新建or 查看
inDrawState: 0,
innerDrawer: false,
// 内部新增rules
areaModelRules: {
selectStandCategory: [
{ required: true, message: '子领域不能为空', trigger: 'change' }
],
showIndex: [
{required: true, message: '排序号不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
]
},
// 内联抽屉信息
areaModelAdd: {
dicTypeName: '',
dicTypeCode: '',
showIndex: '',
describes: '',
parentId: '',
classifyCode: '',
selectStandCategory: '',
dicId: 'ZRAREASAW'
},
// 内部分页,计数
// 子类分类
areaPage: 1,
areaTotal: 0,
areaRows: 10,
// 标准类别表,下拉框里的数据
standCategoryList: [],
// 不重复
newAreaModelAdd: {},
areaRow: '',
areaSelectNum: []
}
},
methods: {
// 条件查询
selecteRgionBtn () {
this.standName1 = this.standardForm.standName
this.describes1 = this.standardForm.describes
this.standCode1 = this.standardForm.standCode
this.page = 1
this.selectClass()
},
// 清空查询
resetSelect (formName) {
this.standName1 = ''
// this.standCode1 = ''
this.describes1 = ''
this.standardForm.standName = ''
// this.standardForm.standCode = ''
this.standardForm.describes = ''
this.page = 1
this.selectClass()
},
// 分页加载列表页列表
selectClass () {
let DicTypeEOPage = {
page: this.page,
pageSize: this.$store.getters.userInfo.configContent,
dicTypeName: this.standName1,
describes: this.describes1,
dicId: 'ZRAREASAW'
}
this.$http.get('sys/dictype/pageCountry', DicTypeEOPage, {
_this: this,
loading: 'loading'
}, res => {
this.regionData = res.data.list
this.total = res.data.count
}, e => {
})
// this.$refs.selection.selectAll(false)
},
// 新增弹窗打开
classAdd (oprState, row) {
this.oprState = oprState
if (this.oprState === 1) {
this.title = '新增信息'
this.dialogState = true
} else if (this.oprState === 2) {
this.title = '编辑信息'
this.regionModelAdd = row
this.dialogState = true
} else {
this.title = '查看信息'
this.regionModelAdd = row
this.areaRow = row.id
this.areaModelAdd.parentId = row.id
this.selectArea(row.id)
this.dialogState = true
}
},
// 新增弹窗提交
saveClass (formName) {
let data = this.regionModelAdd
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.oprState === 1) {
this.$http.postData('sys/dictype/create', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {})
} else if (this.oprState === 2) {
this.$http.putData('sys/dictype', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {
})
}
} else {
// console.log('error submit!!')
// return false
}
})
},
// 查看弹窗关闭
handleClose () {
this.page = 1
this.selectClass()
this.regionModelAdd.dicTypeName = ''
this.regionModelAdd.showIndex = ''
this.regionModelAdd.describes = ''
if (this.$refs['regionModelAdd']) {
this.$refs['regionModelAdd'].resetFields()
}
this.dialogState = false
},
// 新增弹窗关闭
closeModal (formName) {
this.page = 1
this.selectClass()
this.regionModelAdd.dicTypeName = ''
this.regionModelAdd.showIndex = ''
this.regionModelAdd.describes = ''
this.$refs['regionModelAdd'].resetFields()
this.dialogState = false
},
// 批量删除
regionBatchDel () {
if (this.selectNum === '' || this.selectNum.length === 0) {
this.$confirm('请选择一条数据进行删除', '提示', {
showCancelButton: false,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
})
} else {
(
this.$confirm('确认删除这些数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
let delIds = []
let delTypeCodes = []
for (let i = 0; i < this.selectNum.length; i++) {
delIds.push(this.selectNum[i].id)
delTypeCodes.push(this.selectNum[i].dicTypeCode)
}
delIds = delIds.join(',')
delTypeCodes = delTypeCodes.join(',')
let data = {}
data.ids = delIds
data.dicTypeCodes = delTypeCodes
this.$http.delete('sys/dictype/deleteArr', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
}
})
}).catch(() => {
// 取消删除,清空选择
this.$refs.selection.clearSelection()
})
)
}
},
// 删除
classDel (row) {
let data = {}
data.dicTypeEOId = row.id
data.dicTypeCode = row.dicTypeCode
if (data.id !== '' && data.dicTypeCode !== '') {
this.$confirm('确认删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.delete('sys/dictype/delete', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
} else {
}
}).catch(() => {
})
})
}
},
// 多选
handleSelectionChange (val) {
this.selectNum = val
},
pageChange (page) {
this.page = page
this.selectClass()
},
pageSizeChange (pageSize) {
this.rows = pageSize
this.selectClass()
},
// 内联表格加载
selectArea (id) {
this.$http.get('sys/dictype/page', {
page: this.areaPage,
pageSize: this.$store.getters.userInfo.configContent,
dicId: 'ZRAREASAW',
id: id
}, {
_this: this,
loading: 'areaLoading'
}, res => {
this.areaTotal = res.data.count
this.areaData = res.data.list
}, e => {})
},
// 打开内部弹窗
areaAdd (inDrawState, row, id) {
this.inDrawState = inDrawState
if (this.inDrawState === 1) {
this.areaTitle = '新建信息'
this.getStandCategory()
// this.$refs['areaModelAdd'].resetFields()
// this.areaModelAdd.selectStandCategory = ''
this.innerDrawer = true
} else {
this.areaModelAdd = row
this.areaTitle = '查看信息'
this.innerDrawer = true
}
},
// 关闭弹窗
handleAreaClose () {
this.areaPage = 1
this.selectArea(this.areaRow)
this.areaModelAdd.showIndex = ''
this.areaModelAdd.dicTypeName = ''
this.areaModelAdd.dicTypeCode = ''
this.newAreaModelAdd.dicTypeCode = ''
this.newAreaModelAdd.dicTypeName = ''
this.newAreaModelAdd.parentId = ''
if (this.$refs['areaModelAdd']) {
this.$refs['areaModelAdd'].resetFields()
}
this.innerDrawer = false
},
// 关闭新增弹窗
closeAreaModal (formName) {
this.areaPage = 1
this.selectArea(this.areaRow)
this.areaModelAdd.showIndex = ''
this.areaModelAdd.dicTypeName = ''
this.areaModelAdd.dicTypeCode = ''
this.newAreaModelAdd.dicTypeCode = ''
this.newAreaModelAdd.dicTypeName = ''
this.newAreaModelAdd.parentId = ''
this.$refs['areaModelAdd'].resetFields()
this.innerDrawer = false
},
// 获取标准类别List数据
getStandCategory () {
this.$http.get('sys/dictype/getDicTypeListCode', {}, {_this: this}, res => {
this.standCategoryList = res.data.SUBAREA
})
},
// 下拉列表变化
getSelectCate () {
for (let index = 0; index < this.standCategoryList.length; index++) {
let standCategory = this.standCategoryList[index]
// console.log(standCategory)
if (standCategory.value === this.areaModelAdd.selectStandCategory) {
this.selectStandCategoryNum = index
break
}
}
},
// 新增标准类别确定
saveArea (formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
let standCategory = this.standCategoryList[this.selectStandCategoryNum]
this.areaModelAdd.dicTypeName = standCategory.label
this.areaModelAdd.dicTypeCode = standCategory.value
this.newAreaModelAdd.dicTypeCode = this.areaModelAdd.dicTypeCode
this.newAreaModelAdd.dicTypeName = this.areaModelAdd.dicTypeName
this.newAreaModelAdd.parentId = this.areaModelAdd.parentId
this.newAreaModelAdd.showIndex = this.areaModelAdd.showIndex
this.newAreaModelAdd.dicId = 'ZRAREASAW'
// if (this.areaType === 1) {
this.$http.postData('sys/dictype/create', this.newAreaModelAdd, {
_this: this
}, res => {
if (res.ok) {
this.closeAreaModal()
}
}, e => {
})
// }
}
})
},
// 删除
regionAreaDel (row) {
let data = {}
data.dicTypeEOId = row.id
data.dicTypeCode = row.dicTypeCode
if (data.id !== '' && data.dicTypeCode !== '') {
this.$confirm('确认删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.delete('sys/dictype/delete', data, {
_this: this
}, res => {
if (res.ok) {
this.selectArea(this.areaRow)
} else {
}
}).catch(() => {
})
})
}
},
areaBatchDel () {
if (this.areaSelectNum === '' || this.areaSelectNum.length === 0) {
this.$confirm('请选择一条数据进行删除', '提示', {
showCancelButton: false,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
})
} else {
(
this.$confirm('确认删除这些数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
let delIds = []
let delTypeCodes = []
for (let i = 0; i < this.areaSelectNum.length; i++) {
delIds.push(this.areaSelectNum[i].id)
delTypeCodes.push(this.areaSelectNum[i].dicTypeCode)
}
delIds = delIds.join(',')
delTypeCodes = delTypeCodes.join(',')
let data = {}
data.ids = delIds
data.dicTypeCodes = delTypeCodes
this.$http.delete('sys/dictype/deleteArr', data, {
_this: this
}, res => {
if (res.ok) {
this.selectArea(this.areaRow)
}
})
}).catch(() => {
// 取消删除,清空选择
this.$refs.selection.clearSelection()
})
)
}
},
// 多选
handleAreaSelectionChange (val) {
this.areaSelectNum = val
},
// 子类分页
areaPageChange (page) {
this.areaPage = page
this.selectArea(this.areaRow)
},
areaPageSizeChange (pageSize) {
this.areaRows = pageSize
this.selectArea(this.areaRow)
}
},
mounted () {
this.selectClass()
},
computed: {}
}
</script>
<style lang="less" scoped>
#national-area{
position: relative;
height: 100%;
padding: 15px;
background: #fff;
.label-input-form {
display: flex;
justify-content: space-between;
}
.content{
// height: 540px;
margin-top: 10px;
width: 100%;
// height: calc(~'100% - 115px')!important;
overflow-y: auto;
}
.tabpagination{
position: relative;
}
.demo-drawer__content {
// padding: 0 15px;
.search-area1 {
text-align: right;
border-bottom: 1px solid #e8eaec;
padding-bottom: 10px;
margin-bottom: 23px;
}
.label-input-form {
display: inline-block;
}
}
}
.area-content{
padding: 0 15px;
}
</style>
@@ -0,0 +1,472 @@
<template>
<!--配置管理 --- 动态通知&分类-->
<div class="notice-And-classify">
<el-form :inline="true" :model="noticeAndClassifyForm" ref="ruleForm" class="label-input-form">
<el-form-item :label="this.$t('m.option')" class="serch-form-item">
<el-input
v-model.trim="noticeAndClassifyForm.standName"
:placeholder="$t('m.pleaseEnterOptions')"
:maxlength="100"
clearable
@keyup.enter.native="selectClassBtn"></el-input>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
icon="el-icon-search"
type="primary"
class="searchAngNewBtn"
@click="selectClassBtn"></el-button>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
type="primary"
class="searchAngNewBtn"
@click="resetSelect">{{$t('m.clearQuery')}}</el-button>
</el-form-item>
</el-form>
<div class="content">
<div class="action-bar">
<el-button
type="primary"
size="mini"
@click="classAdd(1, null)"
v-btn-permission="'SDXRQ8LV6K'"
>{{$t('m.add')}}</el-button>
<el-button
type="danger"
size="mini"
@click="classBatchDel"
v-btn-permission="'ATBANPLHCM'">{{$t('m.delete')}}</el-button>
</div>
<el-table
:height="tableHeight"
ref="selection"
:data="noticeAndClassifyData"
tooltip-effect="dark"
style="width: 100%"
border
row-key="id"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="dicTypeName"
:label="this.$t('m.option')"
width="400"
align="center"
>
</el-table-column>
<el-table-column
prop="describes"
:label="this.$t('m.describe')"
width="400"
align="center">
</el-table-column>
<el-table-column :label="this.$t('m.operation')" align="center">
<template slot-scope="scope">
<el-button
class="opera-btn"
size="mini"
type="primary"
@click="classAdd(3, scope.row)">{{$t('m.see')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="warning"
v-btn-permission="'VWUD78DHGM'"
@click="classAdd(2, scope.row)">{{$t('m.edit')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="danger"
v-btn-permission="'GAPG2L7CWP'"
@click="classDel(scope.row)">{{$t('m.delete')}}</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!--分页-->
<pagination
:page="page"
:total="total"
@pageChange="pageChange"
@pageSizeChange="pageSizeChange"></pagination>
<loading :loading="loading">数据获取中</loading>
<!--新增抽屉-->
<el-drawer
:title="title"
:visible.sync="dialogState"
direction="rtl"
custom-class="demo-drawer"
ref="drawer"
size="800px"
:class="classObject"
:before-close="handleClose"
>
<div class="demo-drawer__content" v-if="this.oprState === 1 || this.oprState === 2">
<el-form :model="classModelAdd" ref="classModelAdd" :rules="classRules" class="label-input-form">
<el-row>
<el-col :span="12">
<el-form-item :label="this.$t('m.option')"
:label-width="formLabelWidth"
prop="dicTypeName"
:disabled = 'this.oprState === 2'
class="add-form-item">
<el-input
v-model.trim="classModelAdd.dicTypeName"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.sortNumber')"
prop="showIndex"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
type="number"
oninput="if(value.length>4)value=value.slice(0,4)"
v-model.number="classModelAdd.showIndex"
@mousewheel.native.prevent
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.describe')"
prop="describes"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
v-model.trim="classModelAdd.describes"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="demo-drawer-footer">
<el-button size="mini" @click="closeModal('classModelAdd')">{{$t('m.cancel')}}</el-button>
<el-button size="mini" type="primary" @click="saveClass('classModelAdd')">{{$t('m.submit')}}</el-button>
</div>
</div>
<div class="demo-drawer__content" v-else>
<div class="check-item-row">
<div class="check-item-col1">
<div class="check-item-label"> 选项:</div>
<div class="check-item-value">{{classModelAdd.dicTypeName}}</div>
</div>
<div class="check-item-col1">
<div class="check-item-label">排序号:</div>
<div class="check-item-value">{{classModelAdd.showIndex}}</div>
</div>
</div>
<div class="check-item-row">
<div class="check-item-col2">
<div class="check-item-label">描述:</div>
<div class="check-item-value">{{classModelAdd.describes}}</div>
</div>
<div class="check-item-col2">
<div class="check-item-label"></div>
<div class="check-item-value"></div>
</div>
</div>
</div>
</el-drawer>
</div>
</template>
<script>
export default {
name: 'noticeAndClassify',
data () {
return {
// 查询条件
noticeAndClassifyForm: {
// 选项
standName: '',
// 数据编码
standCode: '',
// 描述
describes: ''
},
total: 0,
page: 1,
rows: 10,
loading: false,
// 列表数据
noticeAndClassifyData: [],
// 抽屉打开
dialogState: false,
// form-item label宽度
formLabelWidth: '80px',
// 新增弹窗数据
classModelAdd: {
// 数据信息
dicTypeName: '',
showIndex: '',
// 数据编码
dicTypeCode: '',
// 描述
describes: '',
// 唯一辨识
dicId: 'MLFDOIRSDK'
},
// 弹窗标题
title: '',
// 表单验证
classRules: {
dicTypeName: [
{required: true, message: '选项不能为空', trigger: 'blur'},
{type: 'string', max: 100, message: '最多输入100位', trigger: 'blur'}
],
showIndex: [
{required: true, message: '排序号不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
],
describes: [
{type: 'string', max: 500, message: '最多输入500位', trigger: 'blur'}
]
},
// 中间变量
standName1: '',
describes1: '',
standCode1: '',
// 判断是新增or 编辑 or 查看
oprState: 0,
// 多选时接收选中行数据
selectNum: [],
tableHeight: null
}
},
methods: {
// 条件查询
selectClassBtn () {
this.standName1 = this.noticeAndClassifyForm.standName
this.describes1 = this.noticeAndClassifyForm.describes
this.standCode1 = this.noticeAndClassifyForm.standCode
this.page = 1
this.selectClass()
},
// 清空查询
resetSelect (formName) {
this.standName1 = ''
this.standCode1 = ''
this.describes1 = ''
this.noticeAndClassifyForm.standName = ''
this.noticeAndClassifyForm.standCode = ''
this.noticeAndClassifyForm.describes = ''
this.page = 1
this.selectClass()
},
// 分页加载列表
selectClass () {
let DicTypeEOPage = {
page: this.page,
pageSize: this.$store.getters.userInfo.configContent,
dicTypeName: this.standName1,
dicTypeCode: this.standCode1,
describes: this.describes1,
dicId: 'MLFDOIRSDK'
}
this.$http.get('sys/dictype/page', DicTypeEOPage, {
_this: this,
loading: 'loading'
}, res => {
this.noticeAndClassifyData = res.data.list
this.total = res.data.count
}, e => {
})
// this.$refs.selection.selectAll(false)
},
// 新增弹窗打开
classAdd (oprState, row) {
this.oprState = oprState
if (this.oprState === 1) {
this.title = '新增信息'
this.dialogState = true
} else if (this.oprState === 2) {
this.title = '编辑信息'
this.classModelAdd = row
this.dialogState = true
} else {
this.title = '查看信息'
this.classModelAdd = row
this.dialogState = true
}
},
// 新增弹窗提交
saveClass (formName) {
let data = this.classModelAdd
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.oprState === 1) {
this.classModelAdd.dicTypeCode = this.classModelAdd.dicTypeName
this.$http.postData('sys/dictype/create', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {})
} else if (this.oprState === 2) {
this.$http.putData('sys/dictype', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {
})
}
} else {
return false
}
})
},
// 查看弹窗关闭
handleClose () {
this.page = 1
this.selectClass()
this.classModelAdd.dicTypeName = ''
this.classModelAdd.showIndex = ''
this.classModelAdd.describes = ''
if (this.$refs['classModelAdd']) {
this.$refs['classModelAdd'].resetFields()
}
this.dialogState = false
},
// 新增弹窗关闭
closeModal (formName) {
this.page = 1
this.selectClass()
this.classModelAdd.dicTypeName = ''
this.classModelAdd.showIndex = ''
this.classModelAdd.describes = ''
this.$refs['classModelAdd'].resetFields()
this.dialogState = false
},
// 批量删除
classBatchDel () {
if (this.selectNum === '' || this.selectNum.length === 0) {
this.$confirm('请选择一条数据进行删除', '提示', {
showCancelButton: false,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
})
} else {
(
this.$confirm('确认删除这些数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
let delIds = []
let delTypeCodes = []
for (let i = 0; i < this.selectNum.length; i++) {
delIds.push(this.selectNum[i].id)
delTypeCodes.push(this.selectNum[i].dicTypeCode)
}
delIds = delIds.join(',')
delTypeCodes = delTypeCodes.join(',')
let data = {}
data.ids = delIds
data.dicTypeCodes = delTypeCodes
this.$http.delete('sys/dictype/deleteArr', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
}
})
}).catch(() => {
// 取消删除,清空选择
this.$refs.selection.clearSelection()
})
)
}
},
// 删除
classDel (row) {
let data = {}
data.dicTypeEOId = row.id
data.dicTypeCode = row.dicTypeCode
if (data.id !== '' && data.dicTypeCode !== '') {
this.$confirm('确认删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.delete('sys/dictype/delete', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
} else {
}
}).catch(() => {
})
})
}
},
// 多选
handleSelectionChange (val) {
this.selectNum = val
},
pageChange (page) {
this.page = page
this.selectClass()
},
pageSizeChange (pageSize) {
this.rows = pageSize
this.selectClass()
}
},
mounted () {
this.selectClass()
this.tableHeight = $('.content').height() - 44
window.onresize = () => {
this.tableHeight = $('.content').height() - 44
}
},
computed: {
classObject () {
return {
'check-draw': this.oprState === 3
}
}
}
}
</script>
<style lang="less" scoped>
.notice-And-classify{
position: relative;
height: 100%;
padding: 0 10px;
background: #fff;
.content{
height: calc(~'100% - 45px - 56px');
overflow-y: auto;
}
.demo-drawer__content{
// border: 1px solid #ccc;
padding: 0 15px;
}
}
</style>
@@ -0,0 +1,489 @@
<!-- 配置管理-标准类别 -->
<template>
<div class="standard-category v-class">
<div class="search-area">
<el-form :inline="true" :model="standardForm" ref="ruleForm" class="label-input-form">
<div class="search-area-item">
<el-form-item :label="this.$t('m.option')" class="serch-form-item">
<el-input
v-model.trim="standardForm.standName"
:placeholder="$t('m.pleaseEnterOptions')"
:maxlength="100"
clearable
@keyup.enter.native="selectCategoryBtn"></el-input>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
icon="el-icon-search"
type="primary"
class="searchAngNewBtn"
@click="selectCategoryBtn"></el-button>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
type="primary"
class="searchAngNewBtn"
@click="resetSelect">{{$t('m.clearQuery')}}</el-button>
</el-form-item>
</div>
<div class="search-area-item">
<el-form-item class="serch-form-item btn-box">
<el-button
type="primary"
class="searchAngNewBtn"
@click="classAdd(1, null)"
v-btn-permission="'CXRPGWHNSF'"
>{{$t('m.add')}}</el-button>
</el-form-item>
<el-form-item class="serch-form-item btn-box">
<el-button
type="danger"
class="searchAngNewBtn"
@click="classBatchDel"
v-btn-permission="'R24ALH4Q89'">{{$t('m.delete')}}</el-button>
</el-form-item>
</div>
</el-form>
</div>
<div class="content">
<el-table
ref="selection"
:data="categoryData"
tooltip-effect="dark"
style="width: 100%"
border
row-key="id"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="dicTypeName"
:label="this.$t('m.option')"
width="400"
align="center"
>
</el-table-column>
<el-table-column
prop="describes"
:label="this.$t('m.describe')"
width="400"
align="center">
</el-table-column>
<el-table-column :label="this.$t('m.operation')" align="center">
<template slot-scope="scope">
<el-button
class="opera-btn"
size="mini"
type="primary"
@click="classAdd(3, scope.row)">{{$t('m.see')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="warning"
v-btn-permission="'ZL86999VLW'"
@click="classAdd(2, scope.row)">{{$t('m.edit')}}</el-button>
<el-button
class="opera-btn"
size="mini"
type="danger"
v-btn-permission="'7C7567JU9G'"
@click="classDel(scope.row)">{{$t('m.delete')}}</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!--分页-->
<pagination
class="tabpagination"
:page="page"
:total="total"
@pageChange="pageChange"
@pageSizeChange="pageSizeChange"></pagination>
<loading :loading="loading">数据获取中</loading>
<!--新增抽屉-->
<el-drawer
:title="title"
:visible.sync="dialogState"
direction="rtl"
custom-class="demo-drawer"
ref="drawer"
size="800px"
:class = "classObject"
:before-close="handleClose"
>
<div class="demo-drawer__content" v-if="this.oprState === 1 || this.oprState === 2">
<el-form :model="categoryModelAdd" ref="categoryModelAdd" :rules="categoryModelAddRules" class="label-input-form">
<el-row>
<el-col :span="12">
<el-form-item :label="this.$t('m.option')"
:label-width="formLabelWidth"
prop="dicTypeName"
class="add-form-item">
<el-input
v-model.trim="categoryModelAdd.dicTypeName"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.sortNumber')"
prop="showIndex"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
type="number"
oninput="if(value.length>4)value=value.slice(0,4)"
v-model.number="categoryModelAdd.showIndex"
@mousewheel.native.prevent
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="this.$t('m.describe')"
prop="describes"
:label-width="formLabelWidth"
class="add-form-item">
<el-input
v-model.trim="categoryModelAdd.describes"
autocomplete="off" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="demo-drawer__footer">
<el-button size="mini" @click="closeModal('categoryModelAdd')">{{$t('m.cancel')}}</el-button>
<el-button size="mini" type="primary" @click="saveClass('categoryModelAdd')">{{$t('m.submit')}}</el-button>
</div>
</div>
<div class="demo-drawer__content" v-else>
<div class="check-item-row">
<div class="check-item-col1">
<div class="check-item-label"> 选项:</div>
<div class="check-item-value">{{categoryModelAdd.dicTypeName}}</div>
</div>
<div class="check-item-col1">
<div class="check-item-label">排序号:</div>
<div class="check-item-value">{{categoryModelAdd.showIndex}}</div>
</div>
</div>
<div class="check-item-row">
<div class="check-item-col2">
<div class="check-item-label">描述:</div>
<div class="check-item-value">{{categoryModelAdd.describes}}</div>
</div>
<div class="check-item-col2">
<div class="check-item-label"></div>
<div class="check-item-value"></div>
</div>
</div>
</div>
</el-drawer>
</div>
</template>
<script>
export default {
name: 'StandardCategory',
data () {
return {
// 查询条件
standardForm: {
// 选项
standName: '',
// 数据编码
standCode: '',
// 描述
describes: ''
},
total: 0,
page: 1,
rows: 10,
loading: false,
// 列表数据
categoryData: [],
// 抽屉打开
dialogState: false,
// form-item label宽度
formLabelWidth: '80px',
// 新增弹窗数据
categoryModelAdd: {
// 模态框信息
dicTypeName: '',
showIndex: '',
// 数据编码
dicTypeCode: '',
// 唯一辨识
dicId: 'DUMBLEDO',
// 描述
describes: ''
},
// 弹窗标题
title: '',
// 表单验证
categoryModelAddRules: {
dicTypeName: [
{required: true, message: '选项不能为空', trigger: 'blur'},
{type: 'string', max: 100, message: '最多输入100位', trigger: 'blur'}
],
showIndex: [
{required: true, message: '排序号不能为空且为正整数', trigger: 'blur'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
],
describes: [
{type: 'string', max: 500, message: '最多输入500位', trigger: 'blur'}
]
},
// 中间变量
standName1: '',
describes1: '',
standCode1: '',
// 判断是新增or 编辑 or 查看
oprState: 0,
// 多选时接收选中行数据
selectNum: []
}
},
methods: {
// 条件查询
selectCategoryBtn () {
this.standName1 = this.standardForm.standName
this.describes1 = this.standardForm.describes
this.standCode1 = this.standardForm.standCode
this.page = 1
this.selectCategory()
},
// 清空查询
resetSelect (formName) {
this.standName1 = ''
this.standCode1 = ''
this.describes1 = ''
this.standardForm.standName = ''
this.standardForm.standCode = ''
this.standardForm.describes = ''
this.$refs[formName].resetFields()
this.selectCategory()
},
// 分页加载列表
selectCategory () {
let DicTypeEOPage = {
page: this.page,
pageSize: this.$store.getters.userInfo.configContent,
dicTypeName: this.standName1,
dicTypeCode: this.standCode1,
describes: this.describes1,
dicId: 'DUMBLEDO'
}
this.$http.get('sys/dictype/page', DicTypeEOPage, {
_this: this,
loading: 'loading'
}, res => {
this.categoryData = res.data.list
this.total = res.data.count
}, e => {
})
// this.$refs.selection.selectAll(false)
},
// 新增弹窗打开
classAdd (oprState, row) {
this.oprState = oprState
if (this.oprState === 1) {
this.title = '新增信息'
this.dialogState = true
} else if (this.oprState === 2) {
this.title = '编辑信息'
this.categoryModelAdd = row
this.dialogState = true
} else {
this.title = '查看信息'
this.categoryModelAdd = row
this.dialogState = true
}
},
// 新增弹窗提交
saveClass (formName) {
let data = this.categoryModelAdd
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.oprState === 1) {
this.categoryModelAdd.dicTypeCode = this.categoryModelAdd.dicTypeName
this.$http.postData('sys/dictype/create', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {})
} else if (this.oprState === 2) {
this.$http.putData('sys/dictype', data, {
_this: this
}, res => {
if (res.ok) {
this.closeModal()
} else {
this.dialogState = true
}
}, e => {
})
}
} else {
return false
}
})
},
// 查看弹窗关闭
handleClose () {
this.page = 1
this.selectCategory()
this.categoryModelAdd.dicTypeName = ''
this.categoryModelAdd.showIndex = ''
this.categoryModelAdd.describes = ''
if (this.$refs['categoryModelAdd']) {
this.$refs['categoryModelAdd'].resetFields()
}
this.dialogState = false
},
// 新增弹窗关闭
closeModal (formName) {
this.page = 1
this.selectCategory()
this.categoryModelAdd.dicTypeName = ''
this.categoryModelAdd.showIndex = ''
this.categoryModelAdd.describes = ''
this.dialogState = false
this.$refs['categoryModelAdd'].resetFields()
},
// 批量删除
classBatchDel () {
if (this.selectNum === '' || this.selectNum.length === 0) {
this.$confirm('请选择一条数据进行删除', '提示', {
showCancelButton: false,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
})
} else {
(
this.$confirm('确认删除这些数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
let delIds = []
let delTypeCodes = []
for (let i = 0; i < this.selectNum.length; i++) {
delIds.push(this.selectNum[i].id)
delTypeCodes.push(this.selectNum[i].dicTypeCode)
}
delIds = delIds.join(',')
delTypeCodes = delTypeCodes.join(',')
let data = {}
data.ids = delIds
data.dicTypeCodes = delTypeCodes
this.$http.delete('sys/dictype/deleteArr', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
}
})
}).catch(() => {
// 取消删除,清空选择
this.$refs.selection.clearSelection()
})
)
}
},
// 删除
classDel (row) {
let data = {}
data.dicTypeEOId = row.id
data.dicTypeCode = row.dicTypeCode
if (data.id !== '' && data.dicTypeCode !== '') {
this.$confirm('确认删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.delete('sys/dictype/delete', data, {
_this: this
}, res => {
if (res.ok) {
this.resetSelect()
} else {
}
}).catch(() => {
// this.$message({
// type: 'info',
// message: '已取消删除'
// });
})
})
}
},
// 多选
handleSelectionChange (val) {
this.selectNum = val
},
// 取消多选
clearSelection () {
},
pageChange (page) {
this.page = page
this.selectCategory()
},
pageSizeChange (pageSize) {
this.rows = pageSize
this.selectCategory()
}
},
mounted () {
this.selectCategory()
},
computed: {
classObject () {
return {
'check-draw': this.oprState === 3
}
}
}
}
</script>
<style lang="less">
.standard-category {
position: relative;
height: 100%;
padding: 15px;
background: #fff;
.label-input-form {
display: flex;
justify-content: space-between;
}
.content{
// height: 540px;
margin-top: 10px;
width: 100%;
// height: calc(~'100% - 115px')!important;
overflow-y: auto;
}
.tabpagination{
position: relative;
}
.demo-drawer__content{
// border: 1px solid #ccc;
padding: 0 15px;
}
}
</style>
@@ -0,0 +1,177 @@
<!-- 标准法规属性管理 -->
<template>
<div class="regulatory-repository v-class">
<panel-header :tabs="tabsList" @activated="showComponent" :active="active"></panel-header>
<panel-content>
<transition enter-active-class="" leave-active-class="">
<components :is="active"></components>
</transition>
</panel-content>
</div>
</template>
<script>
import StandardClassification from './components/StandardClassification'
import ProfessionalClassification from './components/ProfessionalClassification'
import StandardCategory from './components/StandardCategory'
import NationalArea from './components/NationalArea'
import ProductCategory from './components/ProductCategory'
import AuthenticationType from './components/AuthenticationType'
import Category from './components/Category'
import EnergyTypes from './components/EnergyTypes'
import DegreeStandard from './components/DegreeStandard'
import FileState from './components/FileState'
import EnterpriseCategory from './components/EnterpriseCategory'
import EnterpriseStandardCategory from './components/EnterpriseStandardCategory'
import Area from './components/Area'
import AssemblyClassification from './components/AssemblyClassification'
import AssociatedSystem from './components/AssociatedSystem'
import AssociatedAssembly from './components/AssociatedAssembly'
import AssociatedComponents from './components/AssociatedComponents'
import noticeAndClassify from './components/noticeAndClassify'
// import smallarea from './components/smallarea'
// import bigArea from './components/bigArea'
export default {
name: 'RegulatoryRepository',
components: {
ProfessionalClassification,
StandardClassification,
StandardCategory,
NationalArea,
ProductCategory,
AuthenticationType,
Category,
EnergyTypes,
DegreeStandard,
FileState,
EnterpriseCategory,
EnterpriseStandardCategory,
Area,
AssemblyClassification,
AssociatedSystem,
// eslint-disable-next-line no-undef
// smallarea,
// eslint-disable-next-line no-undef
// bigArea,
AssociatedAssembly,
// smallarea,
// bigArea,
AssociatedComponents,
noticeAndClassify
},
data () {
return {
active: 'StandardClassification',
tabsList: [ {
title: this.$t('m.natureOfStandardsDocuments'),
name: 'StandardClassification'
}, {
title: this.$t('m.standardCategory'),
name: 'StandardCategory'
},
{
title: this.$t('m.region'),
name: 'Area'
},
{
// title: '国家/地区',
title: this.$t('m.nationalArea'),
name: 'NationalArea'
},
{
// title: '产品类别',
// title: '适用车型',
title: this.$t('m.applicableModels'),
name: 'ProductCategory'
},
{
// title: '认证类型',
// title: '适用认证',
title: this.$t('m.applicableCertification'),
name: 'AuthenticationType'
},
{
// title: '所属专业领域',
title: this.$t('m.professionalField'),
name: 'Category'
},
{
// title: '能源种类',
title: this.$t('m.energyTypes'),
name: 'EnergyTypes'
},
{
// title: '总成分类',
title: this.$t('m.assemblyClassification'),
name: 'AssemblyClassification'
},
{
// title: '采标程度',
title: this.$t('m.degreeStandard'),
name: 'DegreeStandard'
},
{
// title: '标准/文件状态',
title: this.$t('m.fileState'),
name: 'FileState'
},
{
// title: '企标分类',
title: this.$t('m.enterpriseCategory'),
name: 'EnterpriseCategory'
},
{
// title: '企业标准类别',
title: this.$t('m.enterpriseStandardCategory'),
name: 'EnterpriseStandardCategory'
},
{
// title: '关联系统',
title: this.$t('m.associatedSystem'),
name: 'AssociatedSystem'
},
{
// title: '关联总成',
title: this.$t('m.associatedAssembly'),
name: 'AssociatedAssembly'
},
{
// title: '关联部件',
title: this.$t('m.associatedComponents'),
name: 'AssociatedComponents'
},
{
// title: '动态&通知分类',
title: this.$t('m.noticeAndClassify'),
name: 'noticeAndClassify'
},
{
// title: '专业分类',
title: this.$t('m.professionalClassification'),
name: 'ProfessionalClassification'
}
// {
// title: '领域',
// name: 'bigArea'
// },
// {
// title: '子领域',
// name: 'smallarea'
// }
]
}
},
methods: {
// tabs 切换事件
showComponent (name) {
this.active = name
}
}
}
</script>
<style lang="less" scoped>
.regulatory-repository{
position: relative;
height: 100%;
background-color: #fff;
}
</style>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,676 @@
<!-- 配置管理 - 标准法规属性管理 -->
<template>
<div class="standLawsAttrManage">
<div class="search-area">
<div class="left">
<el-form
ref="searchForm"
:model="searchForm"
label-width="100px"
inline
>
<el-form-item label="数据字典编码" class="search-item">
<el-input
v-model="searchForm.dictionaryCode"
placeholder="请输入"
@keyup.enter.native="searchBtn"
clearable
></el-input>
</el-form-item>
<el-form-item
label="数据字典名称"
class="search-item search-item-last"
>
<el-input
v-model="searchForm.dictionaryName"
placeholder="请输入"
@keyup.enter.native="searchBtn"
clearable
></el-input>
</el-form-item>
<el-form-item label="" class="search-item btn-box">
<el-button
class="common-button-primary"
type="primary"
icon="el-icon-search"
round
@click="searchBtn"
></el-button>
</el-form-item>
<el-form-item label="" class="search-item btn-box">
<el-button
class="common-button-default"
icon="el-icon-refresh-left"
@click="resetSelect"
round
></el-button>
</el-form-item>
</el-form>
</div>
<div class="right" style="line-height: normal">
<el-button
type="primary"
class="common-button-primary"
round
@click="showAddModel(1, null)"
v-btn-permission="'29YZ482LEHRJJXELWZGG'"
><i class="iconfont">&#xe84e;</i>新增</el-button
>
<el-button @click="deleteAttr" round class="common-button-default" v-btn-permission="T97J4LTH3TP36CREJ62A"
><i class="iconfont">&#xe61b;</i>删除</el-button
>
</div>
</div>
<div class="content">
<el-table
stripe
ref="selections"
tooltip-effect="dark"
border
height="100%"
:data="attributeList"
class="table"
:header-cell-style="{
background: '#e8e8e8',
color: '#333333',
fontSize: '16px',
fontWeight: 'bold',
height: '48px',
}"
@selection-change="handleSelectone"
>
<el-table-column type="selection" width="55" align="center">
</el-table-column>
<el-table-column prop="dictionaryCode" label="数据字典编码">
</el-table-column>
<el-table-column prop="dictionaryName" label="数据字典名称">
<template slot-scope="scope">
<div class="table-jump" @click="goNuwPage(scope.row)">
{{ scope.row.dictionaryName }}
</div>
</template>
</el-table-column>
<el-table-column prop="orderNum" label="排序号"> </el-table-column>
<el-table-column prop="dictionType" label="类型">
<template slot-scope="scope">
<div v-if="scope.row.dictionType === 'SEL_OPTION'">下拉选项</div>
<div v-if="scope.row.dictionType === 'TREE'">树形结构</div>
</template>
</el-table-column>
<!-- <el-table-column-->
<!-- prop="enable"-->
<!-- label="启用状态">-->
<!-- <template slot-scope="scope">-->
<!-- <div v-if="scope.row.enable === '0'">启用中</div>-->
<!-- <div v-if="scope.row.enable === '1'">未启用</div>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column prop="creationTime" label="创建时间" sortable>
</el-table-column>
<!-- <el-table-column-->
<!-- fixed="right"-->
<!-- label="操作"-->
<!-- width="200"-->
<!-- align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button type="primary" size="mini" :disabled="scope.row.enable==='0'" @click="showAddModel(2, scope.row)">编辑</el-button>-->
<!-- <el-button type="danger" @click="handleClick(scope.row)" size="mini" :disabled="scope.row.enable==='0' ">删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="操作" align="center" width="50" fixed="right">
<template slot-scope="scope">
<div @click.stop style="display: inline-block">
<el-dropdown trigger="click" @command="handleCommand">
<i class="iconfont">&#xe61e;</i>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item
v-btn-permission="'5B3QMLDMTJ4XPLKSFA8Q'"
:disabled="scope.row.enable === '0'"
:command="[scope.row, '编辑']"
>编辑</el-dropdown-item
>
<el-dropdown-item
v-btn-permission="'T97J4LTH3TP36CREJ62A'"
:disabled="scope.row.enable === '0'"
:command="[scope.row, '删除']"
>删除</el-dropdown-item
>
<!-- <el-dropdown-item :command="[scope.row, '流程']">流程</el-dropdown-item>-->
</el-dropdown-menu>
</el-dropdown>
</div>
</template>
</el-table-column>
</el-table>
<loading :loading="attributeDataLoading">数据处理中</loading>
</div>
<pagination
:total="total"
:pageChange="pageNo"
:pageSizeChange="pageSize"
@pageChange="pageChange"
@pageSizeChange="pageSizeChange"
></pagination>
<!-- 编辑抽屉-->
<el-drawer
:title="attributeTitle"
:wrapperClosable="false"
:visible.sync="showInfoModal"
size="800px"
:styles="styles"
:close="cancelModel"
>
<div class="demo-drawer-content">
<el-form
ref="attributeEO"
:model="attributeEO"
:rules="attributeEOFormRules"
class="label-input-form"
label-width="130px"
v-if="showInfoModal"
>
<el-form-item
label="数据字典编码"
prop="dictionaryCode"
class="add-form-item"
>
<el-input
v-model.trim="attributeEO.dictionaryCode"
placeholder="请输入数据字典编码"
:disabled="this.addOrEdit !== 'add'"
clearable
/>
</el-form-item>
<el-form-item
label="数据字典名称"
prop="dictionaryName"
class="add-form-item"
>
<el-input
v-model.trim="attributeEO.dictionaryName"
placeholder="请输入数据字典名称"
clearable
/>
</el-form-item>
<el-form-item label="排序号" prop="orderNum" class="add-form-item">
<el-input
v-model.number="attributeEO.orderNum"
placeholder="只允许输入正整数"
number
:maxlength="3"
/>
</el-form-item>
<el-form-item
label="类型"
prop="dictionType"
class="add-form-item"
>
<el-select
placeholder="请选择类型"
v-model="attributeEO.dictionType"
filterable
>
<el-option
v-for="item in attrTypeOptions"
:value="item.value"
:key="item.value"
:label="item.label"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label="是否关联其他类别"
title="是否关联其他类别"
prop="isRelate"
class="add-form-item"
>
<el-select
placeholder="请选择类别"
v-model="attributeEO.isRelate"
filterable
>
<el-option
v-for="item in isRelateOptions"
:value="item.value"
:key="item.value"
:label="item.label"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label="关联类别"
prop="relateDicId"
v-if="attributeEO.isRelate === '0'"
class="add-form-item"
>
<el-select
v-model="attributeEO.relateDicId"
placeholder="请选择类别"
>
<el-option
v-for="opt in relateDicIdOptions"
:value="opt.value"
:key="opt.value"
:label="opt.label"
>{{ opt.label }}</el-option
>
</el-select>
</el-form-item>
</el-form>
</div>
<div id="roleFormButton" class="demo-drawer-footer">
<el-button
type="primary"
class="common-button-primary"
round
icon="el-icon-check"
@click="saveInfo"
>提交</el-button
>
<el-button
round
icon="el-icon-close"
class="common-button-default"
@click="cancelModel"
>取消</el-button
>
</div>
</el-drawer>
</div>
</template>
<script>
export default {
name: 'standLawsAttrManage',
data () {
return {
attributeDataLoading: false,
attributeList: [],
oprState: 0,
total: 0,
pageNo: 1,
pageSize: this.$store.getters.userInfo.configContent,
attributeEO: {
id: '',
dictionaryCode: '',
dictionaryName: '',
dictionType: '',
orderNum: '',
isRelate: '1',
relateDicId: ''
},
attrTypeOptions: [
{ label: '下拉选项', value: 'SEL_OPTION' },
{ label: '树形结构', value: 'TREE' }
],
attributeTitle: '',
showInfoModal: false,
attributeEOFormRules: {
dictionaryCode: [
{ required: true, message: '数据字典编码不能为空', trigger: 'blur' },
{ type: 'string', max: 50, message: '最多输入50位', trigger: 'blur' },
{
type: 'string',
validator: this.verify.validDicCode,
trigger: 'blur'
}
],
dictionaryName: [
{ required: true, message: '数据字典名称不能为空', trigger: 'blur' },
{
type: 'string',
max: 100,
message: '最多输入100位',
trigger: 'blur'
}
],
dictionType: [
{ required: true, message: '类型不能为空', trigger: 'change' }
],
isRelate: [
{
required: true,
message: '是否关联其他类别不能为空',
trigger: 'change'
}
],
orderNum: [
{
type: 'number',
required: true,
message: '展示顺序不能为空且为正整数',
trigger: 'blur'
},
{
type: 'string',
validator: this.verify.validStandNumInCompile2,
trigger: 'blur'
}
]
},
styles: {
height: 'calc(100% - 55px)',
overflow: 'auto',
paddingBottom: '53px',
position: 'static'
},
selectedList: [], // 选定列表数据
addOrEdit: '',
searchForm: {
dictionaryCode: '',
dictionaryName: ''
},
isRelateOptions: [
{ label: '是', value: '0' },
{ label: '否', value: '1' }
],
relateDicIdOptions: []
}
},
methods: {
// ...
handleCommand (command) {
switch (command[1]) {
case '编辑':
this.showAddModel(2, command[0])
break
case '删除':
this.handleClick(command[0])
break
}
},
goNuwPage (item) {
console.log('item', item)
this.$store.commit('setDetailMap', this.$route.path)
this.$router.push({
name: 'StandLawsAttrDetails',
params: {
id: item.id,
dictionaryName: item.dictionaryName,
dictionType: item.dictionType,
isRelate: item.isRelate,
relateDicId: item.relateDicId
}
})
},
handleSelectone (data) {
this.selectedList = []
for (let i = 0; i < data.length; i++) {
this.selectedList.push(data[i].id)
}
},
pageChange (page) {
this.pageNo = page
this.getAttrByPage()
},
pageSizeChange (pageSize) {
this.pageSize = pageSize
this.getAttrByPage()
},
searchBtn () {
this.pageNo = 1
this.getAttrByPage()
},
resetSelect () {
this.searchForm.dictionaryCode = ''
this.searchForm.dictionaryName = ''
this.pageNo = 1
this.getAttrByPage()
},
getAttrByPage () {
this.$http.get(
'sys/dictionary/page',
{
page: this.pageNo,
pageSize: this.pageSize,
dictionaryCode: this.searchForm.dictionaryCode,
dictionaryName: this.searchForm.dictionaryName
},
{
_this: this,
loading: 'attributeDataLoading'
},
(res) => {
this.attributeList = res.data.list
this.total = res.data.count
},
(e) => {}
)
// this.$refs.selections.selectAll(false)
},
showAddModel (oprState, row) {
this.oprState = oprState
if (this.oprState === 1) {
this.addOrEdit = 'add'
this.attributeTitle = '新增'
this.getDictionarySelList(null)
this.$nextTick(() => {
this.attributeEO = {
id: '',
dictionaryCode: '',
dictionaryName: '',
dictionType: '',
orderNum: '',
isRelate: '1',
relateDicId: ''
}
this.$refs['attributeEO'].resetFields()
})
this.showInfoModal = true
} else {
this.addOrEdit = 'edit'
this.attributeTitle = '编辑'
this.getDictionarySelList(null)
this.attributeEO = JSON.parse(JSON.stringify(row))
this.showInfoModal = true
}
},
saveInfo () {
this.$refs['attributeEO'].validate((valid) => {
if (valid) {
if (
this.attributeEO.isRelate === '0' &&
(this.attributeEO.relateDicId == null ||
this.attributeEO.relateDicId === '')
) {
this.$message.warning('请选择需要关联的类别')
} else {
if (this.addOrEdit === 'add') {
this.$http.postData(
'sys/dictionary/addDictionary',
this.attributeEO,
{
_this: this,
loading: 'roleDataLoading'
},
(res) => {
if (res.ok) {
this.getAttrByPage()
this.cancelModel()
// this.showInfoModal = false
} else {
}
}
)
} else {
this.$http.putData(
'sys/dictionary/updateDictionary',
this.attributeEO,
{
_this: this,
loading: 'roleDataLoading'
},
(res) => {
if (res.ok) {
this.getAttrByPage()
this.cancelModel()
// this.showInfoModal = false
} else {
}
}
)
}
}
}
})
},
// 删除
handleClick (row) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定',
confirmButtonClass: 'common-button-primary',
cancelButtonText: '取消',
roundButton: true,
type: 'warning'
})
.then(() => {
this.$http.put(
'sys/dictionary/deleteByIds',
{
id: row.id
},
{
_this: this
},
(res) => {
if (res.ok) {
this.getAttrByPage()
this.$message({
type: 'success',
message: '删除成功!'
})
} else {
}
},
(e) => {}
)
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
cancelModel () {
this.$nextTick(() => {
// this.$refs['attributeEO'].resetFields()
this.attributeEO = {
id: '',
dictionaryCode: '',
dictionaryName: '',
dictionType: '',
orderNum: '',
isRelate: '1',
relateDicId: ''
}
})
this.showInfoModal = false
},
// deleteAttr () {
// if (this.selectedList.length === 0) {
// this.$message.error('请先选择要删除的数据!')
// } else {
// this.$Modal.confirm({
// title: '提示',
// content: '删除字典同时,该类型下数据将同步被删除,确认删除选中数据?',
// onOk: () => {
// this.$http.put('sys/dictionary/deleteByIds', {
// id: this.selectedList.join(',')
// }, {
// _this: this
// }, res => {
// this.getAttrByPage()
// }, e => {
// })
// },
// onCancel: () => {
// }
// })
// }
// },
deleteAttr () {
// 此处获取选中的数据
if (this.selectedList.length > 0) {
let listIds = []
for (let i = 0; i < this.selectedList.length; i++) {
let listId = this.selectedList[i]
listIds.push(listId)
}
console.log(listIds)
let listIdsStr = listIds.join(',')
this.$confirm('确定删除这些数据?', '提示', {
confirmButtonText: '确定',
confirmButtonClass: 'common-button-primary',
cancelButtonText: '取消',
roundButton: true,
type: 'warning'
}).then(() => {
this.$http.put(
'sys/dictionary/deleteByIds',
{
// id: this.selectedList.join(","),
id: listIds
},
{
_this: this
},
(res) => {
if (res.ok) {
this.getAttrByPage()
this.$message({
type: 'success',
message: '删除成功!'
})
}
}
)
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
} else {
this.$message({
message: '请选择一条数据进行删除',
type: 'warning'
})
};
},
getDictionarySelList (id) {
this.$http.get(
'sys/dictionary/getDictionarySelList',
{
id: id
},
{
_this: this
},
(res) => {
this.relateDicIdOptions = res.data
},
(e) => {}
)
}
},
mounted () {
this.getAttrByPage()
}
}
</script>
<style lang="less" scoped>
.standLawsAttrManage {
height: 100%;
.content {
height: calc(~"100% - 55px - 56px");
overflow-y: auto;
}
.search-select.el-dropdown {
width: 100%;
}
}
</style>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,142 @@
<!-- 配置管理 - 预警时间设置 -->
<template>
<div class="warning-time-setting v-class">
<!-- <div class="warningSelect">-->
<!-- <el-form ref="warningForm" :model="warningForm" inline :rules="warningRule" class="label-input-form">-->
<!-- <el-row>-->
<!-- <el-col :span="24">-->
<!-- <el-form-item :label="$t('m.warningTimeSetting')" prop="warning" class="serch-form-item">-->
<!-- <el-select v-model="warningForm.warning">-->
<!-- <el-option v-for="item in warningList" :value="item.value" :label="item.label" :key="item.value">{{ item.label }}</el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- </el-form>-->
<!-- <div class="btn-group">-->
<!-- <el-button type="primary" class="searchAngNewBtn" @click="handleSubmit('warningForm')" v-btn-permission="'XTW99BCJ8R'">{{$t('m.preservation')}}</el-button>-->
<!-- <el-button @click="handleReset ()" class="searchAngNewBtn">{{$t('m.empty')}}</el-button>-->
<!-- </div>-->
<!-- </div>-->
<div class="warningSelect">
<el-form ref="warningForm" label-position="left" :model="warningForm" inline :rules="warningRule" class="label-input-form">
<el-form-item label-width="150px" label="预警时间设置" prop="warning" class="search-form-item">
<el-select v-model="warningForm.warning">
<el-option v-for="item in warningList" :value="item.value" :label="item.label" :key="item.value">{{ item.label }}</el-option>
</el-select>
</el-form-item>
<div></div>
<el-form-item label-width="150px" label="企业标准在线编辑" prop="edit" class="search-form-item">
<el-radio-group v-model="warningForm.edit" disabled>
<el-radio label="2">开启</el-radio>
<el-radio label="1">关闭</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div class="btn-group">
<el-button round class="common-button-primary" icon="el-icon-check" type="primary" @click="handleSubmit('warningForm')" v-btn-permission="'XTW99BCJ8R'">{{$t('m.preservation')}}</el-button>
<el-button round class="common-button-default" icon="el-icon-close" @click="handleReset ()">{{$t('m.empty')}}</el-button>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'warning-time-setting',
data () {
return {
warningForm: {
warning: '',
edit: sessionStorage.getItem('EditPermission')
},
warningList: [
{
value: 'THREEMONTH',
label: '3个月'
},
{
value: 'SIXMONTH',
label: '6个月'
},
{
value: 'ONEYEAR',
label: '1年'
},
{
value: 'TWOYEAR',
label: '2年'
}
],
warningRule: {
warning: [
{ required: true, message: '请设置预警时间', trigger: 'change' }
],
edit: [
{ required: true, message: '在线编辑功能是否开启', trigger: 'change'}
]
}
}
},
methods: {
handleSubmit (name) {
this.$refs[name].validate((valid) => {
if (valid) {
this.$http.putData('sys/warnTime/updateSource',
{warnType: this.warningForm.warning},
{_this: this}, res => {
})
}
})
},
handleReset () {
this.warningForm.warning = ''
this.warningForm.edit = ''
// this.getWarnTimeInfo()
},
getWarnTimeInfo () {
// let id = 'KSLYU9CPVKQ6RMVN8GWM'
this.$http.get('sys/warnTime/find', {}, {_this: this}, res => {
this.warningForm.warning = res.data.warnType
}, e => {
})
}
},
mounted () {
this.getWarnTimeInfo()
}
}
</script>
<style lang="less" scoped>
@import '~@/assets/styles/mixins';
.warning-time-setting{
/deep/.el-radio-group {
width: 165px;
display: flex;
justify-content: space-between;
align-items: center;
height: 40px;
}
.flex();
justify-content: center;
align-items: center;
height: 100%;
background: #FFF;
.warningSelect{
width: auto;
.el-select {
width: 165px;
}
}
.btn-group{
margin: 15px 0.3rem;
display: flex;
justify-content: center;
}
.btn-group Button{
width: 2rem;
margin-left: 10px;
}
}
</style>