evaluationYearFrom.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598
  1. <template>
  2. <div class="startFrom">
  3. <el-dialog title="年度考评详情" v-model="dialogVisible" :fullscreen="true" :close-on-click-modal="false">
  4. <div class="startDetail">
  5. <p class="starttitleSty">单据信息:</p>
  6. <el-row class="danjuMsg">
  7. <el-col :span="6">
  8. <div class="danjuMsg_data">
  9. <span class="data_tit">业务编号:</span>
  10. <span>{{receiptMsg.code}}</span>
  11. </div>
  12. <div class="danjuMsg_data">
  13. <span class="data_tit">创建日期:</span>
  14. <span>{{receiptMsg.createDate}}</span>
  15. </div>
  16. </el-col>
  17. <el-col :span="6">
  18. <div class="danjuMsg_data">
  19. <span class="data_tit">业务简述:</span>
  20. <span>{{receiptMsg.des}}</span>
  21. </div>
  22. <div class="danjuMsg_data">
  23. <span class="data_tit">业务类别:</span>
  24. <span>{{receiptMsg.type}}</span>
  25. </div>
  26. </el-col>
  27. <el-col :span="6">
  28. <div class="danjuMsg_data">
  29. <span class="data_tit">流程状态:</span>
  30. <span>{{receiptMsg.stage}}</span>
  31. </div>
  32. <div class="danjuMsg_data">
  33. <span class="data_tit">年度:</span>
  34. <span>{{receiptMsg.year}}</span>
  35. </div>
  36. </el-col>
  37. <el-col :span="6">
  38. <div class="danjuMsg_data">
  39. <span class="data_tit">创建人:</span>
  40. <span>{{receiptMsg.createName}}</span>
  41. </div>
  42. <div class="danjuMsg_data">
  43. <span class="data_tit">单据状态:</span>
  44. <span>{{receiptMsg.recStage}}</span>
  45. </div>
  46. </el-col>
  47. </el-row>
  48. <div class="detaTableBtns">
  49. <div class="tableBtn add" @click="addTableDetail" v-if="activeName === 'second'">
  50. <img :src="addIcon" alt="">
  51. <span>新增</span>
  52. </div>
  53. <div class="tableBtn save" @click="saveDetail" v-if="$utils.havePurview('evalYear:twoLevel:save')">
  54. <img :src="saveIcon" alt="">
  55. <span>保存</span>
  56. </div>
  57. <!-- <div class="tableBtn edit">
  58. <img :src="editIcon" alt="">
  59. <span>新增</span>
  60. </div> -->
  61. <!-- <div class="tableBtn delete">
  62. <img :src="deleteIcon" alt="">
  63. <span>删除</span>
  64. </div> -->
  65. </div>
  66. <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
  67. <el-tab-pane label="考评指标项内容" name="first">
  68. <el-table :data="quantifiedList" style="width: 100%" @select="rowClick" @select-all="rowClick">
  69. <el-table-column type="selection" label="操作" align="center"></el-table-column>
  70. <el-table-column type="index" label="序号" width="80" />
  71. <el-table-column label="业务阶段" prop="stageName" />
  72. <el-table-column label="业务属性" prop="sectionName" />
  73. <el-table-column label="单位名称" prop="organizationName" width="300" />
  74. <el-table-column label="填报部门" prop="deptName" width="260" />
  75. <el-table-column label="指标分类" prop="typeName" />
  76. <el-table-column label="指标名称" prop="childName" />
  77. <el-table-column label="指标项" prop="optionName" />
  78. <el-table-column label="值" width="150">
  79. <template #default="scope">
  80. <el-input-number v-model="scope.row.quantifiedValue"
  81. :precision="2" :step="0.1" :disabled="!scope.row.updateMark" />
  82. </template>
  83. </el-table-column>
  84. <el-table-column label="单位" prop="unit" />
  85. <el-table-column label="审核状态">
  86. <template #default="scope">
  87. <el-select v-model="scope.row.state" placeholder="请选择审核状态" :disabled="!scope.row.updateMark">
  88. <el-option
  89. v-for="item in statusData"
  90. :key="item.id"
  91. :label="item.name"
  92. :value="item.id">
  93. </el-option>
  94. </el-select>
  95. </template>
  96. </el-table-column>
  97. </el-table>
  98. </el-tab-pane>
  99. <el-tab-pane label="考评评价指标内容" name="second">
  100. <el-table :data="nonQuantifiedList" style="width: 100%">
  101. <el-table-column type="index" label="序号" width="80" />
  102. <el-table-column label="单位名称" prop="organizationName" width="300">
  103. <template #default="scope">
  104. <el-select v-model="scope.row.organizationName" placeholder="请选择单位名称"
  105. :disabled="!scope.row.showInput"
  106. @change="changeOrgZa">
  107. <el-option
  108. v-for="item in orgruleData"
  109. :key="item.id"
  110. :label="item.organizationName"
  111. :value="item.id">
  112. </el-option>
  113. </el-select>
  114. </template>
  115. </el-table-column>
  116. <el-table-column label="指标分类" prop="typeName">
  117. <template #default="scope">
  118. <el-select v-model="scope.row.typeName" :disabled="!scope.row.showInput" placeholder="请选择指标分类">
  119. <el-option
  120. v-for="item in indicatorTypeData"
  121. :key="item.id"
  122. :label="item.typeName"
  123. :value="item.id">
  124. </el-option>
  125. </el-select>
  126. </template>
  127. </el-table-column>
  128. <el-table-column label="业务阶段" prop="stageName">
  129. <template #default="scope">
  130. <el-select v-model="scope.row.stageName" placeholder="请选择业务阶段"
  131. :disabled="!scope.row.showInput"
  132. @change="(val)=>changeIndic(val, scope.row)">
  133. <el-option
  134. v-for="item in stageData"
  135. :key="item.id"
  136. :label="item.stageName"
  137. :value="item.id">
  138. </el-option>
  139. </el-select>
  140. </template>
  141. </el-table-column>
  142. <el-table-column label="业务属性" prop="sectionName">
  143. <template #default="scope">
  144. <el-select v-model="scope.row.sectionName" placeholder="请选择业务阶段"
  145. :disabled="!scope.row.showInput"
  146. @change="(val)=>changeIndic(val, scope.row)">
  147. <el-option
  148. v-for="item in sectionNameArr"
  149. :key="item.id"
  150. :label="item.secName"
  151. :value="item.id">
  152. </el-option>
  153. </el-select>
  154. </template>
  155. </el-table-column>
  156. <el-table-column label="指标名称" prop="childName">
  157. <template #default="scope">
  158. <el-select v-model="scope.row.childName" placeholder="请选择指标名称"
  159. :disabled="!scope.row.showInput"
  160. @change="changeDept">
  161. <el-option
  162. v-for="item in indicItemoptions"
  163. :key="item.id"
  164. :label="item.indicatorName"
  165. :value="item.id">
  166. </el-option>
  167. </el-select>
  168. </template>
  169. </el-table-column>
  170. <el-table-column label="填报部门" prop="deptName" width="260">
  171. <template #default="scope">
  172. <el-select v-model="scope.row.deptName" placeholder="请选择填报部门" :disabled="!scope.row.showInput">
  173. <el-option
  174. v-for="item in deptNameArr"
  175. :key="item.id"
  176. :label="item.deptName"
  177. :value="item.id">
  178. </el-option>
  179. </el-select>
  180. </template>
  181. </el-table-column>
  182. <el-table-column label="指标项" prop="optionName">
  183. <template #default="scope">
  184. <el-input v-model="scope.row.optionName" disabled />
  185. </template>
  186. </el-table-column>
  187. <el-table-column label="值">
  188. <template #default="scope">
  189. <el-input v-model="scope.row.nonQuantifiedValue" :disabled="scope.row.showInput || !scope.row.updateMark" />
  190. </template>
  191. </el-table-column>
  192. <el-table-column label="审核状态">
  193. <template #default="scope">
  194. <el-select v-model="scope.row.state" placeholder="请选择审核状态" :disabled="!scope.row.updateMark">
  195. <el-option
  196. v-for="item in statusData"
  197. :key="item.id"
  198. :label="item.name"
  199. :value="item.id">
  200. </el-option>
  201. </el-select>
  202. </template>
  203. </el-table-column>
  204. </el-table>
  205. </el-tab-pane>
  206. </el-tabs>
  207. </div>
  208. <template #footer>
  209. <span class="dialog-footer">
  210. <el-button type="primary" @click="dialogVisible = false">取 消</el-button>
  211. </span>
  212. </template>
  213. </el-dialog>
  214. </div>
  215. </template>
  216. <script>
  217. import {apiGetOrgEvalInfoList,apiGetOrgEvaInfoBatchDto, apiGetOrganizationRule,
  218. apiGetindicatorListAll, apiGetbinstageList, apiGetIndicatorTypeList} from '../../api/api'
  219. import addIcon from '../../assets/btnIcon/add.png'
  220. import saveIcon from '../../assets/btnIcon/save.png'
  221. import editIcon from '../../assets/btnIcon/edit.png'
  222. import deleteIcon from '../../assets/btnIcon/delete.png'
  223. export default {
  224. data() {
  225. return {
  226. dialogVisible: false,
  227. activeName: 'first',
  228. quantifiedList: [],
  229. nonQuantifiedList: [],
  230. changeDateSelect: [],
  231. receiptMsg: {
  232. code: '',
  233. des: '',
  234. stage: '',
  235. creator: '',
  236. createDate: '',
  237. type: '',
  238. year: '',
  239. recStage: ''
  240. },
  241. addIcon: addIcon,
  242. saveIcon: saveIcon,
  243. editIcon: editIcon,
  244. deleteIcon: deleteIcon,
  245. rowMsg: {},
  246. statusData: []
  247. }
  248. },
  249. created() {
  250. this.statusData = [
  251. {
  252. name: '已完成',
  253. id: '1'
  254. },
  255. {
  256. name: '待审核',
  257. id: '0'
  258. },
  259. {
  260. name: '未开始',
  261. id: '-1'
  262. }
  263. ]
  264. },
  265. methods: {
  266. init(row) {
  267. this.dialogVisible = true
  268. this.activeName = 'first'
  269. this.receiptMsg = {
  270. code: row.organizationEvaluationCode,
  271. des: row.des,
  272. stage: row.stage,
  273. creator: row.createBy,
  274. createDate: row.createTime,
  275. type: row.checkCycle === 'YDKP'?'月度考评':row.checkCycle === 'JDKP'?'季度考评':'年度考评',
  276. year: row.year,
  277. recStage: '有效'
  278. }
  279. this.getDetails(row.id)
  280. this.getOrgRule(row)
  281. this.getindList()
  282. this.rowMsg = row
  283. },
  284. handleClick() {
  285. this.changeDateSelect = []
  286. },
  287. rowClick(selection, row) {
  288. this.changeDateSelect = selection
  289. },
  290. //获取详情
  291. getDetails(id) {
  292. let that = this
  293. let params = {
  294. organizationEvaluationId: id
  295. }
  296. apiGetOrgEvalInfoList(params).then(datas =>{
  297. if (datas && datas.data) {
  298. that.quantifiedList = datas.data.quantifiedList
  299. // if (datas.data.nonQuantifiedList.length>0) {
  300. // datas.data.nonQuantifiedList.forEach(it =>{
  301. // it.childName = it.indicatorName //指标id
  302. // })
  303. // }
  304. that.nonQuantifiedList = datas.data.nonQuantifiedList.length>0?datas.data.nonQuantifiedList:[]
  305. }
  306. })
  307. },
  308. // 考评评价指标内容
  309. getOrgRule(row) {
  310. let that = this
  311. let params = {
  312. id: row.id,
  313. type: 'kp'
  314. }
  315. apiGetOrganizationRule(params).then(datas =>{
  316. if (datas && datas.data) {
  317. that.orgruleData = datas.data
  318. }
  319. })
  320. },
  321. getindList() {
  322. let that = this
  323. let params = {
  324. type: 2
  325. }
  326. apiGetbinstageList(params).then(datas =>{
  327. if (datas && datas.data) {
  328. that.stageData = datas.data
  329. }
  330. })
  331. apiGetIndicatorTypeList(params).then(datas =>{
  332. if (datas && datas.data) {
  333. that.indicatorTypeData = datas.data
  334. }
  335. })
  336. },
  337. getIndListAll(row) {
  338. let that = this
  339. let params = {
  340. binSection: row.sectionName,
  341. binStage: row.stageName
  342. }
  343. apiGetindicatorListAll(params).then(datas =>{
  344. if (datas && datas.data) {
  345. that.indicItemoptions = datas.data
  346. }
  347. })
  348. },
  349. changeIndic(val, row) {
  350. if (row.stageName !== '' && row.sectionName !== '') {
  351. row.childName = ''
  352. this.getIndListAll(row)
  353. }
  354. },
  355. changeOrgZa(val) {
  356. this.sectionNameArr = []
  357. this.orgruleData.forEach(item =>{
  358. if (item.id === val) {
  359. let obj = {
  360. id: item.binSection,
  361. secName: item.binSectionName
  362. }
  363. this.sectionNameArr.push(obj)
  364. }
  365. })
  366. },
  367. changeDept(val) {
  368. this.deptNameArr = []
  369. this.indicItemoptions.forEach(item =>{
  370. if (item.id === val) {
  371. let obj = {
  372. id: item.dept,
  373. deptName: item.deptName
  374. }
  375. this.deptNameArr.push(obj)
  376. }
  377. })
  378. },
  379. addTableDetail() {
  380. let obj = {
  381. showInput: true,
  382. stageName: '',
  383. sectionName: '',
  384. organizationName: '',
  385. deptName: '',
  386. typeName: '',
  387. optionName: '',
  388. nonQuantifiedValue: ''
  389. }
  390. this.nonQuantifiedList.unshift(obj)
  391. },
  392. saveDetail() {
  393. let that = this
  394. let params = []
  395. if (that.activeName === 'first') {
  396. that.quantifiedList.forEach(item =>{
  397. let obj = {
  398. id: item.id,
  399. isQuantified: '是',
  400. quantifiedValue: item.quantifiedValue,
  401. state: item.state
  402. }
  403. params.push(obj)
  404. })
  405. } else {
  406. that.nonQuantifiedList.forEach(item =>{
  407. let obj = {
  408. isQuantified: '否',
  409. quantifiedValue: 0.0,
  410. optionCode: 'ZRMB', // 指标项
  411. nonQuantifiedValue: item.nonQuantifiedValue,
  412. state: item.state
  413. }
  414. if (item.showInput) {
  415. obj.organizationEvaluationId = that.rowMsg.id
  416. obj.organizationEvaluationRuleId = item.organizationName //单位id
  417. obj.indicatorId = item.childName //指标id
  418. } else {
  419. obj.id = item.id
  420. obj.organizationEvaluationRuleId = item.organizationEvaluationRuleId
  421. obj.indicatorId = item.indicatorId
  422. }
  423. params.push(obj)
  424. })
  425. }
  426. apiGetOrgEvaInfoBatchDto(params).then(datas =>{
  427. if (datas) {
  428. if (datas.success) {
  429. that.$message({
  430. message: '保存成功',
  431. type: 'success'
  432. });
  433. that.getDetails(that.rowMsg.id)
  434. } else {
  435. that.$message({
  436. message: datas.data,
  437. type: 'error'
  438. })
  439. }
  440. }
  441. })
  442. }
  443. }
  444. }
  445. </script>
  446. <style lang="less">
  447. .startFrom{
  448. .el-overlay{
  449. .el-dialog{
  450. // margin-top: 7vh;
  451. .el-dialog__body{
  452. padding: 0 20px !important;
  453. .startDetail{
  454. .starttitleSty{
  455. font-size: 18px;
  456. font-family: Microsoft YaHei;
  457. font-weight: bold;
  458. color: #3B7AD1;
  459. // line-height: 12px;
  460. margin: 20px 0 20px 10px;
  461. }
  462. .danjuMsg{
  463. border: 1px solid #D6DBEA;
  464. padding: 10px 20px;
  465. border-radius: 10px;
  466. margin-bottom: 20px;
  467. .danjuMsg_data{
  468. padding: 5px 0 10px 0;
  469. .data_tit{
  470. margin-right: 10px;
  471. font-weight: bold;
  472. font-size: 14px;
  473. font-family: Microsoft YaHei;
  474. color: #8991B0;
  475. }
  476. .data_tit_wd{
  477. display: inline-block;
  478. width: 90px;
  479. }
  480. .el-form-item--small{
  481. .el-input{
  482. height: 25px;
  483. width: 160px;
  484. }
  485. margin-bottom: 0;
  486. .el-input-number{
  487. height: 25px;
  488. .el-input-number__decrease, .el-input-number__increase{
  489. right: -39px;
  490. }
  491. }
  492. }
  493. }
  494. }
  495. .el-select, .el-input{
  496. width: 100%;
  497. }
  498. .detaTableBtns{
  499. display: flex;
  500. width: 500px;
  501. position: relative;
  502. top: 32px;
  503. left: 90vw;
  504. z-index: 11111;
  505. .tableBtn {
  506. display: flex;
  507. margin-right: 30px;
  508. img{
  509. margin-right: 5px;
  510. margin-top: 1px;
  511. }
  512. span{
  513. font-size: 14px;
  514. font-family: Microsoft YaHei;
  515. font-weight: 400;
  516. }
  517. }
  518. .add{
  519. cursor: pointer;
  520. span{
  521. color: #3B7AD1;
  522. }
  523. }
  524. .save{
  525. cursor: pointer;
  526. span{
  527. color: #50C14E;
  528. }
  529. }
  530. .edit{
  531. span{
  532. color: #F5A623;
  533. }
  534. }
  535. .delete{
  536. cursor: no-drop;
  537. span{
  538. color: #F65177;
  539. }
  540. }
  541. }
  542. .el-tabs{
  543. .el-tabs__header{
  544. .el-tabs__nav{
  545. .el-tabs__item{
  546. font-size: 18px;
  547. font-family: Microsoft YaHei;
  548. font-weight: bold;
  549. margin: 0 10px;
  550. color: #8991B0;
  551. }
  552. .is-active{
  553. font-size: 18px;
  554. font-family: Microsoft YaHei;
  555. font-weight: bold;
  556. color: #3B7AD1;
  557. margin: 0 10px;
  558. }
  559. }
  560. }
  561. .el-table{
  562. .el-table__body-wrapper{
  563. height: 55vh;
  564. }
  565. .el-table__row{
  566. .cell{
  567. .el-input{
  568. height: 24px;
  569. .el-input__inner{
  570. height: 24px;
  571. }
  572. }
  573. }
  574. }
  575. }
  576. }
  577. }
  578. }
  579. .el-dialog__footer{
  580. .dialog-footer{
  581. display: flex;
  582. justify-content: center;
  583. .el-button{
  584. width: 180px !important;
  585. height: 40px !important;
  586. }
  587. }
  588. }
  589. }
  590. }
  591. }
  592. </style>