2588 changed files with 493289 additions and 35937 deletions
@ -0,0 +1,119 @@ |
|||
{ |
|||
"name": "appsys", |
|||
"private": true, |
|||
"version": "2.3.0", |
|||
"type": "module", |
|||
"scripts": { |
|||
"dev": "vite ", |
|||
"build:prod": "vite build --mode production &&vue-tsc --noEmit", |
|||
"prepare": "husky install", |
|||
"lint:eslint": "eslint --fix --ext .ts,.js,.vue ./src ", |
|||
"lint:prettier": "prettier --write \"**/*.{js,cjs,ts,json,tsx,css,less,scss,vue,html,md}\"", |
|||
"lint:stylelint": "stylelint \"**/*.{css,scss,vue}\" --fix", |
|||
"lint:lint-staged": "lint-staged", |
|||
"commit": "git-cz", |
|||
"build": "webpack" |
|||
}, |
|||
"config": { |
|||
"commitizen": { |
|||
"path": "node_modules/cz-git" |
|||
} |
|||
}, |
|||
"lint-staged": { |
|||
"*.{js,ts}": [ |
|||
"eslint --fix", |
|||
"prettier --write" |
|||
], |
|||
"*.{cjs,json}": [ |
|||
"prettier --write" |
|||
], |
|||
"*.{vue,html}": [ |
|||
"eslint --fix", |
|||
"prettier --write", |
|||
"stylelint --fix" |
|||
], |
|||
"*.{scss,css}": [ |
|||
"stylelint --fix", |
|||
"prettier --write" |
|||
], |
|||
"*.md": [ |
|||
"prettier --write" |
|||
] |
|||
}, |
|||
"dependencies": { |
|||
"@element-plus/icons": "^0.0.11", |
|||
"@element-plus/icons-vue": "^2.1.0", |
|||
"@vitejs/plugin-vue": "^4.2.3", |
|||
"@vueuse/core": "^10.1.2", |
|||
"@wangeditor/editor": "^5.1.23", |
|||
"@wangeditor/editor-for-vue": "5.1.10", |
|||
"@wecom/jssdk": "^1.3.2", |
|||
"axios": "^1.4.0", |
|||
"build": "^0.1.4", |
|||
"clipboard": "^2.0.11", |
|||
"echarts": "^5.4.3", |
|||
"element-plus": "^2.3.12", |
|||
"js-beautify": "^1.14.8", |
|||
"js-md5": "^0.7.3", |
|||
"md5": "^2.3.0", |
|||
"nprogress": "^0.2.0", |
|||
"path-browserify": "^1.0.1", |
|||
"path-to-regexp": "^6.2.0", |
|||
"pinia": "^2.0.33", |
|||
"quill": "^1.3.7", |
|||
"screenfull": "^6.0.0", |
|||
"ts-md5": "^1.3.1", |
|||
"vue": "^3.3.4", |
|||
"vue-i18n": "9.2.2", |
|||
"vue-quill-editor": "^3.0.6", |
|||
"vue-router": "^4.2.0", |
|||
"vuedraggable": "^4.1.0", |
|||
"vuedraggable-es": "^4.1.1", |
|||
"wangeditor": "^4.7.15", |
|||
"webpack": "^5.88.2" |
|||
}, |
|||
"devDependencies": { |
|||
"@commitlint/cli": "^17.6.3", |
|||
"@commitlint/config-conventional": "^17.6.3", |
|||
"@iconify-json/ep": "^1.1.10", |
|||
"@types/md5": "^2.3.2", |
|||
"@types/nprogress": "^0.2.0", |
|||
"@types/path-browserify": "^1.0.0", |
|||
"@typescript-eslint/eslint-plugin": "^5.59.6", |
|||
"@typescript-eslint/parser": "^5.59.6", |
|||
"autoprefixer": "^10.4.14", |
|||
"commitizen": "^4.3.0", |
|||
"cz-git": "^1.6.1", |
|||
"eslint": "^8.40.0", |
|||
"eslint-config-prettier": "^8.8.0", |
|||
"eslint-plugin-prettier": "^4.2.1", |
|||
"eslint-plugin-vue": "^9.13.0", |
|||
"fast-glob": "^3.2.11", |
|||
"husky": "^8.0.3", |
|||
"lint-staged": "^13.2.2", |
|||
"postcss": "^8.4.23", |
|||
"postcss-html": "^1.5.0", |
|||
"postcss-scss": "^4.0.6", |
|||
"prettier": "^2.8.8", |
|||
"sass": "^1.58.3", |
|||
"stylelint": "^15.5.0", |
|||
"stylelint-config-html": "^1.1.0", |
|||
"stylelint-config-recess-order": "^4.0.0", |
|||
"stylelint-config-recommended-scss": "11.0.0 ", |
|||
"stylelint-config-recommended-vue": "^1.4.0", |
|||
"stylelint-config-standard": "^33.0.0", |
|||
"stylelint-config-standard-scss": "^9.0.0", |
|||
"typescript": "^5.0.4", |
|||
"unocss": "^0.51.13", |
|||
"unplugin-auto-import": "^0.15.3", |
|||
"unplugin-icons": "^0.16.1", |
|||
"unplugin-vue-components": "^0.24.1", |
|||
"vite": "^4.3.5", |
|||
"vite-plugin-svg-icons": "^2.0.1", |
|||
"vue-tsc": "^1.6.5 ", |
|||
"webpack-cli": "^5.1.4" |
|||
}, |
|||
"repository": "", |
|||
"author": "", |
|||
"license": "MIT" |
|||
} |
|||
@ -0,0 +1,119 @@ |
|||
{ |
|||
"name": "appsys", |
|||
"private": true, |
|||
"version": "2.3.0", |
|||
"type": "module", |
|||
"scripts": { |
|||
"dev": "vite serve --mode development", |
|||
"build:prod": "vite build --mode production &&vue-tsc --noEmit", |
|||
"prepare": "husky install", |
|||
"lint:eslint": "eslint --fix --ext .ts,.js,.vue ./src ", |
|||
"lint:prettier": "prettier --write \"**/*.{js,cjs,ts,json,tsx,css,less,scss,vue,html,md}\"", |
|||
"lint:stylelint": "stylelint \"**/*.{css,scss,vue}\" --fix", |
|||
"lint:lint-staged": "lint-staged", |
|||
"commit": "git-cz", |
|||
"build": "webpack" |
|||
}, |
|||
"config": { |
|||
"commitizen": { |
|||
"path": "node_modules/cz-git" |
|||
} |
|||
}, |
|||
"lint-staged": { |
|||
"*.{js,ts}": [ |
|||
"eslint --fix", |
|||
"prettier --write" |
|||
], |
|||
"*.{cjs,json}": [ |
|||
"prettier --write" |
|||
], |
|||
"*.{vue,html}": [ |
|||
"eslint --fix", |
|||
"prettier --write", |
|||
"stylelint --fix" |
|||
], |
|||
"*.{scss,css}": [ |
|||
"stylelint --fix", |
|||
"prettier --write" |
|||
], |
|||
"*.md": [ |
|||
"prettier --write" |
|||
] |
|||
}, |
|||
"dependencies": { |
|||
"@element-plus/icons": "^0.0.11", |
|||
"@element-plus/icons-vue": "^2.1.0", |
|||
"@vitejs/plugin-vue": "^4.2.3", |
|||
"@vueuse/core": "^10.1.2", |
|||
"@wangeditor/editor": "^5.1.23", |
|||
"@wangeditor/editor-for-vue": "5.1.10", |
|||
"@wecom/jssdk": "^1.3.2", |
|||
"axios": "^1.4.0", |
|||
"build": "^0.1.4", |
|||
"clipboard": "^2.0.11", |
|||
"echarts": "^5.4.3", |
|||
"element-plus": "^2.3.12", |
|||
"js-beautify": "^1.14.8", |
|||
"js-md5": "^0.7.3", |
|||
"md5": "^2.3.0", |
|||
"nprogress": "^0.2.0", |
|||
"path-browserify": "^1.0.1", |
|||
"path-to-regexp": "^6.2.0", |
|||
"pinia": "^2.0.33", |
|||
"quill": "^1.3.7", |
|||
"screenfull": "^6.0.0", |
|||
"ts-md5": "^1.3.1", |
|||
"vue": "^3.3.4", |
|||
"vue-i18n": "9.2.2", |
|||
"vue-quill-editor": "^3.0.6", |
|||
"vue-router": "^4.2.0", |
|||
"vuedraggable": "^4.1.0", |
|||
"vuedraggable-es": "^4.1.1", |
|||
"wangeditor": "^4.7.15", |
|||
"webpack": "^5.88.2" |
|||
}, |
|||
"devDependencies": { |
|||
"@commitlint/cli": "^17.6.3", |
|||
"@commitlint/config-conventional": "^17.6.3", |
|||
"@iconify-json/ep": "^1.1.10", |
|||
"@types/md5": "^2.3.2", |
|||
"@types/nprogress": "^0.2.0", |
|||
"@types/path-browserify": "^1.0.0", |
|||
"@typescript-eslint/eslint-plugin": "^5.59.6", |
|||
"@typescript-eslint/parser": "^5.59.6", |
|||
"autoprefixer": "^10.4.14", |
|||
"commitizen": "^4.3.0", |
|||
"cz-git": "^1.6.1", |
|||
"eslint": "^8.40.0", |
|||
"eslint-config-prettier": "^8.8.0", |
|||
"eslint-plugin-prettier": "^4.2.1", |
|||
"eslint-plugin-vue": "^9.13.0", |
|||
"fast-glob": "^3.2.11", |
|||
"husky": "^8.0.3", |
|||
"lint-staged": "^13.2.2", |
|||
"postcss": "^8.4.23", |
|||
"postcss-html": "^1.5.0", |
|||
"postcss-scss": "^4.0.6", |
|||
"prettier": "^2.8.8", |
|||
"sass": "^1.58.3", |
|||
"stylelint": "^15.5.0", |
|||
"stylelint-config-html": "^1.1.0", |
|||
"stylelint-config-recess-order": "^4.0.0", |
|||
"stylelint-config-recommended-scss": "11.0.0 ", |
|||
"stylelint-config-recommended-vue": "^1.4.0", |
|||
"stylelint-config-standard": "^33.0.0", |
|||
"stylelint-config-standard-scss": "^9.0.0", |
|||
"typescript": "^5.0.4", |
|||
"unocss": "^0.51.13", |
|||
"unplugin-auto-import": "^0.15.3", |
|||
"unplugin-icons": "^0.16.1", |
|||
"unplugin-vue-components": "^0.24.1", |
|||
"vite": "^4.3.5", |
|||
"vite-plugin-svg-icons": "^2.0.1", |
|||
"vue-tsc": "^1.6.5 ", |
|||
"webpack-cli": "^5.1.4" |
|||
}, |
|||
"repository": "", |
|||
"author": "", |
|||
"license": "MIT" |
|||
} |
|||
@ -0,0 +1,158 @@ |
|||
export interface postinfp{ |
|||
id?:number, |
|||
number?: string, |
|||
name?:string, |
|||
superior?:number, |
|||
organizationtype?: number, |
|||
abbreviation?: string, |
|||
time?: number, |
|||
state?: number, |
|||
wechatorganizationid?: number, |
|||
superiorsun?: string, |
|||
schoole?: number, |
|||
kingdeeid?: string, |
|||
ispower?: number, |
|||
sort?: number, |
|||
classname?: string, |
|||
level?: number, |
|||
isman?: number, |
|||
status?: boolean, |
|||
child?: null, |
|||
type?:number; |
|||
} |
|||
export interface tarData{ |
|||
page?:number; |
|||
pageSize?:number; |
|||
name?:string; |
|||
dimension?:string; |
|||
attribute?:string; |
|||
orgidlist?:Array<any>; |
|||
} |
|||
export interface addlist{ |
|||
name?:string; |
|||
share?:number; |
|||
acceptdepartmentid?:Array<any>; |
|||
userlist?:Array<any>; |
|||
dimension?:string; |
|||
nature?:number; |
|||
unit?:string; |
|||
cycle?:number; |
|||
cycleattr?:Number; |
|||
scoringmethod?:number; |
|||
visiblerangegroup?:Array<any>; |
|||
visiblerangedepart?:Array<any>; |
|||
} |
|||
export interface deltarget{ |
|||
id?:String; |
|||
state?:number; |
|||
istrue?:number; |
|||
} |
|||
export interface getgroupData{ |
|||
id?:number; |
|||
all:number; |
|||
} |
|||
export interface edittarget{ |
|||
acceptdepartmentid?:Array<any> |
|||
cycle?:Number; |
|||
cycleattr:number; |
|||
dimension:string; |
|||
id:string; |
|||
name:string; |
|||
nature:number; |
|||
scoringmethod:Number; |
|||
unit:string; |
|||
userlist:Array<any> |
|||
} |
|||
export interface position{ |
|||
page?:number; |
|||
pagesize?:number; |
|||
organization?:string; |
|||
} |
|||
export interface getgroup{ |
|||
id?:number; |
|||
level?:number; |
|||
} |
|||
export interface organd{ |
|||
all?:number; |
|||
id?:string; |
|||
levelL:number; |
|||
} |
|||
export interface postsss{ |
|||
attribute?:string; |
|||
dimension?:string; |
|||
page?:number; |
|||
pageSize?:number; |
|||
title?:string; |
|||
postidlist?:Array<any>; |
|||
} |
|||
export interface addposttar{ |
|||
title?:string; |
|||
dimension?: String; |
|||
unit?:String; |
|||
type?: number; |
|||
scoringmethod?: number; |
|||
cycle?:number; |
|||
cycleattr?: number; |
|||
departmentPostOther?:Array<any> |
|||
otherposttarget?:Array<any>; |
|||
|
|||
} |
|||
export interface searchorgpos{ |
|||
name?:string; |
|||
id?:string; |
|||
} |
|||
export interface setposttarget{ |
|||
id?:string; |
|||
state?:number; |
|||
istrue?:number; |
|||
} |
|||
export interface table_base_post_target{ |
|||
id?:string; |
|||
} |
|||
export interface getdetails{ |
|||
targetid: string; |
|||
inspect: Array<any>; |
|||
postlist: Array<any>; |
|||
cycle:Number; |
|||
} |
|||
export interface neweditposttarget{ |
|||
title?:string; |
|||
dimension?: String; |
|||
unit?:String; |
|||
type?: number; |
|||
scoringmethod?: Number; |
|||
cycle?:Number; |
|||
cycleattr?: Number; |
|||
otherposttarget?:Array<any>; |
|||
id:string; |
|||
} |
|||
export interface get_organdpost_ary{ |
|||
id: string; |
|||
} |
|||
export interface look_work_flowcont{ |
|||
id:string; |
|||
} |
|||
export interface quantechart{ |
|||
AccMethod?:Array<any>; |
|||
targetid?:Array<any>; |
|||
year?:Array<any>; |
|||
analysisangle?:number; |
|||
org?:Array<any>; |
|||
timeattribute?:Array<any> |
|||
} |
|||
export interface gettarget{ |
|||
page:number; |
|||
pagesize:number; |
|||
} |
|||
export interface getquantechartorgandyear{ |
|||
targetid:Array<any>; |
|||
} |
|||
export interface summaryplanrecord{ |
|||
department:string; |
|||
month:Number; |
|||
targetid:string; |
|||
year:Number; |
|||
} |
|||
export interface get_post_target{ |
|||
id:string; |
|||
} |
|||
@ -0,0 +1,158 @@ |
|||
export interface postinfp{ |
|||
id?:number, |
|||
number?: string, |
|||
name?:string, |
|||
superior?:number, |
|||
organizationtype?: number, |
|||
abbreviation?: string, |
|||
time?: number, |
|||
state?: number, |
|||
wechatorganizationid?: number, |
|||
superiorsun?: string, |
|||
schoole?: number, |
|||
kingdeeid?: string, |
|||
ispower?: number, |
|||
sort?: number, |
|||
classname?: string, |
|||
level?: number, |
|||
isman?: number, |
|||
status?: boolean, |
|||
child?: null, |
|||
type?:number; |
|||
} |
|||
export interface tarData{ |
|||
page?:number; |
|||
pageSize?:number; |
|||
name?:string; |
|||
dimension?:string; |
|||
attribute?:string; |
|||
orgidlist?:Array<any>; |
|||
} |
|||
export interface addlist{ |
|||
name?:string; |
|||
share?:number; |
|||
acceptdepartmentid?:Array<any>; |
|||
userlist?:Array<any>; |
|||
dimension?:string; |
|||
nature?:number; |
|||
unit?:string; |
|||
cycle?:number; |
|||
cycleattr?:Number; |
|||
scoringmethod?:number; |
|||
visiblerangegroup?:Array<any>; |
|||
visiblerangedepart?:Array<any>; |
|||
} |
|||
export interface deltarget{ |
|||
id?:String; |
|||
state?:number; |
|||
istrue?:number; |
|||
} |
|||
export interface getgroupData{ |
|||
id?:number; |
|||
all:number; |
|||
} |
|||
export interface edittarget{ |
|||
acceptdepartmentid?:Array<any> |
|||
cycle?:Number; |
|||
cycleattr:number; |
|||
dimension:string; |
|||
id:string; |
|||
name:string; |
|||
nature:number; |
|||
scoringmethod:Number; |
|||
unit:string; |
|||
userlist:Array<any> |
|||
} |
|||
export interface position{ |
|||
page?:number; |
|||
pagesize?:number; |
|||
organization?:string; |
|||
} |
|||
export interface getgroup{ |
|||
id?:number; |
|||
level?:number; |
|||
} |
|||
export interface organd{ |
|||
all?:number; |
|||
id?:string; |
|||
levelL:number; |
|||
} |
|||
export interface postsss{ |
|||
attribute?:string; |
|||
dimension?:string; |
|||
page?:number; |
|||
pageSize?:number; |
|||
title?:string; |
|||
postidlist?:Array<any>; |
|||
} |
|||
export interface addposttar{ |
|||
title?:string; |
|||
dimension?: String; |
|||
unit?:String; |
|||
type?: number; |
|||
scoringmethod?: number; |
|||
cycle?:number; |
|||
cycleattr?: number; |
|||
departmentPostOther?:Array<any> |
|||
otherposttarget?:Array<any>; |
|||
|
|||
} |
|||
export interface searchorgpos{ |
|||
name?:string; |
|||
orgid?:string; |
|||
} |
|||
export interface setposttarget{ |
|||
id?:string; |
|||
state?:number; |
|||
istrue?:number; |
|||
} |
|||
export interface table_base_post_target{ |
|||
id?:string; |
|||
} |
|||
export interface getdetails{ |
|||
targetid: string; |
|||
inspect: Array<any>; |
|||
postlist: Array<any>; |
|||
cycle:Number; |
|||
} |
|||
export interface neweditposttarget{ |
|||
title?:string; |
|||
dimension?: String; |
|||
unit?:String; |
|||
type?: number; |
|||
scoringmethod?: Number; |
|||
cycle?:Number; |
|||
cycleattr?: Number; |
|||
otherposttarget?:Array<any>; |
|||
id:string; |
|||
} |
|||
export interface get_organdpost_ary{ |
|||
id: string; |
|||
} |
|||
export interface look_work_flowcont{ |
|||
id:string; |
|||
} |
|||
export interface quantechart{ |
|||
AccMethod?:Array<any>; |
|||
targetid?:Array<any>; |
|||
year?:Array<any>; |
|||
analysisangle?:number; |
|||
org?:Array<any>; |
|||
timeattribute?:Array<any> |
|||
} |
|||
export interface gettarget{ |
|||
page:number; |
|||
pagesize:number; |
|||
} |
|||
export interface getquantechartorgandyear{ |
|||
targetid:Array<any>; |
|||
} |
|||
export interface summaryplanrecord{ |
|||
department:string; |
|||
month:Number; |
|||
targetid:string; |
|||
year:Number; |
|||
} |
|||
export interface get_post_target{ |
|||
id:string; |
|||
} |
|||
@ -0,0 +1,159 @@ |
|||
export interface postinfp{ |
|||
id?:number, |
|||
number?: string, |
|||
name?:string, |
|||
superior?:number, |
|||
organizationtype?: number, |
|||
abbreviation?: string, |
|||
time?: number, |
|||
state?: number, |
|||
wechatorganizationid?: number, |
|||
superiorsun?: string, |
|||
schoole?: number, |
|||
kingdeeid?: string, |
|||
ispower?: number, |
|||
sort?: number, |
|||
classname?: string, |
|||
level?: number, |
|||
isman?: number, |
|||
status?: boolean, |
|||
child?: null, |
|||
type?:number; |
|||
} |
|||
export interface tarData{ |
|||
page?:number; |
|||
pageSize?:number; |
|||
name?:string; |
|||
dimension?:string; |
|||
attribute?:string; |
|||
orgidlist?:Array<any>; |
|||
} |
|||
export interface addlist{ |
|||
name?:string; |
|||
share?:number; |
|||
acceptdepartmentid?:Array<any>; |
|||
userlist?:Array<any>; |
|||
dimension?:string; |
|||
nature?:number; |
|||
unit?:string; |
|||
cycle?:number; |
|||
cycleattr?:Number; |
|||
scoringmethod?:number; |
|||
visiblerangegroup?:Array<any>; |
|||
visiblerangedepart?:Array<any>; |
|||
} |
|||
export interface deltarget{ |
|||
id?:String; |
|||
state?:number; |
|||
istrue?:number; |
|||
} |
|||
export interface getgroupData{ |
|||
id?:number; |
|||
all:number; |
|||
} |
|||
export interface edittarget{ |
|||
acceptdepartmentid?:Array<any> |
|||
cycle?:Number; |
|||
cycleattr:number; |
|||
dimension:string; |
|||
id:string; |
|||
name:string; |
|||
nature:number; |
|||
scoringmethod:Number; |
|||
unit:string; |
|||
userlist:Array<any> |
|||
} |
|||
export interface position{ |
|||
page?:number; |
|||
pagesize?:number; |
|||
organization?:string; |
|||
} |
|||
export interface getgroup{ |
|||
id?:number; |
|||
level?:number; |
|||
} |
|||
export interface organd{ |
|||
all?:number; |
|||
id?:string; |
|||
levelL:number; |
|||
} |
|||
export interface postsss{ |
|||
attribute?:string; |
|||
dimension?:string; |
|||
page?:number; |
|||
pageSize?:number; |
|||
title?:string; |
|||
postidlist?:Array<any>; |
|||
} |
|||
export interface addposttar{ |
|||
title?:string; |
|||
dimension?: String; |
|||
unit?:String; |
|||
type?: number; |
|||
scoringmethod?: number; |
|||
cycle?:number; |
|||
cycleattr?: number; |
|||
departmentPostOther?:Array<any> |
|||
otherposttarget?:Array<any>; |
|||
|
|||
} |
|||
export interface searchorgpos{ |
|||
name?:string; |
|||
orgid?:string; |
|||
} |
|||
export interface setposttarget{ |
|||
id?:string; |
|||
state?:number; |
|||
istrue?:number; |
|||
} |
|||
export interface table_base_post_target{ |
|||
id?:string; |
|||
} |
|||
export interface getdetails{ |
|||
targetid: string; |
|||
inspect: Array<any>; |
|||
postlist: Array<any>; |
|||
cycle:Number; |
|||
} |
|||
export interface neweditposttarget{ |
|||
title?:string; |
|||
dimension?: String; |
|||
unit?:String; |
|||
type?: number; |
|||
scoringmethod?: Number; |
|||
cycle?:Number; |
|||
cycleattr?: Number; |
|||
otherposttarget?:Array<any>; |
|||
id:string; |
|||
visiblegroup:"",visiblerange:"" |
|||
} |
|||
export interface get_organdpost_ary{ |
|||
id: string; |
|||
} |
|||
export interface look_work_flowcont{ |
|||
id:string; |
|||
} |
|||
export interface quantechart{ |
|||
AccMethod?:Array<any>; |
|||
targetid?:Array<any>; |
|||
year?:Array<any>; |
|||
analysisangle?:number; |
|||
org?:Array<any>; |
|||
timeattribute?:Array<any> |
|||
} |
|||
export interface gettarget{ |
|||
page:number; |
|||
pagesize:number; |
|||
} |
|||
export interface getquantechartorgandyear{ |
|||
targetid:Array<any>; |
|||
} |
|||
export interface summaryplanrecord{ |
|||
department:string; |
|||
month:Number; |
|||
targetid:string; |
|||
year:Number; |
|||
} |
|||
export interface get_post_target{ |
|||
id:string; |
|||
} |
|||
@ -0,0 +1,160 @@ |
|||
export interface postinfp{ |
|||
id?:number, |
|||
number?: string, |
|||
name?:string, |
|||
superior?:number, |
|||
organizationtype?: number, |
|||
abbreviation?: string, |
|||
time?: number, |
|||
state?: number, |
|||
wechatorganizationid?: number, |
|||
superiorsun?: string, |
|||
schoole?: number, |
|||
kingdeeid?: string, |
|||
ispower?: number, |
|||
sort?: number, |
|||
classname?: string, |
|||
level?: number, |
|||
isman?: number, |
|||
status?: boolean, |
|||
child?: null, |
|||
type?:number; |
|||
} |
|||
export interface tarData{ |
|||
page?:number; |
|||
pageSize?:number; |
|||
name?:string; |
|||
dimension?:string; |
|||
attribute?:string; |
|||
orgidlist?:Array<any>; |
|||
} |
|||
export interface addlist{ |
|||
name?:string; |
|||
share?:number; |
|||
acceptdepartmentid?:Array<any>; |
|||
userlist?:Array<any>; |
|||
dimension?:string; |
|||
nature?:number; |
|||
unit?:string; |
|||
cycle?:number; |
|||
cycleattr?:Number; |
|||
scoringmethod?:number; |
|||
visiblerangegroup?:Array<any>; |
|||
visiblerangedepart?:Array<any>; |
|||
} |
|||
export interface deltarget{ |
|||
id?:String; |
|||
state?:number; |
|||
istrue?:number; |
|||
} |
|||
export interface getgroupData{ |
|||
id?:number; |
|||
all:number; |
|||
} |
|||
export interface edittarget{ |
|||
acceptdepartmentid?:Array<any> |
|||
cycle?:Number; |
|||
cycleattr:number; |
|||
dimension:string; |
|||
id:string; |
|||
name:string; |
|||
nature:number; |
|||
scoringmethod:Number; |
|||
unit:string; |
|||
userlist:Array<any> |
|||
} |
|||
export interface position{ |
|||
page?:number; |
|||
pagesize?:number; |
|||
organization?:string; |
|||
} |
|||
export interface getgroup{ |
|||
id?:number; |
|||
level?:number; |
|||
} |
|||
export interface organd{ |
|||
all?:number; |
|||
id?:string; |
|||
levelL:number; |
|||
} |
|||
export interface postsss{ |
|||
attribute?:string; |
|||
dimension?:string; |
|||
page?:number; |
|||
pageSize?:number; |
|||
title?:string; |
|||
postidlist?:Array<any>; |
|||
} |
|||
export interface addposttar{ |
|||
title?:string; |
|||
dimension?: String; |
|||
unit?:String; |
|||
type?: number; |
|||
scoringmethod?: number; |
|||
cycle?:number; |
|||
cycleattr?: number; |
|||
departmentPostOther?:Array<any> |
|||
otherposttarget?:Array<any>; |
|||
|
|||
} |
|||
export interface searchorgpos{ |
|||
name?:string; |
|||
orgid?:string; |
|||
} |
|||
export interface setposttarget{ |
|||
id?:string; |
|||
state?:number; |
|||
istrue?:number; |
|||
} |
|||
export interface table_base_post_target{ |
|||
id?:string; |
|||
} |
|||
export interface getdetails{ |
|||
targetid: string; |
|||
inspect: Array<any>; |
|||
postlist: Array<any>; |
|||
cycle:Number; |
|||
} |
|||
export interface neweditposttarget{ |
|||
title?:string; |
|||
dimension?: String; |
|||
unit?:String; |
|||
type?: number; |
|||
scoringmethod?: Number; |
|||
cycle?:Number; |
|||
cycleattr?: Number; |
|||
otherposttarget?:Array<any>; |
|||
id:string; |
|||
visiblegroup:""; |
|||
visiblerange:"" |
|||
} |
|||
export interface get_organdpost_ary{ |
|||
id: string; |
|||
} |
|||
export interface look_work_flowcont{ |
|||
id:string; |
|||
} |
|||
export interface quantechart{ |
|||
AccMethod?:Array<any>; |
|||
targetid?:Array<any>; |
|||
year?:Array<any>; |
|||
analysisangle?:number; |
|||
org?:Array<any>; |
|||
timeattribute?:Array<any> |
|||
} |
|||
export interface gettarget{ |
|||
page:number; |
|||
pagesize:number; |
|||
} |
|||
export interface getquantechartorgandyear{ |
|||
targetid:Array<any>; |
|||
} |
|||
export interface summaryplanrecord{ |
|||
department:string; |
|||
month:Number; |
|||
targetid:string; |
|||
year:Number; |
|||
} |
|||
export interface get_post_target{ |
|||
id:string; |
|||
} |
|||
@ -0,0 +1,160 @@ |
|||
export interface postinfp{ |
|||
id?:number, |
|||
number?: string, |
|||
name?:string, |
|||
superior?:number, |
|||
organizationtype?: number, |
|||
abbreviation?: string, |
|||
time?: number, |
|||
state?: number, |
|||
wechatorganizationid?: number, |
|||
superiorsun?: string, |
|||
schoole?: number, |
|||
kingdeeid?: string, |
|||
ispower?: number, |
|||
sort?: number, |
|||
classname?: string, |
|||
level?: number, |
|||
isman?: number, |
|||
status?: boolean, |
|||
child?: null, |
|||
type?:number; |
|||
} |
|||
export interface tarData{ |
|||
page?:number; |
|||
pageSize?:number; |
|||
name?:string; |
|||
dimension?:string; |
|||
attribute?:string; |
|||
orgidlist?:Array<any>; |
|||
} |
|||
export interface addlist{ |
|||
name?:string; |
|||
share?:number; |
|||
acceptdepartmentid?:Array<any>; |
|||
userlist?:Array<any>; |
|||
dimension?:string; |
|||
nature?:number; |
|||
unit?:string; |
|||
cycle?:number; |
|||
cycleattr?:Number; |
|||
scoringmethod?:number; |
|||
visiblerangegroup?:Array<any>; |
|||
visiblerangedepart?:Array<any>; |
|||
} |
|||
export interface deltarget{ |
|||
id?:String; |
|||
state?:number; |
|||
istrue?:number; |
|||
} |
|||
export interface getgroupData{ |
|||
id?:number; |
|||
all:number; |
|||
} |
|||
export interface edittarget{ |
|||
acceptdepartmentid?:Array<any> |
|||
cycle?:Number; |
|||
cycleattr:number; |
|||
dimension:string; |
|||
id:string; |
|||
name:string; |
|||
nature:number; |
|||
scoringmethod:Number; |
|||
unit:string; |
|||
userlist:Array<any> |
|||
} |
|||
export interface position{ |
|||
page?:number; |
|||
pagesize?:number; |
|||
organization?:string; |
|||
} |
|||
export interface getgroup{ |
|||
id?:number; |
|||
level?:number; |
|||
} |
|||
export interface organd{ |
|||
all?:number; |
|||
id?:string; |
|||
levelL:number; |
|||
} |
|||
export interface postsss{ |
|||
attribute?:string; |
|||
dimension?:string; |
|||
page?:number; |
|||
pageSize?:number; |
|||
title?:string; |
|||
postidlist?:Array<any>; |
|||
} |
|||
export interface addposttar{ |
|||
title?:string; |
|||
dimension?: String; |
|||
unit?:String; |
|||
type?: number; |
|||
scoringmethod?: number; |
|||
cycle?:number; |
|||
cycleattr?: number; |
|||
departmentPostOther?:Array<any> |
|||
otherposttarget?:Array<any>; |
|||
|
|||
} |
|||
export interface searchorgpos{ |
|||
name?:string; |
|||
orgid?:string; |
|||
} |
|||
export interface setposttarget{ |
|||
id?:string; |
|||
state?:number; |
|||
istrue?:number; |
|||
} |
|||
export interface table_base_post_target{ |
|||
id?:string; |
|||
} |
|||
export interface getdetails{ |
|||
targetid: string; |
|||
inspect: Array<any>; |
|||
postlist: Array<any>; |
|||
cycle:Number; |
|||
} |
|||
export interface neweditposttarget{ |
|||
title?:string; |
|||
dimension?: String; |
|||
unit?:String; |
|||
type?: number; |
|||
scoringmethod?: Number; |
|||
cycle?:Number; |
|||
cycleattr?: Number; |
|||
otherposttarget?:Array<any>; |
|||
id:string; |
|||
visiblegroup:""; |
|||
visiblerange:st |
|||
} |
|||
export interface get_organdpost_ary{ |
|||
id: string; |
|||
} |
|||
export interface look_work_flowcont{ |
|||
id:string; |
|||
} |
|||
export interface quantechart{ |
|||
AccMethod?:Array<any>; |
|||
targetid?:Array<any>; |
|||
year?:Array<any>; |
|||
analysisangle?:number; |
|||
org?:Array<any>; |
|||
timeattribute?:Array<any> |
|||
} |
|||
export interface gettarget{ |
|||
page:number; |
|||
pagesize:number; |
|||
} |
|||
export interface getquantechartorgandyear{ |
|||
targetid:Array<any>; |
|||
} |
|||
export interface summaryplanrecord{ |
|||
department:string; |
|||
month:Number; |
|||
targetid:string; |
|||
year:Number; |
|||
} |
|||
export interface get_post_target{ |
|||
id:string; |
|||
} |
|||
@ -0,0 +1,160 @@ |
|||
export interface postinfp{ |
|||
id?:number, |
|||
number?: string, |
|||
name?:string, |
|||
superior?:number, |
|||
organizationtype?: number, |
|||
abbreviation?: string, |
|||
time?: number, |
|||
state?: number, |
|||
wechatorganizationid?: number, |
|||
superiorsun?: string, |
|||
schoole?: number, |
|||
kingdeeid?: string, |
|||
ispower?: number, |
|||
sort?: number, |
|||
classname?: string, |
|||
level?: number, |
|||
isman?: number, |
|||
status?: boolean, |
|||
child?: null, |
|||
type?:number; |
|||
} |
|||
export interface tarData{ |
|||
page?:number; |
|||
pageSize?:number; |
|||
name?:string; |
|||
dimension?:string; |
|||
attribute?:string; |
|||
orgidlist?:Array<any>; |
|||
} |
|||
export interface addlist{ |
|||
name?:string; |
|||
share?:number; |
|||
acceptdepartmentid?:Array<any>; |
|||
userlist?:Array<any>; |
|||
dimension?:string; |
|||
nature?:number; |
|||
unit?:string; |
|||
cycle?:number; |
|||
cycleattr?:Number; |
|||
scoringmethod?:number; |
|||
visiblerangegroup?:Array<any>; |
|||
visiblerangedepart?:Array<any>; |
|||
} |
|||
export interface deltarget{ |
|||
id?:String; |
|||
state?:number; |
|||
istrue?:number; |
|||
} |
|||
export interface getgroupData{ |
|||
id?:number; |
|||
all:number; |
|||
} |
|||
export interface edittarget{ |
|||
acceptdepartmentid?:Array<any> |
|||
cycle?:Number; |
|||
cycleattr:number; |
|||
dimension:string; |
|||
id:string; |
|||
name:string; |
|||
nature:number; |
|||
scoringmethod:Number; |
|||
unit:string; |
|||
userlist:Array<any> |
|||
} |
|||
export interface position{ |
|||
page?:number; |
|||
pagesize?:number; |
|||
organization?:string; |
|||
} |
|||
export interface getgroup{ |
|||
id?:number; |
|||
level?:number; |
|||
} |
|||
export interface organd{ |
|||
all?:number; |
|||
id?:string; |
|||
levelL:number; |
|||
} |
|||
export interface postsss{ |
|||
attribute?:string; |
|||
dimension?:string; |
|||
page?:number; |
|||
pageSize?:number; |
|||
title?:string; |
|||
postidlist?:Array<any>; |
|||
} |
|||
export interface addposttar{ |
|||
title?:string; |
|||
dimension?: String; |
|||
unit?:String; |
|||
type?: number; |
|||
scoringmethod?: number; |
|||
cycle?:number; |
|||
cycleattr?: number; |
|||
departmentPostOther?:Array<any> |
|||
otherposttarget?:Array<any>; |
|||
|
|||
} |
|||
export interface searchorgpos{ |
|||
name?:string; |
|||
orgid?:string; |
|||
} |
|||
export interface setposttarget{ |
|||
id?:string; |
|||
state?:number; |
|||
istrue?:number; |
|||
} |
|||
export interface table_base_post_target{ |
|||
id?:string; |
|||
} |
|||
export interface getdetails{ |
|||
targetid: string; |
|||
inspect: Array<any>; |
|||
postlist: Array<any>; |
|||
cycle:Number; |
|||
} |
|||
export interface neweditposttarget{ |
|||
title?:string; |
|||
dimension?: String; |
|||
unit?:String; |
|||
type?: number; |
|||
scoringmethod?: Number; |
|||
cycle?:Number; |
|||
cycleattr?: Number; |
|||
otherposttarget?:Array<any>; |
|||
id:string; |
|||
visiblegroup:""; |
|||
visiblerange:string |
|||
} |
|||
export interface get_organdpost_ary{ |
|||
id: string; |
|||
} |
|||
export interface look_work_flowcont{ |
|||
id:string; |
|||
} |
|||
export interface quantechart{ |
|||
AccMethod?:Array<any>; |
|||
targetid?:Array<any>; |
|||
year?:Array<any>; |
|||
analysisangle?:number; |
|||
org?:Array<any>; |
|||
timeattribute?:Array<any> |
|||
} |
|||
export interface gettarget{ |
|||
page:number; |
|||
pagesize:number; |
|||
} |
|||
export interface getquantechartorgandyear{ |
|||
targetid:Array<any>; |
|||
} |
|||
export interface summaryplanrecord{ |
|||
department:string; |
|||
month:Number; |
|||
targetid:string; |
|||
year:Number; |
|||
} |
|||
export interface get_post_target{ |
|||
id:string; |
|||
} |
|||
@ -0,0 +1,160 @@ |
|||
export interface postinfp{ |
|||
id?:number, |
|||
number?: string, |
|||
name?:string, |
|||
superior?:number, |
|||
organizationtype?: number, |
|||
abbreviation?: string, |
|||
time?: number, |
|||
state?: number, |
|||
wechatorganizationid?: number, |
|||
superiorsun?: string, |
|||
schoole?: number, |
|||
kingdeeid?: string, |
|||
ispower?: number, |
|||
sort?: number, |
|||
classname?: string, |
|||
level?: number, |
|||
isman?: number, |
|||
status?: boolean, |
|||
child?: null, |
|||
type?:number; |
|||
} |
|||
export interface tarData{ |
|||
page?:number; |
|||
pageSize?:number; |
|||
name?:string; |
|||
dimension?:string; |
|||
attribute?:string; |
|||
orgidlist?:Array<any>; |
|||
} |
|||
export interface addlist{ |
|||
name?:string; |
|||
share?:number; |
|||
acceptdepartmentid?:Array<any>; |
|||
userlist?:Array<any>; |
|||
dimension?:string; |
|||
nature?:number; |
|||
unit?:string; |
|||
cycle?:number; |
|||
cycleattr?:Number; |
|||
scoringmethod?:number; |
|||
visiblerangegroup?:Array<any>; |
|||
visiblerangedepart?:Array<any>; |
|||
} |
|||
export interface deltarget{ |
|||
id?:String; |
|||
state?:number; |
|||
istrue?:number; |
|||
} |
|||
export interface getgroupData{ |
|||
id?:number; |
|||
all:number; |
|||
} |
|||
export interface edittarget{ |
|||
acceptdepartmentid?:Array<any> |
|||
cycle?:Number; |
|||
cycleattr:number; |
|||
dimension:string; |
|||
id:string; |
|||
name:string; |
|||
nature:number; |
|||
scoringmethod:Number; |
|||
unit:string; |
|||
userlist:Array<any> |
|||
} |
|||
export interface position{ |
|||
page?:number; |
|||
pagesize?:number; |
|||
organization?:string; |
|||
} |
|||
export interface getgroup{ |
|||
id?:number; |
|||
level?:number; |
|||
} |
|||
export interface organd{ |
|||
all?:number; |
|||
id?:string; |
|||
levelL:number; |
|||
} |
|||
export interface postsss{ |
|||
attribute?:string; |
|||
dimension?:string; |
|||
page?:number; |
|||
pageSize?:number; |
|||
title?:string; |
|||
postidlist?:Array<any>; |
|||
} |
|||
export interface addposttar{ |
|||
title?:string; |
|||
dimension?: String; |
|||
unit?:String; |
|||
type?: number; |
|||
scoringmethod?: number; |
|||
cycle?:number; |
|||
cycleattr?: number; |
|||
departmentPostOther?:Array<any> |
|||
otherposttarget?:Array<any>; |
|||
|
|||
} |
|||
export interface searchorgpos{ |
|||
name?:string; |
|||
orgid?:string; |
|||
} |
|||
export interface setposttarget{ |
|||
id?:string; |
|||
state?:number; |
|||
istrue?:number; |
|||
} |
|||
export interface table_base_post_target{ |
|||
id?:string; |
|||
} |
|||
export interface getdetails{ |
|||
targetid: string; |
|||
inspect: Array<any>; |
|||
postlist: Array<any>; |
|||
cycle:Number; |
|||
} |
|||
export interface neweditposttarget{ |
|||
title?:string; |
|||
dimension?: String; |
|||
unit?:String; |
|||
type?: number; |
|||
scoringmethod?: Number; |
|||
cycle?:Number; |
|||
cycleattr?: Number; |
|||
otherposttarget?:Array<any>; |
|||
id:string; |
|||
visiblegroup:string; |
|||
visiblerange:string |
|||
} |
|||
export interface get_organdpost_ary{ |
|||
id: string; |
|||
} |
|||
export interface look_work_flowcont{ |
|||
id:string; |
|||
} |
|||
export interface quantechart{ |
|||
AccMethod?:Array<any>; |
|||
targetid?:Array<any>; |
|||
year?:Array<any>; |
|||
analysisangle?:number; |
|||
org?:Array<any>; |
|||
timeattribute?:Array<any> |
|||
} |
|||
export interface gettarget{ |
|||
page:number; |
|||
pagesize:number; |
|||
} |
|||
export interface getquantechartorgandyear{ |
|||
targetid:Array<any>; |
|||
} |
|||
export interface summaryplanrecord{ |
|||
department:string; |
|||
month:Number; |
|||
targetid:string; |
|||
year:Number; |
|||
} |
|||
export interface get_post_target{ |
|||
id:string; |
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
import { createApp } from 'vue'; |
|||
import App from './App.vue'; |
|||
import router from '@/router'; |
|||
import { setupStore } from '@/store'; |
|||
import { setupDirective } from '@/directive'; |
|||
|
|||
import ElementPlus from 'element-plus' |
|||
import zhCn from 'element-plus/es/locale/lang/zh-cn' |
|||
|
|||
import '@/permission'; |
|||
|
|||
// 本地SVG图标
|
|||
import 'virtual:svg-icons-register'; |
|||
|
|||
// 国际化
|
|||
import i18n from '@/lang/index'; |
|||
|
|||
// 样式
|
|||
import 'element-plus/theme-chalk/dark/css-vars.css'; |
|||
import '@/styles/index.scss'; |
|||
import 'uno.css'; |
|||
const app = createApp(App); |
|||
// 全局注册 自定义指令(directive)
|
|||
setupDirective(app); |
|||
// 全局注册 状态管理(store)
|
|||
setupStore(app); |
|||
app.use(router).use(i18n).use(ElementPlus, { |
|||
locale: zhCn |
|||
}).use(AKDesign).mount('#app'); |
|||
|
|||
|
|||
@ -0,0 +1,39 @@ |
|||
import { createApp } from 'vue'; |
|||
import App from './App.vue'; |
|||
import router from '@/router'; |
|||
import { setupStore } from '@/store'; |
|||
import { setupDirective } from '@/directive'; |
|||
|
|||
import ElementPlus from 'element-plus' |
|||
import zhCn from 'element-plus/es/locale/lang/zh-cn' |
|||
|
|||
import '@/permission'; |
|||
|
|||
// 本地SVG图标
|
|||
import 'virtual:svg-icons-register'; |
|||
|
|||
// 国际化
|
|||
import i18n from '@/lang/index'; |
|||
|
|||
// 样式
|
|||
import 'element-plus/theme-chalk/dark/css-vars.css'; |
|||
import '@/styles/index.scss'; |
|||
import 'uno.css'; |
|||
const app = createApp(App); |
|||
// 全局注册 自定义指令(directive)
|
|||
setupDirective(app); |
|||
// 全局注册 状态管理(store)
|
|||
setupStore(app); |
|||
import * as ElementPlusIconsVue from '@element-plus/icons-vue' |
|||
|
|||
import AKDesign from '@/views/sysworkflow/codepage/index' |
|||
|
|||
for (const [key, component] of Object.entries(ElementPlusIconsVue)) { |
|||
app.component(key, component) |
|||
} |
|||
|
|||
app.use(router).use(i18n).use(ElementPlus, { |
|||
locale: zhCn |
|||
}).use(AKDesign).mount('#app'); |
|||
|
|||
|
|||
@ -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="部门" width=""> |
|||
<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> |
|||
@ -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="部门" width="5"> |
|||
<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> |
|||
@ -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="部门" width="600"> |
|||
<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> |
|||
@ -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="部门" width="400"> |
|||
<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> |
|||
@ -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="部门" width="300"> |
|||
<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> |
|||
@ -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="部门" width="300"> |
|||
<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="版本号" width="/> |
|||
<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> |
|||
@ -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="部门" width="300"> |
|||
<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="版本号" width=""/> |
|||
<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> |
|||
@ -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="部门" width="300"> |
|||
<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="版本号" width="300"/> |
|||
<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> |
|||
@ -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" :header-cell-style="{'text-align':'center'}" border style="width: 100%"> |
|||
<el-table-column prop="groupname,deaprtname," label="部门" width="300"> |
|||
<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="版本号" width="300"/> |
|||
<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> |
|||
@ -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" :header-cell-style="{'text-align':'center'}" border style="width: 100%"> |
|||
<el-table-column prop="groupname,deaprtname," label="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" style="{'text-align':'center'}"/> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<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> |
|||
@ -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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" style="{'text-align':'center'}"/> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<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> |
|||
@ -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" :header-cell-style="{'text-align':'center'}" border style="width: 100%"> |
|||
<el-table-column prop="groupname,deaprtname," label="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" style="{'text-align':'center'}"/> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<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> |
|||
@ -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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" style="{'text-align':'center'}"/> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<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> |
|||
@ -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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" :header-cell-style="{'text-align':'center'}"/> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<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> |
|||
@ -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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align/> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<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> |
|||
@ -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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="/> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<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> |
|||
@ -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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align=""/> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<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> |
|||
@ -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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="cen"/> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<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> |
|||
@ -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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center"/> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<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> |
|||
@ -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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<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> |
|||
@ -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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align /> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<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> |
|||
@ -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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<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> |
|||
@ -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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<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> |
|||
@ -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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<el-table-column prop="time" label="时间" /> |
|||
<el-table-column prop="state" label="状态" width="70" header-align="center" align="center" > |
|||
<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> |
|||
@ -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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<el-table-column prop="time" label="时间" /> |
|||
<el-table-column prop="state" label="状态" width="70" header-align="center" align="center"> |
|||
<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> |
|||
@ -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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<el-table-column prop="time" label="时间" /> |
|||
<el-table-column prop="state" label="状态" width="70" header-align="center" align="center"> |
|||
<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"header-align="center" > |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<el-table-column prop="time" label="时间" /> |
|||
<el-table-column prop="state" label="状态" width="70" header-align="center" align="center"> |
|||
<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" header-align="center" > |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<el-table-column prop="time" label="时间" /> |
|||
<el-table-column prop="state" label="状态" width="70" header-align="center" align="center"> |
|||
<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" header-align="center"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<el-table-column prop="time" label="时间" width="/> |
|||
<el-table-column prop="state" label="状态" width="70" header-align="center" align="center"> |
|||
<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" header-align="center"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<el-table-column prop="time" label="时间" width=""/> |
|||
<el-table-column prop="state" label="状态" width="70" header-align="center" align="center"> |
|||
<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" header-align="center"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<el-table-column prop="time" label="时间" width="200"/> |
|||
<el-table-column prop="state" label="状态" width="70" header-align="center" align="center"> |
|||
<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" header-align="center"> |
|||
<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="部门" width="30%"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<el-table-column prop="time" label="时间" width="200"/> |
|||
<el-table-column prop="state" label="状态" width="70" header-align="center" align="center"> |
|||
<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" header-align="center"> |
|||
<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="部门" width="70%"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<el-table-column prop="time" label="时间" width="200"/> |
|||
<el-table-column prop="state" label="状态" width="70" header-align="center" align="center"> |
|||
<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" header-align="center"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<el-table-column prop="time" label="时间" width="200"/> |
|||
<el-table-column prop="state" label="状态" width="70" header-align="center" align="center"> |
|||
<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" header-align="center"> |
|||
<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="部门" style="width:50"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<el-table-column prop="time" label="时间" width="200"/> |
|||
<el-table-column prop="state" label="状态" width="70" header-align="center" align="center"> |
|||
<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" header-align="center"> |
|||
<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="部门" style="width:50%"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<el-table-column prop="time" label="时间" width="200"/> |
|||
<el-table-column prop="state" label="状态" width="70" header-align="center" align="center"> |
|||
<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" header-align="center"> |
|||
<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="部门" style="width:30%"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<el-table-column prop="time" label="时间" width="200"/> |
|||
<el-table-column prop="state" label="状态" width="70" header-align="center" align="center"> |
|||
<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" header-align="center"> |
|||
<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="部门" style="width:20%"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<el-table-column prop="time" label="时间" width="200"/> |
|||
<el-table-column prop="state" label="状态" width="70" header-align="center" align="center"> |
|||
<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" header-align="center"> |
|||
<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="部门" style="width:20%"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<el-table-column prop="time" label="时间" width="200"/> |
|||
<el-table-column prop="state" label="状态" width="70" header-align="center" align="center"> |
|||
<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" header-align="center"> |
|||
<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="部门" style="width:500"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<el-table-column prop="time" label="时间" width="200"/> |
|||
<el-table-column prop="state" label="状态" width="70" header-align="center" align="center"> |
|||
<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" header-align="center"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<el-table-column prop="time" label="时间" width="200"/> |
|||
<el-table-column prop="state" label="状态" width="70" header-align="center" align="center"> |
|||
<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" header-align="center"> |
|||
<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="部门" width="500"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<el-table-column prop="time" label="时间" width="200"/> |
|||
<el-table-column prop="state" label="状态" width="70" header-align="center" align="center"> |
|||
<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" header-align="center"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<el-table-column prop="time" label="时间" width="200"/> |
|||
<el-table-column prop="state" label="状态" width="70" header-align="center" align="center"> |
|||
<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" header-align="center"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<el-table-column prop="time" label="时间" width="200"/> |
|||
<el-table-column prop="state" label="状态" width="70" header-align="center" align="center"> |
|||
<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="200" header-align="center"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<el-table-column prop="time" label="时间" width="200"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="200" header-align="center"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="300"/> |
|||
<el-table-column prop="time" label="时间" width="300"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="200" header-align="center"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="300"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="200" header-align="center"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="400"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="200" header-align="center"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="400"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="300" header-align="center"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="300"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="300" header-align="center"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="300"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="250" header-align="center"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="300"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="230" header-align="center"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="400"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="230" header-align="center"> |
|||
<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="70"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="400"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="230" header-align="center"> |
|||
<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="80"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="400"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="230" header-align="center"> |
|||
<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" @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="80"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="400"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="230" header-align="center"> |
|||
<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" class="" @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="80"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="400"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="230" header-align="center"> |
|||
<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" class="yui" @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="80"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="400"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="230" header-align="center"> |
|||
<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,268 @@ |
|||
<!-- |
|||
@ 作者: 鲁智强 |
|||
@ 时间: 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" class="yui" @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="80"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="400"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="230" header-align="center"> |
|||
<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; |
|||
} |
|||
.yui{ |
|||
width: 170px; |
|||
margin: 7px 0 0 0; |
|||
} |
|||
/* 可以根据需要调整样式 */ |
|||
</style> |
|||
@ -0,0 +1,268 @@ |
|||
<!-- |
|||
@ 作者: 鲁智强 |
|||
@ 时间: 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" class="yui" @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="80"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="400"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="230" header-align="center"> |
|||
<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; |
|||
} |
|||
.yui{ |
|||
width: 170px; |
|||
margin: 10px 0 0 0; |
|||
} |
|||
/* 可以根据需要调整样式 */ |
|||
</style> |
|||
@ -0,0 +1,268 @@ |
|||
<!-- |
|||
@ 作者: 鲁智强 |
|||
@ 时间: 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" class="yui" @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="80"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="400"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="230" header-align="center"> |
|||
<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; |
|||
} |
|||
.yui{ |
|||
width: 170px; |
|||
margin: 5px 0 0 0; |
|||
} |
|||
/* 可以根据需要调整样式 */ |
|||
</style> |
|||
@ -0,0 +1,268 @@ |
|||
<!-- |
|||
@ 作者: 鲁智强 |
|||
@ 时间: 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" class="yui" @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="80"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="400"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="230" header-align="center"> |
|||
<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; |
|||
} |
|||
.yui{ |
|||
width: 170px; |
|||
margin: 3px 0 0 0; |
|||
} |
|||
/* 可以根据需要调整样式 */ |
|||
</style> |
|||
@ -0,0 +1,268 @@ |
|||
<!-- |
|||
@ 作者: 鲁智强 |
|||
@ 时间: 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" class="yui" @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="80"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="400"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="230" header-align="center"> |
|||
<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; |
|||
} |
|||
.yui{ |
|||
width: 170px; |
|||
margin: 0px 0 0 0; |
|||
} |
|||
/* 可以根据需要调整样式 */ |
|||
</style> |
|||
@ -0,0 +1,268 @@ |
|||
<!-- |
|||
@ 作者: 鲁智强 |
|||
@ 时间: 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" class="yui" @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="80"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="400"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="230" header-align="center"> |
|||
<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; |
|||
} |
|||
.yui{ |
|||
width: 170px; |
|||
margin: 2px 0 0 0; |
|||
} |
|||
/* 可以根据需要调整样式 */ |
|||
</style> |
|||
@ -0,0 +1,268 @@ |
|||
<!-- |
|||
@ 作者: 鲁智强 |
|||
@ 时间: 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" class="yui" @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="80"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="400"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="230" header-align="center"> |
|||
<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; |
|||
} |
|||
.yui{ |
|||
width: 170px; |
|||
margin: 2px 0 0 0; |
|||
} |
|||
/* 可以根据需要调整样式 */ |
|||
</style> |
|||
@ -0,0 +1,268 @@ |
|||
<!-- |
|||
@ 作者: 鲁智强 |
|||
@ 时间: 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" class="yui" @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="80"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="400"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="230" header-align="center"> |
|||
<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; |
|||
} |
|||
.yui{ |
|||
width: 170px; |
|||
margin: 2px 0 0 0; |
|||
} |
|||
/* 可以根据需要调整样式 */ |
|||
</style> |
|||
@ -0,0 +1,268 @@ |
|||
<!-- |
|||
@ 作者: 鲁智强 |
|||
@ 时间: 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" class="yui" @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="80"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="400"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="230" header-align="center"> |
|||
<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; |
|||
} |
|||
.yui{ |
|||
width: 170px; |
|||
margin: 2px 0 0 0; |
|||
} |
|||
/* 可以根据需要调整样式 */ |
|||
</style> |
|||
@ -0,0 +1,268 @@ |
|||
<!-- |
|||
@ 作者: 鲁智强 |
|||
@ 时间: 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" class="yui" @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="80"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="400"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="230" header-align="center"> |
|||
<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; |
|||
} |
|||
.yui{ |
|||
width: 170px; |
|||
margin: 2px 0 0 0; |
|||
} |
|||
/* 可以根据需要调整样式 */ |
|||
</style> |
|||
@ -0,0 +1,269 @@ |
|||
<!-- |
|||
@ 作者: 鲁智强 |
|||
@ 时间: 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" class="yui" @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="80"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="400"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="230" header-align="center"> |
|||
<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; |
|||
} |
|||
.yui{ |
|||
width: 170px; |
|||
margin: 2px 0 0 0; |
|||
} |
|||
/* 可以根据需要调整样式 */ |
|||
</style> |
|||
@ -0,0 +1,270 @@ |
|||
<!-- |
|||
@ 作者: 鲁智强 |
|||
@ 时间: 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" class="yui" @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="80"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="400"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="230" header-align="center"> |
|||
<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; |
|||
} |
|||
.yui{ |
|||
width: 170px; |
|||
margin: 2px 0 0 0; |
|||
} |
|||
/* 可以根据需要调整样式 */ |
|||
</style> |
|||
@ -0,0 +1,270 @@ |
|||
<!-- |
|||
@ 作者: 鲁智强 |
|||
@ 时间: 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" class="yui" @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="80"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="400"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="230" header-align="center"> |
|||
<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; |
|||
} |
|||
.yui{ |
|||
width: 170px; |
|||
margin: 2px 0 0 0; |
|||
} |
|||
/* 可以根据需要调整样式 */ |
|||
</style> |
|||
@ -0,0 +1,270 @@ |
|||
<!-- |
|||
@ 作者: 鲁智强 |
|||
@ 时间: 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" class="yui" @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="80"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="400"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="230" header-align="center"> |
|||
<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; |
|||
} |
|||
.yui{ |
|||
width: 170px; |
|||
margin: 2px 0 0 0; |
|||
} |
|||
/* 可以根据需要调整样式 */ |
|||
</style> |
|||
@ -0,0 +1,271 @@ |
|||
<!-- |
|||
@ 作者: 鲁智强 |
|||
@ 时间: 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" class="yui" @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="80"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="400"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="230" header-align="center"> |
|||
<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; |
|||
} |
|||
.yui{ |
|||
width: 170px; |
|||
margin: 2px 0 0 0; |
|||
} |
|||
/* 可以根据需要调整样式 */ |
|||
</style> |
|||
@ -0,0 +1,271 @@ |
|||
<!-- |
|||
@ 作者: 鲁智强 |
|||
@ 时间: 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" class="yui" @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="80"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="400"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="230" header-align="center"> |
|||
<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; |
|||
} |
|||
.yui{ |
|||
width: 170px; |
|||
margin: 2px 0 0 0; |
|||
} |
|||
/* 可以根据需要调整样式 */ |
|||
</style> |
|||
@ -0,0 +1,272 @@ |
|||
<!-- |
|||
@ 作者: 鲁智强 |
|||
@ 时间: 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" class="yui" @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="80"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="400"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="230" header-align="center"> |
|||
<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; |
|||
} |
|||
.yui{ |
|||
width: 170px; |
|||
margin: 2px 0 0 0; |
|||
} |
|||
/* 可以根据需要调整样式 */ |
|||
</style> |
|||
@ -0,0 +1,273 @@ |
|||
<!-- |
|||
@ 作者: 鲁智强 |
|||
@ 时间: 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" class="yui" @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="80"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="400"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="230" header-align="center"> |
|||
<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; |
|||
} |
|||
.yui{ |
|||
width: 170px; |
|||
margin: 2px 0 0 0; |
|||
} |
|||
/* 可以根据需要调整样式 */ |
|||
</style> |
|||
@ -0,0 +1,273 @@ |
|||
<!-- |
|||
@ 作者: 鲁智强 |
|||
@ 时间: 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" class="yui" @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="80"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="400"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="230" header-align="center"> |
|||
<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; |
|||
} |
|||
.yui{ |
|||
width: 170px; |
|||
margin: 2px 0 0 0; |
|||
} |
|||
/* 可以根据需要调整样式 */ |
|||
</style> |
|||
@ -0,0 +1,273 @@ |
|||
<!-- |
|||
@ 作者: 鲁智强 |
|||
@ 时间: 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[2].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" class="yui" @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="80"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="400"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="230" header-align="center"> |
|||
<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; |
|||
} |
|||
.yui{ |
|||
width: 170px; |
|||
margin: 2px 0 0 0; |
|||
} |
|||
/* 可以根据需要调整样式 */ |
|||
</style> |
|||
@ -0,0 +1,273 @@ |
|||
<!-- |
|||
@ 作者: 鲁智强 |
|||
@ 时间: 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[2].child[22].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" class="yui" @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="80"> |
|||
<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="部门" width="300"> |
|||
<template #default="scope"> |
|||
{{scope.row.groupname}}{{scope.row.deaprtname}} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="year" label="年" width="70" header-align="center" align="center" /> |
|||
<el-table-column prop="key" label="版本号" width="400"/> |
|||
<el-table-column prop="time" label="时间" width="400"/> |
|||
<el-table-column prop="state" label="状态" width="80" header-align="center" align="center"> |
|||
<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="230" header-align="center"> |
|||
<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; |
|||
} |
|||
.yui{ |
|||
width: 170px; |
|||
margin: 2px 0 0 0; |
|||
} |
|||
/* 可以根据需要调整样式 */ |
|||
</style> |
|||
@ -0,0 +1,218 @@ |
|||
<!-- |
|||
@ 作者: 鲁智强 |
|||
@ 时间: 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,have_post,get_scheme } from '@/api/opk/news/api' |
|||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|||
import Dialog from './dialog.vue' |
|||
// eslint-disable-next-line vue/require-prop-types |
|||
const { addShow, title } = defineProps(['addShow', 'title']) |
|||
const data = reactive({ |
|||
formInline:{ |
|||
region:'', |
|||
}, |
|||
title:"", |
|||
addPostBox: false, |
|||
editPostCont:false, |
|||
edPostCont: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(){ |
|||
organdpost({id:"309",levelL:0}) |
|||
.then(data => { |
|||
tableData.value = data.data.list; |
|||
}) |
|||
.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 zjr = new Date(formdate.value1).getFullYear() |
|||
get_scheme({page:1,pagesize:20,postid:formdate.orgidlist,versionnumber:formdate.name,year:zjr}) |
|||
.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; |
|||
} |
|||
// 删除数据 |
|||
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 handleedit=(val:any)=>{ |
|||
data.editPostCont=true, |
|||
rowInfo.value=val; |
|||
} |
|||
const handleErd=(val:any)=>{ |
|||
data.edPostCont=true, |
|||
rowInfo.value=val; |
|||
} |
|||
const chl = ()=>{ |
|||
formdate.orgidlist = ""; |
|||
} |
|||
onMounted(()=>{ |
|||
jjjs() |
|||
postt() |
|||
}) |
|||
</script> |
|||
<template> |
|||
<div class="m-2"> |
|||
<el-container class="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" :check-strictly="true" @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/> |
|||
</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="40"> |
|||
<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-4" :data="tableq" border style="width: 100%"> |
|||
<el-table-column prop="deaprtname" label="部门"/> |
|||
<el-table-column prop="year" label="年度" width="69"/> |
|||
<el-table-column prop="key" label="版本号"/> |
|||
<el-table-column prop="time" 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="handleErd(row)">编辑</el-button> |
|||
<el-button type="danger" link @click="handleDel(row)">删除</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> |
|||
</div> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
.horizontal-controls { |
|||
display: flex; |
|||
float: left; |
|||
|
|||
} |
|||
.el-row { |
|||
margin-bottom: 20px; |
|||
} |
|||
.qwe { |
|||
margin:-16px 0 0 -22px; |
|||
float:right; |
|||
} |
|||
.wer{ |
|||
margin:-5px 0 0 20px; |
|||
font-weight:normal; |
|||
} |
|||
.el-divider--vertical{ |
|||
display:inline-block; |
|||
width:1px; |
|||
height:812px; |
|||
margin:0 8px; |
|||
vertical-align:middle; |
|||
position:relative; |
|||
} |
|||
|
|||
/* 可以根据需要调整样式 */ |
|||
</style> |
|||
@ -0,0 +1,218 @@ |
|||
<!-- |
|||
@ 作者: 鲁智强 |
|||
@ 时间: 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,have_post,get_scheme } from '@/api/opk/news/api' |
|||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|||
import Dialog from './dialog.vue' |
|||
// eslint-disable-next-line vue/require-prop-types |
|||
const { addShow, title } = defineProps(['addShow', 'title']) |
|||
const data = reactive({ |
|||
formInline:{ |
|||
region:'', |
|||
}, |
|||
title:"", |
|||
addPostBox: false, |
|||
editPostCont:false, |
|||
edPostCont: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(){ |
|||
organdpost({id:"309",levelL:0}) |
|||
.then(data => { |
|||
tableData.value = data.data.list; |
|||
}) |
|||
.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 zjr = new Date(formdate.value1).getFullYear() |
|||
get_scheme({page:1,pagesize:20,postid:formdate.orgidlist,versionnumber:formdate.name,year:zjr}) |
|||
.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; |
|||
} |
|||
// 删除数据 |
|||
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 handleedit=(val:any)=>{ |
|||
data.editPostCont=true, |
|||
rowInfo.value=val; |
|||
} |
|||
const handleErd=(val:any)=>{ |
|||
data.edPostCont=true, |
|||
rowInfo.value=val; |
|||
} |
|||
const chl = ()=>{ |
|||
formdate.orgidlist = ""; |
|||
} |
|||
onMounted(()=>{ |
|||
jjjs() |
|||
postt() |
|||
}) |
|||
</script> |
|||
<template> |
|||
<div class="m-2"> |
|||
<el-container class="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" :check-strictly="true" @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/> |
|||
</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="40"> |
|||
<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-4" :data="tableq" border style="width: 100%"> |
|||
<el-table-column prop="deaprtname" label="部门" width="69"/> |
|||
<el-table-column prop="year" label="年度" width="69"/> |
|||
<el-table-column prop="key" label="版本号"/> |
|||
<el-table-column prop="time" 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="handleErd(row)">编辑</el-button> |
|||
<el-button type="danger" link @click="handleDel(row)">删除</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> |
|||
</div> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
.horizontal-controls { |
|||
display: flex; |
|||
float: left; |
|||
|
|||
} |
|||
.el-row { |
|||
margin-bottom: 20px; |
|||
} |
|||
.qwe { |
|||
margin:-16px 0 0 -22px; |
|||
float:right; |
|||
} |
|||
.wer{ |
|||
margin:-5px 0 0 20px; |
|||
font-weight:normal; |
|||
} |
|||
.el-divider--vertical{ |
|||
display:inline-block; |
|||
width:1px; |
|||
height:812px; |
|||
margin:0 8px; |
|||
vertical-align:middle; |
|||
position:relative; |
|||
} |
|||
|
|||
/* 可以根据需要调整样式 */ |
|||
</style> |
|||
@ -0,0 +1,218 @@ |
|||
<!-- |
|||
@ 作者: 鲁智强 |
|||
@ 时间: 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,have_post,get_scheme } from '@/api/opk/news/api' |
|||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|||
import Dialog from './dialog.vue' |
|||
// eslint-disable-next-line vue/require-prop-types |
|||
const { addShow, title } = defineProps(['addShow', 'title']) |
|||
const data = reactive({ |
|||
formInline:{ |
|||
region:'', |
|||
}, |
|||
title:"", |
|||
addPostBox: false, |
|||
editPostCont:false, |
|||
edPostCont: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(){ |
|||
organdpost({id:"309",levelL:0}) |
|||
.then(data => { |
|||
tableData.value = data.data.list; |
|||
}) |
|||
.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 zjr = new Date(formdate.value1).getFullYear() |
|||
get_scheme({page:1,pagesize:20,postid:formdate.orgidlist,versionnumber:formdate.name,year:zjr}) |
|||
.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; |
|||
} |
|||
// 删除数据 |
|||
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 handleedit=(val:any)=>{ |
|||
data.editPostCont=true, |
|||
rowInfo.value=val; |
|||
} |
|||
const handleErd=(val:any)=>{ |
|||
data.edPostCont=true, |
|||
rowInfo.value=val; |
|||
} |
|||
const chl = ()=>{ |
|||
formdate.orgidlist = ""; |
|||
} |
|||
onMounted(()=>{ |
|||
jjjs() |
|||
postt() |
|||
}) |
|||
</script> |
|||
<template> |
|||
<div class="m-2"> |
|||
<el-container class="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" :check-strictly="true" @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/> |
|||
</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="40"> |
|||
<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-4" :data="tableq" border style="width: 100%"> |
|||
<el-table-column prop="deaprtname" label="部门" width="299"/> |
|||
<el-table-column prop="year" label="年度" width="69"/> |
|||
<el-table-column prop="key" label="版本号"/> |
|||
<el-table-column prop="time" 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="handleErd(row)">编辑</el-button> |
|||
<el-button type="danger" link @click="handleDel(row)">删除</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> |
|||
</div> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
.horizontal-controls { |
|||
display: flex; |
|||
float: left; |
|||
|
|||
} |
|||
.el-row { |
|||
margin-bottom: 20px; |
|||
} |
|||
.qwe { |
|||
margin:-16px 0 0 -22px; |
|||
float:right; |
|||
} |
|||
.wer{ |
|||
margin:-5px 0 0 20px; |
|||
font-weight:normal; |
|||
} |
|||
.el-divider--vertical{ |
|||
display:inline-block; |
|||
width:1px; |
|||
height:812px; |
|||
margin:0 8px; |
|||
vertical-align:middle; |
|||
position:relative; |
|||
} |
|||
|
|||
/* 可以根据需要调整样式 */ |
|||
</style> |
|||
@ -0,0 +1,218 @@ |
|||
<!-- |
|||
@ 作者: 鲁智强 |
|||
@ 时间: 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,have_post,get_scheme } from '@/api/opk/news/api' |
|||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|||
import Dialog from './dialog.vue' |
|||
// eslint-disable-next-line vue/require-prop-types |
|||
const { addShow, title } = defineProps(['addShow', 'title']) |
|||
const data = reactive({ |
|||
formInline:{ |
|||
region:'', |
|||
}, |
|||
title:"", |
|||
addPostBox: false, |
|||
editPostCont:false, |
|||
edPostCont: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(){ |
|||
organdpost({id:"309",levelL:0}) |
|||
.then(data => { |
|||
tableData.value = data.data.list; |
|||
}) |
|||
.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 zjr = new Date(formdate.value1).getFullYear() |
|||
get_scheme({page:1,pagesize:20,postid:formdate.orgidlist,versionnumber:formdate.name,year:zjr}) |
|||
.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; |
|||
} |
|||
// 删除数据 |
|||
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 handleedit=(val:any)=>{ |
|||
data.editPostCont=true, |
|||
rowInfo.value=val; |
|||
} |
|||
const handleErd=(val:any)=>{ |
|||
data.edPostCont=true, |
|||
rowInfo.value=val; |
|||
} |
|||
const chl = ()=>{ |
|||
formdate.orgidlist = ""; |
|||
} |
|||
onMounted(()=>{ |
|||
jjjs() |
|||
postt() |
|||
}) |
|||
</script> |
|||
<template> |
|||
<div class="m-2"> |
|||
<el-container class="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" :check-strictly="true" @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/> |
|||
</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="40"> |
|||
<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-4" :data="tableq" border style="width: 100%"> |
|||
<el-table-column prop="deaprtname" label="部门" width="299"/> |
|||
<el-table-column prop="year" label="年度" width="69"/> |
|||
<el-table-column prop="key" label="版本号" width="299"/> |
|||
<el-table-column prop="time" 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="handleErd(row)">编辑</el-button> |
|||
<el-button type="danger" link @click="handleDel(row)">删除</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> |
|||
</div> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
.horizontal-controls { |
|||
display: flex; |
|||
float: left; |
|||
|
|||
} |
|||
.el-row { |
|||
margin-bottom: 20px; |
|||
} |
|||
.qwe { |
|||
margin:-16px 0 0 -22px; |
|||
float:right; |
|||
} |
|||
.wer{ |
|||
margin:-5px 0 0 20px; |
|||
font-weight:normal; |
|||
} |
|||
.el-divider--vertical{ |
|||
display:inline-block; |
|||
width:1px; |
|||
height:812px; |
|||
margin:0 8px; |
|||
vertical-align:middle; |
|||
position:relative; |
|||
} |
|||
|
|||
/* 可以根据需要调整样式 */ |
|||
</style> |
|||
@ -0,0 +1,218 @@ |
|||
<!-- |
|||
@ 作者: 鲁智强 |
|||
@ 时间: 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,have_post,get_scheme } from '@/api/opk/news/api' |
|||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|||
import Dialog from './dialog.vue' |
|||
// eslint-disable-next-line vue/require-prop-types |
|||
const { addShow, title } = defineProps(['addShow', 'title']) |
|||
const data = reactive({ |
|||
formInline:{ |
|||
region:'', |
|||
}, |
|||
title:"", |
|||
addPostBox: false, |
|||
editPostCont:false, |
|||
edPostCont: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(){ |
|||
organdpost({id:"309",levelL:0}) |
|||
.then(data => { |
|||
tableData.value = data.data.list; |
|||
}) |
|||
.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 zjr = new Date(formdate.value1).getFullYear() |
|||
get_scheme({page:1,pagesize:20,postid:formdate.orgidlist,versionnumber:formdate.name,year:zjr}) |
|||
.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; |
|||
} |
|||
// 删除数据 |
|||
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 handleedit=(val:any)=>{ |
|||
data.editPostCont=true, |
|||
rowInfo.value=val; |
|||
} |
|||
const handleErd=(val:any)=>{ |
|||
data.edPostCont=true, |
|||
rowInfo.value=val; |
|||
} |
|||
const chl = ()=>{ |
|||
formdate.orgidlist = ""; |
|||
} |
|||
onMounted(()=>{ |
|||
jjjs() |
|||
postt() |
|||
}) |
|||
</script> |
|||
<template> |
|||
<div class="m-2"> |
|||
<el-container class="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" :check-strictly="true" @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/> |
|||
</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="40"> |
|||
<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-4" :data="tableq" border style="width: 100%"> |
|||
<el-table-column prop="deaprtname" label="部门" width="299"/> |
|||
<el-table-column prop="year" label="年度" width="69"/> |
|||
<el-table-column prop="key" label="版本号" width="99"/> |
|||
<el-table-column prop="time" 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="handleErd(row)">编辑</el-button> |
|||
<el-button type="danger" link @click="handleDel(row)">删除</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> |
|||
</div> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
.horizontal-controls { |
|||
display: flex; |
|||
float: left; |
|||
|
|||
} |
|||
.el-row { |
|||
margin-bottom: 20px; |
|||
} |
|||
.qwe { |
|||
margin:-16px 0 0 -22px; |
|||
float:right; |
|||
} |
|||
.wer{ |
|||
margin:-5px 0 0 20px; |
|||
font-weight:normal; |
|||
} |
|||
.el-divider--vertical{ |
|||
display:inline-block; |
|||
width:1px; |
|||
height:812px; |
|||
margin:0 8px; |
|||
vertical-align:middle; |
|||
position:relative; |
|||
} |
|||
|
|||
/* 可以根据需要调整样式 */ |
|||
</style> |
|||
@ -0,0 +1,218 @@ |
|||
<!-- |
|||
@ 作者: 鲁智强 |
|||
@ 时间: 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,have_post,get_scheme } from '@/api/opk/news/api' |
|||
import { formItemValidateStates, TableV2SortOrder } from 'element-plus'; |
|||
import Dialog from './dialog.vue' |
|||
// eslint-disable-next-line vue/require-prop-types |
|||
const { addShow, title } = defineProps(['addShow', 'title']) |
|||
const data = reactive({ |
|||
formInline:{ |
|||
region:'', |
|||
}, |
|||
title:"", |
|||
addPostBox: false, |
|||
editPostCont:false, |
|||
edPostCont: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(){ |
|||
organdpost({id:"309",levelL:0}) |
|||
.then(data => { |
|||
tableData.value = data.data.list; |
|||
}) |
|||
.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 zjr = new Date(formdate.value1).getFullYear() |
|||
get_scheme({page:1,pagesize:20,postid:formdate.orgidlist,versionnumber:formdate.name,year:zjr}) |
|||
.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; |
|||
} |
|||
// 删除数据 |
|||
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 handleedit=(val:any)=>{ |
|||
data.editPostCont=true, |
|||
rowInfo.value=val; |
|||
} |
|||
const handleErd=(val:any)=>{ |
|||
data.edPostCont=true, |
|||
rowInfo.value=val; |
|||
} |
|||
const chl = ()=>{ |
|||
formdate.orgidlist = ""; |
|||
} |
|||
onMounted(()=>{ |
|||
jjjs() |
|||
postt() |
|||
}) |
|||
</script> |
|||
<template> |
|||
<div class="m-2"> |
|||
<el-container class="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" :check-strictly="true" @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/> |
|||
</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="40"> |
|||
<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-4" :data="tableq" border style="width: 100%"> |
|||
<el-table-column prop="deaprtname" label="部门" width="299"/> |
|||
<el-table-column prop="year" label="年度" width="69"/> |
|||
<el-table-column prop="key" label="版本号" width="179"/> |
|||
<el-table-column prop="time" 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="handleErd(row)">编辑</el-button> |
|||
<el-button type="danger" link @click="handleDel(row)">删除</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> |
|||
</div> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
.horizontal-controls { |
|||
display: flex; |
|||
float: left; |
|||
|
|||
} |
|||
.el-row { |
|||
margin-bottom: 20px; |
|||
} |
|||
.qwe { |
|||
margin:-16px 0 0 -22px; |
|||
float:right; |
|||
} |
|||
.wer{ |
|||
margin:-5px 0 0 20px; |
|||
font-weight:normal; |
|||
} |
|||
.el-divider--vertical{ |
|||
display:inline-block; |
|||
width:1px; |
|||
height:812px; |
|||
margin:0 8px; |
|||
vertical-align:middle; |
|||
position:relative; |
|||
} |
|||
|
|||
/* 可以根据需要调整样式 */ |
|||
</style> |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue