evaluationDepartmentPage.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  1. <template>
  2. <div class="evaluationDepartment" v-loading="loadingImport">
  3. <div class="evaluationDepartmentBtn">
  4. <p class="titleSty">考评部门管理</p>
  5. <div class="collectSeach">
  6. <div class="exceed">
  7. <span class="exceedSpan" style="margin-top: 3px;">部门名称:</span>
  8. <el-input v-model="departmentS" placeholder="请输入部门名称"></el-input>
  9. </div>
  10. <el-button type="primary" style="margin-left: 10px;" @click="getSeachData">搜索</el-button>
  11. <el-button style="margin-left: 10px;" @click="resetSeach">重置</el-button>
  12. </div>
  13. <div style="display:flex;justify-content: space-between;padding: 10px;">
  14. <el-row :gutter="10" class="PeriodBtn">
  15. <el-col :span="1.5">
  16. <el-button
  17. type="primary"
  18. plain
  19. icon="Plus"
  20. size="mini"
  21. @click="handleAdd"
  22. >新增</el-button>
  23. </el-col>
  24. <el-col :span="1.5">
  25. <el-button
  26. type="success"
  27. plain
  28. icon="Edit"
  29. size="mini"
  30. @click="handleEdit"
  31. :disabled="changeDateSelect.length === 0 || changeDateSelect.length>1"
  32. >修改</el-button>
  33. </el-col>
  34. <el-col :span="1.5">
  35. <el-button
  36. type="danger"
  37. plain
  38. icon="Delete"
  39. size="mini"
  40. :disabled="changeDateSelect.length === 0"
  41. @click="handleDelete"
  42. >批量删除</el-button>
  43. </el-col>
  44. <el-col :span="1.5">
  45. <el-button
  46. type="info"
  47. plain
  48. icon="Upload"
  49. size="mini"
  50. disabled
  51. @click="handleImport"
  52. >导入</el-button>
  53. </el-col>
  54. <el-col :span="1.5">
  55. <el-button
  56. type="warning"
  57. plain
  58. icon="Download"
  59. size="mini"
  60. disabled
  61. >导出</el-button>
  62. </el-col>
  63. </el-row>
  64. </div>
  65. <div class="evaluationDepartmentTableData">
  66. <el-table :data="evaluationDepartmentData" border style="width: 100%" @select="rowClick" @select-all="rowClick">
  67. <el-table-column type="selection" label="操作" align="center"></el-table-column>
  68. <el-table-column label="部门名称" prop="organizationName" />
  69. <el-table-column label="考评类别" prop="organizationType" />
  70. <el-table-column label="考评周期" prop="evaluationCycle" />
  71. <el-table-column label="考评规则ID" prop="evaluateRuleId" />
  72. <el-table-column label="业务版块" prop="binSectionName" />
  73. <el-table-column label="业务阶段" prop="binStageName" />
  74. <!-- <el-table-column label="年" prop="year" />
  75. <el-table-column label="月" prop="month" /> -->
  76. <el-table-column label="创建时间" prop="createTime" />
  77. </el-table>
  78. <el-pagination
  79. @size-change="handleSizeChange"
  80. @current-change="handleCurrentChange"
  81. :current-page="page.currentPage"
  82. :page-size="page.pagesize"
  83. layout="total, prev, pager, next, jumper"
  84. :total="page.total">
  85. </el-pagination>
  86. </div>
  87. <div class="indexdialog">
  88. <el-dialog :title="title" v-model="dialogVisible" width="600px" :close-on-click-modal="false">
  89. <div class="periodFrom">
  90. <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm" :validate-on-rule-change="false">
  91. <el-form-item label="部门名称" prop="organizationName">
  92. <el-input v-model="ruleForm.organizationName" placeholder="请输入部门名称名称"></el-input>
  93. </el-form-item>
  94. <el-form-item label="考评规则" prop="evaluateRule">
  95. <el-select v-model="ruleForm.evaluateRule" placeholder="请选择考评规则" @change="changeRule">
  96. <el-option
  97. v-for="item in ruleDataAll"
  98. :key="item.id"
  99. :label="item.ruleName"
  100. :value="item.id">
  101. </el-option>
  102. </el-select>
  103. </el-form-item>
  104. <el-form-item label="业务版块">
  105. <el-select v-model="ruleForm.binSection" placeholder="请选择业务版块" disabled>
  106. <el-option
  107. v-for="item in moduleData"
  108. :key="item.keyValue"
  109. :label="item.keyName"
  110. :value="item.keyValue">
  111. </el-option>
  112. </el-select>
  113. </el-form-item>
  114. <el-form-item label="业务阶段">
  115. <el-select v-model="ruleForm.binStage" placeholder="请选择业务阶段" disabled>
  116. <el-option
  117. v-for="item in stageData"
  118. :key="item.keyValue"
  119. :label="item.keyName"
  120. :value="item.keyValue">
  121. </el-option>
  122. </el-select>
  123. </el-form-item>
  124. <el-form-item label="考评周期" prop="evaluationCycle">
  125. <el-select v-model="ruleForm.evaluationCycle" placeholder="请选择业务阶段">
  126. <el-option
  127. v-for="item in periodData"
  128. :key="item.keyValue"
  129. :label="item.keyName"
  130. :value="item.keyValue">
  131. </el-option>
  132. </el-select>
  133. </el-form-item>
  134. <el-form-item label="指标顺序" prop="orderNum">
  135. <el-input-number v-model="ruleForm.orderNum" :min="1" />
  136. </el-form-item>
  137. </el-form>
  138. </div>
  139. <template #footer>
  140. <span class="dialog-footer">
  141. <el-button @click="dialogVisible = false">取 消</el-button>
  142. <el-button type="primary" @click="saveevaluationDepartmentMsg('ruleForm')">确 定</el-button>
  143. </span>
  144. </template>
  145. </el-dialog>
  146. </div>
  147. <indicator-item ref="indicatorItem"></indicator-item>
  148. </div>
  149. <import-dailog ref="importPage" @successImport="successImport" @importLoading="importLoading"></import-dailog>
  150. </div>
  151. </template>
  152. <script>
  153. import importDailog from '../importPage/importDailog.vue'
  154. import {apiGetOrganizationList, apiGetorganizationSaveList, apiGetorganizationdeleteList,
  155. apiGetdatadictionaryList, apiGetevaluateListAll} from '../../api/api'
  156. export default {
  157. components: { importDailog },
  158. data() {
  159. return {
  160. dialogVisible: false,
  161. title: '',
  162. isSave: false,
  163. changeDateSelect: [],
  164. indicatoroptions: [],
  165. departmentS: '',
  166. evaluationDepartmentData:[],
  167. moduleData: [],
  168. stageData: [],
  169. ruleDataAll: [],
  170. periodData: [],
  171. ruleForm: {
  172. organizationName: '',
  173. evaluateRule: '',
  174. binSection: '',
  175. binStage: '',
  176. evaluationCycle: '',
  177. orderNum: 1
  178. },
  179. rules: {
  180. organizationName: [
  181. { required: true, message: '请输入部门名称', trigger: 'blur' }
  182. ],
  183. evaluationCycle: [
  184. { required: true, message: '请选择考评周期', trigger: 'change' }
  185. ],
  186. evaluateRule: [
  187. { required: true, message: '请选择考评规则', trigger: 'change' }
  188. ],
  189. binSection: [
  190. { required: true, message: '请选择业务版块', trigger: 'change' }
  191. ],
  192. binStage: [
  193. { required: true, message: '请输入业务阶段', trigger: 'change' }
  194. ],
  195. orderNum: [
  196. { required: true, message: '请输入指标顺序', trigger: 'blur' }
  197. ]
  198. },
  199. page:{
  200. pagesize: 12,
  201. currentPage: 1,
  202. total: 0
  203. },
  204. evalradio: {},
  205. loadingImport: false,
  206. }
  207. },
  208. created() {
  209. this.getEvalCompanyData()
  210. this.getRuleallData()
  211. this.getDataDictionary('MK0001') //模块
  212. this.getDataDictionary('JD0001') //阶段
  213. this.getPeriodData()
  214. },
  215. methods:{
  216. // 查询部门数据
  217. getEvalCompanyData(type) {
  218. let that = this
  219. let params = {
  220. pageNum: this.page.currentPage,
  221. pageSize: this.page.pagesize,
  222. organizationType: 'BMKP'
  223. }
  224. if (type) {
  225. params.organizationName = that.departmentS
  226. }
  227. apiGetOrganizationList(params).then(datas =>{
  228. if (datas && datas.data) {
  229. that.evaluationDepartmentData = datas.data.records
  230. that.page.total = datas.data.total
  231. }
  232. })
  233. },
  234. // 查询规则模块和阶段数据
  235. getDataDictionary(val) {
  236. let that = this
  237. let params = {
  238. superKey: val
  239. }
  240. apiGetdatadictionaryList(params).then(datas =>{
  241. if (datas && datas.data) {
  242. if (val === 'MK0001') {
  243. that.moduleData = datas.data
  244. } else {
  245. that.stageData = datas.data
  246. }
  247. }
  248. })
  249. },
  250. getRuleallData() {
  251. let that = this
  252. apiGetevaluateListAll().then(datas =>{
  253. if (datas && datas.data) {
  254. that.ruleDataAll = datas.data
  255. }
  256. })
  257. },
  258. //考评周期
  259. getPeriodData() {
  260. let that = this
  261. let params = {
  262. superKey: 'KPZQ0001'
  263. }
  264. apiGetdatadictionaryList(params).then(datas =>{
  265. if (datas && datas.data) {
  266. that.periodData = datas.data
  267. }
  268. })
  269. },
  270. changeRule(val) {
  271. this.ruleDataAll.forEach(item =>{
  272. if (item.id === val) {
  273. this.ruleForm.binSection = item.binSection
  274. this.ruleForm.binStage = item.binStage
  275. }
  276. })
  277. },
  278. handleAdd() {
  279. this.dialogVisible = true
  280. this.isSave = false
  281. this.title = '新增考评部门'
  282. this.$nextTick(() =>{
  283. // this.$refs['ruleForm'].resetFields()
  284. this.ruleForm = {
  285. organizationName: '',
  286. evaluateRule: '',
  287. binSection: '',
  288. binStage: '',
  289. evaluationCycle: '',
  290. orderNum: 1
  291. }
  292. })
  293. },
  294. handleEdit() {
  295. this.dialogVisible = true
  296. this.isSave = true
  297. this.title = '修改考评部门'
  298. this.evalradio = this.changeDateSelect[0]
  299. this.ruleForm = {
  300. organizationName: this.evalradio.organizationName,
  301. evaluationCycle: this.evalradio.evaluationCycle,
  302. evaluateRule: this.evalradio.evaluateRuleId,
  303. binSection: this.evalradio.binSection,
  304. binStage: this.evalradio.binStage,
  305. orderNum: this.evalradio.orderNum
  306. }
  307. },
  308. saveevaluationDepartmentMsg(formName) {
  309. let that = this
  310. that.$refs[formName].validate((valid) => {
  311. if (valid) {
  312. that.saveAndEditIndicatorData()
  313. }
  314. });
  315. },
  316. //新增/修改指标数据
  317. saveAndEditIndicatorData() {
  318. let that = this
  319. let params = {
  320. organizationName: that.ruleForm.organizationName,
  321. evaluationCycle: that.ruleForm.evaluationCycle,
  322. organizationType: 'BMKP',
  323. evaluateRuleId: that.ruleForm.evaluateRule,
  324. binSection: that.ruleForm.binSection,
  325. binStage: that.ruleForm.binStage,
  326. orderNum: that.ruleForm.orderNum
  327. }
  328. if (that.isSave) {
  329. params.id = this.evalradio.id
  330. }
  331. apiGetorganizationSaveList(params).then(datas =>{
  332. if (!that.isSave) {
  333. that.$message({
  334. message: '考评部门新增成功',
  335. type: 'success'
  336. });
  337. } else {
  338. that.$message({
  339. message: '考评部门修改成功',
  340. type: 'success'
  341. });
  342. }
  343. that.dialogVisible = false
  344. that.changeDateSelect = []
  345. that.getEvalCompanyData()
  346. })
  347. },
  348. //删除指标数据
  349. handleDelete() {
  350. this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
  351. confirmButtonText: '确定',
  352. cancelButtonText: '取消',
  353. type: 'warning'
  354. }).then(async() => {
  355. let that = this
  356. let paramsArr = []
  357. that.changeDateSelect.forEach(it =>{
  358. paramsArr.push(it.id)
  359. })
  360. await apiGetorganizationdeleteList(paramsArr.join(',')).then(datas =>{
  361. if (datas) {
  362. that.$message({
  363. type: 'success',
  364. message: '删除成功!'
  365. });
  366. that.changeDateSelect = []
  367. that.getEvalCompanyData()
  368. }
  369. })
  370. })
  371. },
  372. rowClick(selection, row) {
  373. this.changeDateSelect = selection
  374. },
  375. getSeachData() {
  376. this.page.currentPage = 1
  377. this.getEvalCompanyData('seach')
  378. },
  379. resetSeach() {
  380. this.page.currentPage = 1
  381. this.departmentS = ''
  382. this.getEvalCompanyData()
  383. },
  384. successImport(val) {
  385. this.loadingImport = false
  386. this.getEvalCompanyData()
  387. },
  388. importLoading(val) {
  389. this.loadingImport = true
  390. },
  391. handleSizeChange(val){
  392. this.page.pagesize = val
  393. },
  394. handleCurrentChange(val){
  395. this.page.currentPage =val
  396. },
  397. handleImport() {
  398. this.$refs.importPage.upload.title = "考评指标管理信息导入"
  399. this.$refs.importPage.upload.open = true
  400. },
  401. }
  402. }
  403. </script>
  404. <style lang="less">
  405. .evaluationDepartment{
  406. .evaluationDepartmentBtn{
  407. // background: #fff;
  408. padding: 10px 20px 0 20px;
  409. .collectSeach{
  410. display: flex;
  411. margin: 20px 20px 10px;
  412. .exceed{
  413. display: flex;
  414. .exceedSpan{
  415. margin-top: 3px;
  416. width: 100px;
  417. display: inline-block;
  418. }
  419. .el-input{
  420. margin-right:10px;
  421. .el-input__inner{
  422. height:30px;
  423. }
  424. .el-input__suffix{
  425. .el-select__caret{
  426. line-height:30px;
  427. }
  428. }
  429. }
  430. }
  431. .el-select{
  432. margin-right:10px;
  433. .el-input__inner{
  434. height:30px;
  435. }
  436. .el-input__suffix{
  437. .el-select__caret{
  438. line-height:30px;
  439. }
  440. }
  441. }
  442. }
  443. .titleSty{
  444. border-left: 4px solid #007aab;
  445. padding-left: 5px;
  446. font-size: 16px;
  447. font-weight: bold;
  448. font-family: '微软雅黑';
  449. margin-left:20px;
  450. }
  451. span{
  452. font-size:14px;
  453. }
  454. .PeriodBtn{
  455. padding-left: 10px;
  456. }
  457. .el-button{
  458. height: 30px;
  459. // width:100px;
  460. padding: 0 30px ;
  461. // padding-top: 8px;
  462. span{
  463. margin:0;
  464. }
  465. }
  466. .indexdialog{
  467. .el-overlay{
  468. .el-dialog{
  469. .el-dialog__body{
  470. padding: 30px 60px 30px 20px !important;
  471. .periodFrom{
  472. .el-select, .el-input{
  473. width: 100%;
  474. }
  475. }
  476. }
  477. }
  478. }
  479. }
  480. }
  481. .evaluationDepartmentTableData{
  482. padding: 10px 20px;
  483. .el-table{
  484. .el-table__body-wrapper{
  485. max-height: 64vh !important;
  486. }
  487. .el-input__inner{
  488. height: 30px !important;
  489. }
  490. .el-radio__label{
  491. display: none;
  492. }
  493. .indicitem{
  494. color: #409EFF;
  495. font-size: 12px;
  496. margin-right: 20px;
  497. cursor:pointer;
  498. &:hover{
  499. text-decoration: underline;
  500. }
  501. }
  502. }
  503. .el-pagination{
  504. margin-top: 20px;
  505. text-align: end;
  506. position: relative;
  507. }
  508. }
  509. }
  510. </style>