289 changed files with 35809 additions and 31322 deletions
@ -0,0 +1,265 @@ |
|||||
|
<!-- |
||||
|
@ 作者: 鲁智强 |
||||
|
@ 时间: 2023-09-19 09:13:14 |
||||
|
@ 备注: |
||||
|
--> |
||||
|
<script lang='ts' setup> |
||||
|
import {ref,reactive,onMounted} from 'vue' |
||||
|
import { organdpost,posttarget,set_posttarget } from '@/api/opk/api' |
||||
|
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
||||
|
import { editPostCont } from '@/api/opk/pulic/api' |
||||
|
import { departmentprogramme,edit_depart,edit_depart_progra } from '@/api/opk/news/api' |
||||
|
import { ge_copy } from '@/api/opk/zxy/news/api' |
||||
|
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
||||
|
import { getDictFormData } from '@/api/dict' |
||||
|
import Dialog from './dialog.vue' |
||||
|
import Dialoglog from './dialoglog.vue' |
||||
|
import Yg from './yg.vue' |
||||
|
// eslint-disable-next-line vue/require-prop-types |
||||
|
const { addShow, title } = defineProps(['addShow', 'title']) |
||||
|
const data = reactive({ |
||||
|
formInline:{ |
||||
|
region:'', |
||||
|
}, |
||||
|
title:"", |
||||
|
addPostBox: false, |
||||
|
edPostBox:false, |
||||
|
ygPostBox:false, |
||||
|
}) |
||||
|
const orgTreeProps ={ |
||||
|
label: 'name', |
||||
|
children:'child' |
||||
|
} |
||||
|
const orgTreeProp ={ |
||||
|
label: 'title', |
||||
|
children:'childen' |
||||
|
} |
||||
|
const formdat = { |
||||
|
someProp:"", |
||||
|
} |
||||
|
const total =ref(0) |
||||
|
const rowInfo = ref<any>({}) |
||||
|
const postIds = ref<number[]>([]) |
||||
|
const tableData = ref<any>([]); |
||||
|
const tables = ref<any>([]); |
||||
|
// 获取侧栏数据 |
||||
|
function jjjs(){ |
||||
|
addPostCont("/hrapi/org/govthree","post") |
||||
|
.then(data => { |
||||
|
tableData.value = data.data[3].child[14].child; |
||||
|
}) |
||||
|
.catch(error => { |
||||
|
console.error('Error fetching data:', error); |
||||
|
}); |
||||
|
} |
||||
|
jjjs() |
||||
|
function editPost(){ |
||||
|
editPostCont({}) |
||||
|
.then(data => { |
||||
|
tables.value = data.data.list; |
||||
|
}) |
||||
|
} |
||||
|
editPost() |
||||
|
const table = ref<any>([]) |
||||
|
const formdate = reactive({ |
||||
|
page:0, |
||||
|
pagesize:20, |
||||
|
name:"", |
||||
|
dimension:"", |
||||
|
attribute:"", |
||||
|
orgidlist:"", |
||||
|
type:"", |
||||
|
value1:"2023", |
||||
|
}) |
||||
|
// 获取数据 |
||||
|
const tableq = ref([]) |
||||
|
const postt = ()=>{ |
||||
|
const ass = new Date(formdate.value1); |
||||
|
const qwe = ass.getFullYear(); |
||||
|
const zjr = qwe.toString(); |
||||
|
departmentprogramme({orgid:formdate.orgidlist,year:zjr,version:formdate.name}) |
||||
|
.then(data => { |
||||
|
tableq.value = data.data; |
||||
|
total.value = data.data.count; |
||||
|
}) |
||||
|
} |
||||
|
// 新增数据 |
||||
|
const addtableData = ()=>{ |
||||
|
data.addPostBox = true; |
||||
|
} |
||||
|
// 添加行 |
||||
|
const addRow = (val:any)=> { |
||||
|
tableData.value.push(val); |
||||
|
} |
||||
|
// 编辑行 |
||||
|
const editRow = (val:any)=> { |
||||
|
let index =tableData.value.findIndex( |
||||
|
(item:any) => item.id === val.id |
||||
|
); |
||||
|
tableData.value.splice(index, 1, val); |
||||
|
} |
||||
|
// 关闭弹窗 |
||||
|
const closeDetail = ()=>{ |
||||
|
data.addPostBox = false; |
||||
|
} |
||||
|
function editPostState(classId:string,state:number){ |
||||
|
console.log("改变状态--------->",classId,state) |
||||
|
let statusVal = 1 |
||||
|
if( state == 1) statusVal = 2; |
||||
|
edit_depart({id:classId,state:statusVal,istrue:2}) |
||||
|
postt() |
||||
|
} |
||||
|
// 删除数据 |
||||
|
const handleDel = (val:any) => { |
||||
|
const dictTypeIds = [val.outID || postIds.value].join(","); |
||||
|
let dictTypeIdAry = dictTypeIds.split(",") |
||||
|
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
||||
|
confirmButtonText: "确认", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
const add = val.key.toString() |
||||
|
handleSure(val) |
||||
|
console.log(val.id) |
||||
|
edit_depart({id:add,state:3,istrue:2}).then(()=> |
||||
|
ElMessage.success("删除成功")) |
||||
|
postt() |
||||
|
}) |
||||
|
}; |
||||
|
const handleSure = (val:any)=> { |
||||
|
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
||||
|
if(index!=-1){ |
||||
|
tableData.value.splice(index, 1); |
||||
|
} |
||||
|
} |
||||
|
const resetChecked=()=> { |
||||
|
formdate.orgidlist = "" |
||||
|
postt() |
||||
|
} |
||||
|
const handle=(data:any)=>{ |
||||
|
formdate.orgidlist = data.id.toString() |
||||
|
postt() |
||||
|
} |
||||
|
const handleErd=(val:any)=>{ |
||||
|
data.edPostBox=true; |
||||
|
rowInfo.value=val; |
||||
|
} |
||||
|
const handleio=(val:any)=>{ |
||||
|
data.ygPostBox=true; |
||||
|
rowInfo.value = val; |
||||
|
} |
||||
|
|
||||
|
const flitterData4 = (data:any)=>{ |
||||
|
let spanOneArr = [] as any[] |
||||
|
let concatOne = 0 |
||||
|
data.value.forEach((item:any,index:any)=>{ |
||||
|
if(index === 0){ |
||||
|
spanOneArr.push(1) |
||||
|
}else{ |
||||
|
//name 修改 |
||||
|
if(item.department === data.value[index - 1].department){ //第一列需合并相同内容的字段 |
||||
|
spanOneArr[concatOne] += 1 |
||||
|
spanOneArr.push(0) |
||||
|
}else{ |
||||
|
spanOneArr.push(1) |
||||
|
concatOne = index |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
return { |
||||
|
one: spanOneArr, |
||||
|
} |
||||
|
} |
||||
|
function objectSpanMethod({row, column, rowIndex, columnIndex}:any){ |
||||
|
if(columnIndex === 0 ) { |
||||
|
// this.tableData 修改 |
||||
|
const _row = (flitterData4(tableq).one)[rowIndex] |
||||
|
const _col = _row > 0 ? 1 : 0 |
||||
|
return { |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
onMounted(()=>{ |
||||
|
jjjs() |
||||
|
postt() |
||||
|
}) |
||||
|
</script> |
||||
|
<template> |
||||
|
<div class="m-2"> |
||||
|
<el-container clss="m-4"> |
||||
|
<div class="qwe"> |
||||
|
<el-button type="primary" style="width: 140px" size="large" @click="resetChecked">全选</el-button> |
||||
|
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @node-click="handle"/> |
||||
|
</div> |
||||
|
<el-divider direction="vertical"/> |
||||
|
<el-col :span="22"> |
||||
|
<el-container class="wer"> |
||||
|
<el-form-item label="方案版本号:"> |
||||
|
<el-input v-model="formdate.name" placeholder="请输入方案版本号" clearable style="width:200px"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="年度:" label-width="90"> |
||||
|
<el-date-picker v-model="formdate.value1" type="year"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label-width="25"> |
||||
|
<el-button type="primary" @click="postt"><el-icon><Search /></el-icon>查询</el-button> |
||||
|
<el-button class="new_btn" type="warning" @click="addtableData"><el-icon><Plus /></el-icon>新增</el-button> |
||||
|
</el-form-item> |
||||
|
</el-container> |
||||
|
<el-table class="m-1" :data="tableq" :span-method="objectSpanMethod" border style="width: 100%"> |
||||
|
<el-table-column prop="groupname,deaprtname," label="部门"> |
||||
|
<template #default="scope"> |
||||
|
{{scope.row.groupname}}{{scope.row.deaprtname}} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="year" label="年" width="70"/> |
||||
|
<el-table-column prop="key" label="版本号"/> |
||||
|
<el-table-column prop="time" label="时间" /> |
||||
|
<el-table-column prop="state" label="状态" width="70"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch v-model="scope.row.status" class="ml-2" inline-prompt style="--el-switch-on-color: #ff4949; --el-switch-off-color: #13ce66" @change="editPostState(scope.row.key,scope.row.state)"/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column fixed="right" label="操作" width="228"> |
||||
|
<template #default="{ row }"> |
||||
|
<el-button type="primary" link @click="handleio(row)"><el-icon><View /></el-icon>查看详情</el-button> |
||||
|
<el-button type="primary" link @click="handleErd(row)"><el-icon><DocumentChecked /></el-icon>复制</el-button> |
||||
|
<el-button type="primary" link @click="handleDel(row)"><el-icon><Delete /></el-icon>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-col> |
||||
|
</el-container> |
||||
|
<pagination v-if="total > 0" v-model:page="formdate.page" v-model:pagesize="formdate.pagesize" :total="total" @click="postt"/> |
||||
|
<Dialog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Dialog> |
||||
|
<Dialoglog v-if="data.edPostBox" v-model="data.edPostBox" :title="title" :row-info="rowInfo"></Dialoglog> |
||||
|
<Yg v-if="data.ygPostBox" v-model="data.ygPostBox" :title="title" :row-info="rowInfo"></Yg> |
||||
|
</div> |
||||
|
</template> |
||||
|
<style lang='scss' scoped> |
||||
|
.qwe { |
||||
|
margin:-8px 0 0 -6px; |
||||
|
float:right; |
||||
|
} |
||||
|
.wer{ |
||||
|
margin:-5px 0 0 20px; |
||||
|
font-weight:normal; |
||||
|
} |
||||
|
.horizontal-controls { |
||||
|
display: flex; |
||||
|
float: left; |
||||
|
|
||||
|
} |
||||
|
.el-divider--vertical{ |
||||
|
display:inline-block; |
||||
|
width:1px; |
||||
|
height:812px; |
||||
|
margin:0 8px; |
||||
|
vertical-align:middle; |
||||
|
position:relative; |
||||
|
} |
||||
|
|
||||
|
/* 可以根据需要调整样式 */ |
||||
|
</style> |
||||
@ -0,0 +1,265 @@ |
|||||
|
<!-- |
||||
|
@ 作者: 鲁智强 |
||||
|
@ 时间: 2023-09-19 09:13:14 |
||||
|
@ 备注: |
||||
|
--> |
||||
|
<script lang='ts' setup> |
||||
|
import {ref,reactive,onMounted} from 'vue' |
||||
|
import { organdpost,posttarget,set_posttarget } from '@/api/opk/api' |
||||
|
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
||||
|
import { editPostCont } from '@/api/opk/pulic/api' |
||||
|
import { departmentprogramme,edit_depart,edit_depart_progra } from '@/api/opk/news/api' |
||||
|
import { ge_copy } from '@/api/opk/zxy/news/api' |
||||
|
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
||||
|
import { getDictFormData } from '@/api/dict' |
||||
|
import Dialog from './dialog.vue' |
||||
|
import Dialoglog from './dialoglog.vue' |
||||
|
import Yg from './yg.vue' |
||||
|
// eslint-disable-next-line vue/require-prop-types |
||||
|
const { addShow, title } = defineProps(['addShow', 'title']) |
||||
|
const data = reactive({ |
||||
|
formInline:{ |
||||
|
region:'', |
||||
|
}, |
||||
|
title:"", |
||||
|
addPostBox: false, |
||||
|
edPostBox:false, |
||||
|
ygPostBox:false, |
||||
|
}) |
||||
|
const orgTreeProps ={ |
||||
|
label: 'name', |
||||
|
children:'child' |
||||
|
} |
||||
|
const orgTreeProp ={ |
||||
|
label: 'title', |
||||
|
children:'childen' |
||||
|
} |
||||
|
const formdat = { |
||||
|
someProp:"", |
||||
|
} |
||||
|
const total =ref(0) |
||||
|
const rowInfo = ref<any>({}) |
||||
|
const postIds = ref<number[]>([]) |
||||
|
const tableData = ref<any>([]); |
||||
|
const tables = ref<any>([]); |
||||
|
// 获取侧栏数据 |
||||
|
function jjjs(){ |
||||
|
addPostCont("/hrapi/org/govthree","post") |
||||
|
.then(data => { |
||||
|
tableData.value = data.data[3].child[14].child; |
||||
|
}) |
||||
|
.catch(error => { |
||||
|
console.error('Error fetching data:', error); |
||||
|
}); |
||||
|
} |
||||
|
jjjs() |
||||
|
function editPost(){ |
||||
|
editPostCont({}) |
||||
|
.then(data => { |
||||
|
tables.value = data.data.list; |
||||
|
}) |
||||
|
} |
||||
|
editPost() |
||||
|
const table = ref<any>([]) |
||||
|
const formdate = reactive({ |
||||
|
page:0, |
||||
|
pagesize:20, |
||||
|
name:"", |
||||
|
dimension:"", |
||||
|
attribute:"", |
||||
|
orgidlist:"", |
||||
|
type:"", |
||||
|
value1:"2023", |
||||
|
}) |
||||
|
// 获取数据 |
||||
|
const tableq = ref([]) |
||||
|
const postt = ()=>{ |
||||
|
const ass = new Date(formdate.value1); |
||||
|
const qwe = ass.getFullYear(); |
||||
|
const zjr = qwe.toString(); |
||||
|
departmentprogramme({orgid:formdate.orgidlist,year:zjr,version:formdate.name}) |
||||
|
.then(data => { |
||||
|
tableq.value = data.data; |
||||
|
total.value = data.data.count; |
||||
|
}) |
||||
|
} |
||||
|
// 新增数据 |
||||
|
const addtableData = ()=>{ |
||||
|
data.addPostBox = true; |
||||
|
} |
||||
|
// 添加行 |
||||
|
const addRow = (val:any)=> { |
||||
|
tableData.value.push(val); |
||||
|
} |
||||
|
// 编辑行 |
||||
|
const editRow = (val:any)=> { |
||||
|
let index =tableData.value.findIndex( |
||||
|
(item:any) => item.id === val.id |
||||
|
); |
||||
|
tableData.value.splice(index, 1, val); |
||||
|
} |
||||
|
// 关闭弹窗 |
||||
|
const closeDetail = ()=>{ |
||||
|
data.addPostBox = false; |
||||
|
} |
||||
|
function editPostState(classId:string,state:number){ |
||||
|
console.log("改变状态--------->",classId,state) |
||||
|
let statusVal = 1 |
||||
|
if( state == 1) statusVal = 2; |
||||
|
edit_depart({id:classId,state:statusVal,istrue:2}) |
||||
|
postt() |
||||
|
} |
||||
|
// 删除数据 |
||||
|
const handleDel = (val:any) => { |
||||
|
const dictTypeIds = [val.outID || postIds.value].join(","); |
||||
|
let dictTypeIdAry = dictTypeIds.split(",") |
||||
|
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
||||
|
confirmButtonText: "确认", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
const add = val.key.toString() |
||||
|
handleSure(val) |
||||
|
console.log(val.id) |
||||
|
edit_depart({id:add,state:3,istrue:2}).then(()=> |
||||
|
ElMessage.success("删除成功")) |
||||
|
postt() |
||||
|
}) |
||||
|
}; |
||||
|
const handleSure = (val:any)=> { |
||||
|
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
||||
|
if(index!=-1){ |
||||
|
tableData.value.splice(index, 1); |
||||
|
} |
||||
|
} |
||||
|
const resetChecked=()=> { |
||||
|
formdate.orgidlist = "" |
||||
|
postt() |
||||
|
} |
||||
|
const handle=(data:any)=>{ |
||||
|
formdate.orgidlist = data.id.toString() |
||||
|
postt() |
||||
|
} |
||||
|
const handleErd=(val:any)=>{ |
||||
|
data.edPostBox=true; |
||||
|
rowInfo.value=val; |
||||
|
} |
||||
|
const handleio=(val:any)=>{ |
||||
|
data.ygPostBox=true; |
||||
|
rowInfo.value = val; |
||||
|
} |
||||
|
|
||||
|
const flitterData4 = (data:any)=>{ |
||||
|
let spanOneArr = [] as any[] |
||||
|
let concatOne = 0 |
||||
|
data.value.forEach((item:any,index:any)=>{ |
||||
|
if(index === 0){ |
||||
|
spanOneArr.push(1) |
||||
|
}else{ |
||||
|
//name 修改 |
||||
|
if(item.department === data.value[index - 1].department){ //第一列需合并相同内容的字段 |
||||
|
spanOneArr[concatOne] += 1 |
||||
|
spanOneArr.push(0) |
||||
|
}else{ |
||||
|
spanOneArr.push(1) |
||||
|
concatOne = index |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
return { |
||||
|
one: spanOneArr, |
||||
|
} |
||||
|
} |
||||
|
function objectSpanMethod({row, column, rowIndex, columnIndex}:any){ |
||||
|
if(columnIndex === 0 ) { |
||||
|
// this.tableData 修改 |
||||
|
const _row = (flitterData4(tableq).one)[rowIndex] |
||||
|
const _col = _row > 0 ? 1 : 0 |
||||
|
return { |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
onMounted(()=>{ |
||||
|
jjjs() |
||||
|
postt() |
||||
|
}) |
||||
|
</script> |
||||
|
<template> |
||||
|
<div class="m-2"> |
||||
|
<el-container clss="m-4"> |
||||
|
<div class="qwe"> |
||||
|
<el-button type="primary" style="width: 140px" size="large" @click="resetChecked">全选</el-button> |
||||
|
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @node-click="handle"/> |
||||
|
</div> |
||||
|
<el-divider direction="vertical"/> |
||||
|
<el-col :span="22"> |
||||
|
<el-container class="wer"> |
||||
|
<el-form-item label="方案版本号:"> |
||||
|
<el-input v-model="formdate.name" placeholder="请输入方案版本号" clearable style="width:200px"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="年度:" label-width="90"> |
||||
|
<el-date-picker v-model="formdate.value1" type="year"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label-width="25"> |
||||
|
<el-button type="primary" @click="postt"><el-icon><Search /></el-icon>查询</el-button> |
||||
|
<el-button class="new_btn" type="warning" @click="addtableData"><el-icon><Plus /></el-icon>新增</el-button> |
||||
|
</el-form-item> |
||||
|
</el-container> |
||||
|
<el-table class="m-1" :data="tableq" :span-method="objectSpanMethod" border style="width: 100%"> |
||||
|
<el-table-column prop="groupname,deaprtname," label="部门"> |
||||
|
<template #default="scope"> |
||||
|
{{scope.row.groupname}}{{scope.row.deaprtname}} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="year" label="年" width="70"/> |
||||
|
<el-table-column prop="key" label="版本号"/> |
||||
|
<el-table-column prop="time" label="时间" /> |
||||
|
<el-table-column prop="state" label="状态" width="70"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch v-model="scope.row.status" class="ml-2" inline-prompt style="--el-switch-on-color: #ff4949; --el-switch-off-color: #13ce66" @change="editPostState(scope.row.key,scope.row.state)"/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column fixed="right" label="操作" width="228"> |
||||
|
<template #default="{ row }"> |
||||
|
<el-button type="primary" link @click="handleio(row)"><el-icon><View /></el-icon>查看详情</el-button> |
||||
|
<el-button type="primary" link @click="handleErd(row)"><el-icon><DocumentChecked /></el-icon>复制</el-button> |
||||
|
<el-button type="primary" link @click="handleDel(row)"><el-icon><Delete /></el-icon>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-col> |
||||
|
</el-container> |
||||
|
<pagination v-if="total > 0" v-model:page="formdate.page" v-model:pagesize="formdate.pagesize" :total="total" @click="postt"/> |
||||
|
<Dialog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Dialog> |
||||
|
<Dialoglog v-if="data.edPostBox" v-model="data.edPostBox" :title="title" :row-info="rowInfo"></Dialoglog> |
||||
|
<Yg v-if="data.ygPostBox" v-model="data.ygPostBox" :title="title" :row-info="rowInfo"></Yg> |
||||
|
</div> |
||||
|
</template> |
||||
|
<style lang='scss' scoped> |
||||
|
.qwe { |
||||
|
margin:-8px 0 0 -6px; |
||||
|
float:right; |
||||
|
} |
||||
|
.wer{ |
||||
|
margin:-5px 0 0 20px; |
||||
|
font-weight:normal; |
||||
|
} |
||||
|
.horizontal-controls { |
||||
|
display: flex; |
||||
|
float: left; |
||||
|
|
||||
|
} |
||||
|
.el-divider--vertical{ |
||||
|
display:inline-block; |
||||
|
width:1px; |
||||
|
height:812px; |
||||
|
margin:0 8px; |
||||
|
vertical-align:middle; |
||||
|
position:relative; |
||||
|
} |
||||
|
|
||||
|
/* 可以根据需要调整样式 */ |
||||
|
</style> |
||||
@ -0,0 +1,265 @@ |
|||||
|
<!-- |
||||
|
@ 作者: 鲁智强 |
||||
|
@ 时间: 2023-09-19 09:13:14 |
||||
|
@ 备注: |
||||
|
--> |
||||
|
<script lang='ts' setup> |
||||
|
import {ref,reactive,onMounted} from 'vue' |
||||
|
import { organdpost,posttarget,set_posttarget } from '@/api/opk/api' |
||||
|
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
||||
|
import { editPostCont } from '@/api/opk/pulic/api' |
||||
|
import { departmentprogramme,edit_depart,edit_depart_progra } from '@/api/opk/news/api' |
||||
|
import { ge_copy } from '@/api/opk/zxy/news/api' |
||||
|
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
||||
|
import { getDictFormData } from '@/api/dict' |
||||
|
import Dialog from './dialog.vue' |
||||
|
import Dialoglog from './dialoglog.vue' |
||||
|
import Yg from './yg.vue' |
||||
|
// eslint-disable-next-line vue/require-prop-types |
||||
|
const { addShow, title } = defineProps(['addShow', 'title']) |
||||
|
const data = reactive({ |
||||
|
formInline:{ |
||||
|
region:'', |
||||
|
}, |
||||
|
title:"", |
||||
|
addPostBox: false, |
||||
|
edPostBox:false, |
||||
|
ygPostBox:false, |
||||
|
}) |
||||
|
const orgTreeProps ={ |
||||
|
label: 'name', |
||||
|
children:'child' |
||||
|
} |
||||
|
const orgTreeProp ={ |
||||
|
label: 'title', |
||||
|
children:'childen' |
||||
|
} |
||||
|
const formdat = { |
||||
|
someProp:"", |
||||
|
} |
||||
|
const total =ref(0) |
||||
|
const rowInfo = ref<any>({}) |
||||
|
const postIds = ref<number[]>([]) |
||||
|
const tableData = ref<any>([]); |
||||
|
const tables = ref<any>([]); |
||||
|
// 获取侧栏数据 |
||||
|
function jjjs(){ |
||||
|
addPostCont("/hrapi/org/govthree","post") |
||||
|
.then(data => { |
||||
|
tableData.value = data.data[3].child[14].child; |
||||
|
}) |
||||
|
.catch(error => { |
||||
|
console.error('Error fetching data:', error); |
||||
|
}); |
||||
|
} |
||||
|
jjjs() |
||||
|
function editPost(){ |
||||
|
editPostCont({}) |
||||
|
.then(data => { |
||||
|
tables.value = data.data.list; |
||||
|
}) |
||||
|
} |
||||
|
editPost() |
||||
|
const table = ref<any>([]) |
||||
|
const formdate = reactive({ |
||||
|
page:0, |
||||
|
pagesize:20, |
||||
|
name:"", |
||||
|
dimension:"", |
||||
|
attribute:"", |
||||
|
orgidlist:"", |
||||
|
type:"", |
||||
|
value1:"2023", |
||||
|
}) |
||||
|
// 获取数据 |
||||
|
const tableq = ref([]) |
||||
|
const postt = ()=>{ |
||||
|
const ass = new Date(formdate.value1); |
||||
|
const qwe = ass.getFullYear(); |
||||
|
const zjr = qwe.toString(); |
||||
|
departmentprogramme({orgid:formdate.orgidlist,year:zjr,version:formdate.name}) |
||||
|
.then(data => { |
||||
|
tableq.value = data.data; |
||||
|
total.value = data.data.count; |
||||
|
}) |
||||
|
} |
||||
|
// 新增数据 |
||||
|
const addtableData = ()=>{ |
||||
|
data.addPostBox = true; |
||||
|
} |
||||
|
// 添加行 |
||||
|
const addRow = (val:any)=> { |
||||
|
tableData.value.push(val); |
||||
|
} |
||||
|
// 编辑行 |
||||
|
const editRow = (val:any)=> { |
||||
|
let index =tableData.value.findIndex( |
||||
|
(item:any) => item.id === val.id |
||||
|
); |
||||
|
tableData.value.splice(index, 1, val); |
||||
|
} |
||||
|
// 关闭弹窗 |
||||
|
const closeDetail = ()=>{ |
||||
|
data.addPostBox = false; |
||||
|
} |
||||
|
function editPostState(classId:string,state:number){ |
||||
|
console.log("改变状态--------->",classId,state) |
||||
|
let statusVal = 1 |
||||
|
if( state == 1) statusVal = 2; |
||||
|
edit_depart({id:classId,state:statusVal,istrue:2}) |
||||
|
postt() |
||||
|
} |
||||
|
// 删除数据 |
||||
|
const handleDel = (val:any) => { |
||||
|
const dictTypeIds = [val.outID || postIds.value].join(","); |
||||
|
let dictTypeIdAry = dictTypeIds.split(",") |
||||
|
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
||||
|
confirmButtonText: "确认", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
const add = val.key.toString() |
||||
|
handleSure(val) |
||||
|
console.log(val.id) |
||||
|
edit_depart({id:add,state:3,istrue:2}).then(()=> |
||||
|
ElMessage.success("删除成功")) |
||||
|
postt() |
||||
|
}) |
||||
|
}; |
||||
|
const handleSure = (val:any)=> { |
||||
|
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
||||
|
if(index!=-1){ |
||||
|
tableData.value.splice(index, 1); |
||||
|
} |
||||
|
} |
||||
|
const resetChecked=()=> { |
||||
|
formdate.orgidlist = "" |
||||
|
postt() |
||||
|
} |
||||
|
const handle=(data:any)=>{ |
||||
|
formdate.orgidlist = data.id.toString() |
||||
|
postt() |
||||
|
} |
||||
|
const handleErd=(val:any)=>{ |
||||
|
data.edPostBox=true; |
||||
|
rowInfo.value=val; |
||||
|
} |
||||
|
const handleio=(val:any)=>{ |
||||
|
data.ygPostBox=true; |
||||
|
rowInfo.value = val; |
||||
|
} |
||||
|
|
||||
|
const flitterData4 = (data:any)=>{ |
||||
|
let spanOneArr = [] as any[] |
||||
|
let concatOne = 0 |
||||
|
data.value.forEach((item:any,index:any)=>{ |
||||
|
if(index === 0){ |
||||
|
spanOneArr.push(1) |
||||
|
}else{ |
||||
|
//name 修改 |
||||
|
if(item.department === data.value[index - 1].department){ //第一列需合并相同内容的字段 |
||||
|
spanOneArr[concatOne] += 1 |
||||
|
spanOneArr.push(0) |
||||
|
}else{ |
||||
|
spanOneArr.push(1) |
||||
|
concatOne = index |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
return { |
||||
|
one: spanOneArr, |
||||
|
} |
||||
|
} |
||||
|
function objectSpanMethod({row, column, rowIndex, columnIndex}:any){ |
||||
|
if(columnIndex === 0 ) { |
||||
|
// this.tableData 修改 |
||||
|
const _row = (flitterData4(tableq).one)[rowIndex] |
||||
|
const _col = _row > 0 ? 1 : 0 |
||||
|
return { |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
onMounted(()=>{ |
||||
|
jjjs() |
||||
|
postt() |
||||
|
}) |
||||
|
</script> |
||||
|
<template> |
||||
|
<div class="m-2"> |
||||
|
<el-container clss="m-4"> |
||||
|
<div class="qwe"> |
||||
|
<el-button type="primary" style="width: 140px" size="large" @click="resetChecked">全选</el-button> |
||||
|
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @node-click="handle"/> |
||||
|
</div> |
||||
|
<el-divider direction="vertical"/> |
||||
|
<el-col :span="22"> |
||||
|
<el-container class="wer"> |
||||
|
<el-form-item label="方案版本号:"> |
||||
|
<el-input v-model="formdate.name" placeholder="请输入方案版本号" clearable style="width:200px"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="年度:" label-width="90"> |
||||
|
<el-date-picker v-model="formdate.value1" type="year"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label-width="25"> |
||||
|
<el-button type="primary" @click="postt"><el-icon><Search /></el-icon>查询</el-button> |
||||
|
<el-button class="new_btn" type="warning" @click="addtableData"><el-icon><Plus /></el-icon>新增</el-button> |
||||
|
</el-form-item> |
||||
|
</el-container> |
||||
|
<el-table class="m-1" :data="tableq" :span-method="objectSpanMethod" border style="width: 100%"> |
||||
|
<el-table-column prop="groupname,deaprtname," label="部门"> |
||||
|
<template #default="scope"> |
||||
|
{{scope.row.groupname}}{{scope.row.deaprtname}} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="year" label="年" width="70"/> |
||||
|
<el-table-column prop="key" label="版本号"/> |
||||
|
<el-table-column prop="time" label="时间" /> |
||||
|
<el-table-column prop="state" label="状态" width="70"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch v-model="scope.row.status" class="ml-2" inline-prompt style="--el-switch-on-color: #ff4949; --el-switch-off-color: #13ce66" @change="editPostState(scope.row.key,scope.row.state)"/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column fixed="right" label="操作" width="228"> |
||||
|
<template #default="{ row }"> |
||||
|
<el-button type="primary" link @click="handleio(row)"><el-icon><View /></el-icon>查看详情</el-button> |
||||
|
<el-button type="primary" link @click="handleErd(row)"><el-icon><DocumentChecked /></el-icon>复制</el-button> |
||||
|
<el-button type="primary" link @click="handleDel(row)"><el-icon><Delete /></el-icon>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-col> |
||||
|
</el-container> |
||||
|
<pagination v-if="total > 0" v-model:page="formdate.page" v-model:pagesize="formdate.pagesize" :total="total" @click="postt"/> |
||||
|
<Dialog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Dialog> |
||||
|
<Dialoglog v-if="data.edPostBox" v-model="data.edPostBox" :title="title" :row-info="rowInfo"></Dialoglog> |
||||
|
<Yg v-if="data.ygPostBox" v-model="data.ygPostBox" :title="title" :row-info="rowInfo"></Yg> |
||||
|
</div> |
||||
|
</template> |
||||
|
<style lang='scss' scoped> |
||||
|
.qwe { |
||||
|
margin:-8px 0 0 -6px; |
||||
|
float:right; |
||||
|
} |
||||
|
.wer{ |
||||
|
margin:-5px 0 0 20px; |
||||
|
font-weight:normal; |
||||
|
} |
||||
|
.horizontal-controls { |
||||
|
display: flex; |
||||
|
float: left; |
||||
|
|
||||
|
} |
||||
|
.el-divider--vertical{ |
||||
|
display:inline-block; |
||||
|
width:1px; |
||||
|
height:812px; |
||||
|
margin:0 8px; |
||||
|
vertical-align:middle; |
||||
|
position:relative; |
||||
|
} |
||||
|
|
||||
|
/* 可以根据需要调整样式 */ |
||||
|
</style> |
||||
@ -0,0 +1,265 @@ |
|||||
|
<!-- |
||||
|
@ 作者: 鲁智强 |
||||
|
@ 时间: 2023-09-19 09:13:14 |
||||
|
@ 备注: |
||||
|
--> |
||||
|
<script lang='ts' setup> |
||||
|
import {ref,reactive,onMounted} from 'vue' |
||||
|
import { organdpost,posttarget,set_posttarget } from '@/api/opk/api' |
||||
|
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
||||
|
import { editPostCont } from '@/api/opk/pulic/api' |
||||
|
import { departmentprogramme,edit_depart,edit_depart_progra } from '@/api/opk/news/api' |
||||
|
import { ge_copy } from '@/api/opk/zxy/news/api' |
||||
|
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
||||
|
import { getDictFormData } from '@/api/dict' |
||||
|
import Dialog from './dialog.vue' |
||||
|
import Dialoglog from './dialoglog.vue' |
||||
|
import Yg from './yg.vue' |
||||
|
// eslint-disable-next-line vue/require-prop-types |
||||
|
const { addShow, title } = defineProps(['addShow', 'title']) |
||||
|
const data = reactive({ |
||||
|
formInline:{ |
||||
|
region:'', |
||||
|
}, |
||||
|
title:"", |
||||
|
addPostBox: false, |
||||
|
edPostBox:false, |
||||
|
ygPostBox:false, |
||||
|
}) |
||||
|
const orgTreeProps ={ |
||||
|
label: 'name', |
||||
|
children:'child' |
||||
|
} |
||||
|
const orgTreeProp ={ |
||||
|
label: 'title', |
||||
|
children:'childen' |
||||
|
} |
||||
|
const formdat = { |
||||
|
someProp:"", |
||||
|
} |
||||
|
const total =ref(0) |
||||
|
const rowInfo = ref<any>({}) |
||||
|
const postIds = ref<number[]>([]) |
||||
|
const tableData = ref<any>([]); |
||||
|
const tables = ref<any>([]); |
||||
|
// 获取侧栏数据 |
||||
|
function jjjs(){ |
||||
|
addPostCont("/hrapi/org/govthree","post") |
||||
|
.then(data => { |
||||
|
tableData.value = data.data[3].child[14].child; |
||||
|
}) |
||||
|
.catch(error => { |
||||
|
console.error('Error fetching data:', error); |
||||
|
}); |
||||
|
} |
||||
|
jjjs() |
||||
|
function editPost(){ |
||||
|
editPostCont({}) |
||||
|
.then(data => { |
||||
|
tables.value = data.data.list; |
||||
|
}) |
||||
|
} |
||||
|
editPost() |
||||
|
const table = ref<any>([]) |
||||
|
const formdate = reactive({ |
||||
|
page:0, |
||||
|
pagesize:20, |
||||
|
name:"", |
||||
|
dimension:"", |
||||
|
attribute:"", |
||||
|
orgidlist:"", |
||||
|
type:"", |
||||
|
value1:"2023", |
||||
|
}) |
||||
|
// 获取数据 |
||||
|
const tableq = ref([]) |
||||
|
const postt = ()=>{ |
||||
|
const ass = new Date(formdate.value1); |
||||
|
const qwe = ass.getFullYear(); |
||||
|
const zjr = qwe.toString(); |
||||
|
departmentprogramme({orgid:formdate.orgidlist,year:zjr,version:formdate.name}) |
||||
|
.then(data => { |
||||
|
tableq.value = data.data; |
||||
|
total.value = data.data.count; |
||||
|
}) |
||||
|
} |
||||
|
// 新增数据 |
||||
|
const addtableData = ()=>{ |
||||
|
data.addPostBox = true; |
||||
|
} |
||||
|
// 添加行 |
||||
|
const addRow = (val:any)=> { |
||||
|
tableData.value.push(val); |
||||
|
} |
||||
|
// 编辑行 |
||||
|
const editRow = (val:any)=> { |
||||
|
let index =tableData.value.findIndex( |
||||
|
(item:any) => item.id === val.id |
||||
|
); |
||||
|
tableData.value.splice(index, 1, val); |
||||
|
} |
||||
|
// 关闭弹窗 |
||||
|
const closeDetail = ()=>{ |
||||
|
data.addPostBox = false; |
||||
|
} |
||||
|
function editPostState(classId:string,state:number){ |
||||
|
console.log("改变状态--------->",classId,state) |
||||
|
let statusVal = 1 |
||||
|
if( state == 1) statusVal = 2; |
||||
|
edit_depart({id:classId,state:statusVal,istrue:2}) |
||||
|
postt() |
||||
|
} |
||||
|
// 删除数据 |
||||
|
const handleDel = (val:any) => { |
||||
|
const dictTypeIds = [val.outID || postIds.value].join(","); |
||||
|
let dictTypeIdAry = dictTypeIds.split(",") |
||||
|
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
||||
|
confirmButtonText: "确认", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
const add = val.key.toString() |
||||
|
handleSure(val) |
||||
|
console.log(val.id) |
||||
|
edit_depart({id:add,state:3,istrue:2}).then(()=> |
||||
|
ElMessage.success("删除成功")) |
||||
|
postt() |
||||
|
}) |
||||
|
}; |
||||
|
const handleSure = (val:any)=> { |
||||
|
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
||||
|
if(index!=-1){ |
||||
|
tableData.value.splice(index, 1); |
||||
|
} |
||||
|
} |
||||
|
const resetChecked=()=> { |
||||
|
formdate.orgidlist = "" |
||||
|
postt() |
||||
|
} |
||||
|
const handle=(data:any)=>{ |
||||
|
formdate.orgidlist = data.id.toString() |
||||
|
postt() |
||||
|
} |
||||
|
const handleErd=(val:any)=>{ |
||||
|
data.edPostBox=true; |
||||
|
rowInfo.value=val; |
||||
|
} |
||||
|
const handleio=(val:any)=>{ |
||||
|
data.ygPostBox=true; |
||||
|
rowInfo.value = val; |
||||
|
} |
||||
|
|
||||
|
const flitterData4 = (data:any)=>{ |
||||
|
let spanOneArr = [] as any[] |
||||
|
let concatOne = 0 |
||||
|
data.value.forEach((item:any,index:any)=>{ |
||||
|
if(index === 0){ |
||||
|
spanOneArr.push(1) |
||||
|
}else{ |
||||
|
//name 修改 |
||||
|
if(item.department === data.value[index - 1].department){ //第一列需合并相同内容的字段 |
||||
|
spanOneArr[concatOne] += 1 |
||||
|
spanOneArr.push(0) |
||||
|
}else{ |
||||
|
spanOneArr.push(1) |
||||
|
concatOne = index |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
return { |
||||
|
one: spanOneArr, |
||||
|
} |
||||
|
} |
||||
|
function objectSpanMethod({row, column, rowIndex, columnIndex}:any){ |
||||
|
if(columnIndex === 0 ) { |
||||
|
// this.tableData 修改 |
||||
|
const _row = (flitterData4(tableq).one)[rowIndex] |
||||
|
const _col = _row > 0 ? 1 : 0 |
||||
|
return { |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
onMounted(()=>{ |
||||
|
jjjs() |
||||
|
postt() |
||||
|
}) |
||||
|
</script> |
||||
|
<template> |
||||
|
<div class="m-2"> |
||||
|
<el-container clss="m-4"> |
||||
|
<div class="qwe"> |
||||
|
<el-button type="primary" style="width: 140px" size="large" @click="resetChecked">全选</el-button> |
||||
|
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @node-click="handle"/> |
||||
|
</div> |
||||
|
<el-divider direction="vertical"/> |
||||
|
<el-col :span="22"> |
||||
|
<el-container class="wer"> |
||||
|
<el-form-item label="方案版本号:"> |
||||
|
<el-input v-model="formdate.name" placeholder="请输入方案版本号" clearable style="width:200px"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="年度:" label-width="90"> |
||||
|
<el-date-picker v-model="formdate.value1" type="year"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label-width="25"> |
||||
|
<el-button type="primary" @click="postt"><el-icon><Search /></el-icon>查询</el-button> |
||||
|
<el-button class="new_btn" type="warning" @click="addtableData"><el-icon><Plus /></el-icon>新增</el-button> |
||||
|
</el-form-item> |
||||
|
</el-container> |
||||
|
<el-table class="m-1" :data="tableq" :span-method="objectSpanMethod" border style="width: 100%"> |
||||
|
<el-table-column prop="groupname,deaprtname," label="部门"> |
||||
|
<template #default="scope"> |
||||
|
{{scope.row.groupname}}{{scope.row.deaprtname}} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="year" label="年" width="70"/> |
||||
|
<el-table-column prop="key" label="版本号"/> |
||||
|
<el-table-column prop="time" label="时间" /> |
||||
|
<el-table-column prop="state" label="状态" width="70"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch v-model="scope.row.states" class="ml-2" inline-prompt style="--el-switch-on-color: #ff4949; --el-switch-off-color: #13ce66" @change="editPostState(scope.row.key,scope.row.state)"/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column fixed="right" label="操作" width="228"> |
||||
|
<template #default="{ row }"> |
||||
|
<el-button type="primary" link @click="handleio(row)"><el-icon><View /></el-icon>查看详情</el-button> |
||||
|
<el-button type="primary" link @click="handleErd(row)"><el-icon><DocumentChecked /></el-icon>复制</el-button> |
||||
|
<el-button type="primary" link @click="handleDel(row)"><el-icon><Delete /></el-icon>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-col> |
||||
|
</el-container> |
||||
|
<pagination v-if="total > 0" v-model:page="formdate.page" v-model:pagesize="formdate.pagesize" :total="total" @click="postt"/> |
||||
|
<Dialog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Dialog> |
||||
|
<Dialoglog v-if="data.edPostBox" v-model="data.edPostBox" :title="title" :row-info="rowInfo"></Dialoglog> |
||||
|
<Yg v-if="data.ygPostBox" v-model="data.ygPostBox" :title="title" :row-info="rowInfo"></Yg> |
||||
|
</div> |
||||
|
</template> |
||||
|
<style lang='scss' scoped> |
||||
|
.qwe { |
||||
|
margin:-8px 0 0 -6px; |
||||
|
float:right; |
||||
|
} |
||||
|
.wer{ |
||||
|
margin:-5px 0 0 20px; |
||||
|
font-weight:normal; |
||||
|
} |
||||
|
.horizontal-controls { |
||||
|
display: flex; |
||||
|
float: left; |
||||
|
|
||||
|
} |
||||
|
.el-divider--vertical{ |
||||
|
display:inline-block; |
||||
|
width:1px; |
||||
|
height:812px; |
||||
|
margin:0 8px; |
||||
|
vertical-align:middle; |
||||
|
position:relative; |
||||
|
} |
||||
|
|
||||
|
/* 可以根据需要调整样式 */ |
||||
|
</style> |
||||
@ -0,0 +1,265 @@ |
|||||
|
<!-- |
||||
|
@ 作者: 鲁智强 |
||||
|
@ 时间: 2023-09-19 09:13:14 |
||||
|
@ 备注: |
||||
|
--> |
||||
|
<script lang='ts' setup> |
||||
|
import {ref,reactive,onMounted} from 'vue' |
||||
|
import { organdpost,posttarget,set_posttarget } from '@/api/opk/api' |
||||
|
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
||||
|
import { editPostCont } from '@/api/opk/pulic/api' |
||||
|
import { departmentprogramme,edit_depart,edit_depart_progra } from '@/api/opk/news/api' |
||||
|
import { ge_copy } from '@/api/opk/zxy/news/api' |
||||
|
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
||||
|
import { getDictFormData } from '@/api/dict' |
||||
|
import Dialog from './dialog.vue' |
||||
|
import Dialoglog from './dialoglog.vue' |
||||
|
import Yg from './yg.vue' |
||||
|
// eslint-disable-next-line vue/require-prop-types |
||||
|
const { addShow, title } = defineProps(['addShow', 'title']) |
||||
|
const data = reactive({ |
||||
|
formInline:{ |
||||
|
region:'', |
||||
|
}, |
||||
|
title:"", |
||||
|
addPostBox: false, |
||||
|
edPostBox:false, |
||||
|
ygPostBox:false, |
||||
|
}) |
||||
|
const orgTreeProps ={ |
||||
|
label: 'name', |
||||
|
children:'child' |
||||
|
} |
||||
|
const orgTreeProp ={ |
||||
|
label: 'title', |
||||
|
children:'childen' |
||||
|
} |
||||
|
const formdat = { |
||||
|
someProp:"", |
||||
|
} |
||||
|
const total =ref(0) |
||||
|
const rowInfo = ref<any>({}) |
||||
|
const postIds = ref<number[]>([]) |
||||
|
const tableData = ref<any>([]); |
||||
|
const tables = ref<any>([]); |
||||
|
// 获取侧栏数据 |
||||
|
function jjjs(){ |
||||
|
addPostCont("/hrapi/org/govthree","post") |
||||
|
.then(data => { |
||||
|
tableData.value = data.data[3].child[14].child; |
||||
|
}) |
||||
|
.catch(error => { |
||||
|
console.error('Error fetching data:', error); |
||||
|
}); |
||||
|
} |
||||
|
jjjs() |
||||
|
function editPost(){ |
||||
|
editPostCont({}) |
||||
|
.then(data => { |
||||
|
tables.value = data.data.list; |
||||
|
}) |
||||
|
} |
||||
|
editPost() |
||||
|
const table = ref<any>([]) |
||||
|
const formdate = reactive({ |
||||
|
page:0, |
||||
|
pagesize:20, |
||||
|
name:"", |
||||
|
dimension:"", |
||||
|
attribute:"", |
||||
|
orgidlist:"", |
||||
|
type:"", |
||||
|
value1:"2023", |
||||
|
}) |
||||
|
// 获取数据 |
||||
|
const tableq = ref([]) |
||||
|
const postt = ()=>{ |
||||
|
const ass = new Date(formdate.value1); |
||||
|
const qwe = ass.getFullYear(); |
||||
|
const zjr = qwe.toString(); |
||||
|
departmentprogramme({orgid:formdate.orgidlist,year:zjr,version:formdate.name}) |
||||
|
.then(data => { |
||||
|
tableq.value = data.data; |
||||
|
total.value = data.data.count; |
||||
|
}) |
||||
|
} |
||||
|
// 新增数据 |
||||
|
const addtableData = ()=>{ |
||||
|
data.addPostBox = true; |
||||
|
} |
||||
|
// 添加行 |
||||
|
const addRow = (val:any)=> { |
||||
|
tableData.value.push(val); |
||||
|
} |
||||
|
// 编辑行 |
||||
|
const editRow = (val:any)=> { |
||||
|
let index =tableData.value.findIndex( |
||||
|
(item:any) => item.id === val.id |
||||
|
); |
||||
|
tableData.value.splice(index, 1, val); |
||||
|
} |
||||
|
// 关闭弹窗 |
||||
|
const closeDetail = ()=>{ |
||||
|
data.addPostBox = false; |
||||
|
} |
||||
|
function editPostState(classId:string,state:number){ |
||||
|
console.log("改变状态--------->",classId,state) |
||||
|
let statusVal = 1 |
||||
|
if( state == 1) statusVal = 2; |
||||
|
edit_depart({id:classId,state:statusVal,istrue:2}) |
||||
|
postt() |
||||
|
} |
||||
|
// 删除数据 |
||||
|
const handleDel = (val:any) => { |
||||
|
const dictTypeIds = [val.outID || postIds.value].join(","); |
||||
|
let dictTypeIdAry = dictTypeIds.split(",") |
||||
|
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
||||
|
confirmButtonText: "确认", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
const add = val.key.toString() |
||||
|
handleSure(val) |
||||
|
console.log(val.id) |
||||
|
edit_depart({id:add,state:3,istrue:2}).then(()=> |
||||
|
ElMessage.success("删除成功")) |
||||
|
postt() |
||||
|
}) |
||||
|
}; |
||||
|
const handleSure = (val:any)=> { |
||||
|
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
||||
|
if(index!=-1){ |
||||
|
tableData.value.splice(index, 1); |
||||
|
} |
||||
|
} |
||||
|
const resetChecked=()=> { |
||||
|
formdate.orgidlist = "" |
||||
|
postt() |
||||
|
} |
||||
|
const handle=(data:any)=>{ |
||||
|
formdate.orgidlist = data.id.toString() |
||||
|
postt() |
||||
|
} |
||||
|
const handleErd=(val:any)=>{ |
||||
|
data.edPostBox=true; |
||||
|
rowInfo.value=val; |
||||
|
} |
||||
|
const handleio=(val:any)=>{ |
||||
|
data.ygPostBox=true; |
||||
|
rowInfo.value = val; |
||||
|
} |
||||
|
|
||||
|
const flitterData4 = (data:any)=>{ |
||||
|
let spanOneArr = [] as any[] |
||||
|
let concatOne = 0 |
||||
|
data.value.forEach((item:any,index:any)=>{ |
||||
|
if(index === 0){ |
||||
|
spanOneArr.push(1) |
||||
|
}else{ |
||||
|
//name 修改 |
||||
|
if(item.department === data.value[index - 1].department){ //第一列需合并相同内容的字段 |
||||
|
spanOneArr[concatOne] += 1 |
||||
|
spanOneArr.push(0) |
||||
|
}else{ |
||||
|
spanOneArr.push(1) |
||||
|
concatOne = index |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
return { |
||||
|
one: spanOneArr, |
||||
|
} |
||||
|
} |
||||
|
function objectSpanMethod({row, column, rowIndex, columnIndex}:any){ |
||||
|
if(columnIndex === 0 ) { |
||||
|
// this.tableData 修改 |
||||
|
const _row = (flitterData4(tableq).one)[rowIndex] |
||||
|
const _col = _row > 0 ? 1 : 0 |
||||
|
return { |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
onMounted(()=>{ |
||||
|
jjjs() |
||||
|
postt() |
||||
|
}) |
||||
|
</script> |
||||
|
<template> |
||||
|
<div class="m-2"> |
||||
|
<el-container clss="m-4"> |
||||
|
<div class="qwe"> |
||||
|
<el-button type="primary" style="width: 140px" size="large" @click="resetChecked">全选</el-button> |
||||
|
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @node-click="handle"/> |
||||
|
</div> |
||||
|
<el-divider direction="vertical"/> |
||||
|
<el-col :span="22"> |
||||
|
<el-container class="wer"> |
||||
|
<el-form-item label="方案版本号:"> |
||||
|
<el-input v-model="formdate.name" placeholder="请输入方案版本号" clearable style="width:200px"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="年度:" label-width="90"> |
||||
|
<el-date-picker v-model="formdate.value1" type="year"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label-width="25"> |
||||
|
<el-button type="primary" @click="postt"><el-icon><Search /></el-icon>查询</el-button> |
||||
|
<el-button class="new_btn" type="warning" @click="addtableData"><el-icon><Plus /></el-icon>新增</el-button> |
||||
|
</el-form-item> |
||||
|
</el-container> |
||||
|
<el-table class="m-1" :data="tableq" :span-method="objectSpanMethod" border style="width: 100%"> |
||||
|
<el-table-column prop="groupname,deaprtname," label="部门"> |
||||
|
<template #default="scope"> |
||||
|
{{scope.row.groupname}}{{scope.row.deaprtname}} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="year" label="年" width="70"/> |
||||
|
<el-table-column prop="key" label="版本号"/> |
||||
|
<el-table-column prop="time" label="时间" /> |
||||
|
<el-table-column prop="state" label="状态" width="70"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch v-model="scope.row.states" class="ml-2" inline-prompt style="--el-switch-on-color: #ff4949; --el-switch-off-color: #13ce66" @change="editPostState(scope.row.key,scope.row.state)"/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column fixed="right" label="操作" width="228"> |
||||
|
<template #default="{ row }"> |
||||
|
<el-button type="primary" link @click="handleio(row)"><el-icon><View /></el-icon>查看详情</el-button> |
||||
|
<el-button type="primary" link @click="handleErd(row)"><el-icon><DocumentChecked /></el-icon>复制</el-button> |
||||
|
<el-button type="primary" link @click="handleDel(row)"><el-icon><Delete /></el-icon>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-col> |
||||
|
</el-container> |
||||
|
<pagination v-if="total > 0" v-model:page="formdate.page" v-model:pagesize="formdate.pagesize" :total="total" @click="postt"/> |
||||
|
<Dialog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Dialog> |
||||
|
<Dialoglog v-if="data.edPostBox" v-model="data.edPostBox" :title="title" :row-info="rowInfo"></Dialoglog> |
||||
|
<Yg v-if="data.ygPostBox" v-model="data.ygPostBox" :title="title" :row-info="rowInfo"></Yg> |
||||
|
</div> |
||||
|
</template> |
||||
|
<style lang='scss' scoped> |
||||
|
.qwe { |
||||
|
margin:-8px 0 0 -6px; |
||||
|
float:right; |
||||
|
} |
||||
|
.wer{ |
||||
|
margin:-5px 0 0 20px; |
||||
|
font-weight:normal; |
||||
|
} |
||||
|
.horizontal-controls { |
||||
|
display: flex; |
||||
|
float: left; |
||||
|
|
||||
|
} |
||||
|
.el-divider--vertical{ |
||||
|
display:inline-block; |
||||
|
width:1px; |
||||
|
height:812px; |
||||
|
margin:0 8px; |
||||
|
vertical-align:middle; |
||||
|
position:relative; |
||||
|
} |
||||
|
|
||||
|
/* 可以根据需要调整样式 */ |
||||
|
</style> |
||||
@ -0,0 +1,265 @@ |
|||||
|
<!-- |
||||
|
@ 作者: 鲁智强 |
||||
|
@ 时间: 2023-09-19 09:13:14 |
||||
|
@ 备注: |
||||
|
--> |
||||
|
<script lang='ts' setup> |
||||
|
import {ref,reactive,onMounted} from 'vue' |
||||
|
import { organdpost,posttarget,set_posttarget } from '@/api/opk/api' |
||||
|
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
||||
|
import { editPostCont } from '@/api/opk/pulic/api' |
||||
|
import { departmentprogramme,edit_depart,edit_depart_progra } from '@/api/opk/news/api' |
||||
|
import { ge_copy } from '@/api/opk/zxy/news/api' |
||||
|
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
||||
|
import { getDictFormData } from '@/api/dict' |
||||
|
import Dialog from './dialog.vue' |
||||
|
import Dialoglog from './dialoglog.vue' |
||||
|
import Yg from './yg.vue' |
||||
|
// eslint-disable-next-line vue/require-prop-types |
||||
|
const { addShow, title } = defineProps(['addShow', 'title']) |
||||
|
const data = reactive({ |
||||
|
formInline:{ |
||||
|
region:'', |
||||
|
}, |
||||
|
title:"", |
||||
|
addPostBox: false, |
||||
|
edPostBox:false, |
||||
|
ygPostBox:false, |
||||
|
}) |
||||
|
const orgTreeProps ={ |
||||
|
label: 'name', |
||||
|
children:'child' |
||||
|
} |
||||
|
const orgTreeProp ={ |
||||
|
label: 'title', |
||||
|
children:'childen' |
||||
|
} |
||||
|
const formdat = { |
||||
|
someProp:"", |
||||
|
} |
||||
|
const total =ref(0) |
||||
|
const rowInfo = ref<any>({}) |
||||
|
const postIds = ref<number[]>([]) |
||||
|
const tableData = ref<any>([]); |
||||
|
const tables = ref<any>([]); |
||||
|
// 获取侧栏数据 |
||||
|
function jjjs(){ |
||||
|
addPostCont("/hrapi/org/govthree","post") |
||||
|
.then(data => { |
||||
|
tableData.value = data.data[3].child[14].child; |
||||
|
}) |
||||
|
.catch(error => { |
||||
|
console.error('Error fetching data:', error); |
||||
|
}); |
||||
|
} |
||||
|
jjjs() |
||||
|
function editPost(){ |
||||
|
editPostCont({}) |
||||
|
.then(data => { |
||||
|
tables.value = data.data.list; |
||||
|
}) |
||||
|
} |
||||
|
editPost() |
||||
|
const table = ref<any>([]) |
||||
|
const formdate = reactive({ |
||||
|
page:0, |
||||
|
pagesize:20, |
||||
|
name:"", |
||||
|
dimension:"", |
||||
|
attribute:"", |
||||
|
orgidlist:"", |
||||
|
type:"", |
||||
|
value1:"2023", |
||||
|
}) |
||||
|
// 获取数据 |
||||
|
const tableq = ref([]) |
||||
|
const postt = ()=>{ |
||||
|
const ass = new Date(formdate.value1); |
||||
|
const qwe = ass.getFullYear(); |
||||
|
const zjr = qwe.toString(); |
||||
|
departmentprogramme({orgid:formdate.orgidlist,year:zjr,version:formdate.name}) |
||||
|
.then(data => { |
||||
|
tableq.value = data.data; |
||||
|
total.value = data.data.count; |
||||
|
}) |
||||
|
} |
||||
|
// 新增数据 |
||||
|
const addtableData = ()=>{ |
||||
|
data.addPostBox = true; |
||||
|
} |
||||
|
// 添加行 |
||||
|
const addRow = (val:any)=> { |
||||
|
tableData.value.push(val); |
||||
|
} |
||||
|
// 编辑行 |
||||
|
const editRow = (val:any)=> { |
||||
|
let index =tableData.value.findIndex( |
||||
|
(item:any) => item.id === val.id |
||||
|
); |
||||
|
tableData.value.splice(index, 1, val); |
||||
|
} |
||||
|
// 关闭弹窗 |
||||
|
const closeDetail = ()=>{ |
||||
|
data.addPostBox = false; |
||||
|
} |
||||
|
function editPostState(classId:string,state:number){ |
||||
|
console.log("改变状态--------->",classId,state) |
||||
|
let statusVal = 1 |
||||
|
if( state == 1) statusVal = 2; |
||||
|
edit_depart({id:classId,state:statusVal,istrue:2}) |
||||
|
postt() |
||||
|
} |
||||
|
// 删除数据 |
||||
|
const handleDel = (val:any) => { |
||||
|
const dictTypeIds = [val.outID || postIds.value].join(","); |
||||
|
let dictTypeIdAry = dictTypeIds.split(",") |
||||
|
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
||||
|
confirmButtonText: "确认", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
const add = val.key.toString() |
||||
|
handleSure(val) |
||||
|
console.log(val.id) |
||||
|
edit_depart({id:add,state:3,istrue:2}).then(()=> |
||||
|
ElMessage.success("删除成功")) |
||||
|
postt() |
||||
|
}) |
||||
|
}; |
||||
|
const handleSure = (val:any)=> { |
||||
|
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
||||
|
if(index!=-1){ |
||||
|
tableData.value.splice(index, 1); |
||||
|
} |
||||
|
} |
||||
|
const resetChecked=()=> { |
||||
|
formdate.orgidlist = "" |
||||
|
postt() |
||||
|
} |
||||
|
const handle=(data:any)=>{ |
||||
|
formdate.orgidlist = data.id.toString() |
||||
|
postt() |
||||
|
} |
||||
|
const handleErd=(val:any)=>{ |
||||
|
data.edPostBox=true; |
||||
|
rowInfo.value=val; |
||||
|
} |
||||
|
const handleio=(val:any)=>{ |
||||
|
data.ygPostBox=true; |
||||
|
rowInfo.value = val; |
||||
|
} |
||||
|
|
||||
|
const flitterData4 = (data:any)=>{ |
||||
|
let spanOneArr = [] as any[] |
||||
|
let concatOne = 0 |
||||
|
data.value.forEach((item:any,index:any)=>{ |
||||
|
if(index === 0){ |
||||
|
spanOneArr.push(1) |
||||
|
}else{ |
||||
|
//name 修改 |
||||
|
if(item.department === data.value[index - 1].department){ //第一列需合并相同内容的字段 |
||||
|
spanOneArr[concatOne] += 1 |
||||
|
spanOneArr.push(0) |
||||
|
}else{ |
||||
|
spanOneArr.push(1) |
||||
|
concatOne = index |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
return { |
||||
|
one: spanOneArr, |
||||
|
} |
||||
|
} |
||||
|
function objectSpanMethod({row, column, rowIndex, columnIndex}:any){ |
||||
|
if(columnIndex === 0 ) { |
||||
|
// this.tableData 修改 |
||||
|
const _row = (flitterData4(tableq).one)[rowIndex] |
||||
|
const _col = _row > 0 ? 1 : 0 |
||||
|
return { |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
onMounted(()=>{ |
||||
|
jjjs() |
||||
|
postt() |
||||
|
}) |
||||
|
</script> |
||||
|
<template> |
||||
|
<div class="m-2"> |
||||
|
<el-container clss="m-4"> |
||||
|
<div class="qwe"> |
||||
|
<el-button type="primary" style="width: 140px" size="large" @click="resetChecked">全选</el-button> |
||||
|
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @node-click="handle"/> |
||||
|
</div> |
||||
|
<el-divider direction="vertical"/> |
||||
|
<el-col :span="22"> |
||||
|
<el-container class="wer"> |
||||
|
<el-form-item label="方案版本号:"> |
||||
|
<el-input v-model="formdate.name" placeholder="请输入方案版本号" clearable style="width:200px"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="年度:" label-width="90"> |
||||
|
<el-date-picker v-model="formdate.value1" type="year"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label-width="25"> |
||||
|
<el-button type="primary" @click="postt"><el-icon><Search /></el-icon>查询</el-button> |
||||
|
<el-button class="new_btn" type="warning" @click="addtableData"><el-icon><Plus /></el-icon>新增</el-button> |
||||
|
</el-form-item> |
||||
|
</el-container> |
||||
|
<el-table class="m-1" :data="tableq" :span-method="objectSpanMethod" border style="width: 100%"> |
||||
|
<el-table-column prop="groupname,deaprtname," label="部门"> |
||||
|
<template #default="scope"> |
||||
|
{{scope.row.groupname}}{{scope.row.deaprtname}} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="year" label="年" width="70"/> |
||||
|
<el-table-column prop="key" label="版本号"/> |
||||
|
<el-table-column prop="time" label="时间" /> |
||||
|
<el-table-column prop="state" label="状态" width="70"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch v-model="scope.row.states" class="ml-2" :inactive-value="1" :active-value="2" inline-prompt style="--el-switch-on-color: #ff4949; --el-switch-off-color: #13ce66" @change="editPostState(scope.row.key,scope.row.state)"/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column fixed="right" label="操作" width="228"> |
||||
|
<template #default="{ row }"> |
||||
|
<el-button type="primary" link @click="handleio(row)"><el-icon><View /></el-icon>查看详情</el-button> |
||||
|
<el-button type="primary" link @click="handleErd(row)"><el-icon><DocumentChecked /></el-icon>复制</el-button> |
||||
|
<el-button type="primary" link @click="handleDel(row)"><el-icon><Delete /></el-icon>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-col> |
||||
|
</el-container> |
||||
|
<pagination v-if="total > 0" v-model:page="formdate.page" v-model:pagesize="formdate.pagesize" :total="total" @click="postt"/> |
||||
|
<Dialog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Dialog> |
||||
|
<Dialoglog v-if="data.edPostBox" v-model="data.edPostBox" :title="title" :row-info="rowInfo"></Dialoglog> |
||||
|
<Yg v-if="data.ygPostBox" v-model="data.ygPostBox" :title="title" :row-info="rowInfo"></Yg> |
||||
|
</div> |
||||
|
</template> |
||||
|
<style lang='scss' scoped> |
||||
|
.qwe { |
||||
|
margin:-8px 0 0 -6px; |
||||
|
float:right; |
||||
|
} |
||||
|
.wer{ |
||||
|
margin:-5px 0 0 20px; |
||||
|
font-weight:normal; |
||||
|
} |
||||
|
.horizontal-controls { |
||||
|
display: flex; |
||||
|
float: left; |
||||
|
|
||||
|
} |
||||
|
.el-divider--vertical{ |
||||
|
display:inline-block; |
||||
|
width:1px; |
||||
|
height:812px; |
||||
|
margin:0 8px; |
||||
|
vertical-align:middle; |
||||
|
position:relative; |
||||
|
} |
||||
|
|
||||
|
/* 可以根据需要调整样式 */ |
||||
|
</style> |
||||
@ -0,0 +1,265 @@ |
|||||
|
<!-- |
||||
|
@ 作者: 鲁智强 |
||||
|
@ 时间: 2023-09-19 09:13:14 |
||||
|
@ 备注: |
||||
|
--> |
||||
|
<script lang='ts' setup> |
||||
|
import {ref,reactive,onMounted} from 'vue' |
||||
|
import { organdpost,posttarget,set_posttarget } from '@/api/opk/api' |
||||
|
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
||||
|
import { editPostCont } from '@/api/opk/pulic/api' |
||||
|
import { departmentprogramme,edit_depart,edit_depart_progra } from '@/api/opk/news/api' |
||||
|
import { ge_copy } from '@/api/opk/zxy/news/api' |
||||
|
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
||||
|
import { getDictFormData } from '@/api/dict' |
||||
|
import Dialog from './dialog.vue' |
||||
|
import Dialoglog from './dialoglog.vue' |
||||
|
import Yg from './yg.vue' |
||||
|
// eslint-disable-next-line vue/require-prop-types |
||||
|
const { addShow, title } = defineProps(['addShow', 'title']) |
||||
|
const data = reactive({ |
||||
|
formInline:{ |
||||
|
region:'', |
||||
|
}, |
||||
|
title:"", |
||||
|
addPostBox: false, |
||||
|
edPostBox:false, |
||||
|
ygPostBox:false, |
||||
|
}) |
||||
|
const orgTreeProps ={ |
||||
|
label: 'name', |
||||
|
children:'child' |
||||
|
} |
||||
|
const orgTreeProp ={ |
||||
|
label: 'title', |
||||
|
children:'childen' |
||||
|
} |
||||
|
const formdat = { |
||||
|
someProp:"", |
||||
|
} |
||||
|
const total =ref(0) |
||||
|
const rowInfo = ref<any>({}) |
||||
|
const postIds = ref<number[]>([]) |
||||
|
const tableData = ref<any>([]); |
||||
|
const tables = ref<any>([]); |
||||
|
// 获取侧栏数据 |
||||
|
function jjjs(){ |
||||
|
addPostCont("/hrapi/org/govthree","post") |
||||
|
.then(data => { |
||||
|
tableData.value = data.data[3].child[14].child; |
||||
|
}) |
||||
|
.catch(error => { |
||||
|
console.error('Error fetching data:', error); |
||||
|
}); |
||||
|
} |
||||
|
jjjs() |
||||
|
function editPost(){ |
||||
|
editPostCont({}) |
||||
|
.then(data => { |
||||
|
tables.value = data.data.list; |
||||
|
}) |
||||
|
} |
||||
|
editPost() |
||||
|
const table = ref<any>([]) |
||||
|
const formdate = reactive({ |
||||
|
page:0, |
||||
|
pagesize:20, |
||||
|
name:"", |
||||
|
dimension:"", |
||||
|
attribute:"", |
||||
|
orgidlist:"", |
||||
|
type:"", |
||||
|
value1:"2023", |
||||
|
}) |
||||
|
// 获取数据 |
||||
|
const tableq = ref([]) |
||||
|
const postt = ()=>{ |
||||
|
const ass = new Date(formdate.value1); |
||||
|
const qwe = ass.getFullYear(); |
||||
|
const zjr = qwe.toString(); |
||||
|
departmentprogramme({orgid:formdate.orgidlist,year:zjr,version:formdate.name}) |
||||
|
.then(data => { |
||||
|
tableq.value = data.data; |
||||
|
total.value = data.data.count; |
||||
|
}) |
||||
|
} |
||||
|
// 新增数据 |
||||
|
const addtableData = ()=>{ |
||||
|
data.addPostBox = true; |
||||
|
} |
||||
|
// 添加行 |
||||
|
const addRow = (val:any)=> { |
||||
|
tableData.value.push(val); |
||||
|
} |
||||
|
// 编辑行 |
||||
|
const editRow = (val:any)=> { |
||||
|
let index =tableData.value.findIndex( |
||||
|
(item:any) => item.id === val.id |
||||
|
); |
||||
|
tableData.value.splice(index, 1, val); |
||||
|
} |
||||
|
// 关闭弹窗 |
||||
|
const closeDetail = ()=>{ |
||||
|
data.addPostBox = false; |
||||
|
} |
||||
|
function editPostState(classId:string,state:number){ |
||||
|
console.log("改变状态--------->",classId,state) |
||||
|
let statusVal = 1 |
||||
|
if( state == 1) statusVal = 2; |
||||
|
edit_depart({id:classId,state:statusVal,istrue:2}) |
||||
|
postt() |
||||
|
} |
||||
|
// 删除数据 |
||||
|
const handleDel = (val:any) => { |
||||
|
const dictTypeIds = [val.outID || postIds.value].join(","); |
||||
|
let dictTypeIdAry = dictTypeIds.split(",") |
||||
|
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
||||
|
confirmButtonText: "确认", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
const add = val.key.toString() |
||||
|
handleSure(val) |
||||
|
console.log(val.id) |
||||
|
edit_depart({id:add,state:3,istrue:2}).then(()=> |
||||
|
ElMessage.success("删除成功")) |
||||
|
postt() |
||||
|
}) |
||||
|
}; |
||||
|
const handleSure = (val:any)=> { |
||||
|
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
||||
|
if(index!=-1){ |
||||
|
tableData.value.splice(index, 1); |
||||
|
} |
||||
|
} |
||||
|
const resetChecked=()=> { |
||||
|
formdate.orgidlist = "" |
||||
|
postt() |
||||
|
} |
||||
|
const handle=(data:any)=>{ |
||||
|
formdate.orgidlist = data.id.toString() |
||||
|
postt() |
||||
|
} |
||||
|
const handleErd=(val:any)=>{ |
||||
|
data.edPostBox=true; |
||||
|
rowInfo.value=val; |
||||
|
} |
||||
|
const handleio=(val:any)=>{ |
||||
|
data.ygPostBox=true; |
||||
|
rowInfo.value = val; |
||||
|
} |
||||
|
|
||||
|
const flitterData4 = (data:any)=>{ |
||||
|
let spanOneArr = [] as any[] |
||||
|
let concatOne = 0 |
||||
|
data.value.forEach((item:any,index:any)=>{ |
||||
|
if(index === 0){ |
||||
|
spanOneArr.push(1) |
||||
|
}else{ |
||||
|
//name 修改 |
||||
|
if(item.department === data.value[index - 1].department){ //第一列需合并相同内容的字段 |
||||
|
spanOneArr[concatOne] += 1 |
||||
|
spanOneArr.push(0) |
||||
|
}else{ |
||||
|
spanOneArr.push(1) |
||||
|
concatOne = index |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
return { |
||||
|
one: spanOneArr, |
||||
|
} |
||||
|
} |
||||
|
function objectSpanMethod({row, column, rowIndex, columnIndex}:any){ |
||||
|
if(columnIndex === 0 ) { |
||||
|
// this.tableData 修改 |
||||
|
const _row = (flitterData4(tableq).one)[rowIndex] |
||||
|
const _col = _row > 0 ? 1 : 0 |
||||
|
return { |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
onMounted(()=>{ |
||||
|
jjjs() |
||||
|
postt() |
||||
|
}) |
||||
|
</script> |
||||
|
<template> |
||||
|
<div class="m-2"> |
||||
|
<el-container clss="m-4"> |
||||
|
<div class="qwe"> |
||||
|
<el-button type="primary" style="width: 140px" size="large" @click="resetChecked">全选</el-button> |
||||
|
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @node-click="handle"/> |
||||
|
</div> |
||||
|
<el-divider direction="vertical"/> |
||||
|
<el-col :span="22"> |
||||
|
<el-container class="wer"> |
||||
|
<el-form-item label="方案版本号:"> |
||||
|
<el-input v-model="formdate.name" placeholder="请输入方案版本号" clearable style="width:200px"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="年度:" label-width="90"> |
||||
|
<el-date-picker v-model="formdate.value1" type="year"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label-width="25"> |
||||
|
<el-button type="primary" @click="postt"><el-icon><Search /></el-icon>查询</el-button> |
||||
|
<el-button class="new_btn" type="warning" @click="addtableData"><el-icon><Plus /></el-icon>新增</el-button> |
||||
|
</el-form-item> |
||||
|
</el-container> |
||||
|
<el-table class="m-1" :data="tableq" :span-method="objectSpanMethod" border style="width: 100%"> |
||||
|
<el-table-column prop="groupname,deaprtname," label="部门"> |
||||
|
<template #default="scope"> |
||||
|
{{scope.row.groupname}}{{scope.row.deaprtname}} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="year" label="年" width="70"/> |
||||
|
<el-table-column prop="key" label="版本号"/> |
||||
|
<el-table-column prop="time" label="时间" /> |
||||
|
<el-table-column prop="state" label="状态" width="70"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch v-model="scope.row.state" class="ml-2" :inactive-value="1" :active-value="2" inline-prompt style="--el-switch-on-color: #ff4949; --el-switch-off-color: #13ce66" @change="editPostState(scope.row.key,scope.row.state)"/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column fixed="right" label="操作" width="228"> |
||||
|
<template #default="{ row }"> |
||||
|
<el-button type="primary" link @click="handleio(row)"><el-icon><View /></el-icon>查看详情</el-button> |
||||
|
<el-button type="primary" link @click="handleErd(row)"><el-icon><DocumentChecked /></el-icon>复制</el-button> |
||||
|
<el-button type="primary" link @click="handleDel(row)"><el-icon><Delete /></el-icon>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-col> |
||||
|
</el-container> |
||||
|
<pagination v-if="total > 0" v-model:page="formdate.page" v-model:pagesize="formdate.pagesize" :total="total" @click="postt"/> |
||||
|
<Dialog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Dialog> |
||||
|
<Dialoglog v-if="data.edPostBox" v-model="data.edPostBox" :title="title" :row-info="rowInfo"></Dialoglog> |
||||
|
<Yg v-if="data.ygPostBox" v-model="data.ygPostBox" :title="title" :row-info="rowInfo"></Yg> |
||||
|
</div> |
||||
|
</template> |
||||
|
<style lang='scss' scoped> |
||||
|
.qwe { |
||||
|
margin:-8px 0 0 -6px; |
||||
|
float:right; |
||||
|
} |
||||
|
.wer{ |
||||
|
margin:-5px 0 0 20px; |
||||
|
font-weight:normal; |
||||
|
} |
||||
|
.horizontal-controls { |
||||
|
display: flex; |
||||
|
float: left; |
||||
|
|
||||
|
} |
||||
|
.el-divider--vertical{ |
||||
|
display:inline-block; |
||||
|
width:1px; |
||||
|
height:812px; |
||||
|
margin:0 8px; |
||||
|
vertical-align:middle; |
||||
|
position:relative; |
||||
|
} |
||||
|
|
||||
|
/* 可以根据需要调整样式 */ |
||||
|
</style> |
||||
@ -0,0 +1,265 @@ |
|||||
|
<!-- |
||||
|
@ 作者: 鲁智强 |
||||
|
@ 时间: 2023-09-19 09:13:14 |
||||
|
@ 备注: |
||||
|
--> |
||||
|
<script lang='ts' setup> |
||||
|
import {ref,reactive,onMounted} from 'vue' |
||||
|
import { organdpost,posttarget,set_posttarget } from '@/api/opk/api' |
||||
|
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
||||
|
import { editPostCont } from '@/api/opk/pulic/api' |
||||
|
import { departmentprogramme,edit_depart,edit_depart_progra } from '@/api/opk/news/api' |
||||
|
import { ge_copy } from '@/api/opk/zxy/news/api' |
||||
|
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
||||
|
import { getDictFormData } from '@/api/dict' |
||||
|
import Dialog from './dialog.vue' |
||||
|
import Dialoglog from './dialoglog.vue' |
||||
|
import Yg from './yg.vue' |
||||
|
// eslint-disable-next-line vue/require-prop-types |
||||
|
const { addShow, title } = defineProps(['addShow', 'title']) |
||||
|
const data = reactive({ |
||||
|
formInline:{ |
||||
|
region:'', |
||||
|
}, |
||||
|
title:"", |
||||
|
addPostBox: false, |
||||
|
edPostBox:false, |
||||
|
ygPostBox:false, |
||||
|
}) |
||||
|
const orgTreeProps ={ |
||||
|
label: 'name', |
||||
|
children:'child' |
||||
|
} |
||||
|
const orgTreeProp ={ |
||||
|
label: 'title', |
||||
|
children:'childen' |
||||
|
} |
||||
|
const formdat = { |
||||
|
someProp:"", |
||||
|
} |
||||
|
const total =ref(0) |
||||
|
const rowInfo = ref<any>({}) |
||||
|
const postIds = ref<number[]>([]) |
||||
|
const tableData = ref<any>([]); |
||||
|
const tables = ref<any>([]); |
||||
|
// 获取侧栏数据 |
||||
|
function jjjs(){ |
||||
|
addPostCont("/hrapi/org/govthree","post") |
||||
|
.then(data => { |
||||
|
tableData.value = data.data[3].child[14].child; |
||||
|
}) |
||||
|
.catch(error => { |
||||
|
console.error('Error fetching data:', error); |
||||
|
}); |
||||
|
} |
||||
|
jjjs() |
||||
|
function editPost(){ |
||||
|
editPostCont({}) |
||||
|
.then(data => { |
||||
|
tables.value = data.data.list; |
||||
|
}) |
||||
|
} |
||||
|
editPost() |
||||
|
const table = ref<any>([]) |
||||
|
const formdate = reactive({ |
||||
|
page:0, |
||||
|
pagesize:20, |
||||
|
name:"", |
||||
|
dimension:"", |
||||
|
attribute:"", |
||||
|
orgidlist:"", |
||||
|
type:"", |
||||
|
value1:"2023", |
||||
|
}) |
||||
|
// 获取数据 |
||||
|
const tableq = ref([]) |
||||
|
const postt = ()=>{ |
||||
|
const ass = new Date(formdate.value1); |
||||
|
const qwe = ass.getFullYear(); |
||||
|
const zjr = qwe.toString(); |
||||
|
departmentprogramme({orgid:formdate.orgidlist,year:zjr,version:formdate.name}) |
||||
|
.then(data => { |
||||
|
tableq.value = data.data; |
||||
|
total.value = data.data.count; |
||||
|
}) |
||||
|
} |
||||
|
// 新增数据 |
||||
|
const addtableData = ()=>{ |
||||
|
data.addPostBox = true; |
||||
|
} |
||||
|
// 添加行 |
||||
|
const addRow = (val:any)=> { |
||||
|
tableData.value.push(val); |
||||
|
} |
||||
|
// 编辑行 |
||||
|
const editRow = (val:any)=> { |
||||
|
let index =tableData.value.findIndex( |
||||
|
(item:any) => item.id === val.id |
||||
|
); |
||||
|
tableData.value.splice(index, 1, val); |
||||
|
} |
||||
|
// 关闭弹窗 |
||||
|
const closeDetail = ()=>{ |
||||
|
data.addPostBox = false; |
||||
|
} |
||||
|
function editPostState(classId:string,state:number){ |
||||
|
console.log("改变状态--------->",classId,state) |
||||
|
let statusVal = 1 |
||||
|
if( state == 2) statusVal = 2; |
||||
|
edit_depart({id:classId,state:statusVal,istrue:2}) |
||||
|
postt() |
||||
|
} |
||||
|
// 删除数据 |
||||
|
const handleDel = (val:any) => { |
||||
|
const dictTypeIds = [val.outID || postIds.value].join(","); |
||||
|
let dictTypeIdAry = dictTypeIds.split(",") |
||||
|
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
||||
|
confirmButtonText: "确认", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
const add = val.key.toString() |
||||
|
handleSure(val) |
||||
|
console.log(val.id) |
||||
|
edit_depart({id:add,state:3,istrue:2}).then(()=> |
||||
|
ElMessage.success("删除成功")) |
||||
|
postt() |
||||
|
}) |
||||
|
}; |
||||
|
const handleSure = (val:any)=> { |
||||
|
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
||||
|
if(index!=-1){ |
||||
|
tableData.value.splice(index, 1); |
||||
|
} |
||||
|
} |
||||
|
const resetChecked=()=> { |
||||
|
formdate.orgidlist = "" |
||||
|
postt() |
||||
|
} |
||||
|
const handle=(data:any)=>{ |
||||
|
formdate.orgidlist = data.id.toString() |
||||
|
postt() |
||||
|
} |
||||
|
const handleErd=(val:any)=>{ |
||||
|
data.edPostBox=true; |
||||
|
rowInfo.value=val; |
||||
|
} |
||||
|
const handleio=(val:any)=>{ |
||||
|
data.ygPostBox=true; |
||||
|
rowInfo.value = val; |
||||
|
} |
||||
|
|
||||
|
const flitterData4 = (data:any)=>{ |
||||
|
let spanOneArr = [] as any[] |
||||
|
let concatOne = 0 |
||||
|
data.value.forEach((item:any,index:any)=>{ |
||||
|
if(index === 0){ |
||||
|
spanOneArr.push(1) |
||||
|
}else{ |
||||
|
//name 修改 |
||||
|
if(item.department === data.value[index - 1].department){ //第一列需合并相同内容的字段 |
||||
|
spanOneArr[concatOne] += 1 |
||||
|
spanOneArr.push(0) |
||||
|
}else{ |
||||
|
spanOneArr.push(1) |
||||
|
concatOne = index |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
return { |
||||
|
one: spanOneArr, |
||||
|
} |
||||
|
} |
||||
|
function objectSpanMethod({row, column, rowIndex, columnIndex}:any){ |
||||
|
if(columnIndex === 0 ) { |
||||
|
// this.tableData 修改 |
||||
|
const _row = (flitterData4(tableq).one)[rowIndex] |
||||
|
const _col = _row > 0 ? 1 : 0 |
||||
|
return { |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
onMounted(()=>{ |
||||
|
jjjs() |
||||
|
postt() |
||||
|
}) |
||||
|
</script> |
||||
|
<template> |
||||
|
<div class="m-2"> |
||||
|
<el-container clss="m-4"> |
||||
|
<div class="qwe"> |
||||
|
<el-button type="primary" style="width: 140px" size="large" @click="resetChecked">全选</el-button> |
||||
|
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @node-click="handle"/> |
||||
|
</div> |
||||
|
<el-divider direction="vertical"/> |
||||
|
<el-col :span="22"> |
||||
|
<el-container class="wer"> |
||||
|
<el-form-item label="方案版本号:"> |
||||
|
<el-input v-model="formdate.name" placeholder="请输入方案版本号" clearable style="width:200px"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="年度:" label-width="90"> |
||||
|
<el-date-picker v-model="formdate.value1" type="year"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label-width="25"> |
||||
|
<el-button type="primary" @click="postt"><el-icon><Search /></el-icon>查询</el-button> |
||||
|
<el-button class="new_btn" type="warning" @click="addtableData"><el-icon><Plus /></el-icon>新增</el-button> |
||||
|
</el-form-item> |
||||
|
</el-container> |
||||
|
<el-table class="m-1" :data="tableq" :span-method="objectSpanMethod" border style="width: 100%"> |
||||
|
<el-table-column prop="groupname,deaprtname," label="部门"> |
||||
|
<template #default="scope"> |
||||
|
{{scope.row.groupname}}{{scope.row.deaprtname}} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="year" label="年" width="70"/> |
||||
|
<el-table-column prop="key" label="版本号"/> |
||||
|
<el-table-column prop="time" label="时间" /> |
||||
|
<el-table-column prop="state" label="状态" width="70"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch v-model="scope.row.state" class="ml-2" :inactive-value="1" :active-value="2" inline-prompt style="--el-switch-on-color: #ff4949; --el-switch-off-color: #13ce66" @change="editPostState(scope.row.key,scope.row.state)"/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column fixed="right" label="操作" width="228"> |
||||
|
<template #default="{ row }"> |
||||
|
<el-button type="primary" link @click="handleio(row)"><el-icon><View /></el-icon>查看详情</el-button> |
||||
|
<el-button type="primary" link @click="handleErd(row)"><el-icon><DocumentChecked /></el-icon>复制</el-button> |
||||
|
<el-button type="primary" link @click="handleDel(row)"><el-icon><Delete /></el-icon>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-col> |
||||
|
</el-container> |
||||
|
<pagination v-if="total > 0" v-model:page="formdate.page" v-model:pagesize="formdate.pagesize" :total="total" @click="postt"/> |
||||
|
<Dialog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Dialog> |
||||
|
<Dialoglog v-if="data.edPostBox" v-model="data.edPostBox" :title="title" :row-info="rowInfo"></Dialoglog> |
||||
|
<Yg v-if="data.ygPostBox" v-model="data.ygPostBox" :title="title" :row-info="rowInfo"></Yg> |
||||
|
</div> |
||||
|
</template> |
||||
|
<style lang='scss' scoped> |
||||
|
.qwe { |
||||
|
margin:-8px 0 0 -6px; |
||||
|
float:right; |
||||
|
} |
||||
|
.wer{ |
||||
|
margin:-5px 0 0 20px; |
||||
|
font-weight:normal; |
||||
|
} |
||||
|
.horizontal-controls { |
||||
|
display: flex; |
||||
|
float: left; |
||||
|
|
||||
|
} |
||||
|
.el-divider--vertical{ |
||||
|
display:inline-block; |
||||
|
width:1px; |
||||
|
height:812px; |
||||
|
margin:0 8px; |
||||
|
vertical-align:middle; |
||||
|
position:relative; |
||||
|
} |
||||
|
|
||||
|
/* 可以根据需要调整样式 */ |
||||
|
</style> |
||||
@ -0,0 +1,265 @@ |
|||||
|
<!-- |
||||
|
@ 作者: 鲁智强 |
||||
|
@ 时间: 2023-09-19 09:13:14 |
||||
|
@ 备注: |
||||
|
--> |
||||
|
<script lang='ts' setup> |
||||
|
import {ref,reactive,onMounted} from 'vue' |
||||
|
import { organdpost,posttarget,set_posttarget } from '@/api/opk/api' |
||||
|
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
||||
|
import { editPostCont } from '@/api/opk/pulic/api' |
||||
|
import { departmentprogramme,edit_depart,edit_depart_progra } from '@/api/opk/news/api' |
||||
|
import { ge_copy } from '@/api/opk/zxy/news/api' |
||||
|
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
||||
|
import { getDictFormData } from '@/api/dict' |
||||
|
import Dialog from './dialog.vue' |
||||
|
import Dialoglog from './dialoglog.vue' |
||||
|
import Yg from './yg.vue' |
||||
|
// eslint-disable-next-line vue/require-prop-types |
||||
|
const { addShow, title } = defineProps(['addShow', 'title']) |
||||
|
const data = reactive({ |
||||
|
formInline:{ |
||||
|
region:'', |
||||
|
}, |
||||
|
title:"", |
||||
|
addPostBox: false, |
||||
|
edPostBox:false, |
||||
|
ygPostBox:false, |
||||
|
}) |
||||
|
const orgTreeProps ={ |
||||
|
label: 'name', |
||||
|
children:'child' |
||||
|
} |
||||
|
const orgTreeProp ={ |
||||
|
label: 'title', |
||||
|
children:'childen' |
||||
|
} |
||||
|
const formdat = { |
||||
|
someProp:"", |
||||
|
} |
||||
|
const total =ref(0) |
||||
|
const rowInfo = ref<any>({}) |
||||
|
const postIds = ref<number[]>([]) |
||||
|
const tableData = ref<any>([]); |
||||
|
const tables = ref<any>([]); |
||||
|
// 获取侧栏数据 |
||||
|
function jjjs(){ |
||||
|
addPostCont("/hrapi/org/govthree","post") |
||||
|
.then(data => { |
||||
|
tableData.value = data.data[3].child[14].child; |
||||
|
}) |
||||
|
.catch(error => { |
||||
|
console.error('Error fetching data:', error); |
||||
|
}); |
||||
|
} |
||||
|
jjjs() |
||||
|
function editPost(){ |
||||
|
editPostCont({}) |
||||
|
.then(data => { |
||||
|
tables.value = data.data.list; |
||||
|
}) |
||||
|
} |
||||
|
editPost() |
||||
|
const table = ref<any>([]) |
||||
|
const formdate = reactive({ |
||||
|
page:0, |
||||
|
pagesize:20, |
||||
|
name:"", |
||||
|
dimension:"", |
||||
|
attribute:"", |
||||
|
orgidlist:"", |
||||
|
type:"", |
||||
|
value1:"2023", |
||||
|
}) |
||||
|
// 获取数据 |
||||
|
const tableq = ref([]) |
||||
|
const postt = ()=>{ |
||||
|
const ass = new Date(formdate.value1); |
||||
|
const qwe = ass.getFullYear(); |
||||
|
const zjr = qwe.toString(); |
||||
|
departmentprogramme({orgid:formdate.orgidlist,year:zjr,version:formdate.name}) |
||||
|
.then(data => { |
||||
|
tableq.value = data.data; |
||||
|
total.value = data.data.count; |
||||
|
}) |
||||
|
} |
||||
|
// 新增数据 |
||||
|
const addtableData = ()=>{ |
||||
|
data.addPostBox = true; |
||||
|
} |
||||
|
// 添加行 |
||||
|
const addRow = (val:any)=> { |
||||
|
tableData.value.push(val); |
||||
|
} |
||||
|
// 编辑行 |
||||
|
const editRow = (val:any)=> { |
||||
|
let index =tableData.value.findIndex( |
||||
|
(item:any) => item.id === val.id |
||||
|
); |
||||
|
tableData.value.splice(index, 1, val); |
||||
|
} |
||||
|
// 关闭弹窗 |
||||
|
const closeDetail = ()=>{ |
||||
|
data.addPostBox = false; |
||||
|
} |
||||
|
function editPostState(classId:string,state:number){ |
||||
|
console.log("改变状态--------->",classId,state) |
||||
|
let statusVal = 1 |
||||
|
if( state == 1) statusVal = 2; |
||||
|
edit_depart({id:classId,state:statusVal,istrue:2}) |
||||
|
postt() |
||||
|
} |
||||
|
// 删除数据 |
||||
|
const handleDel = (val:any) => { |
||||
|
const dictTypeIds = [val.outID || postIds.value].join(","); |
||||
|
let dictTypeIdAry = dictTypeIds.split(",") |
||||
|
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
||||
|
confirmButtonText: "确认", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
const add = val.key.toString() |
||||
|
handleSure(val) |
||||
|
console.log(val.id) |
||||
|
edit_depart({id:add,state:3,istrue:2}).then(()=> |
||||
|
ElMessage.success("删除成功")) |
||||
|
postt() |
||||
|
}) |
||||
|
}; |
||||
|
const handleSure = (val:any)=> { |
||||
|
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
||||
|
if(index!=-1){ |
||||
|
tableData.value.splice(index, 1); |
||||
|
} |
||||
|
} |
||||
|
const resetChecked=()=> { |
||||
|
formdate.orgidlist = "" |
||||
|
postt() |
||||
|
} |
||||
|
const handle=(data:any)=>{ |
||||
|
formdate.orgidlist = data.id.toString() |
||||
|
postt() |
||||
|
} |
||||
|
const handleErd=(val:any)=>{ |
||||
|
data.edPostBox=true; |
||||
|
rowInfo.value=val; |
||||
|
} |
||||
|
const handleio=(val:any)=>{ |
||||
|
data.ygPostBox=true; |
||||
|
rowInfo.value = val; |
||||
|
} |
||||
|
|
||||
|
const flitterData4 = (data:any)=>{ |
||||
|
let spanOneArr = [] as any[] |
||||
|
let concatOne = 0 |
||||
|
data.value.forEach((item:any,index:any)=>{ |
||||
|
if(index === 0){ |
||||
|
spanOneArr.push(1) |
||||
|
}else{ |
||||
|
//name 修改 |
||||
|
if(item.department === data.value[index - 1].department){ //第一列需合并相同内容的字段 |
||||
|
spanOneArr[concatOne] += 1 |
||||
|
spanOneArr.push(0) |
||||
|
}else{ |
||||
|
spanOneArr.push(1) |
||||
|
concatOne = index |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
return { |
||||
|
one: spanOneArr, |
||||
|
} |
||||
|
} |
||||
|
function objectSpanMethod({row, column, rowIndex, columnIndex}:any){ |
||||
|
if(columnIndex === 0 ) { |
||||
|
// this.tableData 修改 |
||||
|
const _row = (flitterData4(tableq).one)[rowIndex] |
||||
|
const _col = _row > 0 ? 1 : 0 |
||||
|
return { |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
onMounted(()=>{ |
||||
|
jjjs() |
||||
|
postt() |
||||
|
}) |
||||
|
</script> |
||||
|
<template> |
||||
|
<div class="m-2"> |
||||
|
<el-container clss="m-4"> |
||||
|
<div class="qwe"> |
||||
|
<el-button type="primary" style="width: 140px" size="large" @click="resetChecked">全选</el-button> |
||||
|
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @node-click="handle"/> |
||||
|
</div> |
||||
|
<el-divider direction="vertical"/> |
||||
|
<el-col :span="22"> |
||||
|
<el-container class="wer"> |
||||
|
<el-form-item label="方案版本号:"> |
||||
|
<el-input v-model="formdate.name" placeholder="请输入方案版本号" clearable style="width:200px"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="年度:" label-width="90"> |
||||
|
<el-date-picker v-model="formdate.value1" type="year"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label-width="25"> |
||||
|
<el-button type="primary" @click="postt"><el-icon><Search /></el-icon>查询</el-button> |
||||
|
<el-button class="new_btn" type="warning" @click="addtableData"><el-icon><Plus /></el-icon>新增</el-button> |
||||
|
</el-form-item> |
||||
|
</el-container> |
||||
|
<el-table class="m-1" :data="tableq" :span-method="objectSpanMethod" border style="width: 100%"> |
||||
|
<el-table-column prop="groupname,deaprtname," label="部门"> |
||||
|
<template #default="scope"> |
||||
|
{{scope.row.groupname}}{{scope.row.deaprtname}} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="year" label="年" width="70"/> |
||||
|
<el-table-column prop="key" label="版本号"/> |
||||
|
<el-table-column prop="time" label="时间" /> |
||||
|
<el-table-column prop="state" label="状态" width="70"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch v-model="scope.row.state" class="ml-2" :inactive-value="1" :active-value="2" inline-prompt style="--el-switch-on-color: #ff4949; --el-switch-off-color: #13ce66" @change="editPostState(scope.row.key,scope.row.state)"/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column fixed="right" label="操作" width="228"> |
||||
|
<template #default="{ row }"> |
||||
|
<el-button type="primary" link @click="handleio(row)"><el-icon><View /></el-icon>查看详情</el-button> |
||||
|
<el-button type="primary" link @click="handleErd(row)"><el-icon><DocumentChecked /></el-icon>复制</el-button> |
||||
|
<el-button type="primary" link @click="handleDel(row)"><el-icon><Delete /></el-icon>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-col> |
||||
|
</el-container> |
||||
|
<pagination v-if="total > 0" v-model:page="formdate.page" v-model:pagesize="formdate.pagesize" :total="total" @click="postt"/> |
||||
|
<Dialog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Dialog> |
||||
|
<Dialoglog v-if="data.edPostBox" v-model="data.edPostBox" :title="title" :row-info="rowInfo"></Dialoglog> |
||||
|
<Yg v-if="data.ygPostBox" v-model="data.ygPostBox" :title="title" :row-info="rowInfo"></Yg> |
||||
|
</div> |
||||
|
</template> |
||||
|
<style lang='scss' scoped> |
||||
|
.qwe { |
||||
|
margin:-8px 0 0 -6px; |
||||
|
float:right; |
||||
|
} |
||||
|
.wer{ |
||||
|
margin:-5px 0 0 20px; |
||||
|
font-weight:normal; |
||||
|
} |
||||
|
.horizontal-controls { |
||||
|
display: flex; |
||||
|
float: left; |
||||
|
|
||||
|
} |
||||
|
.el-divider--vertical{ |
||||
|
display:inline-block; |
||||
|
width:1px; |
||||
|
height:812px; |
||||
|
margin:0 8px; |
||||
|
vertical-align:middle; |
||||
|
position:relative; |
||||
|
} |
||||
|
|
||||
|
/* 可以根据需要调整样式 */ |
||||
|
</style> |
||||
@ -0,0 +1,265 @@ |
|||||
|
<!-- |
||||
|
@ 作者: 鲁智强 |
||||
|
@ 时间: 2023-09-19 09:13:14 |
||||
|
@ 备注: |
||||
|
--> |
||||
|
<script lang='ts' setup> |
||||
|
import {ref,reactive,onMounted} from 'vue' |
||||
|
import { organdpost,posttarget,set_posttarget } from '@/api/opk/api' |
||||
|
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
||||
|
import { editPostCont } from '@/api/opk/pulic/api' |
||||
|
import { departmentprogramme,edit_depart,edit_depart_progra } from '@/api/opk/news/api' |
||||
|
import { ge_copy } from '@/api/opk/zxy/news/api' |
||||
|
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
||||
|
import { getDictFormData } from '@/api/dict' |
||||
|
import Dialog from './dialog.vue' |
||||
|
import Dialoglog from './dialoglog.vue' |
||||
|
import Yg from './yg.vue' |
||||
|
// eslint-disable-next-line vue/require-prop-types |
||||
|
const { addShow, title } = defineProps(['addShow', 'title']) |
||||
|
const data = reactive({ |
||||
|
formInline:{ |
||||
|
region:'', |
||||
|
}, |
||||
|
title:"", |
||||
|
addPostBox: false, |
||||
|
edPostBox:false, |
||||
|
ygPostBox:false, |
||||
|
}) |
||||
|
const orgTreeProps ={ |
||||
|
label: 'name', |
||||
|
children:'child' |
||||
|
} |
||||
|
const orgTreeProp ={ |
||||
|
label: 'title', |
||||
|
children:'childen' |
||||
|
} |
||||
|
const formdat = { |
||||
|
someProp:"", |
||||
|
} |
||||
|
const total =ref(0) |
||||
|
const rowInfo = ref<any>({}) |
||||
|
const postIds = ref<number[]>([]) |
||||
|
const tableData = ref<any>([]); |
||||
|
const tables = ref<any>([]); |
||||
|
// 获取侧栏数据 |
||||
|
function jjjs(){ |
||||
|
addPostCont("/hrapi/org/govthree","post") |
||||
|
.then(data => { |
||||
|
tableData.value = data.data[3].child[14].child; |
||||
|
}) |
||||
|
.catch(error => { |
||||
|
console.error('Error fetching data:', error); |
||||
|
}); |
||||
|
} |
||||
|
jjjs() |
||||
|
function editPost(){ |
||||
|
editPostCont({}) |
||||
|
.then(data => { |
||||
|
tables.value = data.data.list; |
||||
|
}) |
||||
|
} |
||||
|
editPost() |
||||
|
const table = ref<any>([]) |
||||
|
const formdate = reactive({ |
||||
|
page:0, |
||||
|
pagesize:20, |
||||
|
name:"", |
||||
|
dimension:"", |
||||
|
attribute:"", |
||||
|
orgidlist:"", |
||||
|
type:"", |
||||
|
value1:"2023", |
||||
|
}) |
||||
|
// 获取数据 |
||||
|
const tableq = ref([]) |
||||
|
const postt = ()=>{ |
||||
|
const ass = new Date(formdate.value1); |
||||
|
const qwe = ass.getFullYear(); |
||||
|
const zjr = qwe.toString(); |
||||
|
departmentprogramme({orgid:formdate.orgidlist,year:zjr,version:formdate.name}) |
||||
|
.then(data => { |
||||
|
tableq.value = data.data; |
||||
|
total.value = data.data.count; |
||||
|
}) |
||||
|
} |
||||
|
// 新增数据 |
||||
|
const addtableData = ()=>{ |
||||
|
data.addPostBox = true; |
||||
|
} |
||||
|
// 添加行 |
||||
|
const addRow = (val:any)=> { |
||||
|
tableData.value.push(val); |
||||
|
} |
||||
|
// 编辑行 |
||||
|
const editRow = (val:any)=> { |
||||
|
let index =tableData.value.findIndex( |
||||
|
(item:any) => item.id === val.id |
||||
|
); |
||||
|
tableData.value.splice(index, 1, val); |
||||
|
} |
||||
|
// 关闭弹窗 |
||||
|
const closeDetail = ()=>{ |
||||
|
data.addPostBox = false; |
||||
|
} |
||||
|
function editPostState(classId:string,state:number){ |
||||
|
console.log("改变状态--------->",classId,state) |
||||
|
let statusVal = 1 |
||||
|
if( state == 2) statusVal = 2; |
||||
|
edit_depart({id:classId,state:statusVal,istrue:2}) |
||||
|
postt() |
||||
|
} |
||||
|
// 删除数据 |
||||
|
const handleDel = (val:any) => { |
||||
|
const dictTypeIds = [val.outID || postIds.value].join(","); |
||||
|
let dictTypeIdAry = dictTypeIds.split(",") |
||||
|
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
||||
|
confirmButtonText: "确认", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
const add = val.key.toString() |
||||
|
handleSure(val) |
||||
|
console.log(val.id) |
||||
|
edit_depart({id:add,state:3,istrue:2}).then(()=> |
||||
|
ElMessage.success("删除成功")) |
||||
|
postt() |
||||
|
}) |
||||
|
}; |
||||
|
const handleSure = (val:any)=> { |
||||
|
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
||||
|
if(index!=-1){ |
||||
|
tableData.value.splice(index, 1); |
||||
|
} |
||||
|
} |
||||
|
const resetChecked=()=> { |
||||
|
formdate.orgidlist = "" |
||||
|
postt() |
||||
|
} |
||||
|
const handle=(data:any)=>{ |
||||
|
formdate.orgidlist = data.id.toString() |
||||
|
postt() |
||||
|
} |
||||
|
const handleErd=(val:any)=>{ |
||||
|
data.edPostBox=true; |
||||
|
rowInfo.value=val; |
||||
|
} |
||||
|
const handleio=(val:any)=>{ |
||||
|
data.ygPostBox=true; |
||||
|
rowInfo.value = val; |
||||
|
} |
||||
|
|
||||
|
const flitterData4 = (data:any)=>{ |
||||
|
let spanOneArr = [] as any[] |
||||
|
let concatOne = 0 |
||||
|
data.value.forEach((item:any,index:any)=>{ |
||||
|
if(index === 0){ |
||||
|
spanOneArr.push(1) |
||||
|
}else{ |
||||
|
//name 修改 |
||||
|
if(item.department === data.value[index - 1].department){ //第一列需合并相同内容的字段 |
||||
|
spanOneArr[concatOne] += 1 |
||||
|
spanOneArr.push(0) |
||||
|
}else{ |
||||
|
spanOneArr.push(1) |
||||
|
concatOne = index |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
return { |
||||
|
one: spanOneArr, |
||||
|
} |
||||
|
} |
||||
|
function objectSpanMethod({row, column, rowIndex, columnIndex}:any){ |
||||
|
if(columnIndex === 0 ) { |
||||
|
// this.tableData 修改 |
||||
|
const _row = (flitterData4(tableq).one)[rowIndex] |
||||
|
const _col = _row > 0 ? 1 : 0 |
||||
|
return { |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
onMounted(()=>{ |
||||
|
jjjs() |
||||
|
postt() |
||||
|
}) |
||||
|
</script> |
||||
|
<template> |
||||
|
<div class="m-2"> |
||||
|
<el-container clss="m-4"> |
||||
|
<div class="qwe"> |
||||
|
<el-button type="primary" style="width: 140px" size="large" @click="resetChecked">全选</el-button> |
||||
|
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @node-click="handle"/> |
||||
|
</div> |
||||
|
<el-divider direction="vertical"/> |
||||
|
<el-col :span="22"> |
||||
|
<el-container class="wer"> |
||||
|
<el-form-item label="方案版本号:"> |
||||
|
<el-input v-model="formdate.name" placeholder="请输入方案版本号" clearable style="width:200px"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="年度:" label-width="90"> |
||||
|
<el-date-picker v-model="formdate.value1" type="year"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label-width="25"> |
||||
|
<el-button type="primary" @click="postt"><el-icon><Search /></el-icon>查询</el-button> |
||||
|
<el-button class="new_btn" type="warning" @click="addtableData"><el-icon><Plus /></el-icon>新增</el-button> |
||||
|
</el-form-item> |
||||
|
</el-container> |
||||
|
<el-table class="m-1" :data="tableq" :span-method="objectSpanMethod" border style="width: 100%"> |
||||
|
<el-table-column prop="groupname,deaprtname," label="部门"> |
||||
|
<template #default="scope"> |
||||
|
{{scope.row.groupname}}{{scope.row.deaprtname}} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="year" label="年" width="70"/> |
||||
|
<el-table-column prop="key" label="版本号"/> |
||||
|
<el-table-column prop="time" label="时间" /> |
||||
|
<el-table-column prop="state" label="状态" width="70"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch v-model="scope.row.state" class="ml-2" :inactive-value="1" :active-value="2" inline-prompt style="--el-switch-on-color: #ff4949; --el-switch-off-color: #13ce66" @change="editPostState(scope.row.key,scope.row.state)"/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column fixed="right" label="操作" width="228"> |
||||
|
<template #default="{ row }"> |
||||
|
<el-button type="primary" link @click="handleio(row)"><el-icon><View /></el-icon>查看详情</el-button> |
||||
|
<el-button type="primary" link @click="handleErd(row)"><el-icon><DocumentChecked /></el-icon>复制</el-button> |
||||
|
<el-button type="primary" link @click="handleDel(row)"><el-icon><Delete /></el-icon>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-col> |
||||
|
</el-container> |
||||
|
<pagination v-if="total > 0" v-model:page="formdate.page" v-model:pagesize="formdate.pagesize" :total="total" @click="postt"/> |
||||
|
<Dialog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Dialog> |
||||
|
<Dialoglog v-if="data.edPostBox" v-model="data.edPostBox" :title="title" :row-info="rowInfo"></Dialoglog> |
||||
|
<Yg v-if="data.ygPostBox" v-model="data.ygPostBox" :title="title" :row-info="rowInfo"></Yg> |
||||
|
</div> |
||||
|
</template> |
||||
|
<style lang='scss' scoped> |
||||
|
.qwe { |
||||
|
margin:-8px 0 0 -6px; |
||||
|
float:right; |
||||
|
} |
||||
|
.wer{ |
||||
|
margin:-5px 0 0 20px; |
||||
|
font-weight:normal; |
||||
|
} |
||||
|
.horizontal-controls { |
||||
|
display: flex; |
||||
|
float: left; |
||||
|
|
||||
|
} |
||||
|
.el-divider--vertical{ |
||||
|
display:inline-block; |
||||
|
width:1px; |
||||
|
height:812px; |
||||
|
margin:0 8px; |
||||
|
vertical-align:middle; |
||||
|
position:relative; |
||||
|
} |
||||
|
|
||||
|
/* 可以根据需要调整样式 */ |
||||
|
</style> |
||||
@ -0,0 +1,265 @@ |
|||||
|
<!-- |
||||
|
@ 作者: 鲁智强 |
||||
|
@ 时间: 2023-09-19 09:13:14 |
||||
|
@ 备注: |
||||
|
--> |
||||
|
<script lang='ts' setup> |
||||
|
import {ref,reactive,onMounted} from 'vue' |
||||
|
import { organdpost,posttarget,set_posttarget } from '@/api/opk/api' |
||||
|
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
||||
|
import { editPostCont } from '@/api/opk/pulic/api' |
||||
|
import { departmentprogramme,edit_depart,edit_depart_progra } from '@/api/opk/news/api' |
||||
|
import { ge_copy } from '@/api/opk/zxy/news/api' |
||||
|
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
||||
|
import { getDictFormData } from '@/api/dict' |
||||
|
import Dialog from './dialog.vue' |
||||
|
import Dialoglog from './dialoglog.vue' |
||||
|
import Yg from './yg.vue' |
||||
|
// eslint-disable-next-line vue/require-prop-types |
||||
|
const { addShow, title } = defineProps(['addShow', 'title']) |
||||
|
const data = reactive({ |
||||
|
formInline:{ |
||||
|
region:'', |
||||
|
}, |
||||
|
title:"", |
||||
|
addPostBox: false, |
||||
|
edPostBox:false, |
||||
|
ygPostBox:false, |
||||
|
}) |
||||
|
const orgTreeProps ={ |
||||
|
label: 'name', |
||||
|
children:'child' |
||||
|
} |
||||
|
const orgTreeProp ={ |
||||
|
label: 'title', |
||||
|
children:'childen' |
||||
|
} |
||||
|
const formdat = { |
||||
|
someProp:"", |
||||
|
} |
||||
|
const total =ref(0) |
||||
|
const rowInfo = ref<any>({}) |
||||
|
const postIds = ref<number[]>([]) |
||||
|
const tableData = ref<any>([]); |
||||
|
const tables = ref<any>([]); |
||||
|
// 获取侧栏数据 |
||||
|
function jjjs(){ |
||||
|
addPostCont("/hrapi/org/govthree","post") |
||||
|
.then(data => { |
||||
|
tableData.value = data.data[3].child[14].child; |
||||
|
}) |
||||
|
.catch(error => { |
||||
|
console.error('Error fetching data:', error); |
||||
|
}); |
||||
|
} |
||||
|
jjjs() |
||||
|
function editPost(){ |
||||
|
editPostCont({}) |
||||
|
.then(data => { |
||||
|
tables.value = data.data.list; |
||||
|
}) |
||||
|
} |
||||
|
editPost() |
||||
|
const table = ref<any>([]) |
||||
|
const formdate = reactive({ |
||||
|
page:0, |
||||
|
pagesize:20, |
||||
|
name:"", |
||||
|
dimension:"", |
||||
|
attribute:"", |
||||
|
orgidlist:"", |
||||
|
type:"", |
||||
|
value1:"2023", |
||||
|
}) |
||||
|
// 获取数据 |
||||
|
const tableq = ref([]) |
||||
|
const postt = ()=>{ |
||||
|
const ass = new Date(formdate.value1); |
||||
|
const qwe = ass.getFullYear(); |
||||
|
const zjr = qwe.toString(); |
||||
|
departmentprogramme({orgid:formdate.orgidlist,year:zjr,version:formdate.name}) |
||||
|
.then(data => { |
||||
|
tableq.value = data.data; |
||||
|
total.value = data.data.count; |
||||
|
}) |
||||
|
} |
||||
|
// 新增数据 |
||||
|
const addtableData = ()=>{ |
||||
|
data.addPostBox = true; |
||||
|
} |
||||
|
// 添加行 |
||||
|
const addRow = (val:any)=> { |
||||
|
tableData.value.push(val); |
||||
|
} |
||||
|
// 编辑行 |
||||
|
const editRow = (val:any)=> { |
||||
|
let index =tableData.value.findIndex( |
||||
|
(item:any) => item.id === val.id |
||||
|
); |
||||
|
tableData.value.splice(index, 1, val); |
||||
|
} |
||||
|
// 关闭弹窗 |
||||
|
const closeDetail = ()=>{ |
||||
|
data.addPostBox = false; |
||||
|
} |
||||
|
function editPostState(classId:string,state:number){ |
||||
|
console.log("改变状态--------->",classId,state) |
||||
|
let statusVal = 1 |
||||
|
if( state == 1) statusVal = 2; |
||||
|
edit_depart({id:classId,state:statusVal,istrue:2}) |
||||
|
postt() |
||||
|
} |
||||
|
// 删除数据 |
||||
|
const handleDel = (val:any) => { |
||||
|
const dictTypeIds = [val.outID || postIds.value].join(","); |
||||
|
let dictTypeIdAry = dictTypeIds.split(",") |
||||
|
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
||||
|
confirmButtonText: "确认", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
const add = val.key.toString() |
||||
|
handleSure(val) |
||||
|
console.log(val.id) |
||||
|
edit_depart({id:add,state:3,istrue:2}).then(()=> |
||||
|
ElMessage.success("删除成功")) |
||||
|
postt() |
||||
|
}) |
||||
|
}; |
||||
|
const handleSure = (val:any)=> { |
||||
|
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
||||
|
if(index!=-1){ |
||||
|
tableData.value.splice(index, 1); |
||||
|
} |
||||
|
} |
||||
|
const resetChecked=()=> { |
||||
|
formdate.orgidlist = "" |
||||
|
postt() |
||||
|
} |
||||
|
const handle=(data:any)=>{ |
||||
|
formdate.orgidlist = data.id.toString() |
||||
|
postt() |
||||
|
} |
||||
|
const handleErd=(val:any)=>{ |
||||
|
data.edPostBox=true; |
||||
|
rowInfo.value=val; |
||||
|
} |
||||
|
const handleio=(val:any)=>{ |
||||
|
data.ygPostBox=true; |
||||
|
rowInfo.value = val; |
||||
|
} |
||||
|
|
||||
|
const flitterData4 = (data:any)=>{ |
||||
|
let spanOneArr = [] as any[] |
||||
|
let concatOne = 0 |
||||
|
data.value.forEach((item:any,index:any)=>{ |
||||
|
if(index === 0){ |
||||
|
spanOneArr.push(1) |
||||
|
}else{ |
||||
|
//name 修改 |
||||
|
if(item.department === data.value[index - 1].department){ //第一列需合并相同内容的字段 |
||||
|
spanOneArr[concatOne] += 1 |
||||
|
spanOneArr.push(0) |
||||
|
}else{ |
||||
|
spanOneArr.push(1) |
||||
|
concatOne = index |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
return { |
||||
|
one: spanOneArr, |
||||
|
} |
||||
|
} |
||||
|
function objectSpanMethod({row, column, rowIndex, columnIndex}:any){ |
||||
|
if(columnIndex === 0 ) { |
||||
|
// this.tableData 修改 |
||||
|
const _row = (flitterData4(tableq).one)[rowIndex] |
||||
|
const _col = _row > 0 ? 1 : 0 |
||||
|
return { |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
onMounted(()=>{ |
||||
|
jjjs() |
||||
|
postt() |
||||
|
}) |
||||
|
</script> |
||||
|
<template> |
||||
|
<div class="m-2"> |
||||
|
<el-container clss="m-4"> |
||||
|
<div class="qwe"> |
||||
|
<el-button type="primary" style="width: 140px" size="large" @click="resetChecked">全选</el-button> |
||||
|
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @node-click="handle"/> |
||||
|
</div> |
||||
|
<el-divider direction="vertical"/> |
||||
|
<el-col :span="22"> |
||||
|
<el-container class="wer"> |
||||
|
<el-form-item label="方案版本号:"> |
||||
|
<el-input v-model="formdate.name" placeholder="请输入方案版本号" clearable style="width:200px"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="年度:" label-width="90"> |
||||
|
<el-date-picker v-model="formdate.value1" type="year"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label-width="25"> |
||||
|
<el-button type="primary" @click="postt"><el-icon><Search /></el-icon>查询</el-button> |
||||
|
<el-button class="new_btn" type="warning" @click="addtableData"><el-icon><Plus /></el-icon>新增</el-button> |
||||
|
</el-form-item> |
||||
|
</el-container> |
||||
|
<el-table class="m-1" :data="tableq" :span-method="objectSpanMethod" border style="width: 100%"> |
||||
|
<el-table-column prop="groupname,deaprtname," label="部门"> |
||||
|
<template #default="scope"> |
||||
|
{{scope.row.groupname}}{{scope.row.deaprtname}} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="year" label="年" width="70"/> |
||||
|
<el-table-column prop="key" label="版本号"/> |
||||
|
<el-table-column prop="time" label="时间" /> |
||||
|
<el-table-column prop="state" label="状态" width="70"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch v-model="scope.row.state" class="ml-2" :inactive-value="1" :active-value="2" inline-prompt style="--el-switch-on-color: #ff4949; --el-switch-off-color: #13ce66" @change="editPostState(scope.row.key,scope.row.state)"/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column fixed="right" label="操作" width="228"> |
||||
|
<template #default="{ row }"> |
||||
|
<el-button type="primary" link @click="handleio(row)"><el-icon><View /></el-icon>查看详情</el-button> |
||||
|
<el-button type="primary" link @click="handleErd(row)"><el-icon><DocumentChecked /></el-icon>复制</el-button> |
||||
|
<el-button type="primary" link @click="handleDel(row)"><el-icon><Delete /></el-icon>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-col> |
||||
|
</el-container> |
||||
|
<pagination v-if="total > 0" v-model:page="formdate.page" v-model:pagesize="formdate.pagesize" :total="total" @click="postt"/> |
||||
|
<Dialog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Dialog> |
||||
|
<Dialoglog v-if="data.edPostBox" v-model="data.edPostBox" :title="title" :row-info="rowInfo"></Dialoglog> |
||||
|
<Yg v-if="data.ygPostBox" v-model="data.ygPostBox" :title="title" :row-info="rowInfo"></Yg> |
||||
|
</div> |
||||
|
</template> |
||||
|
<style lang='scss' scoped> |
||||
|
.qwe { |
||||
|
margin:-8px 0 0 -6px; |
||||
|
float:right; |
||||
|
} |
||||
|
.wer{ |
||||
|
margin:-5px 0 0 20px; |
||||
|
font-weight:normal; |
||||
|
} |
||||
|
.horizontal-controls { |
||||
|
display: flex; |
||||
|
float: left; |
||||
|
|
||||
|
} |
||||
|
.el-divider--vertical{ |
||||
|
display:inline-block; |
||||
|
width:1px; |
||||
|
height:812px; |
||||
|
margin:0 8px; |
||||
|
vertical-align:middle; |
||||
|
position:relative; |
||||
|
} |
||||
|
|
||||
|
/* 可以根据需要调整样式 */ |
||||
|
</style> |
||||
@ -0,0 +1,265 @@ |
|||||
|
<!-- |
||||
|
@ 作者: 鲁智强 |
||||
|
@ 时间: 2023-09-19 09:13:14 |
||||
|
@ 备注: |
||||
|
--> |
||||
|
<script lang='ts' setup> |
||||
|
import {ref,reactive,onMounted} from 'vue' |
||||
|
import { organdpost,posttarget,set_posttarget } from '@/api/opk/api' |
||||
|
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
||||
|
import { editPostCont } from '@/api/opk/pulic/api' |
||||
|
import { departmentprogramme,edit_depart,edit_depart_progra } from '@/api/opk/news/api' |
||||
|
import { ge_copy } from '@/api/opk/zxy/news/api' |
||||
|
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
||||
|
import { getDictFormData } from '@/api/dict' |
||||
|
import Dialog from './dialog.vue' |
||||
|
import Dialoglog from './dialoglog.vue' |
||||
|
import Yg from './yg.vue' |
||||
|
// eslint-disable-next-line vue/require-prop-types |
||||
|
const { addShow, title } = defineProps(['addShow', 'title']) |
||||
|
const data = reactive({ |
||||
|
formInline:{ |
||||
|
region:'', |
||||
|
}, |
||||
|
title:"", |
||||
|
addPostBox: false, |
||||
|
edPostBox:false, |
||||
|
ygPostBox:false, |
||||
|
}) |
||||
|
const orgTreeProps ={ |
||||
|
label: 'name', |
||||
|
children:'child' |
||||
|
} |
||||
|
const orgTreeProp ={ |
||||
|
label: 'title', |
||||
|
children:'childen' |
||||
|
} |
||||
|
const formdat = { |
||||
|
someProp:"", |
||||
|
} |
||||
|
const total =ref(0) |
||||
|
const rowInfo = ref<any>({}) |
||||
|
const postIds = ref<number[]>([]) |
||||
|
const tableData = ref<any>([]); |
||||
|
const tables = ref<any>([]); |
||||
|
// 获取侧栏数据 |
||||
|
function jjjs(){ |
||||
|
addPostCont("/hrapi/org/govthree","post") |
||||
|
.then(data => { |
||||
|
tableData.value = data.data[3].child[14].child; |
||||
|
}) |
||||
|
.catch(error => { |
||||
|
console.error('Error fetching data:', error); |
||||
|
}); |
||||
|
} |
||||
|
jjjs() |
||||
|
function editPost(){ |
||||
|
editPostCont({}) |
||||
|
.then(data => { |
||||
|
tables.value = data.data.list; |
||||
|
}) |
||||
|
} |
||||
|
editPost() |
||||
|
const table = ref<any>([]) |
||||
|
const formdate = reactive({ |
||||
|
page:0, |
||||
|
pagesize:20, |
||||
|
name:"", |
||||
|
dimension:"", |
||||
|
attribute:"", |
||||
|
orgidlist:"", |
||||
|
type:"", |
||||
|
value1:"2023", |
||||
|
}) |
||||
|
// 获取数据 |
||||
|
const tableq = ref([]) |
||||
|
const postt = ()=>{ |
||||
|
const ass = new Date(formdate.value1); |
||||
|
const qwe = ass.getFullYear(); |
||||
|
const zjr = qwe.toString(); |
||||
|
departmentprogramme({orgid:formdate.orgidlist,year:zjr,version:formdate.name}) |
||||
|
.then(data => { |
||||
|
tableq.value = data.data; |
||||
|
total.value = data.data.count; |
||||
|
}) |
||||
|
} |
||||
|
// 新增数据 |
||||
|
const addtableData = ()=>{ |
||||
|
data.addPostBox = true; |
||||
|
} |
||||
|
// 添加行 |
||||
|
const addRow = (val:any)=> { |
||||
|
tableData.value.push(val); |
||||
|
} |
||||
|
// 编辑行 |
||||
|
const editRow = (val:any)=> { |
||||
|
let index =tableData.value.findIndex( |
||||
|
(item:any) => item.id === val.id |
||||
|
); |
||||
|
tableData.value.splice(index, 1, val); |
||||
|
} |
||||
|
// 关闭弹窗 |
||||
|
const closeDetail = ()=>{ |
||||
|
data.addPostBox = false; |
||||
|
} |
||||
|
function editPostState(classId:string,state:number){ |
||||
|
console.log("改变状态--------->",classId,state) |
||||
|
let statusVal = 1 |
||||
|
if( state == 2) statusVal = 2; |
||||
|
edit_depart({id:classId,state:statusVal,istrue:2}) |
||||
|
postt() |
||||
|
} |
||||
|
// 删除数据 |
||||
|
const handleDel = (val:any) => { |
||||
|
const dictTypeIds = [val.outID || postIds.value].join(","); |
||||
|
let dictTypeIdAry = dictTypeIds.split(",") |
||||
|
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
||||
|
confirmButtonText: "确认", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
const add = val.key.toString() |
||||
|
handleSure(val) |
||||
|
console.log(val.id) |
||||
|
edit_depart({id:add,state:3,istrue:2}).then(()=> |
||||
|
ElMessage.success("删除成功")) |
||||
|
postt() |
||||
|
}) |
||||
|
}; |
||||
|
const handleSure = (val:any)=> { |
||||
|
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
||||
|
if(index!=-1){ |
||||
|
tableData.value.splice(index, 1); |
||||
|
} |
||||
|
} |
||||
|
const resetChecked=()=> { |
||||
|
formdate.orgidlist = "" |
||||
|
postt() |
||||
|
} |
||||
|
const handle=(data:any)=>{ |
||||
|
formdate.orgidlist = data.id.toString() |
||||
|
postt() |
||||
|
} |
||||
|
const handleErd=(val:any)=>{ |
||||
|
data.edPostBox=true; |
||||
|
rowInfo.value=val; |
||||
|
} |
||||
|
const handleio=(val:any)=>{ |
||||
|
data.ygPostBox=true; |
||||
|
rowInfo.value = val; |
||||
|
} |
||||
|
|
||||
|
const flitterData4 = (data:any)=>{ |
||||
|
let spanOneArr = [] as any[] |
||||
|
let concatOne = 0 |
||||
|
data.value.forEach((item:any,index:any)=>{ |
||||
|
if(index === 0){ |
||||
|
spanOneArr.push(1) |
||||
|
}else{ |
||||
|
//name 修改 |
||||
|
if(item.department === data.value[index - 1].department){ //第一列需合并相同内容的字段 |
||||
|
spanOneArr[concatOne] += 1 |
||||
|
spanOneArr.push(0) |
||||
|
}else{ |
||||
|
spanOneArr.push(1) |
||||
|
concatOne = index |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
return { |
||||
|
one: spanOneArr, |
||||
|
} |
||||
|
} |
||||
|
function objectSpanMethod({row, column, rowIndex, columnIndex}:any){ |
||||
|
if(columnIndex === 0 ) { |
||||
|
// this.tableData 修改 |
||||
|
const _row = (flitterData4(tableq).one)[rowIndex] |
||||
|
const _col = _row > 0 ? 1 : 0 |
||||
|
return { |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
onMounted(()=>{ |
||||
|
jjjs() |
||||
|
postt() |
||||
|
}) |
||||
|
</script> |
||||
|
<template> |
||||
|
<div class="m-2"> |
||||
|
<el-container clss="m-4"> |
||||
|
<div class="qwe"> |
||||
|
<el-button type="primary" style="width: 140px" size="large" @click="resetChecked">全选</el-button> |
||||
|
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @node-click="handle"/> |
||||
|
</div> |
||||
|
<el-divider direction="vertical"/> |
||||
|
<el-col :span="22"> |
||||
|
<el-container class="wer"> |
||||
|
<el-form-item label="方案版本号:"> |
||||
|
<el-input v-model="formdate.name" placeholder="请输入方案版本号" clearable style="width:200px"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="年度:" label-width="90"> |
||||
|
<el-date-picker v-model="formdate.value1" type="year"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label-width="25"> |
||||
|
<el-button type="primary" @click="postt"><el-icon><Search /></el-icon>查询</el-button> |
||||
|
<el-button class="new_btn" type="warning" @click="addtableData"><el-icon><Plus /></el-icon>新增</el-button> |
||||
|
</el-form-item> |
||||
|
</el-container> |
||||
|
<el-table class="m-1" :data="tableq" :span-method="objectSpanMethod" border style="width: 100%"> |
||||
|
<el-table-column prop="groupname,deaprtname," label="部门"> |
||||
|
<template #default="scope"> |
||||
|
{{scope.row.groupname}}{{scope.row.deaprtname}} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="year" label="年" width="70"/> |
||||
|
<el-table-column prop="key" label="版本号"/> |
||||
|
<el-table-column prop="time" label="时间" /> |
||||
|
<el-table-column prop="state" label="状态" width="70"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch v-model="scope.row.state" class="ml-2" :inactive-value="1" :active-value="2" inline-prompt style="--el-switch-on-color: #ff4949; --el-switch-off-color: #13ce66" @change="editPostState(scope.row.key,scope.row.state)"/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column fixed="right" label="操作" width="228"> |
||||
|
<template #default="{ row }"> |
||||
|
<el-button type="primary" link @click="handleio(row)"><el-icon><View /></el-icon>查看详情</el-button> |
||||
|
<el-button type="primary" link @click="handleErd(row)"><el-icon><DocumentChecked /></el-icon>复制</el-button> |
||||
|
<el-button type="primary" link @click="handleDel(row)"><el-icon><Delete /></el-icon>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-col> |
||||
|
</el-container> |
||||
|
<pagination v-if="total > 0" v-model:page="formdate.page" v-model:pagesize="formdate.pagesize" :total="total" @click="postt"/> |
||||
|
<Dialog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Dialog> |
||||
|
<Dialoglog v-if="data.edPostBox" v-model="data.edPostBox" :title="title" :row-info="rowInfo"></Dialoglog> |
||||
|
<Yg v-if="data.ygPostBox" v-model="data.ygPostBox" :title="title" :row-info="rowInfo"></Yg> |
||||
|
</div> |
||||
|
</template> |
||||
|
<style lang='scss' scoped> |
||||
|
.qwe { |
||||
|
margin:-8px 0 0 -6px; |
||||
|
float:right; |
||||
|
} |
||||
|
.wer{ |
||||
|
margin:-5px 0 0 20px; |
||||
|
font-weight:normal; |
||||
|
} |
||||
|
.horizontal-controls { |
||||
|
display: flex; |
||||
|
float: left; |
||||
|
|
||||
|
} |
||||
|
.el-divider--vertical{ |
||||
|
display:inline-block; |
||||
|
width:1px; |
||||
|
height:812px; |
||||
|
margin:0 8px; |
||||
|
vertical-align:middle; |
||||
|
position:relative; |
||||
|
} |
||||
|
|
||||
|
/* 可以根据需要调整样式 */ |
||||
|
</style> |
||||
@ -0,0 +1,265 @@ |
|||||
|
<!-- |
||||
|
@ 作者: 鲁智强 |
||||
|
@ 时间: 2023-09-19 09:13:14 |
||||
|
@ 备注: |
||||
|
--> |
||||
|
<script lang='ts' setup> |
||||
|
import {ref,reactive,onMounted} from 'vue' |
||||
|
import { organdpost,posttarget,set_posttarget } from '@/api/opk/api' |
||||
|
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
||||
|
import { editPostCont } from '@/api/opk/pulic/api' |
||||
|
import { departmentprogramme,edit_depart,edit_depart_progra } from '@/api/opk/news/api' |
||||
|
import { ge_copy } from '@/api/opk/zxy/news/api' |
||||
|
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
||||
|
import { getDictFormData } from '@/api/dict' |
||||
|
import Dialog from './dialog.vue' |
||||
|
import Dialoglog from './dialoglog.vue' |
||||
|
import Yg from './yg.vue' |
||||
|
// eslint-disable-next-line vue/require-prop-types |
||||
|
const { addShow, title } = defineProps(['addShow', 'title']) |
||||
|
const data = reactive({ |
||||
|
formInline:{ |
||||
|
region:'', |
||||
|
}, |
||||
|
title:"", |
||||
|
addPostBox: false, |
||||
|
edPostBox:false, |
||||
|
ygPostBox:false, |
||||
|
}) |
||||
|
const orgTreeProps ={ |
||||
|
label: 'name', |
||||
|
children:'child' |
||||
|
} |
||||
|
const orgTreeProp ={ |
||||
|
label: 'title', |
||||
|
children:'childen' |
||||
|
} |
||||
|
const formdat = { |
||||
|
someProp:"", |
||||
|
} |
||||
|
const total =ref(0) |
||||
|
const rowInfo = ref<any>({}) |
||||
|
const postIds = ref<number[]>([]) |
||||
|
const tableData = ref<any>([]); |
||||
|
const tables = ref<any>([]); |
||||
|
// 获取侧栏数据 |
||||
|
function jjjs(){ |
||||
|
addPostCont("/hrapi/org/govthree","post") |
||||
|
.then(data => { |
||||
|
tableData.value = data.data[3].child[14].child; |
||||
|
}) |
||||
|
.catch(error => { |
||||
|
console.error('Error fetching data:', error); |
||||
|
}); |
||||
|
} |
||||
|
jjjs() |
||||
|
function editPost(){ |
||||
|
editPostCont({}) |
||||
|
.then(data => { |
||||
|
tables.value = data.data.list; |
||||
|
}) |
||||
|
} |
||||
|
editPost() |
||||
|
const table = ref<any>([]) |
||||
|
const formdate = reactive({ |
||||
|
page:0, |
||||
|
pagesize:20, |
||||
|
name:"", |
||||
|
dimension:"", |
||||
|
attribute:"", |
||||
|
orgidlist:"", |
||||
|
type:"", |
||||
|
value1:"2023", |
||||
|
}) |
||||
|
// 获取数据 |
||||
|
const tableq = ref([]) |
||||
|
const postt = ()=>{ |
||||
|
const ass = new Date(formdate.value1); |
||||
|
const qwe = ass.getFullYear(); |
||||
|
const zjr = qwe.toString(); |
||||
|
departmentprogramme({orgid:formdate.orgidlist,year:zjr,version:formdate.name}) |
||||
|
.then(data => { |
||||
|
tableq.value = data.data; |
||||
|
total.value = data.data.count; |
||||
|
}) |
||||
|
} |
||||
|
// 新增数据 |
||||
|
const addtableData = ()=>{ |
||||
|
data.addPostBox = true; |
||||
|
} |
||||
|
// 添加行 |
||||
|
const addRow = (val:any)=> { |
||||
|
tableData.value.push(val); |
||||
|
} |
||||
|
// 编辑行 |
||||
|
const editRow = (val:any)=> { |
||||
|
let index =tableData.value.findIndex( |
||||
|
(item:any) => item.id === val.id |
||||
|
); |
||||
|
tableData.value.splice(index, 1, val); |
||||
|
} |
||||
|
// 关闭弹窗 |
||||
|
const closeDetail = ()=>{ |
||||
|
data.addPostBox = false; |
||||
|
} |
||||
|
function editPostState(classId:string,state:number){ |
||||
|
console.log("改变状态--------->",classId,state) |
||||
|
let statusVal = 1 |
||||
|
if( state == 1) statusVal = 2; |
||||
|
edit_depart({id:classId,state:statusVal,istrue:2}) |
||||
|
postt() |
||||
|
} |
||||
|
// 删除数据 |
||||
|
const handleDel = (val:any) => { |
||||
|
const dictTypeIds = [val.outID || postIds.value].join(","); |
||||
|
let dictTypeIdAry = dictTypeIds.split(",") |
||||
|
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
||||
|
confirmButtonText: "确认", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
const add = val.key.toString() |
||||
|
handleSure(val) |
||||
|
console.log(val.id) |
||||
|
edit_depart({id:add,state:3,istrue:2}).then(()=> |
||||
|
ElMessage.success("删除成功")) |
||||
|
postt() |
||||
|
}) |
||||
|
}; |
||||
|
const handleSure = (val:any)=> { |
||||
|
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
||||
|
if(index!=-1){ |
||||
|
tableData.value.splice(index, 1); |
||||
|
} |
||||
|
} |
||||
|
const resetChecked=()=> { |
||||
|
formdate.orgidlist = "" |
||||
|
postt() |
||||
|
} |
||||
|
const handle=(data:any)=>{ |
||||
|
formdate.orgidlist = data.id.toString() |
||||
|
postt() |
||||
|
} |
||||
|
const handleErd=(val:any)=>{ |
||||
|
data.edPostBox=true; |
||||
|
rowInfo.value=val; |
||||
|
} |
||||
|
const handleio=(val:any)=>{ |
||||
|
data.ygPostBox=true; |
||||
|
rowInfo.value = val; |
||||
|
} |
||||
|
|
||||
|
const flitterData4 = (data:any)=>{ |
||||
|
let spanOneArr = [] as any[] |
||||
|
let concatOne = 0 |
||||
|
data.value.forEach((item:any,index:any)=>{ |
||||
|
if(index === 0){ |
||||
|
spanOneArr.push(1) |
||||
|
}else{ |
||||
|
//name 修改 |
||||
|
if(item.department === data.value[index - 1].department){ //第一列需合并相同内容的字段 |
||||
|
spanOneArr[concatOne] += 1 |
||||
|
spanOneArr.push(0) |
||||
|
}else{ |
||||
|
spanOneArr.push(1) |
||||
|
concatOne = index |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
return { |
||||
|
one: spanOneArr, |
||||
|
} |
||||
|
} |
||||
|
function objectSpanMethod({row, column, rowIndex, columnIndex}:any){ |
||||
|
if(columnIndex === 0 ) { |
||||
|
// this.tableData 修改 |
||||
|
const _row = (flitterData4(tableq).one)[rowIndex] |
||||
|
const _col = _row > 0 ? 1 : 0 |
||||
|
return { |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
onMounted(()=>{ |
||||
|
jjjs() |
||||
|
postt() |
||||
|
}) |
||||
|
</script> |
||||
|
<template> |
||||
|
<div class="m-2"> |
||||
|
<el-container clss="m-4"> |
||||
|
<div class="qwe"> |
||||
|
<el-button type="primary" style="width: 140px" size="large" @click="resetChecked">全选</el-button> |
||||
|
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @node-click="handle"/> |
||||
|
</div> |
||||
|
<el-divider direction="vertical"/> |
||||
|
<el-col :span="22"> |
||||
|
<el-container class="wer"> |
||||
|
<el-form-item label="方案版本号:"> |
||||
|
<el-input v-model="formdate.name" placeholder="请输入方案版本号" clearable style="width:200px"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="年度:" label-width="90"> |
||||
|
<el-date-picker v-model="formdate.value1" type="year"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label-width="25"> |
||||
|
<el-button type="primary" @click="postt"><el-icon><Search /></el-icon>查询</el-button> |
||||
|
<el-button class="new_btn" type="warning" @click="addtableData"><el-icon><Plus /></el-icon>新增</el-button> |
||||
|
</el-form-item> |
||||
|
</el-container> |
||||
|
<el-table class="m-1" :data="tableq" :span-method="objectSpanMethod" border style="width: 100%"> |
||||
|
<el-table-column prop="groupname,deaprtname," label="部门"> |
||||
|
<template #default="scope"> |
||||
|
{{scope.row.groupname}}{{scope.row.deaprtname}} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="year" label="年" width="70"/> |
||||
|
<el-table-column prop="key" label="版本号"/> |
||||
|
<el-table-column prop="time" label="时间" /> |
||||
|
<el-table-column prop="state" label="状态" width="70"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch v-model="scope.row.status" class="ml-2" inline-prompt style="--el-switch-on-color: #ff4949; --el-switch-off-color: #13ce66" @change="editPostState(scope.row.key,scope.row.state)"/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column fixed="right" label="操作" width="228"> |
||||
|
<template #default="{ row }"> |
||||
|
<el-button type="primary" link @click="handleio(row)"><el-icon><View /></el-icon>查看详情</el-button> |
||||
|
<el-button type="primary" link @click="handleErd(row)"><el-icon><DocumentChecked /></el-icon>复制</el-button> |
||||
|
<el-button type="primary" link @click="handleDel(row)"><el-icon><Delete /></el-icon>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-col> |
||||
|
</el-container> |
||||
|
<pagination v-if="total > 0" v-model:page="formdate.page" v-model:pagesize="formdate.pagesize" :total="total" @click="postt"/> |
||||
|
<Dialog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Dialog> |
||||
|
<Dialoglog v-if="data.edPostBox" v-model="data.edPostBox" :title="title" :row-info="rowInfo"></Dialoglog> |
||||
|
<Yg v-if="data.ygPostBox" v-model="data.ygPostBox" :title="title" :row-info="rowInfo"></Yg> |
||||
|
</div> |
||||
|
</template> |
||||
|
<style lang='scss' scoped> |
||||
|
.qwe { |
||||
|
margin:-8px 0 0 -6px; |
||||
|
float:right; |
||||
|
} |
||||
|
.wer{ |
||||
|
margin:-5px 0 0 20px; |
||||
|
font-weight:normal; |
||||
|
} |
||||
|
.horizontal-controls { |
||||
|
display: flex; |
||||
|
float: left; |
||||
|
|
||||
|
} |
||||
|
.el-divider--vertical{ |
||||
|
display:inline-block; |
||||
|
width:1px; |
||||
|
height:812px; |
||||
|
margin:0 8px; |
||||
|
vertical-align:middle; |
||||
|
position:relative; |
||||
|
} |
||||
|
|
||||
|
/* 可以根据需要调整样式 */ |
||||
|
</style> |
||||
@ -0,0 +1,265 @@ |
|||||
|
<!-- |
||||
|
@ 作者: 鲁智强 |
||||
|
@ 时间: 2023-09-19 09:13:14 |
||||
|
@ 备注: |
||||
|
--> |
||||
|
<script lang='ts' setup> |
||||
|
import {ref,reactive,onMounted} from 'vue' |
||||
|
import { organdpost,posttarget,set_posttarget } from '@/api/opk/api' |
||||
|
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
||||
|
import { editPostCont } from '@/api/opk/pulic/api' |
||||
|
import { departmentprogramme,edit_depart,edit_depart_progra } from '@/api/opk/news/api' |
||||
|
import { ge_copy } from '@/api/opk/zxy/news/api' |
||||
|
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
||||
|
import { getDictFormData } from '@/api/dict' |
||||
|
import Dialog from './dialog.vue' |
||||
|
import Dialoglog from './dialoglog.vue' |
||||
|
import Yg from './yg.vue' |
||||
|
// eslint-disable-next-line vue/require-prop-types |
||||
|
const { addShow, title } = defineProps(['addShow', 'title']) |
||||
|
const data = reactive({ |
||||
|
formInline:{ |
||||
|
region:'', |
||||
|
}, |
||||
|
title:"", |
||||
|
addPostBox: false, |
||||
|
edPostBox:false, |
||||
|
ygPostBox:false, |
||||
|
}) |
||||
|
const orgTreeProps ={ |
||||
|
label: 'name', |
||||
|
children:'child' |
||||
|
} |
||||
|
const orgTreeProp ={ |
||||
|
label: 'title', |
||||
|
children:'childen' |
||||
|
} |
||||
|
const formdat = { |
||||
|
someProp:"", |
||||
|
} |
||||
|
const total =ref(0) |
||||
|
const rowInfo = ref<any>({}) |
||||
|
const postIds = ref<number[]>([]) |
||||
|
const tableData = ref<any>([]); |
||||
|
const tables = ref<any>([]); |
||||
|
// 获取侧栏数据 |
||||
|
function jjjs(){ |
||||
|
addPostCont("/hrapi/org/govthree","post") |
||||
|
.then(data => { |
||||
|
tableData.value = data.data[3].child[14].child; |
||||
|
}) |
||||
|
.catch(error => { |
||||
|
console.error('Error fetching data:', error); |
||||
|
}); |
||||
|
} |
||||
|
jjjs() |
||||
|
function editPost(){ |
||||
|
editPostCont({}) |
||||
|
.then(data => { |
||||
|
tables.value = data.data.list; |
||||
|
}) |
||||
|
} |
||||
|
editPost() |
||||
|
const table = ref<any>([]) |
||||
|
const formdate = reactive({ |
||||
|
page:0, |
||||
|
pagesize:20, |
||||
|
name:"", |
||||
|
dimension:"", |
||||
|
attribute:"", |
||||
|
orgidlist:"", |
||||
|
type:"", |
||||
|
value1:"2023", |
||||
|
}) |
||||
|
// 获取数据 |
||||
|
const tableq = ref([]) |
||||
|
const postt = ()=>{ |
||||
|
const ass = new Date(formdate.value1); |
||||
|
const qwe = ass.getFullYear(); |
||||
|
const zjr = qwe.toString(); |
||||
|
departmentprogramme({orgid:formdate.orgidlist,year:zjr,version:formdate.name}) |
||||
|
.then(data => { |
||||
|
tableq.value = data.data; |
||||
|
total.value = data.data.count; |
||||
|
}) |
||||
|
} |
||||
|
// 新增数据 |
||||
|
const addtableData = ()=>{ |
||||
|
data.addPostBox = true; |
||||
|
} |
||||
|
// 添加行 |
||||
|
const addRow = (val:any)=> { |
||||
|
tableData.value.push(val); |
||||
|
} |
||||
|
// 编辑行 |
||||
|
const editRow = (val:any)=> { |
||||
|
let index =tableData.value.findIndex( |
||||
|
(item:any) => item.id === val.id |
||||
|
); |
||||
|
tableData.value.splice(index, 1, val); |
||||
|
} |
||||
|
// 关闭弹窗 |
||||
|
const closeDetail = ()=>{ |
||||
|
data.addPostBox = false; |
||||
|
} |
||||
|
function editPostState(classId:string,state:number){ |
||||
|
console.log("改变状态--------->",classId,state) |
||||
|
let statusVal = 1 |
||||
|
if( state == 1) statusVal = 2; |
||||
|
edit_depart({id:classId,state:statusVal,istrue:2}) |
||||
|
postt() |
||||
|
} |
||||
|
// 删除数据 |
||||
|
const handleDel = (val:any) => { |
||||
|
const dictTypeIds = [val.outID || postIds.value].join(","); |
||||
|
let dictTypeIdAry = dictTypeIds.split(",") |
||||
|
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
||||
|
confirmButtonText: "确认", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
const add = val.key.toString() |
||||
|
handleSure(val) |
||||
|
console.log(val.id) |
||||
|
edit_depart({id:add,state:3,istrue:2}).then(()=> |
||||
|
ElMessage.success("删除成功")) |
||||
|
postt() |
||||
|
}) |
||||
|
}; |
||||
|
const handleSure = (val:any)=> { |
||||
|
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
||||
|
if(index!=-1){ |
||||
|
tableData.value.splice(index, 1); |
||||
|
} |
||||
|
} |
||||
|
const resetChecked=()=> { |
||||
|
formdate.orgidlist = "" |
||||
|
postt() |
||||
|
} |
||||
|
const handle=(data:any)=>{ |
||||
|
formdate.orgidlist = data.id.toString() |
||||
|
postt() |
||||
|
} |
||||
|
const handleErd=(val:any)=>{ |
||||
|
data.edPostBox=true; |
||||
|
rowInfo.value=val; |
||||
|
} |
||||
|
const handleio=(val:any)=>{ |
||||
|
data.ygPostBox=true; |
||||
|
rowInfo.value = val; |
||||
|
} |
||||
|
|
||||
|
const flitterData4 = (data:any)=>{ |
||||
|
let spanOneArr = [] as any[] |
||||
|
let concatOne = 0 |
||||
|
data.value.forEach((item:any,index:any)=>{ |
||||
|
if(index === 0){ |
||||
|
spanOneArr.push(1) |
||||
|
}else{ |
||||
|
//name 修改 |
||||
|
if(item.department === data.value[index - 1].department){ //第一列需合并相同内容的字段 |
||||
|
spanOneArr[concatOne] += 1 |
||||
|
spanOneArr.push(0) |
||||
|
}else{ |
||||
|
spanOneArr.push(1) |
||||
|
concatOne = index |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
return { |
||||
|
one: spanOneArr, |
||||
|
} |
||||
|
} |
||||
|
function objectSpanMethod({row, column, rowIndex, columnIndex}:any){ |
||||
|
if(columnIndex === 0 ) { |
||||
|
// this.tableData 修改 |
||||
|
const _row = (flitterData4(tableq).one)[rowIndex] |
||||
|
const _col = _row > 0 ? 1 : 0 |
||||
|
return { |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
onMounted(()=>{ |
||||
|
jjjs() |
||||
|
postt() |
||||
|
}) |
||||
|
</script> |
||||
|
<template> |
||||
|
<div class="m-2"> |
||||
|
<el-container clss="m-4"> |
||||
|
<div class="qwe"> |
||||
|
<el-button type="primary" style="width: 140px" size="large" @click="resetChecked">全选</el-button> |
||||
|
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @node-click="handle"/> |
||||
|
</div> |
||||
|
<el-divider direction="vertical"/> |
||||
|
<el-col :span="22"> |
||||
|
<el-container class="wer"> |
||||
|
<el-form-item label="方案版本号:"> |
||||
|
<el-input v-model="formdate.name" placeholder="请输入方案版本号" clearable style="width:200px"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="年度:" label-width="90"> |
||||
|
<el-date-picker v-model="formdate.value1" type="year"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label-width="25"> |
||||
|
<el-button type="primary" @click="postt"><el-icon><Search /></el-icon>查询</el-button> |
||||
|
<el-button class="new_btn" type="warning" @click="addtableData"><el-icon><Plus /></el-icon>新增</el-button> |
||||
|
</el-form-item> |
||||
|
</el-container> |
||||
|
<el-table class="m-1" :data="tableq" :span-method="objectSpanMethod" border style="width: 100%"> |
||||
|
<el-table-column prop="groupname,deaprtname," label="部门"> |
||||
|
<template #default="scope"> |
||||
|
{{scope.row.groupname}}{{scope.row.deaprtname}} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="year" label="年" width="70"/> |
||||
|
<el-table-column prop="key" label="版本号"/> |
||||
|
<el-table-column prop="time" label="时间" /> |
||||
|
<el-table-column prop="state" label="状态" width="70"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch v-model="scope.row.status" class="ml-2" inline-prompt style="--el-switch-on-color: #ff4949; --el-switch-off-color: #13ce66" @change="editPostState(scope.row.key,scope.row.state)"/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column fixed="right" label="操作" width="228"> |
||||
|
<template #default="{ row }"> |
||||
|
<el-button type="primary" link @click="handleio(row)"><el-icon><View /></el-icon>查看详情</el-button> |
||||
|
<el-button type="primary" link @click="handleErd(row)"><el-icon><DocumentChecked /></el-icon>复制</el-button> |
||||
|
<el-button type="primary" link @click="handleDel(row)"><el-icon><Delete /></el-icon>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-col> |
||||
|
</el-container> |
||||
|
<pagination v-if="total > 0" v-model:page="formdate.page" v-model:pagesize="formdate.pagesize" :total="total" @click="postt"/> |
||||
|
<Dialog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Dialog> |
||||
|
<Dialoglog v-if="data.edPostBox" v-model="data.edPostBox" :title="title" :row-info="rowInfo"></Dialoglog> |
||||
|
<Yg v-if="data.ygPostBox" v-model="data.ygPostBox" :title="title" :row-info="rowInfo"></Yg> |
||||
|
</div> |
||||
|
</template> |
||||
|
<style lang='scss' scoped> |
||||
|
.qwe { |
||||
|
margin:-8px 0 0 -6px; |
||||
|
float:right; |
||||
|
} |
||||
|
.wer{ |
||||
|
margin:-5px 0 0 20px; |
||||
|
font-weight:normal; |
||||
|
} |
||||
|
.horizontal-controls { |
||||
|
display: flex; |
||||
|
float: left; |
||||
|
|
||||
|
} |
||||
|
.el-divider--vertical{ |
||||
|
display:inline-block; |
||||
|
width:1px; |
||||
|
height:812px; |
||||
|
margin:0 8px; |
||||
|
vertical-align:middle; |
||||
|
position:relative; |
||||
|
} |
||||
|
|
||||
|
/* 可以根据需要调整样式 */ |
||||
|
</style> |
||||
@ -0,0 +1,265 @@ |
|||||
|
<!-- |
||||
|
@ 作者: 鲁智强 |
||||
|
@ 时间: 2023-09-19 09:13:14 |
||||
|
@ 备注: |
||||
|
--> |
||||
|
<script lang='ts' setup> |
||||
|
import {ref,reactive,onMounted} from 'vue' |
||||
|
import { organdpost,posttarget,set_posttarget } from '@/api/opk/api' |
||||
|
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
||||
|
import { editPostCont } from '@/api/opk/pulic/api' |
||||
|
import { departmentprogramme,edit_depart,edit_depart_progra } from '@/api/opk/news/api' |
||||
|
import { ge_copy } from '@/api/opk/zxy/news/api' |
||||
|
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
||||
|
import { getDictFormData } from '@/api/dict' |
||||
|
import Dialog from './dialog.vue' |
||||
|
import Dialoglog from './dialoglog.vue' |
||||
|
import Yg from './yg.vue' |
||||
|
// eslint-disable-next-line vue/require-prop-types |
||||
|
const { addShow, title } = defineProps(['addShow', 'title']) |
||||
|
const data = reactive({ |
||||
|
formInline:{ |
||||
|
region:'', |
||||
|
}, |
||||
|
title:"", |
||||
|
addPostBox: false, |
||||
|
edPostBox:false, |
||||
|
ygPostBox:false, |
||||
|
}) |
||||
|
const orgTreeProps ={ |
||||
|
label: 'name', |
||||
|
children:'child' |
||||
|
} |
||||
|
const orgTreeProp ={ |
||||
|
label: 'title', |
||||
|
children:'childen' |
||||
|
} |
||||
|
const formdat = { |
||||
|
someProp:"", |
||||
|
} |
||||
|
const total =ref(0) |
||||
|
const rowInfo = ref<any>({}) |
||||
|
const postIds = ref<number[]>([]) |
||||
|
const tableData = ref<any>([]); |
||||
|
const tables = ref<any>([]); |
||||
|
// 获取侧栏数据 |
||||
|
function jjjs(){ |
||||
|
addPostCont("/hrapi/org/govthree","post") |
||||
|
.then(data => { |
||||
|
tableData.value = data.data[3].child[14].child; |
||||
|
}) |
||||
|
.catch(error => { |
||||
|
console.error('Error fetching data:', error); |
||||
|
}); |
||||
|
} |
||||
|
jjjs() |
||||
|
function editPost(){ |
||||
|
editPostCont({}) |
||||
|
.then(data => { |
||||
|
tables.value = data.data.list; |
||||
|
}) |
||||
|
} |
||||
|
editPost() |
||||
|
const table = ref<any>([]) |
||||
|
const formdate = reactive({ |
||||
|
page:0, |
||||
|
pagesize:20, |
||||
|
name:"", |
||||
|
dimension:"", |
||||
|
attribute:"", |
||||
|
orgidlist:"", |
||||
|
type:"", |
||||
|
value1:"2023", |
||||
|
}) |
||||
|
// 获取数据 |
||||
|
const tableq = ref([]) |
||||
|
const postt = ()=>{ |
||||
|
const ass = new Date(formdate.value1); |
||||
|
const qwe = ass.getFullYear(); |
||||
|
const zjr = qwe.toString(); |
||||
|
departmentprogramme({orgid:formdate.orgidlist,year:zjr,version:formdate.name}) |
||||
|
.then(data => { |
||||
|
tableq.value = data.data; |
||||
|
total.value = data.data.count; |
||||
|
}) |
||||
|
} |
||||
|
// 新增数据 |
||||
|
const addtableData = ()=>{ |
||||
|
data.addPostBox = true; |
||||
|
} |
||||
|
// 添加行 |
||||
|
const addRow = (val:any)=> { |
||||
|
tableData.value.push(val); |
||||
|
} |
||||
|
// 编辑行 |
||||
|
const editRow = (val:any)=> { |
||||
|
let index =tableData.value.findIndex( |
||||
|
(item:any) => item.id === val.id |
||||
|
); |
||||
|
tableData.value.splice(index, 1, val); |
||||
|
} |
||||
|
// 关闭弹窗 |
||||
|
const closeDetail = ()=>{ |
||||
|
data.addPostBox = false; |
||||
|
} |
||||
|
function editPostState(classId:string,state:number){ |
||||
|
console.log("改变状态--------->",classId,state) |
||||
|
let statusVal = 1 |
||||
|
if( state == 1) statusVal = 2; |
||||
|
edit_depart({id:classId,state:statusVal,istrue:2}) |
||||
|
postt() |
||||
|
} |
||||
|
// 删除数据 |
||||
|
const handleDel = (val:any) => { |
||||
|
const dictTypeIds = [val.outID || postIds.value].join(","); |
||||
|
let dictTypeIdAry = dictTypeIds.split(",") |
||||
|
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
||||
|
confirmButtonText: "确认", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
const add = val.key.toString() |
||||
|
handleSure(val) |
||||
|
console.log(val.id) |
||||
|
edit_depart({id:add,state:3,istrue:2}).then(()=> |
||||
|
ElMessage.success("删除成功")) |
||||
|
postt() |
||||
|
}) |
||||
|
}; |
||||
|
const handleSure = (val:any)=> { |
||||
|
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
||||
|
if(index!=-1){ |
||||
|
tableData.value.splice(index, 1); |
||||
|
} |
||||
|
} |
||||
|
const resetChecked=()=> { |
||||
|
formdate.orgidlist = "" |
||||
|
postt() |
||||
|
} |
||||
|
const handle=(data:any)=>{ |
||||
|
formdate.orgidlist = data.id.toString() |
||||
|
postt() |
||||
|
} |
||||
|
const handleErd=(val:any)=>{ |
||||
|
data.edPostBox=true; |
||||
|
rowInfo.value=val; |
||||
|
} |
||||
|
const handleio=(val:any)=>{ |
||||
|
data.ygPostBox=true; |
||||
|
rowInfo.value = val; |
||||
|
} |
||||
|
|
||||
|
const flitterData4 = (data:any)=>{ |
||||
|
let spanOneArr = [] as any[] |
||||
|
let concatOne = 0 |
||||
|
data.value.forEach((item:any,index:any)=>{ |
||||
|
if(index === 0){ |
||||
|
spanOneArr.push(1) |
||||
|
}else{ |
||||
|
//name 修改 |
||||
|
if(item.department === data.value[index - 1].department){ //第一列需合并相同内容的字段 |
||||
|
spanOneArr[concatOne] += 1 |
||||
|
spanOneArr.push(0) |
||||
|
}else{ |
||||
|
spanOneArr.push(1) |
||||
|
concatOne = index |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
return { |
||||
|
one: spanOneArr, |
||||
|
} |
||||
|
} |
||||
|
function objectSpanMethod({row, column, rowIndex, columnIndex}:any){ |
||||
|
if(columnIndex === 0 ) { |
||||
|
// this.tableData 修改 |
||||
|
const _row = (flitterData4(tableq).one)[rowIndex] |
||||
|
const _col = _row > 0 ? 1 : 0 |
||||
|
return { |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
onMounted(()=>{ |
||||
|
jjjs() |
||||
|
postt() |
||||
|
}) |
||||
|
</script> |
||||
|
<template> |
||||
|
<div class="m-2"> |
||||
|
<el-container clss="m-4"> |
||||
|
<div class="qwe"> |
||||
|
<el-button type="primary" style="width: 140px" size="large" @click="resetChecked">全选</el-button> |
||||
|
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @node-click="handle"/> |
||||
|
</div> |
||||
|
<el-divider direction="vertical"/> |
||||
|
<el-col :span="22"> |
||||
|
<el-container class="wer"> |
||||
|
<el-form-item label="方案版本号:"> |
||||
|
<el-input v-model="formdate.name" placeholder="请输入方案版本号" clearable style="width:200px"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="年度:" label-width="90"> |
||||
|
<el-date-picker v-model="formdate.value1" type="year"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label-width="25"> |
||||
|
<el-button type="primary" @click="postt"><el-icon><Search /></el-icon>查询</el-button> |
||||
|
<el-button class="new_btn" type="warning" @click="addtableData"><el-icon><Plus /></el-icon>新增</el-button> |
||||
|
</el-form-item> |
||||
|
</el-container> |
||||
|
<el-table class="m-1" :data="tableq" :span-method="objectSpanMethod" border style="width: 100%"> |
||||
|
<el-table-column prop="groupname,deaprtname," label="部门"> |
||||
|
<template #default="scope"> |
||||
|
{{scope.row.groupname}}{{scope.row.deaprtname}} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="year" label="年" width="70"/> |
||||
|
<el-table-column prop="key" label="版本号"/> |
||||
|
<el-table-column prop="time" label="时间" /> |
||||
|
<el-table-column prop="state" label="状态" width="70"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch v-model="scope.row.status" class="ml-2" inline-prompt style="--el-switch-on-color: #ff4949; --el-switch-off-color: #13ce66" @change="editPostState(scope.row.key,scope.row.state)"/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column fixed="right" label="操作" width="228"> |
||||
|
<template #default="{ row }"> |
||||
|
<el-button type="primary" link @click="handleio(row)"><el-icon><View /></el-icon>查看详情</el-button> |
||||
|
<el-button type="primary" link @click="handleErd(row)"><el-icon><DocumentChecked /></el-icon>复制</el-button> |
||||
|
<el-button type="primary" link @click="handleDel(row)"><el-icon><Delete /></el-icon>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-col> |
||||
|
</el-container> |
||||
|
<pagination v-if="total > 0" v-model:page="formdate.page" v-model:pagesize="formdate.pagesize" :total="total" @click="postt"/> |
||||
|
<Dialog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Dialog> |
||||
|
<Dialoglog v-if="data.edPostBox" v-model="data.edPostBox" :title="title" :row-info="rowInfo"></Dialoglog> |
||||
|
<Yg v-if="data.ygPostBox" v-model="data.ygPostBox" :title="title" :row-info="rowInfo"></Yg> |
||||
|
</div> |
||||
|
</template> |
||||
|
<style lang='scss' scoped> |
||||
|
.qwe { |
||||
|
margin:-8px 0 0 -6px; |
||||
|
float:right; |
||||
|
} |
||||
|
.wer{ |
||||
|
margin:-5px 0 0 20px; |
||||
|
font-weight:normal; |
||||
|
} |
||||
|
.horizontal-controls { |
||||
|
display: flex; |
||||
|
float: left; |
||||
|
|
||||
|
} |
||||
|
.el-divider--vertical{ |
||||
|
display:inline-block; |
||||
|
width:1px; |
||||
|
height:812px; |
||||
|
margin:0 8px; |
||||
|
vertical-align:middle; |
||||
|
position:relative; |
||||
|
} |
||||
|
|
||||
|
/* 可以根据需要调整样式 */ |
||||
|
</style> |
||||
@ -0,0 +1,265 @@ |
|||||
|
<!-- |
||||
|
@ 作者: 鲁智强 |
||||
|
@ 时间: 2023-09-19 09:13:14 |
||||
|
@ 备注: |
||||
|
--> |
||||
|
<script lang='ts' setup> |
||||
|
import {ref,reactive,onMounted} from 'vue' |
||||
|
import { organdpost,posttarget,set_posttarget } from '@/api/opk/api' |
||||
|
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
||||
|
import { editPostCont } from '@/api/opk/pulic/api' |
||||
|
import { departmentprogramme,edit_depart,edit_depart_progra } from '@/api/opk/news/api' |
||||
|
import { ge_copy } from '@/api/opk/zxy/news/api' |
||||
|
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
||||
|
import { getDictFormData } from '@/api/dict' |
||||
|
import Dialog from './dialog.vue' |
||||
|
import Dialoglog from './dialoglog.vue' |
||||
|
import Yg from './yg.vue' |
||||
|
// eslint-disable-next-line vue/require-prop-types |
||||
|
const { addShow, title } = defineProps(['addShow', 'title']) |
||||
|
const data = reactive({ |
||||
|
formInline:{ |
||||
|
region:'', |
||||
|
}, |
||||
|
title:"", |
||||
|
addPostBox: false, |
||||
|
edPostBox:false, |
||||
|
ygPostBox:false, |
||||
|
}) |
||||
|
const orgTreeProps ={ |
||||
|
label: 'name', |
||||
|
children:'child' |
||||
|
} |
||||
|
const orgTreeProp ={ |
||||
|
label: 'title', |
||||
|
children:'childen' |
||||
|
} |
||||
|
const formdat = { |
||||
|
someProp:"", |
||||
|
} |
||||
|
const total =ref(0) |
||||
|
const rowInfo = ref<any>({}) |
||||
|
const postIds = ref<number[]>([]) |
||||
|
const tableData = ref<any>([]); |
||||
|
const tables = ref<any>([]); |
||||
|
// 获取侧栏数据 |
||||
|
function jjjs(){ |
||||
|
addPostCont("/hrapi/org/govthree","post") |
||||
|
.then(data => { |
||||
|
tableData.value = data.data[3].child[14].child; |
||||
|
}) |
||||
|
.catch(error => { |
||||
|
console.error('Error fetching data:', error); |
||||
|
}); |
||||
|
} |
||||
|
jjjs() |
||||
|
function editPost(){ |
||||
|
editPostCont({}) |
||||
|
.then(data => { |
||||
|
tables.value = data.data.list; |
||||
|
}) |
||||
|
} |
||||
|
editPost() |
||||
|
const table = ref<any>([]) |
||||
|
const formdate = reactive({ |
||||
|
page:0, |
||||
|
pagesize:20, |
||||
|
name:"", |
||||
|
dimension:"", |
||||
|
attribute:"", |
||||
|
orgidlist:"", |
||||
|
type:"", |
||||
|
value1:"2023", |
||||
|
}) |
||||
|
// 获取数据 |
||||
|
const tableq = ref([]) |
||||
|
const postt = ()=>{ |
||||
|
const ass = new Date(formdate.value1); |
||||
|
const qwe = ass.getFullYear(); |
||||
|
const zjr = qwe.toString(); |
||||
|
departmentprogramme({orgid:formdate.orgidlist,year:zjr,version:formdate.name}) |
||||
|
.then(data => { |
||||
|
tableq.value = data.data; |
||||
|
total.value = data.data.count; |
||||
|
}) |
||||
|
} |
||||
|
// 新增数据 |
||||
|
const addtableData = ()=>{ |
||||
|
data.addPostBox = true; |
||||
|
} |
||||
|
// 添加行 |
||||
|
const addRow = (val:any)=> { |
||||
|
tableData.value.push(val); |
||||
|
} |
||||
|
// 编辑行 |
||||
|
const editRow = (val:any)=> { |
||||
|
let index =tableData.value.findIndex( |
||||
|
(item:any) => item.id === val.id |
||||
|
); |
||||
|
tableData.value.splice(index, 1, val); |
||||
|
} |
||||
|
// 关闭弹窗 |
||||
|
const closeDetail = ()=>{ |
||||
|
data.addPostBox = false; |
||||
|
} |
||||
|
function editPostState(classId:string,state:number){ |
||||
|
console.log("改变状态--------->",classId,state) |
||||
|
let statusVal = 1 |
||||
|
if( state == 1) statusVal = 2; |
||||
|
edit_depart({id:classId,state:statusVal,istrue:2}) |
||||
|
postt() |
||||
|
} |
||||
|
// 删除数据 |
||||
|
const handleDel = (val:any) => { |
||||
|
const dictTypeIds = [val.outID || postIds.value].join(","); |
||||
|
let dictTypeIdAry = dictTypeIds.split(",") |
||||
|
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
||||
|
confirmButtonText: "确认", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
const add = val.key.toString() |
||||
|
handleSure(val) |
||||
|
console.log(val.id) |
||||
|
edit_depart({id:add,state:3,istrue:2}).then(()=> |
||||
|
ElMessage.success("删除成功")) |
||||
|
postt() |
||||
|
}) |
||||
|
}; |
||||
|
const handleSure = (val:any)=> { |
||||
|
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
||||
|
if(index!=-1){ |
||||
|
tableData.value.splice(index, 1); |
||||
|
} |
||||
|
} |
||||
|
const resetChecked=()=> { |
||||
|
formdate.orgidlist = "" |
||||
|
postt() |
||||
|
} |
||||
|
const handle=(data:any)=>{ |
||||
|
formdate.orgidlist = data.id.toString() |
||||
|
postt() |
||||
|
} |
||||
|
const handleErd=(val:any)=>{ |
||||
|
data.edPostBox=true; |
||||
|
rowInfo.value=val; |
||||
|
} |
||||
|
const handleio=(val:any)=>{ |
||||
|
data.ygPostBox=true; |
||||
|
rowInfo.value = val; |
||||
|
} |
||||
|
|
||||
|
const flitterData4 = (data:any)=>{ |
||||
|
let spanOneArr = [] as any[] |
||||
|
let concatOne = 0 |
||||
|
data.value.forEach((item:any,index:any)=>{ |
||||
|
if(index === 0){ |
||||
|
spanOneArr.push(1) |
||||
|
}else{ |
||||
|
//name 修改 |
||||
|
if(item.department === data.value[index - 1].department){ //第一列需合并相同内容的字段 |
||||
|
spanOneArr[concatOne] += 1 |
||||
|
spanOneArr.push(0) |
||||
|
}else{ |
||||
|
spanOneArr.push(1) |
||||
|
concatOne = index |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
return { |
||||
|
one: spanOneArr, |
||||
|
} |
||||
|
} |
||||
|
function objectSpanMethod({row, column, rowIndex, columnIndex}:any){ |
||||
|
if(columnIndex === 0 ) { |
||||
|
// this.tableData 修改 |
||||
|
const _row = (flitterData4(tableq).one)[rowIndex] |
||||
|
const _col = _row > 0 ? 1 : 0 |
||||
|
return { |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
onMounted(()=>{ |
||||
|
jjjs() |
||||
|
postt() |
||||
|
}) |
||||
|
</script> |
||||
|
<template> |
||||
|
<div class="m-2"> |
||||
|
<el-container clss="m-4"> |
||||
|
<div class="qwe"> |
||||
|
<el-button type="primary" style="width: 140px" size="large" @click="resetChecked">全选</el-button> |
||||
|
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @node-click="handle"/> |
||||
|
</div> |
||||
|
<el-divider direction="vertical"/> |
||||
|
<el-col :span="22"> |
||||
|
<el-container class="wer"> |
||||
|
<el-form-item label="方案版本号:"> |
||||
|
<el-input v-model="formdate.name" placeholder="请输入方案版本号" clearable style="width:200px"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="年度:" label-width="90"> |
||||
|
<el-date-picker v-model="formdate.value1" type="year"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label-width="25"> |
||||
|
<el-button type="primary" @click="postt"><el-icon><Search /></el-icon>查询</el-button> |
||||
|
<el-button class="new_btn" type="warning" @click="addtableData"><el-icon><Plus /></el-icon>新增</el-button> |
||||
|
</el-form-item> |
||||
|
</el-container> |
||||
|
<el-table class="m-1" :data="tableq" :span-method="objectSpanMethod" border style="width: 100%"> |
||||
|
<el-table-column prop="groupname,deaprtname," label="部门"> |
||||
|
<template #default="scope"> |
||||
|
{{scope.row.groupname}}{{scope.row.deaprtname}} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="year" label="年" width="70"/> |
||||
|
<el-table-column prop="key" label="版本号"/> |
||||
|
<el-table-column prop="time" label="时间" /> |
||||
|
<el-table-column prop="state" label="状态" width="70"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch v-model="scope.row.status" :inactive-value="1" :active-value="2" class="ml-2" inline-prompt style="--el-switch-on-color: #ff4949; --el-switch-off-color: #13ce66" @change="editPostState(scope.row.key,scope.row.state)"/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column fixed="right" label="操作" width="228"> |
||||
|
<template #default="{ row }"> |
||||
|
<el-button type="primary" link @click="handleio(row)"><el-icon><View /></el-icon>查看详情</el-button> |
||||
|
<el-button type="primary" link @click="handleErd(row)"><el-icon><DocumentChecked /></el-icon>复制</el-button> |
||||
|
<el-button type="primary" link @click="handleDel(row)"><el-icon><Delete /></el-icon>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-col> |
||||
|
</el-container> |
||||
|
<pagination v-if="total > 0" v-model:page="formdate.page" v-model:pagesize="formdate.pagesize" :total="total" @click="postt"/> |
||||
|
<Dialog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Dialog> |
||||
|
<Dialoglog v-if="data.edPostBox" v-model="data.edPostBox" :title="title" :row-info="rowInfo"></Dialoglog> |
||||
|
<Yg v-if="data.ygPostBox" v-model="data.ygPostBox" :title="title" :row-info="rowInfo"></Yg> |
||||
|
</div> |
||||
|
</template> |
||||
|
<style lang='scss' scoped> |
||||
|
.qwe { |
||||
|
margin:-8px 0 0 -6px; |
||||
|
float:right; |
||||
|
} |
||||
|
.wer{ |
||||
|
margin:-5px 0 0 20px; |
||||
|
font-weight:normal; |
||||
|
} |
||||
|
.horizontal-controls { |
||||
|
display: flex; |
||||
|
float: left; |
||||
|
|
||||
|
} |
||||
|
.el-divider--vertical{ |
||||
|
display:inline-block; |
||||
|
width:1px; |
||||
|
height:812px; |
||||
|
margin:0 8px; |
||||
|
vertical-align:middle; |
||||
|
position:relative; |
||||
|
} |
||||
|
|
||||
|
/* 可以根据需要调整样式 */ |
||||
|
</style> |
||||
@ -0,0 +1,265 @@ |
|||||
|
<!-- |
||||
|
@ 作者: 鲁智强 |
||||
|
@ 时间: 2023-09-19 09:13:14 |
||||
|
@ 备注: |
||||
|
--> |
||||
|
<script lang='ts' setup> |
||||
|
import {ref,reactive,onMounted} from 'vue' |
||||
|
import { organdpost,posttarget,set_posttarget } from '@/api/opk/api' |
||||
|
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
||||
|
import { editPostCont } from '@/api/opk/pulic/api' |
||||
|
import { departmentprogramme,edit_depart,edit_depart_progra } from '@/api/opk/news/api' |
||||
|
import { ge_copy } from '@/api/opk/zxy/news/api' |
||||
|
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
||||
|
import { getDictFormData } from '@/api/dict' |
||||
|
import Dialog from './dialog.vue' |
||||
|
import Dialoglog from './dialoglog.vue' |
||||
|
import Yg from './yg.vue' |
||||
|
// eslint-disable-next-line vue/require-prop-types |
||||
|
const { addShow, title } = defineProps(['addShow', 'title']) |
||||
|
const data = reactive({ |
||||
|
formInline:{ |
||||
|
region:'', |
||||
|
}, |
||||
|
title:"", |
||||
|
addPostBox: false, |
||||
|
edPostBox:false, |
||||
|
ygPostBox:false, |
||||
|
}) |
||||
|
const orgTreeProps ={ |
||||
|
label: 'name', |
||||
|
children:'child' |
||||
|
} |
||||
|
const orgTreeProp ={ |
||||
|
label: 'title', |
||||
|
children:'childen' |
||||
|
} |
||||
|
const formdat = { |
||||
|
someProp:"", |
||||
|
} |
||||
|
const total =ref(0) |
||||
|
const rowInfo = ref<any>({}) |
||||
|
const postIds = ref<number[]>([]) |
||||
|
const tableData = ref<any>([]); |
||||
|
const tables = ref<any>([]); |
||||
|
// 获取侧栏数据 |
||||
|
function jjjs(){ |
||||
|
addPostCont("/hrapi/org/govthree","post") |
||||
|
.then(data => { |
||||
|
tableData.value = data.data[3].child[14].child; |
||||
|
}) |
||||
|
.catch(error => { |
||||
|
console.error('Error fetching data:', error); |
||||
|
}); |
||||
|
} |
||||
|
jjjs() |
||||
|
function editPost(){ |
||||
|
editPostCont({}) |
||||
|
.then(data => { |
||||
|
tables.value = data.data.list; |
||||
|
}) |
||||
|
} |
||||
|
editPost() |
||||
|
const table = ref<any>([]) |
||||
|
const formdate = reactive({ |
||||
|
page:0, |
||||
|
pagesize:20, |
||||
|
name:"", |
||||
|
dimension:"", |
||||
|
attribute:"", |
||||
|
orgidlist:"", |
||||
|
type:"", |
||||
|
value1:"2023", |
||||
|
}) |
||||
|
// 获取数据 |
||||
|
const tableq = ref([]) |
||||
|
const postt = ()=>{ |
||||
|
const ass = new Date(formdate.value1); |
||||
|
const qwe = ass.getFullYear(); |
||||
|
const zjr = qwe.toString(); |
||||
|
departmentprogramme({orgid:formdate.orgidlist,year:zjr,version:formdate.name}) |
||||
|
.then(data => { |
||||
|
tableq.value = data.data; |
||||
|
total.value = data.data.count; |
||||
|
}) |
||||
|
} |
||||
|
// 新增数据 |
||||
|
const addtableData = ()=>{ |
||||
|
data.addPostBox = true; |
||||
|
} |
||||
|
// 添加行 |
||||
|
const addRow = (val:any)=> { |
||||
|
tableData.value.push(val); |
||||
|
} |
||||
|
// 编辑行 |
||||
|
const editRow = (val:any)=> { |
||||
|
let index =tableData.value.findIndex( |
||||
|
(item:any) => item.id === val.id |
||||
|
); |
||||
|
tableData.value.splice(index, 1, val); |
||||
|
} |
||||
|
// 关闭弹窗 |
||||
|
const closeDetail = ()=>{ |
||||
|
data.addPostBox = false; |
||||
|
} |
||||
|
function editPostState(classId:string,state:number){ |
||||
|
console.log("改变状态--------->",classId,state) |
||||
|
let statusVal = 1 |
||||
|
if( state == 1) statusVal = 2; |
||||
|
edit_depart({id:classId,state:statusVal,istrue:2}) |
||||
|
postt() |
||||
|
} |
||||
|
// 删除数据 |
||||
|
const handleDel = (val:any) => { |
||||
|
const dictTypeIds = [val.outID || postIds.value].join(","); |
||||
|
let dictTypeIdAry = dictTypeIds.split(",") |
||||
|
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
||||
|
confirmButtonText: "确认", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
const add = val.key.toString() |
||||
|
handleSure(val) |
||||
|
console.log(val.id) |
||||
|
edit_depart({id:add,state:3,istrue:2}).then(()=> |
||||
|
ElMessage.success("删除成功")) |
||||
|
postt() |
||||
|
}) |
||||
|
}; |
||||
|
const handleSure = (val:any)=> { |
||||
|
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
||||
|
if(index!=-1){ |
||||
|
tableData.value.splice(index, 1); |
||||
|
} |
||||
|
} |
||||
|
const resetChecked=()=> { |
||||
|
formdate.orgidlist = "" |
||||
|
postt() |
||||
|
} |
||||
|
const handle=(data:any)=>{ |
||||
|
formdate.orgidlist = data.id.toString() |
||||
|
postt() |
||||
|
} |
||||
|
const handleErd=(val:any)=>{ |
||||
|
data.edPostBox=true; |
||||
|
rowInfo.value=val; |
||||
|
} |
||||
|
const handleio=(val:any)=>{ |
||||
|
data.ygPostBox=true; |
||||
|
rowInfo.value = val; |
||||
|
} |
||||
|
|
||||
|
const flitterData4 = (data:any)=>{ |
||||
|
let spanOneArr = [] as any[] |
||||
|
let concatOne = 0 |
||||
|
data.value.forEach((item:any,index:any)=>{ |
||||
|
if(index === 0){ |
||||
|
spanOneArr.push(1) |
||||
|
}else{ |
||||
|
//name 修改 |
||||
|
if(item.department === data.value[index - 1].department){ //第一列需合并相同内容的字段 |
||||
|
spanOneArr[concatOne] += 1 |
||||
|
spanOneArr.push(0) |
||||
|
}else{ |
||||
|
spanOneArr.push(1) |
||||
|
concatOne = index |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
return { |
||||
|
one: spanOneArr, |
||||
|
} |
||||
|
} |
||||
|
function objectSpanMethod({row, column, rowIndex, columnIndex}:any){ |
||||
|
if(columnIndex === 0 ) { |
||||
|
// this.tableData 修改 |
||||
|
const _row = (flitterData4(tableq).one)[rowIndex] |
||||
|
const _col = _row > 0 ? 1 : 0 |
||||
|
return { |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
onMounted(()=>{ |
||||
|
jjjs() |
||||
|
postt() |
||||
|
}) |
||||
|
</script> |
||||
|
<template> |
||||
|
<div class="m-2"> |
||||
|
<el-container clss="m-4"> |
||||
|
<div class="qwe"> |
||||
|
<el-button type="primary" style="width: 140px" size="large" @click="resetChecked">全选</el-button> |
||||
|
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @node-click="handle"/> |
||||
|
</div> |
||||
|
<el-divider direction="vertical"/> |
||||
|
<el-col :span="22"> |
||||
|
<el-container class="wer"> |
||||
|
<el-form-item label="方案版本号:"> |
||||
|
<el-input v-model="formdate.name" placeholder="请输入方案版本号" clearable style="width:200px"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="年度:" label-width="90"> |
||||
|
<el-date-picker v-model="formdate.value1" type="year"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label-width="25"> |
||||
|
<el-button type="primary" @click="postt"><el-icon><Search /></el-icon>查询</el-button> |
||||
|
<el-button class="new_btn" type="warning" @click="addtableData"><el-icon><Plus /></el-icon>新增</el-button> |
||||
|
</el-form-item> |
||||
|
</el-container> |
||||
|
<el-table class="m-1" :data="tableq" :span-method="objectSpanMethod" border style="width: 100%"> |
||||
|
<el-table-column prop="groupname,deaprtname," label="部门"> |
||||
|
<template #default="scope"> |
||||
|
{{scope.row.groupname}}{{scope.row.deaprtname}} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="year" label="年" width="70"/> |
||||
|
<el-table-column prop="key" label="版本号"/> |
||||
|
<el-table-column prop="time" label="时间" /> |
||||
|
<el-table-column prop="state" label="状态" width="70"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch v-model="scope.row.status" :inactive-value="1" :active-value="2" class="ml-2" inline-prompt style="--el-switch-on-color: #ff4949; --el-switch-off-color: #13ce66" @change="editPostState(scope.row.key,scope.row.state)"/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column fixed="right" label="操作" width="228"> |
||||
|
<template #default="{ row }"> |
||||
|
<el-button type="primary" link @click="handleio(row)"><el-icon><View /></el-icon>查看详情</el-button> |
||||
|
<el-button type="primary" link @click="handleErd(row)"><el-icon><DocumentChecked /></el-icon>复制</el-button> |
||||
|
<el-button type="primary" link @click="handleDel(row)"><el-icon><Delete /></el-icon>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-col> |
||||
|
</el-container> |
||||
|
<pagination v-if="total > 0" v-model:page="formdate.page" v-model:pagesize="formdate.pagesize" :total="total" @click="postt"/> |
||||
|
<Dialog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Dialog> |
||||
|
<Dialoglog v-if="data.edPostBox" v-model="data.edPostBox" :title="title" :row-info="rowInfo"></Dialoglog> |
||||
|
<Yg v-if="data.ygPostBox" v-model="data.ygPostBox" :title="title" :row-info="rowInfo"></Yg> |
||||
|
</div> |
||||
|
</template> |
||||
|
<style lang='scss' scoped> |
||||
|
.qwe { |
||||
|
margin:-8px 0 0 -6px; |
||||
|
float:right; |
||||
|
} |
||||
|
.wer{ |
||||
|
margin:-5px 0 0 20px; |
||||
|
font-weight:normal; |
||||
|
} |
||||
|
.horizontal-controls { |
||||
|
display: flex; |
||||
|
float: left; |
||||
|
|
||||
|
} |
||||
|
.el-divider--vertical{ |
||||
|
display:inline-block; |
||||
|
width:1px; |
||||
|
height:812px; |
||||
|
margin:0 8px; |
||||
|
vertical-align:middle; |
||||
|
position:relative; |
||||
|
} |
||||
|
|
||||
|
/* 可以根据需要调整样式 */ |
||||
|
</style> |
||||
@ -0,0 +1,265 @@ |
|||||
|
<!-- |
||||
|
@ 作者: 鲁智强 |
||||
|
@ 时间: 2023-09-19 09:13:14 |
||||
|
@ 备注: |
||||
|
--> |
||||
|
<script lang='ts' setup> |
||||
|
import {ref,reactive,onMounted} from 'vue' |
||||
|
import { organdpost,posttarget,set_posttarget } from '@/api/opk/api' |
||||
|
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
||||
|
import { editPostCont } from '@/api/opk/pulic/api' |
||||
|
import { departmentprogramme,edit_depart,edit_depart_progra } from '@/api/opk/news/api' |
||||
|
import { ge_copy } from '@/api/opk/zxy/news/api' |
||||
|
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
||||
|
import { getDictFormData } from '@/api/dict' |
||||
|
import Dialog from './dialog.vue' |
||||
|
import Dialoglog from './dialoglog.vue' |
||||
|
import Yg from './yg.vue' |
||||
|
// eslint-disable-next-line vue/require-prop-types |
||||
|
const { addShow, title } = defineProps(['addShow', 'title']) |
||||
|
const data = reactive({ |
||||
|
formInline:{ |
||||
|
region:'', |
||||
|
}, |
||||
|
title:"", |
||||
|
addPostBox: false, |
||||
|
edPostBox:false, |
||||
|
ygPostBox:false, |
||||
|
}) |
||||
|
const orgTreeProps ={ |
||||
|
label: 'name', |
||||
|
children:'child' |
||||
|
} |
||||
|
const orgTreeProp ={ |
||||
|
label: 'title', |
||||
|
children:'childen' |
||||
|
} |
||||
|
const formdat = { |
||||
|
someProp:"", |
||||
|
} |
||||
|
const total =ref(0) |
||||
|
const rowInfo = ref<any>({}) |
||||
|
const postIds = ref<number[]>([]) |
||||
|
const tableData = ref<any>([]); |
||||
|
const tables = ref<any>([]); |
||||
|
// 获取侧栏数据 |
||||
|
function jjjs(){ |
||||
|
addPostCont("/hrapi/org/govthree","post") |
||||
|
.then(data => { |
||||
|
tableData.value = data.data[3].child[14].child; |
||||
|
}) |
||||
|
.catch(error => { |
||||
|
console.error('Error fetching data:', error); |
||||
|
}); |
||||
|
} |
||||
|
jjjs() |
||||
|
function editPost(){ |
||||
|
editPostCont({}) |
||||
|
.then(data => { |
||||
|
tables.value = data.data.list; |
||||
|
}) |
||||
|
} |
||||
|
editPost() |
||||
|
const table = ref<any>([]) |
||||
|
const formdate = reactive({ |
||||
|
page:0, |
||||
|
pagesize:20, |
||||
|
name:"", |
||||
|
dimension:"", |
||||
|
attribute:"", |
||||
|
orgidlist:"", |
||||
|
type:"", |
||||
|
value1:"2023", |
||||
|
}) |
||||
|
// 获取数据 |
||||
|
const tableq = ref([]) |
||||
|
const postt = ()=>{ |
||||
|
const ass = new Date(formdate.value1); |
||||
|
const qwe = ass.getFullYear(); |
||||
|
const zjr = qwe.toString(); |
||||
|
departmentprogramme({orgid:formdate.orgidlist,year:zjr,version:formdate.name}) |
||||
|
.then(data => { |
||||
|
tableq.value = data.data; |
||||
|
total.value = data.data.count; |
||||
|
}) |
||||
|
} |
||||
|
// 新增数据 |
||||
|
const addtableData = ()=>{ |
||||
|
data.addPostBox = true; |
||||
|
} |
||||
|
// 添加行 |
||||
|
const addRow = (val:any)=> { |
||||
|
tableData.value.push(val); |
||||
|
} |
||||
|
// 编辑行 |
||||
|
const editRow = (val:any)=> { |
||||
|
let index =tableData.value.findIndex( |
||||
|
(item:any) => item.id === val.id |
||||
|
); |
||||
|
tableData.value.splice(index, 1, val); |
||||
|
} |
||||
|
// 关闭弹窗 |
||||
|
const closeDetail = ()=>{ |
||||
|
data.addPostBox = false; |
||||
|
} |
||||
|
function editPostState(classId:string,state:number){ |
||||
|
console.log("改变状态--------->",classId,state) |
||||
|
let statusVal = 1 |
||||
|
if( state == 1) statusVal = 2; |
||||
|
edit_depart({id:classId,state:statusVal,istrue:2}) |
||||
|
postt() |
||||
|
} |
||||
|
// 删除数据 |
||||
|
const handleDel = (val:any) => { |
||||
|
const dictTypeIds = [val.outID || postIds.value].join(","); |
||||
|
let dictTypeIdAry = dictTypeIds.split(",") |
||||
|
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
||||
|
confirmButtonText: "确认", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
const add = val.key.toString() |
||||
|
handleSure(val) |
||||
|
console.log(val.id) |
||||
|
edit_depart({id:add,state:3,istrue:2}).then(()=> |
||||
|
ElMessage.success("删除成功")) |
||||
|
postt() |
||||
|
}) |
||||
|
}; |
||||
|
const handleSure = (val:any)=> { |
||||
|
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
||||
|
if(index!=-1){ |
||||
|
tableData.value.splice(index, 1); |
||||
|
} |
||||
|
} |
||||
|
const resetChecked=()=> { |
||||
|
formdate.orgidlist = "" |
||||
|
postt() |
||||
|
} |
||||
|
const handle=(data:any)=>{ |
||||
|
formdate.orgidlist = data.id.toString() |
||||
|
postt() |
||||
|
} |
||||
|
const handleErd=(val:any)=>{ |
||||
|
data.edPostBox=true; |
||||
|
rowInfo.value=val; |
||||
|
} |
||||
|
const handleio=(val:any)=>{ |
||||
|
data.ygPostBox=true; |
||||
|
rowInfo.value = val; |
||||
|
} |
||||
|
|
||||
|
const flitterData4 = (data:any)=>{ |
||||
|
let spanOneArr = [] as any[] |
||||
|
let concatOne = 0 |
||||
|
data.value.forEach((item:any,index:any)=>{ |
||||
|
if(index === 0){ |
||||
|
spanOneArr.push(1) |
||||
|
}else{ |
||||
|
//name 修改 |
||||
|
if(item.department === data.value[index - 1].department){ //第一列需合并相同内容的字段 |
||||
|
spanOneArr[concatOne] += 1 |
||||
|
spanOneArr.push(0) |
||||
|
}else{ |
||||
|
spanOneArr.push(1) |
||||
|
concatOne = index |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
return { |
||||
|
one: spanOneArr, |
||||
|
} |
||||
|
} |
||||
|
function objectSpanMethod({row, column, rowIndex, columnIndex}:any){ |
||||
|
if(columnIndex === 0 ) { |
||||
|
// this.tableData 修改 |
||||
|
const _row = (flitterData4(tableq).one)[rowIndex] |
||||
|
const _col = _row > 0 ? 1 : 0 |
||||
|
return { |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
onMounted(()=>{ |
||||
|
jjjs() |
||||
|
postt() |
||||
|
}) |
||||
|
</script> |
||||
|
<template> |
||||
|
<div class="m-2"> |
||||
|
<el-container clss="m-4"> |
||||
|
<div class="qwe"> |
||||
|
<el-button type="primary" style="width: 140px" size="large" @click="resetChecked">全选</el-button> |
||||
|
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @node-click="handle"/> |
||||
|
</div> |
||||
|
<el-divider direction="vertical"/> |
||||
|
<el-col :span="22"> |
||||
|
<el-container class="wer"> |
||||
|
<el-form-item label="方案版本号:"> |
||||
|
<el-input v-model="formdate.name" placeholder="请输入方案版本号" clearable style="width:200px"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="年度:" label-width="90"> |
||||
|
<el-date-picker v-model="formdate.value1" type="year"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label-width="25"> |
||||
|
<el-button type="primary" @click="postt"><el-icon><Search /></el-icon>查询</el-button> |
||||
|
<el-button class="new_btn" type="warning" @click="addtableData"><el-icon><Plus /></el-icon>新增</el-button> |
||||
|
</el-form-item> |
||||
|
</el-container> |
||||
|
<el-table class="m-1" :data="tableq" :span-method="objectSpanMethod" border style="width: 100%"> |
||||
|
<el-table-column prop="groupname,deaprtname," label="部门"> |
||||
|
<template #default="scope"> |
||||
|
{{scope.row.groupname}}{{scope.row.deaprtname}} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="year" label="年" width="70"/> |
||||
|
<el-table-column prop="key" label="版本号"/> |
||||
|
<el-table-column prop="time" label="时间" /> |
||||
|
<el-table-column prop="state" label="状态" width="70"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch v-model="scope.row.status" :inactive-value="1" :active-value="2" class="ml-2" inline-prompt style="--el-switch-on-color: #ff4949; --el-switch-off-color: #13ce66" @change="editPostState(scope.row.key,scope.row.state)"/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column fixed="right" label="操作" width="228"> |
||||
|
<template #default="{ row }"> |
||||
|
<el-button type="primary" link @click="handleio(row)"><el-icon><View /></el-icon>查看详情</el-button> |
||||
|
<el-button type="primary" link @click="handleErd(row)"><el-icon><DocumentChecked /></el-icon>复制</el-button> |
||||
|
<el-button type="primary" link @click="handleDel(row)"><el-icon><Delete /></el-icon>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-col> |
||||
|
</el-container> |
||||
|
<pagination v-if="total > 0" v-model:page="formdate.page" v-model:pagesize="formdate.pagesize" :total="total" @click="postt"/> |
||||
|
<Dialog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Dialog> |
||||
|
<Dialoglog v-if="data.edPostBox" v-model="data.edPostBox" :title="title" :row-info="rowInfo"></Dialoglog> |
||||
|
<Yg v-if="data.ygPostBox" v-model="data.ygPostBox" :title="title" :row-info="rowInfo"></Yg> |
||||
|
</div> |
||||
|
</template> |
||||
|
<style lang='scss' scoped> |
||||
|
.qwe { |
||||
|
margin:-8px 0 0 -6px; |
||||
|
float:right; |
||||
|
} |
||||
|
.wer{ |
||||
|
margin:-5px 0 0 20px; |
||||
|
font-weight:normal; |
||||
|
} |
||||
|
.horizontal-controls { |
||||
|
display: flex; |
||||
|
float: left; |
||||
|
|
||||
|
} |
||||
|
.el-divider--vertical{ |
||||
|
display:inline-block; |
||||
|
width:1px; |
||||
|
height:812px; |
||||
|
margin:0 8px; |
||||
|
vertical-align:middle; |
||||
|
position:relative; |
||||
|
} |
||||
|
|
||||
|
/* 可以根据需要调整样式 */ |
||||
|
</style> |
||||
@ -0,0 +1,265 @@ |
|||||
|
<!-- |
||||
|
@ 作者: 鲁智强 |
||||
|
@ 时间: 2023-09-19 09:13:14 |
||||
|
@ 备注: |
||||
|
--> |
||||
|
<script lang='ts' setup> |
||||
|
import {ref,reactive,onMounted} from 'vue' |
||||
|
import { organdpost,posttarget,set_posttarget } from '@/api/opk/api' |
||||
|
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
||||
|
import { editPostCont } from '@/api/opk/pulic/api' |
||||
|
import { departmentprogramme,edit_depart,edit_depart_progra } from '@/api/opk/news/api' |
||||
|
import { ge_copy } from '@/api/opk/zxy/news/api' |
||||
|
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
||||
|
import { getDictFormData } from '@/api/dict' |
||||
|
import Dialog from './dialog.vue' |
||||
|
import Dialoglog from './dialoglog.vue' |
||||
|
import Yg from './yg.vue' |
||||
|
// eslint-disable-next-line vue/require-prop-types |
||||
|
const { addShow, title } = defineProps(['addShow', 'title']) |
||||
|
const data = reactive({ |
||||
|
formInline:{ |
||||
|
region:'', |
||||
|
}, |
||||
|
title:"", |
||||
|
addPostBox: false, |
||||
|
edPostBox:false, |
||||
|
ygPostBox:false, |
||||
|
}) |
||||
|
const orgTreeProps ={ |
||||
|
label: 'name', |
||||
|
children:'child' |
||||
|
} |
||||
|
const orgTreeProp ={ |
||||
|
label: 'title', |
||||
|
children:'childen' |
||||
|
} |
||||
|
const formdat = { |
||||
|
someProp:"", |
||||
|
} |
||||
|
const total =ref(0) |
||||
|
const rowInfo = ref<any>({}) |
||||
|
const postIds = ref<number[]>([]) |
||||
|
const tableData = ref<any>([]); |
||||
|
const tables = ref<any>([]); |
||||
|
// 获取侧栏数据 |
||||
|
function jjjs(){ |
||||
|
addPostCont("/hrapi/org/govthree","post") |
||||
|
.then(data => { |
||||
|
tableData.value = data.data[3].child[14].child; |
||||
|
}) |
||||
|
.catch(error => { |
||||
|
console.error('Error fetching data:', error); |
||||
|
}); |
||||
|
} |
||||
|
jjjs() |
||||
|
function editPost(){ |
||||
|
editPostCont({}) |
||||
|
.then(data => { |
||||
|
tables.value = data.data.list; |
||||
|
}) |
||||
|
} |
||||
|
editPost() |
||||
|
const table = ref<any>([]) |
||||
|
const formdate = reactive({ |
||||
|
page:0, |
||||
|
pagesize:20, |
||||
|
name:"", |
||||
|
dimension:"", |
||||
|
attribute:"", |
||||
|
orgidlist:"", |
||||
|
type:"", |
||||
|
value1:"2023", |
||||
|
}) |
||||
|
// 获取数据 |
||||
|
const tableq = ref([]) |
||||
|
const postt = ()=>{ |
||||
|
const ass = new Date(formdate.value1); |
||||
|
const qwe = ass.getFullYear(); |
||||
|
const zjr = qwe.toString(); |
||||
|
departmentprogramme({orgid:formdate.orgidlist,year:zjr,version:formdate.name}) |
||||
|
.then(data => { |
||||
|
tableq.value = data.data; |
||||
|
total.value = data.data.count; |
||||
|
}) |
||||
|
} |
||||
|
// 新增数据 |
||||
|
const addtableData = ()=>{ |
||||
|
data.addPostBox = true; |
||||
|
} |
||||
|
// 添加行 |
||||
|
const addRow = (val:any)=> { |
||||
|
tableData.value.push(val); |
||||
|
} |
||||
|
// 编辑行 |
||||
|
const editRow = (val:any)=> { |
||||
|
let index =tableData.value.findIndex( |
||||
|
(item:any) => item.id === val.id |
||||
|
); |
||||
|
tableData.value.splice(index, 1, val); |
||||
|
} |
||||
|
// 关闭弹窗 |
||||
|
const closeDetail = ()=>{ |
||||
|
data.addPostBox = false; |
||||
|
} |
||||
|
function editPostState(classId:string,state:number){ |
||||
|
console.log("改变状态--------->",classId,state) |
||||
|
let statusVal = 1 |
||||
|
if( state == 1) statusVal = 2; |
||||
|
edit_depart({id:classId,state:statusVal,istrue:2}) |
||||
|
postt() |
||||
|
} |
||||
|
// 删除数据 |
||||
|
const handleDel = (val:any) => { |
||||
|
const dictTypeIds = [val.outID || postIds.value].join(","); |
||||
|
let dictTypeIdAry = dictTypeIds.split(",") |
||||
|
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
||||
|
confirmButtonText: "确认", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
const add = val.key.toString() |
||||
|
handleSure(val) |
||||
|
console.log(val.id) |
||||
|
edit_depart({id:add,state:3,istrue:2}).then(()=> |
||||
|
ElMessage.success("删除成功")) |
||||
|
postt() |
||||
|
}) |
||||
|
}; |
||||
|
const handleSure = (val:any)=> { |
||||
|
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
||||
|
if(index!=-1){ |
||||
|
tableData.value.splice(index, 1); |
||||
|
} |
||||
|
} |
||||
|
const resetChecked=()=> { |
||||
|
formdate.orgidlist = "" |
||||
|
postt() |
||||
|
} |
||||
|
const handle=(data:any)=>{ |
||||
|
formdate.orgidlist = data.id.toString() |
||||
|
postt() |
||||
|
} |
||||
|
const handleErd=(val:any)=>{ |
||||
|
data.edPostBox=true; |
||||
|
rowInfo.value=val; |
||||
|
} |
||||
|
const handleio=(val:any)=>{ |
||||
|
data.ygPostBox=true; |
||||
|
rowInfo.value = val; |
||||
|
} |
||||
|
|
||||
|
const flitterData4 = (data:any)=>{ |
||||
|
let spanOneArr = [] as any[] |
||||
|
let concatOne = 0 |
||||
|
data.value.forEach((item:any,index:any)=>{ |
||||
|
if(index === 0){ |
||||
|
spanOneArr.push(1) |
||||
|
}else{ |
||||
|
//name 修改 |
||||
|
if(item.department === data.value[index - 1].department){ //第一列需合并相同内容的字段 |
||||
|
spanOneArr[concatOne] += 1 |
||||
|
spanOneArr.push(0) |
||||
|
}else{ |
||||
|
spanOneArr.push(1) |
||||
|
concatOne = index |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
return { |
||||
|
one: spanOneArr, |
||||
|
} |
||||
|
} |
||||
|
function objectSpanMethod({row, column, rowIndex, columnIndex}:any){ |
||||
|
if(columnIndex === 0 ) { |
||||
|
// this.tableData 修改 |
||||
|
const _row = (flitterData4(tableq).one)[rowIndex] |
||||
|
const _col = _row > 0 ? 1 : 0 |
||||
|
return { |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
onMounted(()=>{ |
||||
|
jjjs() |
||||
|
postt() |
||||
|
}) |
||||
|
</script> |
||||
|
<template> |
||||
|
<div class="m-2"> |
||||
|
<el-container clss="m-4"> |
||||
|
<div class="qwe"> |
||||
|
<el-button type="primary" style="width: 140px" size="large" @click="resetChecked">全选</el-button> |
||||
|
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @node-click="handle"/> |
||||
|
</div> |
||||
|
<el-divider direction="vertical"/> |
||||
|
<el-col :span="22"> |
||||
|
<el-container class="wer"> |
||||
|
<el-form-item label="方案版本号:"> |
||||
|
<el-input v-model="formdate.name" placeholder="请输入方案版本号" clearable style="width:200px"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="年度:" label-width="90"> |
||||
|
<el-date-picker v-model="formdate.value1" type="year"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label-width="25"> |
||||
|
<el-button type="primary" @click="postt"><el-icon><Search /></el-icon>查询</el-button> |
||||
|
<el-button class="new_btn" type="warning" @click="addtableData"><el-icon><Plus /></el-icon>新增</el-button> |
||||
|
</el-form-item> |
||||
|
</el-container> |
||||
|
<el-table class="m-1" :data="tableq" :span-method="objectSpanMethod" border style="width: 100%"> |
||||
|
<el-table-column prop="groupname,deaprtname," label="部门"> |
||||
|
<template #default="scope"> |
||||
|
{{scope.row.groupname}}{{scope.row.deaprtname}} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="year" label="年" width="70"/> |
||||
|
<el-table-column prop="key" label="版本号"/> |
||||
|
<el-table-column prop="time" label="时间" /> |
||||
|
<el-table-column prop="state" label="状态" width="70"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch v-model="scope.row.state" :inactive-value="1" :active-value="2" class="ml-2" inline-prompt style="--el-switch-on-color: #ff4949; --el-switch-off-color: #13ce66" @change="editPostState(scope.row.key,scope.row.state)"/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column fixed="right" label="操作" width="228"> |
||||
|
<template #default="{ row }"> |
||||
|
<el-button type="primary" link @click="handleio(row)"><el-icon><View /></el-icon>查看详情</el-button> |
||||
|
<el-button type="primary" link @click="handleErd(row)"><el-icon><DocumentChecked /></el-icon>复制</el-button> |
||||
|
<el-button type="primary" link @click="handleDel(row)"><el-icon><Delete /></el-icon>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-col> |
||||
|
</el-container> |
||||
|
<pagination v-if="total > 0" v-model:page="formdate.page" v-model:pagesize="formdate.pagesize" :total="total" @click="postt"/> |
||||
|
<Dialog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Dialog> |
||||
|
<Dialoglog v-if="data.edPostBox" v-model="data.edPostBox" :title="title" :row-info="rowInfo"></Dialoglog> |
||||
|
<Yg v-if="data.ygPostBox" v-model="data.ygPostBox" :title="title" :row-info="rowInfo"></Yg> |
||||
|
</div> |
||||
|
</template> |
||||
|
<style lang='scss' scoped> |
||||
|
.qwe { |
||||
|
margin:-8px 0 0 -6px; |
||||
|
float:right; |
||||
|
} |
||||
|
.wer{ |
||||
|
margin:-5px 0 0 20px; |
||||
|
font-weight:normal; |
||||
|
} |
||||
|
.horizontal-controls { |
||||
|
display: flex; |
||||
|
float: left; |
||||
|
|
||||
|
} |
||||
|
.el-divider--vertical{ |
||||
|
display:inline-block; |
||||
|
width:1px; |
||||
|
height:812px; |
||||
|
margin:0 8px; |
||||
|
vertical-align:middle; |
||||
|
position:relative; |
||||
|
} |
||||
|
|
||||
|
/* 可以根据需要调整样式 */ |
||||
|
</style> |
||||
@ -0,0 +1,265 @@ |
|||||
|
<!-- |
||||
|
@ 作者: 鲁智强 |
||||
|
@ 时间: 2023-09-19 09:13:14 |
||||
|
@ 备注: |
||||
|
--> |
||||
|
<script lang='ts' setup> |
||||
|
import {ref,reactive,onMounted} from 'vue' |
||||
|
import { organdpost,posttarget,set_posttarget } from '@/api/opk/api' |
||||
|
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
||||
|
import { editPostCont } from '@/api/opk/pulic/api' |
||||
|
import { departmentprogramme,edit_depart,edit_depart_progra } from '@/api/opk/news/api' |
||||
|
import { ge_copy } from '@/api/opk/zxy/news/api' |
||||
|
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
||||
|
import { getDictFormData } from '@/api/dict' |
||||
|
import Dialog from './dialog.vue' |
||||
|
import Dialoglog from './dialoglog.vue' |
||||
|
import Yg from './yg.vue' |
||||
|
// eslint-disable-next-line vue/require-prop-types |
||||
|
const { addShow, title } = defineProps(['addShow', 'title']) |
||||
|
const data = reactive({ |
||||
|
formInline:{ |
||||
|
region:'', |
||||
|
}, |
||||
|
title:"", |
||||
|
addPostBox: false, |
||||
|
edPostBox:false, |
||||
|
ygPostBox:false, |
||||
|
}) |
||||
|
const orgTreeProps ={ |
||||
|
label: 'name', |
||||
|
children:'child' |
||||
|
} |
||||
|
const orgTreeProp ={ |
||||
|
label: 'title', |
||||
|
children:'childen' |
||||
|
} |
||||
|
const formdat = { |
||||
|
someProp:"", |
||||
|
} |
||||
|
const total =ref(0) |
||||
|
const rowInfo = ref<any>({}) |
||||
|
const postIds = ref<number[]>([]) |
||||
|
const tableData = ref<any>([]); |
||||
|
const tables = ref<any>([]); |
||||
|
// 获取侧栏数据 |
||||
|
function jjjs(){ |
||||
|
addPostCont("/hrapi/org/govthree","post") |
||||
|
.then(data => { |
||||
|
tableData.value = data.data[3].child[14].child; |
||||
|
}) |
||||
|
.catch(error => { |
||||
|
console.error('Error fetching data:', error); |
||||
|
}); |
||||
|
} |
||||
|
jjjs() |
||||
|
function editPost(){ |
||||
|
editPostCont({}) |
||||
|
.then(data => { |
||||
|
tables.value = data.data.list; |
||||
|
}) |
||||
|
} |
||||
|
editPost() |
||||
|
const table = ref<any>([]) |
||||
|
const formdate = reactive({ |
||||
|
page:0, |
||||
|
pagesize:20, |
||||
|
name:"", |
||||
|
dimension:"", |
||||
|
attribute:"", |
||||
|
orgidlist:"", |
||||
|
type:"", |
||||
|
value1:"2023", |
||||
|
}) |
||||
|
// 获取数据 |
||||
|
const tableq = ref([]) |
||||
|
const postt = ()=>{ |
||||
|
const ass = new Date(formdate.value1); |
||||
|
const qwe = ass.getFullYear(); |
||||
|
const zjr = qwe.toString(); |
||||
|
departmentprogramme({orgid:formdate.orgidlist,year:zjr,version:formdate.name}) |
||||
|
.then(data => { |
||||
|
tableq.value = data.data; |
||||
|
total.value = data.data.count; |
||||
|
}) |
||||
|
} |
||||
|
// 新增数据 |
||||
|
const addtableData = ()=>{ |
||||
|
data.addPostBox = true; |
||||
|
} |
||||
|
// 添加行 |
||||
|
const addRow = (val:any)=> { |
||||
|
tableData.value.push(val); |
||||
|
} |
||||
|
// 编辑行 |
||||
|
const editRow = (val:any)=> { |
||||
|
let index =tableData.value.findIndex( |
||||
|
(item:any) => item.id === val.id |
||||
|
); |
||||
|
tableData.value.splice(index, 1, val); |
||||
|
} |
||||
|
// 关闭弹窗 |
||||
|
const closeDetail = ()=>{ |
||||
|
data.addPostBox = false; |
||||
|
} |
||||
|
function editPostState(classId:string,state:number){ |
||||
|
console.log("改变状态--------->",classId,state) |
||||
|
let statusVal = 1 |
||||
|
if( state == 2) statusVal = 2; |
||||
|
edit_depart({id:classId,state:statusVal,istrue:2}) |
||||
|
postt() |
||||
|
} |
||||
|
// 删除数据 |
||||
|
const handleDel = (val:any) => { |
||||
|
const dictTypeIds = [val.outID || postIds.value].join(","); |
||||
|
let dictTypeIdAry = dictTypeIds.split(",") |
||||
|
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
||||
|
confirmButtonText: "确认", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
const add = val.key.toString() |
||||
|
handleSure(val) |
||||
|
console.log(val.id) |
||||
|
edit_depart({id:add,state:3,istrue:2}).then(()=> |
||||
|
ElMessage.success("删除成功")) |
||||
|
postt() |
||||
|
}) |
||||
|
}; |
||||
|
const handleSure = (val:any)=> { |
||||
|
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
||||
|
if(index!=-1){ |
||||
|
tableData.value.splice(index, 1); |
||||
|
} |
||||
|
} |
||||
|
const resetChecked=()=> { |
||||
|
formdate.orgidlist = "" |
||||
|
postt() |
||||
|
} |
||||
|
const handle=(data:any)=>{ |
||||
|
formdate.orgidlist = data.id.toString() |
||||
|
postt() |
||||
|
} |
||||
|
const handleErd=(val:any)=>{ |
||||
|
data.edPostBox=true; |
||||
|
rowInfo.value=val; |
||||
|
} |
||||
|
const handleio=(val:any)=>{ |
||||
|
data.ygPostBox=true; |
||||
|
rowInfo.value = val; |
||||
|
} |
||||
|
|
||||
|
const flitterData4 = (data:any)=>{ |
||||
|
let spanOneArr = [] as any[] |
||||
|
let concatOne = 0 |
||||
|
data.value.forEach((item:any,index:any)=>{ |
||||
|
if(index === 0){ |
||||
|
spanOneArr.push(1) |
||||
|
}else{ |
||||
|
//name 修改 |
||||
|
if(item.department === data.value[index - 1].department){ //第一列需合并相同内容的字段 |
||||
|
spanOneArr[concatOne] += 1 |
||||
|
spanOneArr.push(0) |
||||
|
}else{ |
||||
|
spanOneArr.push(1) |
||||
|
concatOne = index |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
return { |
||||
|
one: spanOneArr, |
||||
|
} |
||||
|
} |
||||
|
function objectSpanMethod({row, column, rowIndex, columnIndex}:any){ |
||||
|
if(columnIndex === 0 ) { |
||||
|
// this.tableData 修改 |
||||
|
const _row = (flitterData4(tableq).one)[rowIndex] |
||||
|
const _col = _row > 0 ? 1 : 0 |
||||
|
return { |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
onMounted(()=>{ |
||||
|
jjjs() |
||||
|
postt() |
||||
|
}) |
||||
|
</script> |
||||
|
<template> |
||||
|
<div class="m-2"> |
||||
|
<el-container clss="m-4"> |
||||
|
<div class="qwe"> |
||||
|
<el-button type="primary" style="width: 140px" size="large" @click="resetChecked">全选</el-button> |
||||
|
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @node-click="handle"/> |
||||
|
</div> |
||||
|
<el-divider direction="vertical"/> |
||||
|
<el-col :span="22"> |
||||
|
<el-container class="wer"> |
||||
|
<el-form-item label="方案版本号:"> |
||||
|
<el-input v-model="formdate.name" placeholder="请输入方案版本号" clearable style="width:200px"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="年度:" label-width="90"> |
||||
|
<el-date-picker v-model="formdate.value1" type="year"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label-width="25"> |
||||
|
<el-button type="primary" @click="postt"><el-icon><Search /></el-icon>查询</el-button> |
||||
|
<el-button class="new_btn" type="warning" @click="addtableData"><el-icon><Plus /></el-icon>新增</el-button> |
||||
|
</el-form-item> |
||||
|
</el-container> |
||||
|
<el-table class="m-1" :data="tableq" :span-method="objectSpanMethod" border style="width: 100%"> |
||||
|
<el-table-column prop="groupname,deaprtname," label="部门"> |
||||
|
<template #default="scope"> |
||||
|
{{scope.row.groupname}}{{scope.row.deaprtname}} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="year" label="年" width="70"/> |
||||
|
<el-table-column prop="key" label="版本号"/> |
||||
|
<el-table-column prop="time" label="时间" /> |
||||
|
<el-table-column prop="state" label="状态" width="70"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch v-model="scope.row.state" :inactive-value="1" :active-value="2" class="ml-2" inline-prompt style="--el-switch-on-color: #ff4949; --el-switch-off-color: #13ce66" @change="editPostState(scope.row.key,scope.row.state)"/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column fixed="right" label="操作" width="228"> |
||||
|
<template #default="{ row }"> |
||||
|
<el-button type="primary" link @click="handleio(row)"><el-icon><View /></el-icon>查看详情</el-button> |
||||
|
<el-button type="primary" link @click="handleErd(row)"><el-icon><DocumentChecked /></el-icon>复制</el-button> |
||||
|
<el-button type="primary" link @click="handleDel(row)"><el-icon><Delete /></el-icon>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-col> |
||||
|
</el-container> |
||||
|
<pagination v-if="total > 0" v-model:page="formdate.page" v-model:pagesize="formdate.pagesize" :total="total" @click="postt"/> |
||||
|
<Dialog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Dialog> |
||||
|
<Dialoglog v-if="data.edPostBox" v-model="data.edPostBox" :title="title" :row-info="rowInfo"></Dialoglog> |
||||
|
<Yg v-if="data.ygPostBox" v-model="data.ygPostBox" :title="title" :row-info="rowInfo"></Yg> |
||||
|
</div> |
||||
|
</template> |
||||
|
<style lang='scss' scoped> |
||||
|
.qwe { |
||||
|
margin:-8px 0 0 -6px; |
||||
|
float:right; |
||||
|
} |
||||
|
.wer{ |
||||
|
margin:-5px 0 0 20px; |
||||
|
font-weight:normal; |
||||
|
} |
||||
|
.horizontal-controls { |
||||
|
display: flex; |
||||
|
float: left; |
||||
|
|
||||
|
} |
||||
|
.el-divider--vertical{ |
||||
|
display:inline-block; |
||||
|
width:1px; |
||||
|
height:812px; |
||||
|
margin:0 8px; |
||||
|
vertical-align:middle; |
||||
|
position:relative; |
||||
|
} |
||||
|
|
||||
|
/* 可以根据需要调整样式 */ |
||||
|
</style> |
||||
@ -0,0 +1,265 @@ |
|||||
|
<!-- |
||||
|
@ 作者: 鲁智强 |
||||
|
@ 时间: 2023-09-19 09:13:14 |
||||
|
@ 备注: |
||||
|
--> |
||||
|
<script lang='ts' setup> |
||||
|
import {ref,reactive,onMounted} from 'vue' |
||||
|
import { organdpost,posttarget,set_posttarget } from '@/api/opk/api' |
||||
|
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
||||
|
import { editPostCont } from '@/api/opk/pulic/api' |
||||
|
import { departmentprogramme,edit_depart,edit_depart_progra } from '@/api/opk/news/api' |
||||
|
import { ge_copy } from '@/api/opk/zxy/news/api' |
||||
|
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
||||
|
import { getDictFormData } from '@/api/dict' |
||||
|
import Dialog from './dialog.vue' |
||||
|
import Dialoglog from './dialoglog.vue' |
||||
|
import Yg from './yg.vue' |
||||
|
// eslint-disable-next-line vue/require-prop-types |
||||
|
const { addShow, title } = defineProps(['addShow', 'title']) |
||||
|
const data = reactive({ |
||||
|
formInline:{ |
||||
|
region:'', |
||||
|
}, |
||||
|
title:"", |
||||
|
addPostBox: false, |
||||
|
edPostBox:false, |
||||
|
ygPostBox:false, |
||||
|
}) |
||||
|
const orgTreeProps ={ |
||||
|
label: 'name', |
||||
|
children:'child' |
||||
|
} |
||||
|
const orgTreeProp ={ |
||||
|
label: 'title', |
||||
|
children:'childen' |
||||
|
} |
||||
|
const formdat = { |
||||
|
someProp:"", |
||||
|
} |
||||
|
const total =ref(0) |
||||
|
const rowInfo = ref<any>({}) |
||||
|
const postIds = ref<number[]>([]) |
||||
|
const tableData = ref<any>([]); |
||||
|
const tables = ref<any>([]); |
||||
|
// 获取侧栏数据 |
||||
|
function jjjs(){ |
||||
|
addPostCont("/hrapi/org/govthree","post") |
||||
|
.then(data => { |
||||
|
tableData.value = data.data[3].child[14].child; |
||||
|
}) |
||||
|
.catch(error => { |
||||
|
console.error('Error fetching data:', error); |
||||
|
}); |
||||
|
} |
||||
|
jjjs() |
||||
|
function editPost(){ |
||||
|
editPostCont({}) |
||||
|
.then(data => { |
||||
|
tables.value = data.data.list; |
||||
|
}) |
||||
|
} |
||||
|
editPost() |
||||
|
const table = ref<any>([]) |
||||
|
const formdate = reactive({ |
||||
|
page:0, |
||||
|
pagesize:20, |
||||
|
name:"", |
||||
|
dimension:"", |
||||
|
attribute:"", |
||||
|
orgidlist:"", |
||||
|
type:"", |
||||
|
value1:"2023", |
||||
|
}) |
||||
|
// 获取数据 |
||||
|
const tableq = ref([]) |
||||
|
const postt = ()=>{ |
||||
|
const ass = new Date(formdate.value1); |
||||
|
const qwe = ass.getFullYear(); |
||||
|
const zjr = qwe.toString(); |
||||
|
departmentprogramme({orgid:formdate.orgidlist,year:zjr,version:formdate.name}) |
||||
|
.then(data => { |
||||
|
tableq.value = data.data; |
||||
|
total.value = data.data.count; |
||||
|
}) |
||||
|
} |
||||
|
// 新增数据 |
||||
|
const addtableData = ()=>{ |
||||
|
data.addPostBox = true; |
||||
|
} |
||||
|
// 添加行 |
||||
|
const addRow = (val:any)=> { |
||||
|
tableData.value.push(val); |
||||
|
} |
||||
|
// 编辑行 |
||||
|
const editRow = (val:any)=> { |
||||
|
let index =tableData.value.findIndex( |
||||
|
(item:any) => item.id === val.id |
||||
|
); |
||||
|
tableData.value.splice(index, 1, val); |
||||
|
} |
||||
|
// 关闭弹窗 |
||||
|
const closeDetail = ()=>{ |
||||
|
data.addPostBox = false; |
||||
|
} |
||||
|
function editPostState(classId:string,state:number){ |
||||
|
console.log("改变状态--------->",classId,state) |
||||
|
let statusVal = 1 |
||||
|
if( state == 1) statusVal = 2; |
||||
|
edit_depart({id:classId,state:statusVal,istrue:2}) |
||||
|
postt() |
||||
|
} |
||||
|
// 删除数据 |
||||
|
const handleDel = (val:any) => { |
||||
|
const dictTypeIds = [val.outID || postIds.value].join(","); |
||||
|
let dictTypeIdAry = dictTypeIds.split(",") |
||||
|
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
||||
|
confirmButtonText: "确认", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
const add = val.key.toString() |
||||
|
handleSure(val) |
||||
|
console.log(val.id) |
||||
|
edit_depart({id:add,state:3,istrue:2}).then(()=> |
||||
|
ElMessage.success("删除成功")) |
||||
|
postt() |
||||
|
}) |
||||
|
}; |
||||
|
const handleSure = (val:any)=> { |
||||
|
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
||||
|
if(index!=-1){ |
||||
|
tableData.value.splice(index, 1); |
||||
|
} |
||||
|
} |
||||
|
const resetChecked=()=> { |
||||
|
formdate.orgidlist = "" |
||||
|
postt() |
||||
|
} |
||||
|
const handle=(data:any)=>{ |
||||
|
formdate.orgidlist = data.id.toString() |
||||
|
postt() |
||||
|
} |
||||
|
const handleErd=(val:any)=>{ |
||||
|
data.edPostBox=true; |
||||
|
rowInfo.value=val; |
||||
|
} |
||||
|
const handleio=(val:any)=>{ |
||||
|
data.ygPostBox=true; |
||||
|
rowInfo.value = val; |
||||
|
} |
||||
|
|
||||
|
const flitterData4 = (data:any)=>{ |
||||
|
let spanOneArr = [] as any[] |
||||
|
let concatOne = 0 |
||||
|
data.value.forEach((item:any,index:any)=>{ |
||||
|
if(index === 0){ |
||||
|
spanOneArr.push(1) |
||||
|
}else{ |
||||
|
//name 修改 |
||||
|
if(item.department === data.value[index - 1].department){ //第一列需合并相同内容的字段 |
||||
|
spanOneArr[concatOne] += 1 |
||||
|
spanOneArr.push(0) |
||||
|
}else{ |
||||
|
spanOneArr.push(1) |
||||
|
concatOne = index |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
return { |
||||
|
one: spanOneArr, |
||||
|
} |
||||
|
} |
||||
|
function objectSpanMethod({row, column, rowIndex, columnIndex}:any){ |
||||
|
if(columnIndex === 0 ) { |
||||
|
// this.tableData 修改 |
||||
|
const _row = (flitterData4(tableq).one)[rowIndex] |
||||
|
const _col = _row > 0 ? 1 : 0 |
||||
|
return { |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
onMounted(()=>{ |
||||
|
jjjs() |
||||
|
postt() |
||||
|
}) |
||||
|
</script> |
||||
|
<template> |
||||
|
<div class="m-2"> |
||||
|
<el-container clss="m-4"> |
||||
|
<div class="qwe"> |
||||
|
<el-button type="primary" style="width: 140px" size="large" @click="resetChecked">全选</el-button> |
||||
|
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @node-click="handle"/> |
||||
|
</div> |
||||
|
<el-divider direction="vertical"/> |
||||
|
<el-col :span="22"> |
||||
|
<el-container class="wer"> |
||||
|
<el-form-item label="方案版本号:"> |
||||
|
<el-input v-model="formdate.name" placeholder="请输入方案版本号" clearable style="width:200px"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="年度:" label-width="90"> |
||||
|
<el-date-picker v-model="formdate.value1" type="year"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label-width="25"> |
||||
|
<el-button type="primary" @click="postt"><el-icon><Search /></el-icon>查询</el-button> |
||||
|
<el-button class="new_btn" type="warning" @click="addtableData"><el-icon><Plus /></el-icon>新增</el-button> |
||||
|
</el-form-item> |
||||
|
</el-container> |
||||
|
<el-table class="m-1" :data="tableq" :span-method="objectSpanMethod" border style="width: 100%"> |
||||
|
<el-table-column prop="groupname,deaprtname," label="部门"> |
||||
|
<template #default="scope"> |
||||
|
{{scope.row.groupname}}{{scope.row.deaprtname}} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="year" label="年" width="70"/> |
||||
|
<el-table-column prop="key" label="版本号"/> |
||||
|
<el-table-column prop="time" label="时间" /> |
||||
|
<el-table-column prop="state" label="状态" width="70"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch v-model="scope.row.state" :inactive-value="1" :active-value="2" class="ml-2" inline-prompt style="--el-switch-on-color: #ff4949; --el-switch-off-color: #13ce66" @change="editPostState(scope.row.key,scope.row.state)"/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column fixed="right" label="操作" width="228"> |
||||
|
<template #default="{ row }"> |
||||
|
<el-button type="primary" link @click="handleio(row)"><el-icon><View /></el-icon>查看详情</el-button> |
||||
|
<el-button type="primary" link @click="handleErd(row)"><el-icon><DocumentChecked /></el-icon>复制</el-button> |
||||
|
<el-button type="primary" link @click="handleDel(row)"><el-icon><Delete /></el-icon>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-col> |
||||
|
</el-container> |
||||
|
<pagination v-if="total > 0" v-model:page="formdate.page" v-model:pagesize="formdate.pagesize" :total="total" @click="postt"/> |
||||
|
<Dialog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Dialog> |
||||
|
<Dialoglog v-if="data.edPostBox" v-model="data.edPostBox" :title="title" :row-info="rowInfo"></Dialoglog> |
||||
|
<Yg v-if="data.ygPostBox" v-model="data.ygPostBox" :title="title" :row-info="rowInfo"></Yg> |
||||
|
</div> |
||||
|
</template> |
||||
|
<style lang='scss' scoped> |
||||
|
.qwe { |
||||
|
margin:-8px 0 0 -6px; |
||||
|
float:right; |
||||
|
} |
||||
|
.wer{ |
||||
|
margin:-5px 0 0 20px; |
||||
|
font-weight:normal; |
||||
|
} |
||||
|
.horizontal-controls { |
||||
|
display: flex; |
||||
|
float: left; |
||||
|
|
||||
|
} |
||||
|
.el-divider--vertical{ |
||||
|
display:inline-block; |
||||
|
width:1px; |
||||
|
height:812px; |
||||
|
margin:0 8px; |
||||
|
vertical-align:middle; |
||||
|
position:relative; |
||||
|
} |
||||
|
|
||||
|
/* 可以根据需要调整样式 */ |
||||
|
</style> |
||||
@ -0,0 +1,265 @@ |
|||||
|
<!-- |
||||
|
@ 作者: 鲁智强 |
||||
|
@ 时间: 2023-09-19 09:13:14 |
||||
|
@ 备注: |
||||
|
--> |
||||
|
<script lang='ts' setup> |
||||
|
import {ref,reactive,onMounted} from 'vue' |
||||
|
import { organdpost,posttarget,set_posttarget } from '@/api/opk/api' |
||||
|
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
||||
|
import { editPostCont } from '@/api/opk/pulic/api' |
||||
|
import { departmentprogramme,edit_depart,edit_depart_progra } from '@/api/opk/news/api' |
||||
|
import { ge_copy } from '@/api/opk/zxy/news/api' |
||||
|
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
||||
|
import { getDictFormData } from '@/api/dict' |
||||
|
import Dialog from './dialog.vue' |
||||
|
import Dialoglog from './dialoglog.vue' |
||||
|
import Yg from './yg.vue' |
||||
|
// eslint-disable-next-line vue/require-prop-types |
||||
|
const { addShow, title } = defineProps(['addShow', 'title']) |
||||
|
const data = reactive({ |
||||
|
formInline:{ |
||||
|
region:'', |
||||
|
}, |
||||
|
title:"", |
||||
|
addPostBox: false, |
||||
|
edPostBox:false, |
||||
|
ygPostBox:false, |
||||
|
}) |
||||
|
const orgTreeProps ={ |
||||
|
label: 'name', |
||||
|
children:'child' |
||||
|
} |
||||
|
const orgTreeProp ={ |
||||
|
label: 'title', |
||||
|
children:'childen' |
||||
|
} |
||||
|
const formdat = { |
||||
|
someProp:"", |
||||
|
} |
||||
|
const total =ref(0) |
||||
|
const rowInfo = ref<any>({}) |
||||
|
const postIds = ref<number[]>([]) |
||||
|
const tableData = ref<any>([]); |
||||
|
const tables = ref<any>([]); |
||||
|
// 获取侧栏数据 |
||||
|
function jjjs(){ |
||||
|
addPostCont("/hrapi/org/govthree","post") |
||||
|
.then(data => { |
||||
|
tableData.value = data.data[3].child[14].child; |
||||
|
}) |
||||
|
.catch(error => { |
||||
|
console.error('Error fetching data:', error); |
||||
|
}); |
||||
|
} |
||||
|
jjjs() |
||||
|
function editPost(){ |
||||
|
editPostCont({}) |
||||
|
.then(data => { |
||||
|
tables.value = data.data.list; |
||||
|
}) |
||||
|
} |
||||
|
editPost() |
||||
|
const table = ref<any>([]) |
||||
|
const formdate = reactive({ |
||||
|
page:0, |
||||
|
pagesize:20, |
||||
|
name:"", |
||||
|
dimension:"", |
||||
|
attribute:"", |
||||
|
orgidlist:"", |
||||
|
type:"", |
||||
|
value1:"2023", |
||||
|
}) |
||||
|
// 获取数据 |
||||
|
const tableq = ref([]) |
||||
|
const postt = ()=>{ |
||||
|
const ass = new Date(formdate.value1); |
||||
|
const qwe = ass.getFullYear(); |
||||
|
const zjr = qwe.toString(); |
||||
|
departmentprogramme({orgid:formdate.orgidlist,year:zjr,version:formdate.name}) |
||||
|
.then(data => { |
||||
|
tableq.value = data.data; |
||||
|
total.value = data.data.count; |
||||
|
}) |
||||
|
} |
||||
|
// 新增数据 |
||||
|
const addtableData = ()=>{ |
||||
|
data.addPostBox = true; |
||||
|
} |
||||
|
// 添加行 |
||||
|
const addRow = (val:any)=> { |
||||
|
tableData.value.push(val); |
||||
|
} |
||||
|
// 编辑行 |
||||
|
const editRow = (val:any)=> { |
||||
|
let index =tableData.value.findIndex( |
||||
|
(item:any) => item.id === val.id |
||||
|
); |
||||
|
tableData.value.splice(index, 1, val); |
||||
|
} |
||||
|
// 关闭弹窗 |
||||
|
const closeDetail = ()=>{ |
||||
|
data.addPostBox = false; |
||||
|
} |
||||
|
function editPostState(classId:string,state:number){ |
||||
|
console.log("改变状态--------->",classId,state) |
||||
|
let statusVal = 1 |
||||
|
if( state == 2) statusVal = 2; |
||||
|
edit_depart({id:classId,state:statusVal,istrue:2}) |
||||
|
postt() |
||||
|
} |
||||
|
// 删除数据 |
||||
|
const handleDel = (val:any) => { |
||||
|
const dictTypeIds = [val.outID || postIds.value].join(","); |
||||
|
let dictTypeIdAry = dictTypeIds.split(",") |
||||
|
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
||||
|
confirmButtonText: "确认", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
const add = val.key.toString() |
||||
|
handleSure(val) |
||||
|
console.log(val.id) |
||||
|
edit_depart({id:add,state:3,istrue:2}).then(()=> |
||||
|
ElMessage.success("删除成功")) |
||||
|
postt() |
||||
|
}) |
||||
|
}; |
||||
|
const handleSure = (val:any)=> { |
||||
|
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
||||
|
if(index!=-1){ |
||||
|
tableData.value.splice(index, 1); |
||||
|
} |
||||
|
} |
||||
|
const resetChecked=()=> { |
||||
|
formdate.orgidlist = "" |
||||
|
postt() |
||||
|
} |
||||
|
const handle=(data:any)=>{ |
||||
|
formdate.orgidlist = data.id.toString() |
||||
|
postt() |
||||
|
} |
||||
|
const handleErd=(val:any)=>{ |
||||
|
data.edPostBox=true; |
||||
|
rowInfo.value=val; |
||||
|
} |
||||
|
const handleio=(val:any)=>{ |
||||
|
data.ygPostBox=true; |
||||
|
rowInfo.value = val; |
||||
|
} |
||||
|
|
||||
|
const flitterData4 = (data:any)=>{ |
||||
|
let spanOneArr = [] as any[] |
||||
|
let concatOne = 0 |
||||
|
data.value.forEach((item:any,index:any)=>{ |
||||
|
if(index === 0){ |
||||
|
spanOneArr.push(1) |
||||
|
}else{ |
||||
|
//name 修改 |
||||
|
if(item.department === data.value[index - 1].department){ //第一列需合并相同内容的字段 |
||||
|
spanOneArr[concatOne] += 1 |
||||
|
spanOneArr.push(0) |
||||
|
}else{ |
||||
|
spanOneArr.push(1) |
||||
|
concatOne = index |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
return { |
||||
|
one: spanOneArr, |
||||
|
} |
||||
|
} |
||||
|
function objectSpanMethod({row, column, rowIndex, columnIndex}:any){ |
||||
|
if(columnIndex === 0 ) { |
||||
|
// this.tableData 修改 |
||||
|
const _row = (flitterData4(tableq).one)[rowIndex] |
||||
|
const _col = _row > 0 ? 1 : 0 |
||||
|
return { |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
onMounted(()=>{ |
||||
|
jjjs() |
||||
|
postt() |
||||
|
}) |
||||
|
</script> |
||||
|
<template> |
||||
|
<div class="m-2"> |
||||
|
<el-container clss="m-4"> |
||||
|
<div class="qwe"> |
||||
|
<el-button type="primary" style="width: 140px" size="large" @click="resetChecked">全选</el-button> |
||||
|
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @node-click="handle"/> |
||||
|
</div> |
||||
|
<el-divider direction="vertical"/> |
||||
|
<el-col :span="22"> |
||||
|
<el-container class="wer"> |
||||
|
<el-form-item label="方案版本号:"> |
||||
|
<el-input v-model="formdate.name" placeholder="请输入方案版本号" clearable style="width:200px"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="年度:" label-width="90"> |
||||
|
<el-date-picker v-model="formdate.value1" type="year"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label-width="25"> |
||||
|
<el-button type="primary" @click="postt"><el-icon><Search /></el-icon>查询</el-button> |
||||
|
<el-button class="new_btn" type="warning" @click="addtableData"><el-icon><Plus /></el-icon>新增</el-button> |
||||
|
</el-form-item> |
||||
|
</el-container> |
||||
|
<el-table class="m-1" :data="tableq" :span-method="objectSpanMethod" border style="width: 100%"> |
||||
|
<el-table-column prop="groupname,deaprtname," label="部门"> |
||||
|
<template #default="scope"> |
||||
|
{{scope.row.groupname}}{{scope.row.deaprtname}} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="year" label="年" width="70"/> |
||||
|
<el-table-column prop="key" label="版本号"/> |
||||
|
<el-table-column prop="time" label="时间" /> |
||||
|
<el-table-column prop="state" label="状态" width="70"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch v-model="scope.row.state" :inactive-value="1" :active-value="2" class="ml-2" inline-prompt style="--el-switch-on-color: #ff4949; --el-switch-off-color: #13ce66" @change="editPostState(scope.row.key,scope.row.state)"/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column fixed="right" label="操作" width="228"> |
||||
|
<template #default="{ row }"> |
||||
|
<el-button type="primary" link @click="handleio(row)"><el-icon><View /></el-icon>查看详情</el-button> |
||||
|
<el-button type="primary" link @click="handleErd(row)"><el-icon><DocumentChecked /></el-icon>复制</el-button> |
||||
|
<el-button type="primary" link @click="handleDel(row)"><el-icon><Delete /></el-icon>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-col> |
||||
|
</el-container> |
||||
|
<pagination v-if="total > 0" v-model:page="formdate.page" v-model:pagesize="formdate.pagesize" :total="total" @click="postt"/> |
||||
|
<Dialog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Dialog> |
||||
|
<Dialoglog v-if="data.edPostBox" v-model="data.edPostBox" :title="title" :row-info="rowInfo"></Dialoglog> |
||||
|
<Yg v-if="data.ygPostBox" v-model="data.ygPostBox" :title="title" :row-info="rowInfo"></Yg> |
||||
|
</div> |
||||
|
</template> |
||||
|
<style lang='scss' scoped> |
||||
|
.qwe { |
||||
|
margin:-8px 0 0 -6px; |
||||
|
float:right; |
||||
|
} |
||||
|
.wer{ |
||||
|
margin:-5px 0 0 20px; |
||||
|
font-weight:normal; |
||||
|
} |
||||
|
.horizontal-controls { |
||||
|
display: flex; |
||||
|
float: left; |
||||
|
|
||||
|
} |
||||
|
.el-divider--vertical{ |
||||
|
display:inline-block; |
||||
|
width:1px; |
||||
|
height:812px; |
||||
|
margin:0 8px; |
||||
|
vertical-align:middle; |
||||
|
position:relative; |
||||
|
} |
||||
|
|
||||
|
/* 可以根据需要调整样式 */ |
||||
|
</style> |
||||
@ -0,0 +1,265 @@ |
|||||
|
<!-- |
||||
|
@ 作者: 鲁智强 |
||||
|
@ 时间: 2023-09-19 09:13:14 |
||||
|
@ 备注: |
||||
|
--> |
||||
|
<script lang='ts' setup> |
||||
|
import {ref,reactive,onMounted} from 'vue' |
||||
|
import { organdpost,posttarget,set_posttarget } from '@/api/opk/api' |
||||
|
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
||||
|
import { editPostCont } from '@/api/opk/pulic/api' |
||||
|
import { departmentprogramme,edit_depart,edit_depart_progra } from '@/api/opk/news/api' |
||||
|
import { ge_copy } from '@/api/opk/zxy/news/api' |
||||
|
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
||||
|
import { getDictFormData } from '@/api/dict' |
||||
|
import Dialog from './dialog.vue' |
||||
|
import Dialoglog from './dialoglog.vue' |
||||
|
import Yg from './yg.vue' |
||||
|
// eslint-disable-next-line vue/require-prop-types |
||||
|
const { addShow, title } = defineProps(['addShow', 'title']) |
||||
|
const data = reactive({ |
||||
|
formInline:{ |
||||
|
region:'', |
||||
|
}, |
||||
|
title:"", |
||||
|
addPostBox: false, |
||||
|
edPostBox:false, |
||||
|
ygPostBox:false, |
||||
|
}) |
||||
|
const orgTreeProps ={ |
||||
|
label: 'name', |
||||
|
children:'child' |
||||
|
} |
||||
|
const orgTreeProp ={ |
||||
|
label: 'title', |
||||
|
children:'childen' |
||||
|
} |
||||
|
const formdat = { |
||||
|
someProp:"", |
||||
|
} |
||||
|
const total =ref(0) |
||||
|
const rowInfo = ref<any>({}) |
||||
|
const postIds = ref<number[]>([]) |
||||
|
const tableData = ref<any>([]); |
||||
|
const tables = ref<any>([]); |
||||
|
// 获取侧栏数据 |
||||
|
function jjjs(){ |
||||
|
addPostCont("/hrapi/org/govthree","post") |
||||
|
.then(data => { |
||||
|
tableData.value = data.data[3].child[14].child; |
||||
|
}) |
||||
|
.catch(error => { |
||||
|
console.error('Error fetching data:', error); |
||||
|
}); |
||||
|
} |
||||
|
jjjs() |
||||
|
function editPost(){ |
||||
|
editPostCont({}) |
||||
|
.then(data => { |
||||
|
tables.value = data.data.list; |
||||
|
}) |
||||
|
} |
||||
|
editPost() |
||||
|
const table = ref<any>([]) |
||||
|
const formdate = reactive({ |
||||
|
page:0, |
||||
|
pagesize:20, |
||||
|
name:"", |
||||
|
dimension:"", |
||||
|
attribute:"", |
||||
|
orgidlist:"", |
||||
|
type:"", |
||||
|
value1:"2023", |
||||
|
}) |
||||
|
// 获取数据 |
||||
|
const tableq = ref([]) |
||||
|
const postt = ()=>{ |
||||
|
const ass = new Date(formdate.value1); |
||||
|
const qwe = ass.getFullYear(); |
||||
|
const zjr = qwe.toString(); |
||||
|
departmentprogramme({orgid:formdate.orgidlist,year:zjr,version:formdate.name}) |
||||
|
.then(data => { |
||||
|
tableq.value = data.data; |
||||
|
total.value = data.data.count; |
||||
|
}) |
||||
|
} |
||||
|
// 新增数据 |
||||
|
const addtableData = ()=>{ |
||||
|
data.addPostBox = true; |
||||
|
} |
||||
|
// 添加行 |
||||
|
const addRow = (val:any)=> { |
||||
|
tableData.value.push(val); |
||||
|
} |
||||
|
// 编辑行 |
||||
|
const editRow = (val:any)=> { |
||||
|
let index =tableData.value.findIndex( |
||||
|
(item:any) => item.id === val.id |
||||
|
); |
||||
|
tableData.value.splice(index, 1, val); |
||||
|
} |
||||
|
// 关闭弹窗 |
||||
|
const closeDetail = ()=>{ |
||||
|
data.addPostBox = false; |
||||
|
} |
||||
|
function editPostState(classId:string,state:number){ |
||||
|
console.log("改变状态--------->",classId,state) |
||||
|
let statusVal = 1 |
||||
|
if( state == 2) statusVal = 2; |
||||
|
edit_depart({id:classId,state:statusVal,istrue:2}) |
||||
|
postt() |
||||
|
} |
||||
|
// 删除数据 |
||||
|
const handleDel = (val:any) => { |
||||
|
const dictTypeIds = [val.outID || postIds.value].join(","); |
||||
|
let dictTypeIdAry = dictTypeIds.split(",") |
||||
|
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
||||
|
confirmButtonText: "确认", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
const add = val.key.toString() |
||||
|
handleSure(val) |
||||
|
console.log(val.id) |
||||
|
edit_depart({id:add,state:3,istrue:2}).then(()=> |
||||
|
ElMessage.success("删除成功")) |
||||
|
postt() |
||||
|
}) |
||||
|
}; |
||||
|
const handleSure = (val:any)=> { |
||||
|
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
||||
|
if(index!=-1){ |
||||
|
tableData.value.splice(index, 1); |
||||
|
} |
||||
|
} |
||||
|
const resetChecked=()=> { |
||||
|
formdate.orgidlist = "" |
||||
|
postt() |
||||
|
} |
||||
|
const handle=(data:any)=>{ |
||||
|
formdate.orgidlist = data.id.toString() |
||||
|
postt() |
||||
|
} |
||||
|
const handleErd=(val:any)=>{ |
||||
|
data.edPostBox=true; |
||||
|
rowInfo.value=val; |
||||
|
} |
||||
|
const handleio=(val:any)=>{ |
||||
|
data.ygPostBox=true; |
||||
|
rowInfo.value = val; |
||||
|
} |
||||
|
|
||||
|
const flitterData4 = (data:any)=>{ |
||||
|
let spanOneArr = [] as any[] |
||||
|
let concatOne = 0 |
||||
|
data.value.forEach((item:any,index:any)=>{ |
||||
|
if(index === 0){ |
||||
|
spanOneArr.push(1) |
||||
|
}else{ |
||||
|
//name 修改 |
||||
|
if(item.department === data.value[index - 1].department){ //第一列需合并相同内容的字段 |
||||
|
spanOneArr[concatOne] += 1 |
||||
|
spanOneArr.push(0) |
||||
|
}else{ |
||||
|
spanOneArr.push(1) |
||||
|
concatOne = index |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
return { |
||||
|
one: spanOneArr, |
||||
|
} |
||||
|
} |
||||
|
function objectSpanMethod({row, column, rowIndex, columnIndex}:any){ |
||||
|
if(columnIndex === 0 ) { |
||||
|
// this.tableData 修改 |
||||
|
const _row = (flitterData4(tableq).one)[rowIndex] |
||||
|
const _col = _row > 0 ? 1 : 0 |
||||
|
return { |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
onMounted(()=>{ |
||||
|
jjjs() |
||||
|
postt() |
||||
|
}) |
||||
|
</script> |
||||
|
<template> |
||||
|
<div class="m-2"> |
||||
|
<el-container clss="m-4"> |
||||
|
<div class="qwe"> |
||||
|
<el-button type="primary" style="width: 140px" size="large" @click="resetChecked">全选</el-button> |
||||
|
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @node-click="handle"/> |
||||
|
</div> |
||||
|
<el-divider direction="vertical"/> |
||||
|
<el-col :span="22"> |
||||
|
<el-container class="wer"> |
||||
|
<el-form-item label="方案版本号:"> |
||||
|
<el-input v-model="formdate.name" placeholder="请输入方案版本号" clearable style="width:200px"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="年度:" label-width="90"> |
||||
|
<el-date-picker v-model="formdate.value1" type="year"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label-width="25"> |
||||
|
<el-button type="primary" @click="postt"><el-icon><Search /></el-icon>查询</el-button> |
||||
|
<el-button class="new_btn" type="warning" @click="addtableData"><el-icon><Plus /></el-icon>新增</el-button> |
||||
|
</el-form-item> |
||||
|
</el-container> |
||||
|
<el-table class="m-1" :data="tableq" :span-method="objectSpanMethod" border style="width: 100%"> |
||||
|
<el-table-column prop="groupname,deaprtname," label="部门"> |
||||
|
<template #default="scope"> |
||||
|
{{scope.row.groupname}}{{scope.row.deaprtname}} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="year" label="年" width="70"/> |
||||
|
<el-table-column prop="key" label="版本号"/> |
||||
|
<el-table-column prop="time" label="时间" /> |
||||
|
<el-table-column prop="state" label="状态" width="70"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch v-model="scope.row.state" :inactive-value="1" :active-value="1" class="ml-2" inline-prompt style="--el-switch-on-color: #ff4949; --el-switch-off-color: #13ce66" @change="editPostState(scope.row.key,scope.row.state)"/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column fixed="right" label="操作" width="228"> |
||||
|
<template #default="{ row }"> |
||||
|
<el-button type="primary" link @click="handleio(row)"><el-icon><View /></el-icon>查看详情</el-button> |
||||
|
<el-button type="primary" link @click="handleErd(row)"><el-icon><DocumentChecked /></el-icon>复制</el-button> |
||||
|
<el-button type="primary" link @click="handleDel(row)"><el-icon><Delete /></el-icon>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-col> |
||||
|
</el-container> |
||||
|
<pagination v-if="total > 0" v-model:page="formdate.page" v-model:pagesize="formdate.pagesize" :total="total" @click="postt"/> |
||||
|
<Dialog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Dialog> |
||||
|
<Dialoglog v-if="data.edPostBox" v-model="data.edPostBox" :title="title" :row-info="rowInfo"></Dialoglog> |
||||
|
<Yg v-if="data.ygPostBox" v-model="data.ygPostBox" :title="title" :row-info="rowInfo"></Yg> |
||||
|
</div> |
||||
|
</template> |
||||
|
<style lang='scss' scoped> |
||||
|
.qwe { |
||||
|
margin:-8px 0 0 -6px; |
||||
|
float:right; |
||||
|
} |
||||
|
.wer{ |
||||
|
margin:-5px 0 0 20px; |
||||
|
font-weight:normal; |
||||
|
} |
||||
|
.horizontal-controls { |
||||
|
display: flex; |
||||
|
float: left; |
||||
|
|
||||
|
} |
||||
|
.el-divider--vertical{ |
||||
|
display:inline-block; |
||||
|
width:1px; |
||||
|
height:812px; |
||||
|
margin:0 8px; |
||||
|
vertical-align:middle; |
||||
|
position:relative; |
||||
|
} |
||||
|
|
||||
|
/* 可以根据需要调整样式 */ |
||||
|
</style> |
||||
@ -0,0 +1,265 @@ |
|||||
|
<!-- |
||||
|
@ 作者: 鲁智强 |
||||
|
@ 时间: 2023-09-19 09:13:14 |
||||
|
@ 备注: |
||||
|
--> |
||||
|
<script lang='ts' setup> |
||||
|
import {ref,reactive,onMounted} from 'vue' |
||||
|
import { organdpost,posttarget,set_posttarget } from '@/api/opk/api' |
||||
|
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
||||
|
import { editPostCont } from '@/api/opk/pulic/api' |
||||
|
import { departmentprogramme,edit_depart,edit_depart_progra } from '@/api/opk/news/api' |
||||
|
import { ge_copy } from '@/api/opk/zxy/news/api' |
||||
|
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
||||
|
import { getDictFormData } from '@/api/dict' |
||||
|
import Dialog from './dialog.vue' |
||||
|
import Dialoglog from './dialoglog.vue' |
||||
|
import Yg from './yg.vue' |
||||
|
// eslint-disable-next-line vue/require-prop-types |
||||
|
const { addShow, title } = defineProps(['addShow', 'title']) |
||||
|
const data = reactive({ |
||||
|
formInline:{ |
||||
|
region:'', |
||||
|
}, |
||||
|
title:"", |
||||
|
addPostBox: false, |
||||
|
edPostBox:false, |
||||
|
ygPostBox:false, |
||||
|
}) |
||||
|
const orgTreeProps ={ |
||||
|
label: 'name', |
||||
|
children:'child' |
||||
|
} |
||||
|
const orgTreeProp ={ |
||||
|
label: 'title', |
||||
|
children:'childen' |
||||
|
} |
||||
|
const formdat = { |
||||
|
someProp:"", |
||||
|
} |
||||
|
const total =ref(0) |
||||
|
const rowInfo = ref<any>({}) |
||||
|
const postIds = ref<number[]>([]) |
||||
|
const tableData = ref<any>([]); |
||||
|
const tables = ref<any>([]); |
||||
|
// 获取侧栏数据 |
||||
|
function jjjs(){ |
||||
|
addPostCont("/hrapi/org/govthree","post") |
||||
|
.then(data => { |
||||
|
tableData.value = data.data[3].child[14].child; |
||||
|
}) |
||||
|
.catch(error => { |
||||
|
console.error('Error fetching data:', error); |
||||
|
}); |
||||
|
} |
||||
|
jjjs() |
||||
|
function editPost(){ |
||||
|
editPostCont({}) |
||||
|
.then(data => { |
||||
|
tables.value = data.data.list; |
||||
|
}) |
||||
|
} |
||||
|
editPost() |
||||
|
const table = ref<any>([]) |
||||
|
const formdate = reactive({ |
||||
|
page:0, |
||||
|
pagesize:20, |
||||
|
name:"", |
||||
|
dimension:"", |
||||
|
attribute:"", |
||||
|
orgidlist:"", |
||||
|
type:"", |
||||
|
value1:"2023", |
||||
|
}) |
||||
|
// 获取数据 |
||||
|
const tableq = ref([]) |
||||
|
const postt = ()=>{ |
||||
|
const ass = new Date(formdate.value1); |
||||
|
const qwe = ass.getFullYear(); |
||||
|
const zjr = qwe.toString(); |
||||
|
departmentprogramme({orgid:formdate.orgidlist,year:zjr,version:formdate.name}) |
||||
|
.then(data => { |
||||
|
tableq.value = data.data; |
||||
|
total.value = data.data.count; |
||||
|
}) |
||||
|
} |
||||
|
// 新增数据 |
||||
|
const addtableData = ()=>{ |
||||
|
data.addPostBox = true; |
||||
|
} |
||||
|
// 添加行 |
||||
|
const addRow = (val:any)=> { |
||||
|
tableData.value.push(val); |
||||
|
} |
||||
|
// 编辑行 |
||||
|
const editRow = (val:any)=> { |
||||
|
let index =tableData.value.findIndex( |
||||
|
(item:any) => item.id === val.id |
||||
|
); |
||||
|
tableData.value.splice(index, 1, val); |
||||
|
} |
||||
|
// 关闭弹窗 |
||||
|
const closeDetail = ()=>{ |
||||
|
data.addPostBox = false; |
||||
|
} |
||||
|
function editPostState(classId:string,state:number){ |
||||
|
console.log("改变状态--------->",classId,state) |
||||
|
let statusVal = 1 |
||||
|
if( state == 2) statusVal = 2; |
||||
|
edit_depart({id:classId,state:statusVal,istrue:2}) |
||||
|
postt() |
||||
|
} |
||||
|
// 删除数据 |
||||
|
const handleDel = (val:any) => { |
||||
|
const dictTypeIds = [val.outID || postIds.value].join(","); |
||||
|
let dictTypeIdAry = dictTypeIds.split(",") |
||||
|
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
||||
|
confirmButtonText: "确认", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
const add = val.key.toString() |
||||
|
handleSure(val) |
||||
|
console.log(val.id) |
||||
|
edit_depart({id:add,state:3,istrue:2}).then(()=> |
||||
|
ElMessage.success("删除成功")) |
||||
|
postt() |
||||
|
}) |
||||
|
}; |
||||
|
const handleSure = (val:any)=> { |
||||
|
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
||||
|
if(index!=-1){ |
||||
|
tableData.value.splice(index, 1); |
||||
|
} |
||||
|
} |
||||
|
const resetChecked=()=> { |
||||
|
formdate.orgidlist = "" |
||||
|
postt() |
||||
|
} |
||||
|
const handle=(data:any)=>{ |
||||
|
formdate.orgidlist = data.id.toString() |
||||
|
postt() |
||||
|
} |
||||
|
const handleErd=(val:any)=>{ |
||||
|
data.edPostBox=true; |
||||
|
rowInfo.value=val; |
||||
|
} |
||||
|
const handleio=(val:any)=>{ |
||||
|
data.ygPostBox=true; |
||||
|
rowInfo.value = val; |
||||
|
} |
||||
|
|
||||
|
const flitterData4 = (data:any)=>{ |
||||
|
let spanOneArr = [] as any[] |
||||
|
let concatOne = 0 |
||||
|
data.value.forEach((item:any,index:any)=>{ |
||||
|
if(index === 0){ |
||||
|
spanOneArr.push(1) |
||||
|
}else{ |
||||
|
//name 修改 |
||||
|
if(item.department === data.value[index - 1].department){ //第一列需合并相同内容的字段 |
||||
|
spanOneArr[concatOne] += 1 |
||||
|
spanOneArr.push(0) |
||||
|
}else{ |
||||
|
spanOneArr.push(1) |
||||
|
concatOne = index |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
return { |
||||
|
one: spanOneArr, |
||||
|
} |
||||
|
} |
||||
|
function objectSpanMethod({row, column, rowIndex, columnIndex}:any){ |
||||
|
if(columnIndex === 0 ) { |
||||
|
// this.tableData 修改 |
||||
|
const _row = (flitterData4(tableq).one)[rowIndex] |
||||
|
const _col = _row > 0 ? 1 : 0 |
||||
|
return { |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
onMounted(()=>{ |
||||
|
jjjs() |
||||
|
postt() |
||||
|
}) |
||||
|
</script> |
||||
|
<template> |
||||
|
<div class="m-2"> |
||||
|
<el-container clss="m-4"> |
||||
|
<div class="qwe"> |
||||
|
<el-button type="primary" style="width: 140px" size="large" @click="resetChecked">全选</el-button> |
||||
|
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @node-click="handle"/> |
||||
|
</div> |
||||
|
<el-divider direction="vertical"/> |
||||
|
<el-col :span="22"> |
||||
|
<el-container class="wer"> |
||||
|
<el-form-item label="方案版本号:"> |
||||
|
<el-input v-model="formdate.name" placeholder="请输入方案版本号" clearable style="width:200px"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="年度:" label-width="90"> |
||||
|
<el-date-picker v-model="formdate.value1" type="year"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label-width="25"> |
||||
|
<el-button type="primary" @click="postt"><el-icon><Search /></el-icon>查询</el-button> |
||||
|
<el-button class="new_btn" type="warning" @click="addtableData"><el-icon><Plus /></el-icon>新增</el-button> |
||||
|
</el-form-item> |
||||
|
</el-container> |
||||
|
<el-table class="m-1" :data="tableq" :span-method="objectSpanMethod" border style="width: 100%"> |
||||
|
<el-table-column prop="groupname,deaprtname," label="部门"> |
||||
|
<template #default="scope"> |
||||
|
{{scope.row.groupname}}{{scope.row.deaprtname}} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="year" label="年" width="70"/> |
||||
|
<el-table-column prop="key" label="版本号"/> |
||||
|
<el-table-column prop="time" label="时间" /> |
||||
|
<el-table-column prop="state" label="状态" width="70"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch v-model="scope.row.state" :inactive-value="2" :active-value="1" class="ml-2" inline-prompt style="--el-switch-on-color: #ff4949; --el-switch-off-color: #13ce66" @change="editPostState(scope.row.key,scope.row.state)"/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column fixed="right" label="操作" width="228"> |
||||
|
<template #default="{ row }"> |
||||
|
<el-button type="primary" link @click="handleio(row)"><el-icon><View /></el-icon>查看详情</el-button> |
||||
|
<el-button type="primary" link @click="handleErd(row)"><el-icon><DocumentChecked /></el-icon>复制</el-button> |
||||
|
<el-button type="primary" link @click="handleDel(row)"><el-icon><Delete /></el-icon>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-col> |
||||
|
</el-container> |
||||
|
<pagination v-if="total > 0" v-model:page="formdate.page" v-model:pagesize="formdate.pagesize" :total="total" @click="postt"/> |
||||
|
<Dialog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Dialog> |
||||
|
<Dialoglog v-if="data.edPostBox" v-model="data.edPostBox" :title="title" :row-info="rowInfo"></Dialoglog> |
||||
|
<Yg v-if="data.ygPostBox" v-model="data.ygPostBox" :title="title" :row-info="rowInfo"></Yg> |
||||
|
</div> |
||||
|
</template> |
||||
|
<style lang='scss' scoped> |
||||
|
.qwe { |
||||
|
margin:-8px 0 0 -6px; |
||||
|
float:right; |
||||
|
} |
||||
|
.wer{ |
||||
|
margin:-5px 0 0 20px; |
||||
|
font-weight:normal; |
||||
|
} |
||||
|
.horizontal-controls { |
||||
|
display: flex; |
||||
|
float: left; |
||||
|
|
||||
|
} |
||||
|
.el-divider--vertical{ |
||||
|
display:inline-block; |
||||
|
width:1px; |
||||
|
height:812px; |
||||
|
margin:0 8px; |
||||
|
vertical-align:middle; |
||||
|
position:relative; |
||||
|
} |
||||
|
|
||||
|
/* 可以根据需要调整样式 */ |
||||
|
</style> |
||||
@ -0,0 +1,265 @@ |
|||||
|
<!-- |
||||
|
@ 作者: 鲁智强 |
||||
|
@ 时间: 2023-09-19 09:13:14 |
||||
|
@ 备注: |
||||
|
--> |
||||
|
<script lang='ts' setup> |
||||
|
import {ref,reactive,onMounted} from 'vue' |
||||
|
import { organdpost,posttarget,set_posttarget } from '@/api/opk/api' |
||||
|
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
||||
|
import { editPostCont } from '@/api/opk/pulic/api' |
||||
|
import { departmentprogramme,edit_depart,edit_depart_progra } from '@/api/opk/news/api' |
||||
|
import { ge_copy } from '@/api/opk/zxy/news/api' |
||||
|
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
||||
|
import { getDictFormData } from '@/api/dict' |
||||
|
import Dialog from './dialog.vue' |
||||
|
import Dialoglog from './dialoglog.vue' |
||||
|
import Yg from './yg.vue' |
||||
|
// eslint-disable-next-line vue/require-prop-types |
||||
|
const { addShow, title } = defineProps(['addShow', 'title']) |
||||
|
const data = reactive({ |
||||
|
formInline:{ |
||||
|
region:'', |
||||
|
}, |
||||
|
title:"", |
||||
|
addPostBox: false, |
||||
|
edPostBox:false, |
||||
|
ygPostBox:false, |
||||
|
}) |
||||
|
const orgTreeProps ={ |
||||
|
label: 'name', |
||||
|
children:'child' |
||||
|
} |
||||
|
const orgTreeProp ={ |
||||
|
label: 'title', |
||||
|
children:'childen' |
||||
|
} |
||||
|
const formdat = { |
||||
|
someProp:"", |
||||
|
} |
||||
|
const total =ref(0) |
||||
|
const rowInfo = ref<any>({}) |
||||
|
const postIds = ref<number[]>([]) |
||||
|
const tableData = ref<any>([]); |
||||
|
const tables = ref<any>([]); |
||||
|
// 获取侧栏数据 |
||||
|
function jjjs(){ |
||||
|
addPostCont("/hrapi/org/govthree","post") |
||||
|
.then(data => { |
||||
|
tableData.value = data.data[3].child[14].child; |
||||
|
}) |
||||
|
.catch(error => { |
||||
|
console.error('Error fetching data:', error); |
||||
|
}); |
||||
|
} |
||||
|
jjjs() |
||||
|
function editPost(){ |
||||
|
editPostCont({}) |
||||
|
.then(data => { |
||||
|
tables.value = data.data.list; |
||||
|
}) |
||||
|
} |
||||
|
editPost() |
||||
|
const table = ref<any>([]) |
||||
|
const formdate = reactive({ |
||||
|
page:0, |
||||
|
pagesize:20, |
||||
|
name:"", |
||||
|
dimension:"", |
||||
|
attribute:"", |
||||
|
orgidlist:"", |
||||
|
type:"", |
||||
|
value1:"2023", |
||||
|
}) |
||||
|
// 获取数据 |
||||
|
const tableq = ref([]) |
||||
|
const postt = ()=>{ |
||||
|
const ass = new Date(formdate.value1); |
||||
|
const qwe = ass.getFullYear(); |
||||
|
const zjr = qwe.toString(); |
||||
|
departmentprogramme({orgid:formdate.orgidlist,year:zjr,version:formdate.name}) |
||||
|
.then(data => { |
||||
|
tableq.value = data.data; |
||||
|
total.value = data.data.count; |
||||
|
}) |
||||
|
} |
||||
|
// 新增数据 |
||||
|
const addtableData = ()=>{ |
||||
|
data.addPostBox = true; |
||||
|
} |
||||
|
// 添加行 |
||||
|
const addRow = (val:any)=> { |
||||
|
tableData.value.push(val); |
||||
|
} |
||||
|
// 编辑行 |
||||
|
const editRow = (val:any)=> { |
||||
|
let index =tableData.value.findIndex( |
||||
|
(item:any) => item.id === val.id |
||||
|
); |
||||
|
tableData.value.splice(index, 1, val); |
||||
|
} |
||||
|
// 关闭弹窗 |
||||
|
const closeDetail = ()=>{ |
||||
|
data.addPostBox = false; |
||||
|
} |
||||
|
function editPostState(classId:string,state:number){ |
||||
|
console.log("改变状态--------->",classId,state) |
||||
|
let statusVal = 1 |
||||
|
if( state == 1) statusVal = 2; |
||||
|
edit_depart({id:classId,state:statusVal,istrue:2}) |
||||
|
postt() |
||||
|
} |
||||
|
// 删除数据 |
||||
|
const handleDel = (val:any) => { |
||||
|
const dictTypeIds = [val.outID || postIds.value].join(","); |
||||
|
let dictTypeIdAry = dictTypeIds.split(",") |
||||
|
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
||||
|
confirmButtonText: "确认", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
const add = val.key.toString() |
||||
|
handleSure(val) |
||||
|
console.log(val.id) |
||||
|
edit_depart({id:add,state:3,istrue:2}).then(()=> |
||||
|
ElMessage.success("删除成功")) |
||||
|
postt() |
||||
|
}) |
||||
|
}; |
||||
|
const handleSure = (val:any)=> { |
||||
|
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
||||
|
if(index!=-1){ |
||||
|
tableData.value.splice(index, 1); |
||||
|
} |
||||
|
} |
||||
|
const resetChecked=()=> { |
||||
|
formdate.orgidlist = "" |
||||
|
postt() |
||||
|
} |
||||
|
const handle=(data:any)=>{ |
||||
|
formdate.orgidlist = data.id.toString() |
||||
|
postt() |
||||
|
} |
||||
|
const handleErd=(val:any)=>{ |
||||
|
data.edPostBox=true; |
||||
|
rowInfo.value=val; |
||||
|
} |
||||
|
const handleio=(val:any)=>{ |
||||
|
data.ygPostBox=true; |
||||
|
rowInfo.value = val; |
||||
|
} |
||||
|
|
||||
|
const flitterData4 = (data:any)=>{ |
||||
|
let spanOneArr = [] as any[] |
||||
|
let concatOne = 0 |
||||
|
data.value.forEach((item:any,index:any)=>{ |
||||
|
if(index === 0){ |
||||
|
spanOneArr.push(1) |
||||
|
}else{ |
||||
|
//name 修改 |
||||
|
if(item.department === data.value[index - 1].department){ //第一列需合并相同内容的字段 |
||||
|
spanOneArr[concatOne] += 1 |
||||
|
spanOneArr.push(0) |
||||
|
}else{ |
||||
|
spanOneArr.push(1) |
||||
|
concatOne = index |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
return { |
||||
|
one: spanOneArr, |
||||
|
} |
||||
|
} |
||||
|
function objectSpanMethod({row, column, rowIndex, columnIndex}:any){ |
||||
|
if(columnIndex === 0 ) { |
||||
|
// this.tableData 修改 |
||||
|
const _row = (flitterData4(tableq).one)[rowIndex] |
||||
|
const _col = _row > 0 ? 1 : 0 |
||||
|
return { |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
onMounted(()=>{ |
||||
|
jjjs() |
||||
|
postt() |
||||
|
}) |
||||
|
</script> |
||||
|
<template> |
||||
|
<div class="m-2"> |
||||
|
<el-container clss="m-4"> |
||||
|
<div class="qwe"> |
||||
|
<el-button type="primary" style="width: 140px" size="large" @click="resetChecked">全选</el-button> |
||||
|
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @node-click="handle"/> |
||||
|
</div> |
||||
|
<el-divider direction="vertical"/> |
||||
|
<el-col :span="22"> |
||||
|
<el-container class="wer"> |
||||
|
<el-form-item label="方案版本号:"> |
||||
|
<el-input v-model="formdate.name" placeholder="请输入方案版本号" clearable style="width:200px"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="年度:" label-width="90"> |
||||
|
<el-date-picker v-model="formdate.value1" type="year"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label-width="25"> |
||||
|
<el-button type="primary" @click="postt"><el-icon><Search /></el-icon>查询</el-button> |
||||
|
<el-button class="new_btn" type="warning" @click="addtableData"><el-icon><Plus /></el-icon>新增</el-button> |
||||
|
</el-form-item> |
||||
|
</el-container> |
||||
|
<el-table class="m-1" :data="tableq" :span-method="objectSpanMethod" border style="width: 100%"> |
||||
|
<el-table-column prop="groupname,deaprtname," label="部门"> |
||||
|
<template #default="scope"> |
||||
|
{{scope.row.groupname}}{{scope.row.deaprtname}} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="year" label="年" width="70"/> |
||||
|
<el-table-column prop="key" label="版本号"/> |
||||
|
<el-table-column prop="time" label="时间" /> |
||||
|
<el-table-column prop="state" label="状态" width="70"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch v-model="scope.row.state" :inactive-value="2" :active-value="1" class="ml-2" inline-prompt style="--el-switch-on-color: #ff4949; --el-switch-off-color: #13ce66" @change="editPostState(scope.row.key,scope.row.state)"/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column fixed="right" label="操作" width="228"> |
||||
|
<template #default="{ row }"> |
||||
|
<el-button type="primary" link @click="handleio(row)"><el-icon><View /></el-icon>查看详情</el-button> |
||||
|
<el-button type="primary" link @click="handleErd(row)"><el-icon><DocumentChecked /></el-icon>复制</el-button> |
||||
|
<el-button type="primary" link @click="handleDel(row)"><el-icon><Delete /></el-icon>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-col> |
||||
|
</el-container> |
||||
|
<pagination v-if="total > 0" v-model:page="formdate.page" v-model:pagesize="formdate.pagesize" :total="total" @click="postt"/> |
||||
|
<Dialog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Dialog> |
||||
|
<Dialoglog v-if="data.edPostBox" v-model="data.edPostBox" :title="title" :row-info="rowInfo"></Dialoglog> |
||||
|
<Yg v-if="data.ygPostBox" v-model="data.ygPostBox" :title="title" :row-info="rowInfo"></Yg> |
||||
|
</div> |
||||
|
</template> |
||||
|
<style lang='scss' scoped> |
||||
|
.qwe { |
||||
|
margin:-8px 0 0 -6px; |
||||
|
float:right; |
||||
|
} |
||||
|
.wer{ |
||||
|
margin:-5px 0 0 20px; |
||||
|
font-weight:normal; |
||||
|
} |
||||
|
.horizontal-controls { |
||||
|
display: flex; |
||||
|
float: left; |
||||
|
|
||||
|
} |
||||
|
.el-divider--vertical{ |
||||
|
display:inline-block; |
||||
|
width:1px; |
||||
|
height:812px; |
||||
|
margin:0 8px; |
||||
|
vertical-align:middle; |
||||
|
position:relative; |
||||
|
} |
||||
|
|
||||
|
/* 可以根据需要调整样式 */ |
||||
|
</style> |
||||
@ -0,0 +1,265 @@ |
|||||
|
<!-- |
||||
|
@ 作者: 鲁智强 |
||||
|
@ 时间: 2023-09-19 09:13:14 |
||||
|
@ 备注: |
||||
|
--> |
||||
|
<script lang='ts' setup> |
||||
|
import {ref,reactive,onMounted} from 'vue' |
||||
|
import { organdpost,posttarget,set_posttarget } from '@/api/opk/api' |
||||
|
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
||||
|
import { editPostCont } from '@/api/opk/pulic/api' |
||||
|
import { departmentprogramme,edit_depart,edit_depart_progra } from '@/api/opk/news/api' |
||||
|
import { ge_copy } from '@/api/opk/zxy/news/api' |
||||
|
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
||||
|
import { getDictFormData } from '@/api/dict' |
||||
|
import Dialog from './dialog.vue' |
||||
|
import Dialoglog from './dialoglog.vue' |
||||
|
import Yg from './yg.vue' |
||||
|
// eslint-disable-next-line vue/require-prop-types |
||||
|
const { addShow, title } = defineProps(['addShow', 'title']) |
||||
|
const data = reactive({ |
||||
|
formInline:{ |
||||
|
region:'', |
||||
|
}, |
||||
|
title:"", |
||||
|
addPostBox: false, |
||||
|
edPostBox:false, |
||||
|
ygPostBox:false, |
||||
|
}) |
||||
|
const orgTreeProps ={ |
||||
|
label: 'name', |
||||
|
children:'child' |
||||
|
} |
||||
|
const orgTreeProp ={ |
||||
|
label: 'title', |
||||
|
children:'childen' |
||||
|
} |
||||
|
const formdat = { |
||||
|
someProp:"", |
||||
|
} |
||||
|
const total =ref(0) |
||||
|
const rowInfo = ref<any>({}) |
||||
|
const postIds = ref<number[]>([]) |
||||
|
const tableData = ref<any>([]); |
||||
|
const tables = ref<any>([]); |
||||
|
// 获取侧栏数据 |
||||
|
function jjjs(){ |
||||
|
addPostCont("/hrapi/org/govthree","post") |
||||
|
.then(data => { |
||||
|
tableData.value = data.data[3].child[14].child; |
||||
|
}) |
||||
|
.catch(error => { |
||||
|
console.error('Error fetching data:', error); |
||||
|
}); |
||||
|
} |
||||
|
jjjs() |
||||
|
function editPost(){ |
||||
|
editPostCont({}) |
||||
|
.then(data => { |
||||
|
tables.value = data.data.list; |
||||
|
}) |
||||
|
} |
||||
|
editPost() |
||||
|
const table = ref<any>([]) |
||||
|
const formdate = reactive({ |
||||
|
page:0, |
||||
|
pagesize:20, |
||||
|
name:"", |
||||
|
dimension:"", |
||||
|
attribute:"", |
||||
|
orgidlist:"", |
||||
|
type:"", |
||||
|
value1:"2023", |
||||
|
}) |
||||
|
// 获取数据 |
||||
|
const tableq = ref([]) |
||||
|
const postt = ()=>{ |
||||
|
const ass = new Date(formdate.value1); |
||||
|
const qwe = ass.getFullYear(); |
||||
|
const zjr = qwe.toString(); |
||||
|
departmentprogramme({orgid:formdate.orgidlist,year:zjr,version:formdate.name}) |
||||
|
.then(data => { |
||||
|
tableq.value = data.data; |
||||
|
total.value = data.data.count; |
||||
|
}) |
||||
|
} |
||||
|
// 新增数据 |
||||
|
const addtableData = ()=>{ |
||||
|
data.addPostBox = true; |
||||
|
} |
||||
|
// 添加行 |
||||
|
const addRow = (val:any)=> { |
||||
|
tableData.value.push(val); |
||||
|
} |
||||
|
// 编辑行 |
||||
|
const editRow = (val:any)=> { |
||||
|
let index =tableData.value.findIndex( |
||||
|
(item:any) => item.id === val.id |
||||
|
); |
||||
|
tableData.value.splice(index, 1, val); |
||||
|
} |
||||
|
// 关闭弹窗 |
||||
|
const closeDetail = ()=>{ |
||||
|
data.addPostBox = false; |
||||
|
} |
||||
|
function editPostState(classId:string,state:number){ |
||||
|
console.log("改变状态--------->",classId,state) |
||||
|
let statusVal = 1 |
||||
|
if( state == 1) statusVal = 2; |
||||
|
edit_depart({id:classId,state:statusVal,istrue:2}) |
||||
|
postt() |
||||
|
} |
||||
|
// 删除数据 |
||||
|
const handleDel = (val:any) => { |
||||
|
const dictTypeIds = [val.outID || postIds.value].join(","); |
||||
|
let dictTypeIdAry = dictTypeIds.split(",") |
||||
|
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
||||
|
confirmButtonText: "确认", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
const add = val.key.toString() |
||||
|
handleSure(val) |
||||
|
console.log(val.id) |
||||
|
edit_depart({id:add,state:3,istrue:2}).then(()=> |
||||
|
ElMessage.success("删除成功")) |
||||
|
postt() |
||||
|
}) |
||||
|
}; |
||||
|
const handleSure = (val:any)=> { |
||||
|
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
||||
|
if(index!=-1){ |
||||
|
tableData.value.splice(index, 1); |
||||
|
} |
||||
|
} |
||||
|
const resetChecked=()=> { |
||||
|
formdate.orgidlist = "" |
||||
|
postt() |
||||
|
} |
||||
|
const handle=(data:any)=>{ |
||||
|
formdate.orgidlist = data.id.toString() |
||||
|
postt() |
||||
|
} |
||||
|
const handleErd=(val:any)=>{ |
||||
|
data.edPostBox=true; |
||||
|
rowInfo.value=val; |
||||
|
} |
||||
|
const handleio=(val:any)=>{ |
||||
|
data.ygPostBox=true; |
||||
|
rowInfo.value = val; |
||||
|
} |
||||
|
|
||||
|
const flitterData4 = (data:any)=>{ |
||||
|
let spanOneArr = [] as any[] |
||||
|
let concatOne = 0 |
||||
|
data.value.forEach((item:any,index:any)=>{ |
||||
|
if(index === 0){ |
||||
|
spanOneArr.push(1) |
||||
|
}else{ |
||||
|
//name 修改 |
||||
|
if(item.department === data.value[index - 1].department){ //第一列需合并相同内容的字段 |
||||
|
spanOneArr[concatOne] += 1 |
||||
|
spanOneArr.push(0) |
||||
|
}else{ |
||||
|
spanOneArr.push(1) |
||||
|
concatOne = index |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
return { |
||||
|
one: spanOneArr, |
||||
|
} |
||||
|
} |
||||
|
function objectSpanMethod({row, column, rowIndex, columnIndex}:any){ |
||||
|
if(columnIndex === 0 ) { |
||||
|
// this.tableData 修改 |
||||
|
const _row = (flitterData4(tableq).one)[rowIndex] |
||||
|
const _col = _row > 0 ? 1 : 0 |
||||
|
return { |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
onMounted(()=>{ |
||||
|
jjjs() |
||||
|
postt() |
||||
|
}) |
||||
|
</script> |
||||
|
<template> |
||||
|
<div class="m-2"> |
||||
|
<el-container clss="m-4"> |
||||
|
<div class="qwe"> |
||||
|
<el-button type="primary" style="width: 140px" size="large" @click="resetChecked">全选</el-button> |
||||
|
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @node-click="handle"/> |
||||
|
</div> |
||||
|
<el-divider direction="vertical"/> |
||||
|
<el-col :span="22"> |
||||
|
<el-container class="wer"> |
||||
|
<el-form-item label="方案版本号:"> |
||||
|
<el-input v-model="formdate.name" placeholder="请输入方案版本号" clearable style="width:200px"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="年度:" label-width="90"> |
||||
|
<el-date-picker v-model="formdate.value1" type="year"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label-width="25"> |
||||
|
<el-button type="primary" @click="postt"><el-icon><Search /></el-icon>查询</el-button> |
||||
|
<el-button class="new_btn" type="warning" @click="addtableData"><el-icon><Plus /></el-icon>新增</el-button> |
||||
|
</el-form-item> |
||||
|
</el-container> |
||||
|
<el-table class="m-1" :data="tableq" :span-method="objectSpanMethod" border style="width: 100%"> |
||||
|
<el-table-column prop="groupname,deaprtname," label="部门"> |
||||
|
<template #default="scope"> |
||||
|
{{scope.row.groupname}}{{scope.row.deaprtname}} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="year" label="年" width="70"/> |
||||
|
<el-table-column prop="key" label="版本号"/> |
||||
|
<el-table-column prop="time" label="时间" /> |
||||
|
<el-table-column prop="state" label="状态" width="70"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch v-model="scope.row.state" :inactive-value="2" :active-value="1" class="ml-2" inline-prompt style="--el-switch-on-color: #ff4949; --el-switch-off-color: #ff4949" @change="editPostState(scope.row.key,scope.row.state)"/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column fixed="right" label="操作" width="228"> |
||||
|
<template #default="{ row }"> |
||||
|
<el-button type="primary" link @click="handleio(row)"><el-icon><View /></el-icon>查看详情</el-button> |
||||
|
<el-button type="primary" link @click="handleErd(row)"><el-icon><DocumentChecked /></el-icon>复制</el-button> |
||||
|
<el-button type="primary" link @click="handleDel(row)"><el-icon><Delete /></el-icon>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-col> |
||||
|
</el-container> |
||||
|
<pagination v-if="total > 0" v-model:page="formdate.page" v-model:pagesize="formdate.pagesize" :total="total" @click="postt"/> |
||||
|
<Dialog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Dialog> |
||||
|
<Dialoglog v-if="data.edPostBox" v-model="data.edPostBox" :title="title" :row-info="rowInfo"></Dialoglog> |
||||
|
<Yg v-if="data.ygPostBox" v-model="data.ygPostBox" :title="title" :row-info="rowInfo"></Yg> |
||||
|
</div> |
||||
|
</template> |
||||
|
<style lang='scss' scoped> |
||||
|
.qwe { |
||||
|
margin:-8px 0 0 -6px; |
||||
|
float:right; |
||||
|
} |
||||
|
.wer{ |
||||
|
margin:-5px 0 0 20px; |
||||
|
font-weight:normal; |
||||
|
} |
||||
|
.horizontal-controls { |
||||
|
display: flex; |
||||
|
float: left; |
||||
|
|
||||
|
} |
||||
|
.el-divider--vertical{ |
||||
|
display:inline-block; |
||||
|
width:1px; |
||||
|
height:812px; |
||||
|
margin:0 8px; |
||||
|
vertical-align:middle; |
||||
|
position:relative; |
||||
|
} |
||||
|
|
||||
|
/* 可以根据需要调整样式 */ |
||||
|
</style> |
||||
@ -0,0 +1,265 @@ |
|||||
|
<!-- |
||||
|
@ 作者: 鲁智强 |
||||
|
@ 时间: 2023-09-19 09:13:14 |
||||
|
@ 备注: |
||||
|
--> |
||||
|
<script lang='ts' setup> |
||||
|
import {ref,reactive,onMounted} from 'vue' |
||||
|
import { organdpost,posttarget,set_posttarget } from '@/api/opk/api' |
||||
|
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
||||
|
import { editPostCont } from '@/api/opk/pulic/api' |
||||
|
import { departmentprogramme,edit_depart,edit_depart_progra } from '@/api/opk/news/api' |
||||
|
import { ge_copy } from '@/api/opk/zxy/news/api' |
||||
|
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
||||
|
import { getDictFormData } from '@/api/dict' |
||||
|
import Dialog from './dialog.vue' |
||||
|
import Dialoglog from './dialoglog.vue' |
||||
|
import Yg from './yg.vue' |
||||
|
// eslint-disable-next-line vue/require-prop-types |
||||
|
const { addShow, title } = defineProps(['addShow', 'title']) |
||||
|
const data = reactive({ |
||||
|
formInline:{ |
||||
|
region:'', |
||||
|
}, |
||||
|
title:"", |
||||
|
addPostBox: false, |
||||
|
edPostBox:false, |
||||
|
ygPostBox:false, |
||||
|
}) |
||||
|
const orgTreeProps ={ |
||||
|
label: 'name', |
||||
|
children:'child' |
||||
|
} |
||||
|
const orgTreeProp ={ |
||||
|
label: 'title', |
||||
|
children:'childen' |
||||
|
} |
||||
|
const formdat = { |
||||
|
someProp:"", |
||||
|
} |
||||
|
const total =ref(0) |
||||
|
const rowInfo = ref<any>({}) |
||||
|
const postIds = ref<number[]>([]) |
||||
|
const tableData = ref<any>([]); |
||||
|
const tables = ref<any>([]); |
||||
|
// 获取侧栏数据 |
||||
|
function jjjs(){ |
||||
|
addPostCont("/hrapi/org/govthree","post") |
||||
|
.then(data => { |
||||
|
tableData.value = data.data[3].child[14].child; |
||||
|
}) |
||||
|
.catch(error => { |
||||
|
console.error('Error fetching data:', error); |
||||
|
}); |
||||
|
} |
||||
|
jjjs() |
||||
|
function editPost(){ |
||||
|
editPostCont({}) |
||||
|
.then(data => { |
||||
|
tables.value = data.data.list; |
||||
|
}) |
||||
|
} |
||||
|
editPost() |
||||
|
const table = ref<any>([]) |
||||
|
const formdate = reactive({ |
||||
|
page:0, |
||||
|
pagesize:20, |
||||
|
name:"", |
||||
|
dimension:"", |
||||
|
attribute:"", |
||||
|
orgidlist:"", |
||||
|
type:"", |
||||
|
value1:"2023", |
||||
|
}) |
||||
|
// 获取数据 |
||||
|
const tableq = ref([]) |
||||
|
const postt = ()=>{ |
||||
|
const ass = new Date(formdate.value1); |
||||
|
const qwe = ass.getFullYear(); |
||||
|
const zjr = qwe.toString(); |
||||
|
departmentprogramme({orgid:formdate.orgidlist,year:zjr,version:formdate.name}) |
||||
|
.then(data => { |
||||
|
tableq.value = data.data; |
||||
|
total.value = data.data.count; |
||||
|
}) |
||||
|
} |
||||
|
// 新增数据 |
||||
|
const addtableData = ()=>{ |
||||
|
data.addPostBox = true; |
||||
|
} |
||||
|
// 添加行 |
||||
|
const addRow = (val:any)=> { |
||||
|
tableData.value.push(val); |
||||
|
} |
||||
|
// 编辑行 |
||||
|
const editRow = (val:any)=> { |
||||
|
let index =tableData.value.findIndex( |
||||
|
(item:any) => item.id === val.id |
||||
|
); |
||||
|
tableData.value.splice(index, 1, val); |
||||
|
} |
||||
|
// 关闭弹窗 |
||||
|
const closeDetail = ()=>{ |
||||
|
data.addPostBox = false; |
||||
|
} |
||||
|
function editPostState(classId:string,state:number){ |
||||
|
console.log("改变状态--------->",classId,state) |
||||
|
let statusVal = 1 |
||||
|
if( state == 1) statusVal = 2; |
||||
|
edit_depart({id:classId,state:statusVal,istrue:2}) |
||||
|
postt() |
||||
|
} |
||||
|
// 删除数据 |
||||
|
const handleDel = (val:any) => { |
||||
|
const dictTypeIds = [val.outID || postIds.value].join(","); |
||||
|
let dictTypeIdAry = dictTypeIds.split(",") |
||||
|
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
||||
|
confirmButtonText: "确认", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
const add = val.key.toString() |
||||
|
handleSure(val) |
||||
|
console.log(val.id) |
||||
|
edit_depart({id:add,state:3,istrue:2}).then(()=> |
||||
|
ElMessage.success("删除成功")) |
||||
|
postt() |
||||
|
}) |
||||
|
}; |
||||
|
const handleSure = (val:any)=> { |
||||
|
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
||||
|
if(index!=-1){ |
||||
|
tableData.value.splice(index, 1); |
||||
|
} |
||||
|
} |
||||
|
const resetChecked=()=> { |
||||
|
formdate.orgidlist = "" |
||||
|
postt() |
||||
|
} |
||||
|
const handle=(data:any)=>{ |
||||
|
formdate.orgidlist = data.id.toString() |
||||
|
postt() |
||||
|
} |
||||
|
const handleErd=(val:any)=>{ |
||||
|
data.edPostBox=true; |
||||
|
rowInfo.value=val; |
||||
|
} |
||||
|
const handleio=(val:any)=>{ |
||||
|
data.ygPostBox=true; |
||||
|
rowInfo.value = val; |
||||
|
} |
||||
|
|
||||
|
const flitterData4 = (data:any)=>{ |
||||
|
let spanOneArr = [] as any[] |
||||
|
let concatOne = 0 |
||||
|
data.value.forEach((item:any,index:any)=>{ |
||||
|
if(index === 0){ |
||||
|
spanOneArr.push(1) |
||||
|
}else{ |
||||
|
//name 修改 |
||||
|
if(item.department === data.value[index - 1].department){ //第一列需合并相同内容的字段 |
||||
|
spanOneArr[concatOne] += 1 |
||||
|
spanOneArr.push(0) |
||||
|
}else{ |
||||
|
spanOneArr.push(1) |
||||
|
concatOne = index |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
return { |
||||
|
one: spanOneArr, |
||||
|
} |
||||
|
} |
||||
|
function objectSpanMethod({row, column, rowIndex, columnIndex}:any){ |
||||
|
if(columnIndex === 0 ) { |
||||
|
// this.tableData 修改 |
||||
|
const _row = (flitterData4(tableq).one)[rowIndex] |
||||
|
const _col = _row > 0 ? 1 : 0 |
||||
|
return { |
||||
|
rowspan: _row, |
||||
|
colspan: _col |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
onMounted(()=>{ |
||||
|
jjjs() |
||||
|
postt() |
||||
|
}) |
||||
|
</script> |
||||
|
<template> |
||||
|
<div class="m-2"> |
||||
|
<el-container clss="m-4"> |
||||
|
<div class="qwe"> |
||||
|
<el-button type="primary" style="width: 140px" size="large" @click="resetChecked">全选</el-button> |
||||
|
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @node-click="handle"/> |
||||
|
</div> |
||||
|
<el-divider direction="vertical"/> |
||||
|
<el-col :span="22"> |
||||
|
<el-container class="wer"> |
||||
|
<el-form-item label="方案版本号:"> |
||||
|
<el-input v-model="formdate.name" placeholder="请输入方案版本号" clearable style="width:200px"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="年度:" label-width="90"> |
||||
|
<el-date-picker v-model="formdate.value1" type="year"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label-width="25"> |
||||
|
<el-button type="primary" @click="postt"><el-icon><Search /></el-icon>查询</el-button> |
||||
|
<el-button class="new_btn" type="warning" @click="addtableData"><el-icon><Plus /></el-icon>新增</el-button> |
||||
|
</el-form-item> |
||||
|
</el-container> |
||||
|
<el-table class="m-1" :data="tableq" :span-method="objectSpanMethod" border style="width: 100%"> |
||||
|
<el-table-column prop="groupname,deaprtname," label="部门"> |
||||
|
<template #default="scope"> |
||||
|
{{scope.row.groupname}}{{scope.row.deaprtname}} |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column prop="year" label="年" width="70"/> |
||||
|
<el-table-column prop="key" label="版本号"/> |
||||
|
<el-table-column prop="time" label="时间" /> |
||||
|
<el-table-column prop="state" label="状态" width="70"> |
||||
|
<template #default="scope"> |
||||
|
<el-switch v-model="scope.row.state" :inactive-value="2" :active-value="1" class="ml-2" inline-prompt style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949" @change="editPostState(scope.row.key,scope.row.state)"/> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column fixed="right" label="操作" width="228"> |
||||
|
<template #default="{ row }"> |
||||
|
<el-button type="primary" link @click="handleio(row)"><el-icon><View /></el-icon>查看详情</el-button> |
||||
|
<el-button type="primary" link @click="handleErd(row)"><el-icon><DocumentChecked /></el-icon>复制</el-button> |
||||
|
<el-button type="primary" link @click="handleDel(row)"><el-icon><Delete /></el-icon>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</el-col> |
||||
|
</el-container> |
||||
|
<pagination v-if="total > 0" v-model:page="formdate.page" v-model:pagesize="formdate.pagesize" :total="total" @click="postt"/> |
||||
|
<Dialog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Dialog> |
||||
|
<Dialoglog v-if="data.edPostBox" v-model="data.edPostBox" :title="title" :row-info="rowInfo"></Dialoglog> |
||||
|
<Yg v-if="data.ygPostBox" v-model="data.ygPostBox" :title="title" :row-info="rowInfo"></Yg> |
||||
|
</div> |
||||
|
</template> |
||||
|
<style lang='scss' scoped> |
||||
|
.qwe { |
||||
|
margin:-8px 0 0 -6px; |
||||
|
float:right; |
||||
|
} |
||||
|
.wer{ |
||||
|
margin:-5px 0 0 20px; |
||||
|
font-weight:normal; |
||||
|
} |
||||
|
.horizontal-controls { |
||||
|
display: flex; |
||||
|
float: left; |
||||
|
|
||||
|
} |
||||
|
.el-divider--vertical{ |
||||
|
display:inline-block; |
||||
|
width:1px; |
||||
|
height:812px; |
||||
|
margin:0 8px; |
||||
|
vertical-align:middle; |
||||
|
position:relative; |
||||
|
} |
||||
|
|
||||
|
/* 可以根据需要调整样式 */ |
||||
|
</style> |
||||
@ -1,216 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const searchArchiveQuery = reactive<any>({ |
|
||||
page:1, |
|
||||
pagesize:13 |
|
||||
}) |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
page: 1, |
|
||||
pagesize: 20, |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const page = ref(0) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:formdate.page.value,pagesize:formdate.pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<el-pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,216 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const searchArchiveQuery = reactive<any>({ |
|
||||
page:1, |
|
||||
pagesize:13 |
|
||||
}) |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
page: 1, |
|
||||
pagesize: 20, |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const page = ref(0) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:formdate.page,pagesize:formdate.pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<el-pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,216 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const searchArchiveQuery = reactive<any>({ |
|
||||
page:1, |
|
||||
pagesize:13 |
|
||||
}) |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
page: 1, |
|
||||
pagesize: 0, |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const page = ref(0) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:formdate.page,pagesize:formdate.pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<el-pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,216 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const searchArchiveQuery = reactive<any>({ |
|
||||
page:1, |
|
||||
pagesize:13 |
|
||||
}) |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
page: 0, |
|
||||
pagesize: 0, |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const page = ref(0) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:formdate.page,pagesize:formdate.pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<el-pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,216 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const searchArchiveQuery = reactive<any>({ |
|
||||
page:1, |
|
||||
pagesize:13 |
|
||||
}) |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
page: 1, |
|
||||
pagesize: 0, |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const page = ref(0) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:formdate.page,pagesize:formdate.pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<el-pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,216 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const searchArchiveQuery = reactive<any>({ |
|
||||
page:1, |
|
||||
pagesize:13 |
|
||||
}) |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
page: 1, |
|
||||
pagesize: 0, |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const page = ref(0) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:formdate.page,pagesize:formdate.pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,212 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
page: 1, |
|
||||
pagesize: 0, |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const page = ref(0) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:formdate.page,pagesize:formdate.pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,212 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
page: 1, |
|
||||
pagesize: 5, |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const page = ref(0) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:formdate.page,pagesize:formdate.pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,210 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const page = ref(0) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:formdate.page,pagesize:formdate.pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,210 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const page = ref(0) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:formdate.pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,210 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const page = ref(0) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,211 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const page = ref(0) |
|
||||
const |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,211 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const page = ref(0) |
|
||||
const pagesize = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,211 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const page = ref("0) |
|
||||
const pagesize = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,211 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const page = ref("0") |
|
||||
const pagesize = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,211 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const page = ref(0) |
|
||||
const pagesize = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,211 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const page = refNumber(0) |
|
||||
const pagesize = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,211 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const page = ref(N0) |
|
||||
const pagesize = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,211 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const page = ref(Number(0) |
|
||||
const pagesize = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,211 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const page = ref(Number(0)) |
|
||||
const pagesize = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,211 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const page = ref(Number(0) |
|
||||
const pagesize = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,211 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const page = ref(0) |
|
||||
const pagesize = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,212 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const page = ref(0) |
|
||||
const pagesize = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
|
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,212 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const page = ref(0) |
|
||||
const pagesize = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
page |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,212 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const page = ref(0) |
|
||||
const pagesize = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
page = |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,212 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const page = ref(0) |
|
||||
const pagesize = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
page = page |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,212 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const page = ref(0) |
|
||||
const pagesize = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
page = pages |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,212 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const page = ref(0) |
|
||||
const pagesize = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
page = Number(pages |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,212 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const page = ref(0) |
|
||||
const pagesize = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
page = Number(pages) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,212 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesize = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
page = Number(pages) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,212 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesize = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,213 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesize = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,213 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesize = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,213 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesize = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,213 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesize = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number() |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,213 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesize = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,213 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,213 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:""}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,213 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:[]}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
const handlePageChange = (newPage:any) => { |
|
||||
// 更新当前页码 |
|
||||
page.value = newPage; |
|
||||
// 调用获取数据的函数,传递新的页码 |
|
||||
newtarlist(); |
|
||||
}; |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:[]}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="formdate.pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:[]}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="pagesize" :current-page="formdate.page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:[]}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="pagesize" :current-page=page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:[]}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="pagesize" :current-page="page" @current-change="handlePageChange"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:[]}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="pagesize" :current-page="page" @current-change=""/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:[]}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="pagesize" :current-page="page" @current-=""/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:[]}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="pagesize" :current-page="page"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:[]}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="pagesizea" :current-page="pagea"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:[]}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="pagesizea" :current-page="pages"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:[]}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="pagesizes" :current-page="pages"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:[]}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination :total="total" :page-size="pagesizes" :current-page="pages"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:[]}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartments" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination :total="total" :page-size="pagesizes" :current-page="pages"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:[]}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartments" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartments" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination :total="total" :page-size="pagesizes" :current-page="pages"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:[]}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartments" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination :total="total" :page-size="pagesizes" :current-page="pages"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:[]}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartments" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="查看详情"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination :total="total" :page-size="pagesizes" :current-page="pages"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:form'd}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartments" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="查看详情"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination :total="total" :page-size="pagesizes" :current-page="pages"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartments" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="查看详情"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination :total="total" :page-size="pagesizes" :current-page="pages"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartments" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="查看详情"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination :total="total" :page-size="pagesizes" :current-page="pages"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartments" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="查看详情"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination :total="total" :page-size="pagesizes" :current-page="pages"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @click="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartments" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="查看详情"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination :total="total" :page-size="pagesizes" :current-page="pages"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @click="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartments" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="查看详情"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination :total="total" :page-size="pagesizes" :current-page="pages"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String, |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @click="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartments" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="查看详情"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination :total="total" :page-size="pagesizes" :current-page="pages"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @click="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartments" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="查看详情"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination :total="total" :page-size="pagesizes" :current-page="pages"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,204 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @click="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartments" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="查看详情"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination :total="total" :page-size="pagesizes" :current-page="pages"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @click="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartments" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="查看详情"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination :total="total" :page-size="pagesizes" :current-page="pages"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartments" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="查看详情"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination :total="total" :page-size="pagesizes" :current-page="pages"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:[]}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartments" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder=""> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination :total="total" :page-size="pagesizes" :current-page="pages"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:[]}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartments" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination :total="total" :page-size="pagesizes" :current-page="pages"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:[]}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="pagesizes" :current-page="pages"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:[]}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="pagesize" :current-page="page"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="pagesize" :current-page="page"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="pagesize" :current-page="page"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="pagesize" :current-page="page"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
@ -1,207 +0,0 @@ |
|||||
<!-- |
|
||||
@ 作者: 鲁智强 |
|
||||
@ 时间: 2023-09-19 09:13:14 |
|
||||
@ 备注: |
|
||||
--> |
|
||||
<script lang='ts' setup> |
|
||||
import {ref,reactive,onMounted} from 'vue' |
|
||||
import Diolog from './diolog.vue' |
|
||||
import Edit from './editdialog.vue' |
|
||||
import { addPostCont,tarlist,deltarget } from '@/api/opk/api' |
|
||||
import { editPostCont } from '@/api/opk/pulic/api' |
|
||||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|
||||
// eslint-disable-next-line vue/require-prop-types |
|
||||
const { addShow, title } = defineProps(['addShow', 'title']) |
|
||||
const data = reactive({ |
|
||||
formInline:{ |
|
||||
region:'', |
|
||||
}, |
|
||||
title:"", |
|
||||
addPostBox: false, |
|
||||
editPostCont:false, |
|
||||
}) |
|
||||
const orgTreeProps ={ |
|
||||
label: 'name', |
|
||||
children:'child' |
|
||||
} |
|
||||
const orgTreeProp ={ |
|
||||
label: 'title', |
|
||||
children:'childen' |
|
||||
} |
|
||||
const formdat = { |
|
||||
someProp:"", |
|
||||
} |
|
||||
const total =ref(0) |
|
||||
let rowInfo = ref<any>({}) |
|
||||
const postIds = ref<number[]>([]) |
|
||||
const tableData = ref<any>([]); |
|
||||
const tables = ref<any>([]); |
|
||||
// 获取侧栏数据 |
|
||||
function jjjs(){ |
|
||||
addPostCont("/hrapi/org/govthree","post") |
|
||||
.then(data => { |
|
||||
tableData.value = data.data[3].child[14].child; |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
jjjs() |
|
||||
function editPost(){ |
|
||||
editPostCont() |
|
||||
.then(data => { |
|
||||
tables.value = data.data.list; |
|
||||
}) |
|
||||
} |
|
||||
editPost() |
|
||||
const table = ref<any>([]) |
|
||||
const formdate = reactive({ |
|
||||
name:"", |
|
||||
dimension:"", |
|
||||
attribute:"", |
|
||||
orgidlist:[]as String[], |
|
||||
type:"", |
|
||||
}) |
|
||||
// 获取数据 |
|
||||
const pages = ref(0) |
|
||||
const pagesizes = ref(4) |
|
||||
const newtarlist = () =>{ |
|
||||
const add = formdate.type.toString() |
|
||||
const edd = formdate.orgidlist.toString() |
|
||||
const page = Number(pages) |
|
||||
const pagesize = Number(pagesizes) |
|
||||
formdate.orgidlist = edd.split(',') |
|
||||
tarlist({page:page,pagesize:pagesize,name:formdate.name,dimension:formdate.dimension, attribute:add,orgidlist:formdate.orgidlist}) |
|
||||
.then(data=>{ |
|
||||
table.value = data.data.list |
|
||||
}) |
|
||||
.catch(error => { |
|
||||
console.error('Error fetching data:', error); |
|
||||
}); |
|
||||
} |
|
||||
// 新增数据 |
|
||||
const addtableData = ()=>{ |
|
||||
data.addPostBox = true; |
|
||||
} |
|
||||
// 添加行 |
|
||||
const addRow = (val:any)=> { |
|
||||
tableData.value.push(val); |
|
||||
} |
|
||||
// 编辑行 |
|
||||
const editRow = (val:any)=> { |
|
||||
let index =tableData.value.findIndex( |
|
||||
(item:any) => item.id === val.id |
|
||||
); |
|
||||
tableData.value.splice(index, 1, val); |
|
||||
} |
|
||||
// 关闭弹窗 |
|
||||
const closeDetail = ()=>{ |
|
||||
data.addPostBox = false; |
|
||||
} |
|
||||
// 删除数据 |
|
||||
const handleDel = (val:any) => { |
|
||||
const dictTypeIds = [val.outID || postIds.value].join(","); |
|
||||
let dictTypeIdAry = dictTypeIds.split(",") |
|
||||
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
||||
confirmButtonText: "确认", |
|
||||
cancelButtonText: "取消", |
|
||||
type: "warning", |
|
||||
}) |
|
||||
.then(() => { |
|
||||
const delid = new String(val.id) |
|
||||
handleSure(val) |
|
||||
console.log(val.id) |
|
||||
deltarget({id:delid,state:3,istrue:2}).then(()=> |
|
||||
ElMessage.success("删除成功")) |
|
||||
newtarlist() |
|
||||
}) |
|
||||
.catch(() => { |
|
||||
alert('用户取消了删除操作'); |
|
||||
}); |
|
||||
}; |
|
||||
const handleSure = (val:any)=> { |
|
||||
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
||||
if(index!=-1){ |
|
||||
tableData.value.splice(index, 1); |
|
||||
} |
|
||||
} |
|
||||
const handle=(data:any)=>{ |
|
||||
formdate.orgidlist = data.id |
|
||||
console.log(formdate.orgidlist) |
|
||||
} |
|
||||
const handleedit=(val:any)=>{ |
|
||||
data.editPostCont=true, |
|
||||
rowInfo.value=val; |
|
||||
} |
|
||||
onMounted(()=>{ |
|
||||
jjjs() |
|
||||
}) |
|
||||
</script> |
|
||||
<template> |
|
||||
<div> |
|
||||
<el-row style="width: 100%"> |
|
||||
<el-tree ref="orgTreeRef" v-model="formdate.orgidlist" show-checkbox node-key="id" class="orgTree" :data="tableData" :props="orgTreeProps" :default-expand-all="false" @check="handle"/> |
|
||||
<el-col :span="22"> |
|
||||
<div class="horizontal-controls"> |
|
||||
<el-form-item label="考核指标"> |
|
||||
<el-input v-model="formdate.name" placeholder="请输入考核指标" clearable/> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="指标名称"> |
|
||||
<el-tree-select ref="orgTreeRef" v-model="formdate.dimension" clearable node-key="outId" class="orgTree" :data="tables" :props="orgTreeProp" :default-expand-all="false"/> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-model="formdate" label="指标名称"> |
|
||||
<el-select v-model="formdate.type" placeholder="请输入名称" clearable> |
|
||||
<el-option label="定性指标" :value="1" /> |
|
||||
<el-option label="定量指标" :value="2" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-button @click="newtarlist">查询</el-button> |
|
||||
<el-button class="new_btn" type="success" @click="addtableData">新增</el-button> |
|
||||
</div> |
|
||||
<el-table :data="table" border style="width: 100%"> |
|
||||
<el-table-column prop="title" label="考核指标"/> |
|
||||
<el-table-column prop="dimensiontitle" label="考核维度"/> |
|
||||
<el-table-column prop="" label="指标性质"/> |
|
||||
<el-table-column prop="unites" label="计量单位" /> |
|
||||
<el-table-column prop="cycleattr" label="考核周期" /> |
|
||||
<el-table-column prop="" label="计分方式"/> |
|
||||
<el-table-column prop="relevantdepartmentsmap" label="关联部门"> |
|
||||
<template #default="scope"> |
|
||||
<el-select v-model="formdat.someProp" placeholder="请选择"> |
|
||||
<el-option v-for="item in scope.row.relevantdepartmentsmap" :key="item.key" :label="item.title" :value="item.title"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="reportmap[0].title" label="数据提交"/> |
|
||||
<el-table-column prop="state" label="辅助计数"/> |
|
||||
<el-table-column prop="" label="状态" width="70"> |
|
||||
<template #default="scope"> |
|
||||
<el-switch v-model="scope.row.status" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column fixed="right" label="操作" width="200"> |
|
||||
<template #default="{ row }"> |
|
||||
<el-button type="success" link @click="handleedit(row)">修改</el-button> |
|
||||
<el-button type="danger" link @click="handleDel(row)">删除</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<pagination layout="prev, pager, next" :total="total" :page-size="pagesize" :current-page="page"/> |
|
||||
<Diolog v-if="data.addPostBox" v-model="data.addPostBox" :title="title" :array-num="tableData.length" @add-row="addRow" @edit-row="editRow"></Diolog> |
|
||||
<Edit v-if="data.editPostCont" v-model="data.editPostCont" :row-info="rowInfo" :title="title" :array-num="tableData.length" :table-data="tableData"></Edit> |
|
||||
</div> |
|
||||
</template> |
|
||||
<style lang='scss' scoped> |
|
||||
*{ |
|
||||
font-weight: bolder; |
|
||||
} |
|
||||
.horizontal-controls { |
|
||||
display: flex; |
|
||||
float: left; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/* 可以根据需要调整样式 */ |
|
||||
</style> |
|
||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue