evaluationStartFrom.vue 25 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.creator}}</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('evalStart: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="目标值">
  77. <template #default="scope">
  78. <el-input-number v-model="scope.row.quantifiedValue"
  79. :precision="2" :step="0.1" :min="0" :disabled="!scope.row.updateMark" />
  80. </template>
  81. </el-table-column>
  82. <el-table-column label="单位" prop="unit" />
  83. <el-table-column label="审核状态">
  84. <template #default="scope">
  85. <el-select v-model="scope.row.state" placeholder="请选择审核状态" :disabled="!scope.row.updateMark">
  86. <el-option
  87. v-for="item in statusData"
  88. :key="item.id"
  89. :label="item.name"
  90. :value="item.id">
  91. </el-option>
  92. </el-select>
  93. </template>
  94. </el-table-column>
  95. </el-table>
  96. </el-tab-pane>
  97. <el-tab-pane label="考评评价指标内容" name="second">
  98. <el-table :data="nonQuantifiedList" style="width: 100%">
  99. <el-table-column type="index" label="序号" width="80" />
  100. <el-table-column label="单位名称" prop="organizationName" width="300">
  101. <template #default="scope">
  102. <el-select v-model="scope.row.organizationName" placeholder="请选择单位名称"
  103. :disabled="!scope.row.showInput"
  104. @change="changeOrgZa">
  105. <el-option
  106. v-for="item in orgruleData"
  107. :key="item.id"
  108. :label="item.organizationName"
  109. :value="item.id">
  110. </el-option>
  111. </el-select>
  112. </template>
  113. </el-table-column>
  114. <el-table-column label="指标分类" prop="typeName">
  115. <template #default="scope">
  116. <el-select v-model="scope.row.typeName" :disabled="!scope.row.showInput" placeholder="请选择指标分类">
  117. <el-option
  118. v-for="item in indicatorTypeData"
  119. :key="item.id"
  120. :label="item.typeName"
  121. :value="item.id">
  122. </el-option>
  123. </el-select>
  124. </template>
  125. </el-table-column>
  126. <el-table-column label="业务阶段" prop="stageName">
  127. <template #default="scope">
  128. <el-select v-model="scope.row.stageName" placeholder="请选择业务阶段"
  129. :disabled="!scope.row.showInput"
  130. @change="(val)=>changeIndic(val, scope.row)">
  131. <el-option
  132. v-for="item in stageData"
  133. :key="item.id"
  134. :label="item.stageName"
  135. :value="item.id">
  136. </el-option>
  137. </el-select>
  138. </template>
  139. </el-table-column>
  140. <el-table-column label="业务属性" prop="sectionName">
  141. <template #default="scope">
  142. <el-select v-model="scope.row.sectionName" placeholder="请选择业务阶段"
  143. :disabled="!scope.row.showInput"
  144. @change="(val)=>changeIndic(val, scope.row)">
  145. <el-option
  146. v-for="item in sectionNameArr"
  147. :key="item.id"
  148. :label="item.secName"
  149. :value="item.id">
  150. </el-option>
  151. </el-select>
  152. </template>
  153. </el-table-column>
  154. <el-table-column label="指标名称" prop="childName">
  155. <template #default="scope">
  156. <el-select v-model="scope.row.childName" placeholder="请选择业务阶段"
  157. :disabled="!scope.row.showInput"
  158. @change="changeDept">
  159. <el-option
  160. v-for="item in indicItemoptions"
  161. :key="item.id"
  162. :label="item.indicatorName"
  163. :value="item.id">
  164. </el-option>
  165. </el-select>
  166. </template>
  167. </el-table-column>
  168. <el-table-column label="填报部门" prop="deptName" width="260">
  169. <template #default="scope">
  170. <el-select v-model="scope.row.deptName" placeholder="请选择业务阶段" :disabled="!scope.row.showInput">
  171. <el-option
  172. v-for="item in deptNameArr"
  173. :key="item.id"
  174. :label="item.deptName"
  175. :value="item.id">
  176. </el-option>
  177. </el-select>
  178. </template>
  179. </el-table-column>
  180. <el-table-column label="值">
  181. <template #default="scope">
  182. <el-input v-model="scope.row.nonQuantifiedValue" :disabled="!scope.row.updateMark" />
  183. </template>
  184. </el-table-column>
  185. <el-table-column label="审核状态">
  186. <template #default="scope">
  187. <el-select v-model="scope.row.state" placeholder="请选择审核状态" :disabled="!scope.row.updateMark">
  188. <el-option
  189. v-for="item in statusData"
  190. :key="item.id"
  191. :label="item.name"
  192. :value="item.id">
  193. </el-option>
  194. </el-select>
  195. </template>
  196. </el-table-column>
  197. </el-table>
  198. </el-tab-pane>
  199. </el-tabs>
  200. </div>
  201. <template #footer>
  202. <span class="dialog-footer">
  203. <el-button type="primary" @click="dialogVisible = false">取 消</el-button>
  204. </span>
  205. </template>
  206. </el-dialog>
  207. </div>
  208. </template>
  209. <script>
  210. import {apiGetdeptresponDetail,apiGetindicatorsaveBatchDto, apiGetOrganizationRule,
  211. apiGetindicatorListAll, apiGetbinstageList, apiGetIndicatorTypeList} from '../../api/api'
  212. import addIcon from '../../assets/btnIcon/add.png'
  213. import saveIcon from '../../assets/btnIcon/save.png'
  214. import editIcon from '../../assets/btnIcon/edit.png'
  215. import deleteIcon from '../../assets/btnIcon/delete.png'
  216. export default {
  217. data() {
  218. return {
  219. dialogVisible: false,
  220. activeName: 'first',
  221. quantifiedList: [],
  222. nonQuantifiedList: [],
  223. changeDateSelect: [],
  224. receiptMsg: {
  225. code: '',
  226. des: '',
  227. stage: '',
  228. creator: '',
  229. createDate: '',
  230. type: '',
  231. year: '',
  232. recStage: ''
  233. },
  234. addIcon: addIcon,
  235. saveIcon: saveIcon,
  236. editIcon: editIcon,
  237. deleteIcon: deleteIcon,
  238. rowMsg: {},
  239. orgruleData: [],
  240. indicatorTypeData: [],
  241. stageData: [],
  242. indicItemoptions: [],
  243. sectionNameArr: [],
  244. deptNameArr: [],
  245. statusData: []
  246. }
  247. },
  248. created() {
  249. this.statusData = [
  250. {
  251. name: '已完成',
  252. id: '1'
  253. },
  254. {
  255. name: '待审核',
  256. id: '0'
  257. },
  258. {
  259. name: '未开始',
  260. id: '-1'
  261. }
  262. ]
  263. },
  264. methods: {
  265. init(row) {
  266. this.dialogVisible = true
  267. this.activeName = 'first'
  268. this.receiptMsg = {
  269. code: row.responsibilityCode,
  270. des: row.des,
  271. stage: row.stage,
  272. creator: row.createBy,
  273. createDate: row.createTime,
  274. type: row.checkCycle === 'YDKP'?'月度考评':row.checkCycle === 'JDKP'?'季度考评':'年度考评',
  275. year: row.year,
  276. recStage: '有效'
  277. }
  278. this.getDetails(row.id)
  279. this.getOrgRule(row)
  280. this.getindList()
  281. this.rowMsg = row
  282. },
  283. // 考评评价指标内容
  284. getOrgRule(row) {
  285. let that = this
  286. let params = {
  287. id: row.id,
  288. type: 'mb'
  289. }
  290. apiGetOrganizationRule(params).then(datas =>{
  291. if (datas && datas.data) {
  292. that.orgruleData = datas.data
  293. }
  294. })
  295. },
  296. getindList() {
  297. let that = this
  298. let params = {
  299. type: 2
  300. }
  301. apiGetbinstageList(params).then(datas =>{
  302. if (datas && datas.data) {
  303. that.stageData = datas.data
  304. }
  305. })
  306. apiGetIndicatorTypeList(params).then(datas =>{
  307. if (datas && datas.data) {
  308. that.indicatorTypeData = datas.data
  309. }
  310. })
  311. },
  312. getIndListAll(row) {
  313. let that = this
  314. let params = {
  315. binSection: row.sectionName,
  316. binStage: row.stageName
  317. }
  318. apiGetindicatorListAll(params).then(datas =>{
  319. if (datas && datas.data) {
  320. that.indicItemoptions = datas.data
  321. }
  322. })
  323. },
  324. changeIndic(val, row) {
  325. if (row.stageName !== '' && row.sectionName !== '') {
  326. this.getIndListAll(row)
  327. }
  328. },
  329. changeOrgZa(val) {
  330. this.sectionNameArr = []
  331. this.orgruleData.forEach(item =>{
  332. if (item.id === val) {
  333. let obj = {
  334. id: item.binSection,
  335. secName: item.binSectionName
  336. }
  337. this.sectionNameArr.push(obj)
  338. }
  339. })
  340. },
  341. changeDept(val) {
  342. this.deptNameArr = []
  343. this.indicItemoptions.forEach(item =>{
  344. if (item.id === val) {
  345. let obj = {
  346. id: item.dept,
  347. deptName: item.deptName
  348. }
  349. this.deptNameArr.push(obj)
  350. }
  351. })
  352. },
  353. handleClick() {
  354. this.changeDateSelect = []
  355. },
  356. rowClick(selection, row) {
  357. this.changeDateSelect = selection
  358. },
  359. //获取详情
  360. getDetails(id) {
  361. let that = this
  362. let params = {
  363. deptResponsibilityIds: id
  364. }
  365. apiGetdeptresponDetail(params).then(datas =>{
  366. if (datas && datas.data) {
  367. that.quantifiedList = datas.data.quantifiedList
  368. // let nonarr = []
  369. if (datas.data.nonQuantifiedList.length>0) {
  370. datas.data.nonQuantifiedList.forEach(it =>{
  371. it.childName = it.indicatorName //指标id
  372. // nonarr.push(obj)
  373. })
  374. }
  375. that.nonQuantifiedList = datas.data.nonQuantifiedList.length>0?datas.data.nonQuantifiedList:[]
  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. deptResponsibilityId: that.rowMsg.id
  414. }
  415. if (item.showInput) {
  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. apiGetindicatorsaveBatchDto(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: 200px;
  501. position: relative;
  502. top: 32px;
  503. left: 80vw;
  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>