evaluationYearPage.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502
  1. <template>
  2. <div class="evaluationYear">
  3. <div class="evaluationYearBtn">
  4. <div class="collectSeach">
  5. <div class="exceed">
  6. <span class="exceedSpan">业务编号:</span>
  7. <el-input v-model="rescode" placeholder="请输入业务编号"></el-input>
  8. </div>
  9. <div class="exceed">
  10. <span class="exceedSpan">业务简述:</span>
  11. <el-input v-model="resDes" placeholder="请输入业务简述"></el-input>
  12. </div>
  13. <el-button type="primary" style="margin-left: 10px;" @click="getSeachData">搜索</el-button>
  14. <el-button style="margin-left: 10px;" @click="resetSeach">重置</el-button>
  15. </div>
  16. <div class="PeriodBtn">
  17. <btns
  18. :showImport="false"
  19. :showSave="false"
  20. :showExport="false"
  21. :showAdd="$utils.havePurview('evalYear:oneLevel:add')"
  22. :showDelete="$utils.havePurview('evalYear:oneLevel:delete')"
  23. :disDelete="changeDateSelect.length === 0"
  24. :disExport="true"
  25. @handleAdd="handleAdd"
  26. @handleDelete="handleDelete"
  27. @handleExport="handleExport"
  28. ></btns>
  29. </div>
  30. <div class="evaluationYearTableData">
  31. <el-table :data="evaluationYearData" style="width: 100%" @select="rowClick" @select-all="rowClick">
  32. <el-table-column type="selection" label="操作" align="center"></el-table-column>
  33. <el-table-column label="业务编号" prop="organizationEvaluationCode" width="300" />
  34. <el-table-column label="考评单位" width="330">
  35. <template #default="scope">
  36. <el-tooltip
  37. class="box-item"
  38. effect="customized"
  39. :content="scope.row.organizationName"
  40. placement="top"
  41. >
  42. <span class="tooltipCC">{{scope.row.organizationName}}</span>
  43. </el-tooltip>
  44. </template>
  45. </el-table-column>
  46. <el-table-column label="业务类别">
  47. <template #default="scope">
  48. <span v-if="scope.row.checkCycle === 'YDKP'" style="font-size: 12px;">月度考评</span>
  49. <span v-else-if="scope.row.checkCycle === 'JDKP'" style="font-size: 12px;">季度考评</span>
  50. <span v-else style="font-size: 12px;">年度考评</span>
  51. </template>
  52. </el-table-column>
  53. <el-table-column label="年度" prop="year" />
  54. <el-table-column label="月度/季度" prop="month" />
  55. <el-table-column label="流程状态" prop="stage" />
  56. <el-table-column label="业务简述" prop="des" width="230">
  57. <template #default="scope">
  58. <el-tooltip
  59. class="box-item"
  60. effect="customized"
  61. :content="scope.row.des"
  62. placement="top"
  63. >
  64. <span class="tooltipCC">{{scope.row.des}}</span>
  65. </el-tooltip>
  66. </template>
  67. </el-table-column>
  68. <el-table-column label="操作">
  69. <template #default="scope">
  70. <p class="indicitem" v-if="scope.row.stage === '流程未启动'" @click="agetdeptresponsibility(scope.row)">启动</p>
  71. <p class="indicitem" v-else @click="getDetail(scope.row)">详情</p>
  72. </template>
  73. </el-table-column>
  74. </el-table>
  75. <el-pagination
  76. @size-change="handleSizeChange"
  77. @current-change="handleCurrentChange"
  78. :current-page="page.currentPage"
  79. :page-size="page.pagesize"
  80. layout="total, prev, pager, next, jumper"
  81. :total="page.total">
  82. </el-pagination>
  83. </div>
  84. <el-dialog :title="title" v-model="dialogVisible" width="600px" :close-on-click-modal="false">
  85. <div class="periodFrom">
  86. <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm" :validate-on-rule-change="false">
  87. <el-form-item label="考评类别" prop="organizationType">
  88. <el-select v-model="ruleForm.organizationType" placeholder="请选择考评类别">
  89. <el-option
  90. v-for="item in organizationType"
  91. :key="item.code"
  92. :label="item.label"
  93. :value="item.code">
  94. </el-option>
  95. </el-select>
  96. </el-form-item>
  97. <el-form-item label="考评周期" prop="evaluationCycle">
  98. <el-select v-model="ruleForm.evaluationCycle" placeholder="请选择考评周期">
  99. <el-option
  100. v-for="item in periodData"
  101. :key="item.keyValue"
  102. :label="item.keyName"
  103. :value="item.keyValue"
  104. :disabled="item.keyValue === 'JDKP' || item.keyValue === 'YDKP'">
  105. </el-option>
  106. </el-select>
  107. </el-form-item>
  108. <!-- <el-form-item label="考评规则" prop="evaluateRule">
  109. <el-select v-model="ruleForm.evaluateRule" placeholder="请选择考评规则">
  110. <el-option
  111. v-for="item in ruleDataAll"
  112. :key="item.id"
  113. :label="item.evaluateRuleName"
  114. :value="item.id">
  115. </el-option>
  116. </el-select>
  117. </el-form-item> -->
  118. <el-form-item label="年份" prop="year">
  119. <el-date-picker
  120. v-model="ruleForm.year"
  121. type="year"
  122. value-format="YYYY"
  123. placeholder="请选择年份"
  124. />
  125. </el-form-item>
  126. <el-form-item label="描述" prop="desc">
  127. <el-input v-model="ruleForm.desc" :rows="5" type="textarea" placeholder="请输入描述"></el-input>
  128. </el-form-item>
  129. </el-form>
  130. </div>
  131. <template #footer>
  132. <span class="dialog-footer">
  133. <el-button @click="dialogVisible = false">取 消</el-button>
  134. <el-button type="primary" @click="saveevaluaStart('ruleForm')">确 定</el-button>
  135. </span>
  136. </template>
  137. </el-dialog>
  138. </div>
  139. <start-from-list ref="startFromDetail"></start-from-list>
  140. </div>
  141. </template>
  142. <script>
  143. import startFromList from './evaluationYearFrom.vue'
  144. import btns from '../elbuttonS.vue'
  145. import {apiGetOrgEvaluationList, apiPostOrgEvaSave,apiPostOrgevaluationDelete,
  146. apiGetgenerateUnitYearEvaluation, apiGetdatadictionaryList} from '../../api/api'
  147. export default {
  148. components: {
  149. startFromList,
  150. btns
  151. },
  152. data() {
  153. return {
  154. dialogVisible: false,
  155. title: '',
  156. windframradio: {},
  157. deleteSelect: [],
  158. changeDateSelect: [],
  159. evaluationYearData:[],
  160. page:{
  161. pagesize: 12,
  162. currentPage: 1,
  163. total: 0
  164. },
  165. ruleForm: {
  166. organizationType: '',
  167. evaluationCycle: '',
  168. evaluateRule: '',
  169. year: '',
  170. month: 0,
  171. desc: ''
  172. },
  173. rules: {
  174. organizationType: [
  175. { required: true, message: '请选择考评类别', trigger: 'change' }
  176. ],
  177. evaluationCycle: [
  178. { required: true, message: '请选择考评周期', trigger: 'blur' }
  179. ],
  180. evaluateRule: [
  181. { required: true, message: '请选择考评规则', trigger: 'change' }
  182. ],
  183. year: [
  184. { required: true, message: '请选择年份', trigger: 'change' }
  185. ],
  186. desc: [
  187. { required: true, message: '请输入描述', trigger: 'blur' }
  188. ]
  189. },
  190. organizationType: [],
  191. periodData: [],
  192. ruleDataAll: [],
  193. rescode: '',
  194. resDes: ''
  195. }
  196. },
  197. created() {
  198. this.organizationType = [
  199. {
  200. label: '单位考评',
  201. code: 'DWKP'
  202. },
  203. {
  204. label: '部门考评',
  205. code: 'BMKP'
  206. }
  207. ]
  208. this.getevaluStartList()
  209. this.getPeriodData()
  210. },
  211. methods:{
  212. // 查询列表页面
  213. getevaluStartList(type) {
  214. let that = this
  215. let params = {
  216. pageNum: that.page.currentPage,
  217. pageSize: that.page.pagesize,
  218. checkCycle: 'NDKP'
  219. }
  220. if (type) {
  221. params.organizationEvaluationCode = that.rescode
  222. params.des = that.resDes
  223. }
  224. apiGetOrgEvaluationList(params).then(datas =>{
  225. if (datas && datas.data) {
  226. that.evaluationYearData = datas.data.records
  227. that.page.total = datas.data.total
  228. }
  229. })
  230. },
  231. //考评周期
  232. getPeriodData() {
  233. let that = this
  234. let params = {
  235. superKey: 'KPZQ0001'
  236. }
  237. apiGetdatadictionaryList(params).then(datas =>{
  238. if (datas && datas.data) {
  239. that.periodData = datas.data
  240. }
  241. })
  242. },
  243. saveevaluaStart(formName) {
  244. let that = this
  245. that.$refs[formName].validate((valid) => {
  246. if (valid) {
  247. that.saveAndEditIndicatorData()
  248. }
  249. });
  250. },
  251. //新增/修改考评启动数据
  252. saveAndEditIndicatorData() {
  253. let that = this
  254. let params = {
  255. organizationType: that.ruleForm.organizationType,
  256. checkCycle: that.ruleForm.evaluationCycle,
  257. year: that.ruleForm.year,
  258. des: that.ruleForm.desc
  259. }
  260. if (that.isSave) {
  261. params.id = this.evalradio.id
  262. }
  263. apiPostOrgEvaSave(params).then(datas =>{
  264. if (!datas.success) {
  265. that.$message({
  266. message: datas.message,
  267. type: 'error'
  268. });
  269. } else {
  270. if (!that.isSave) {
  271. that.$message({
  272. message: '考评规则新增成功',
  273. type: 'success'
  274. });
  275. } else {
  276. that.$message({
  277. message: '考评规则修改成功',
  278. type: 'success'
  279. });
  280. }
  281. that.dialogVisible = false
  282. that.changeDateSelect = []
  283. that.getevaluStartList()
  284. }
  285. })
  286. },
  287. agetdeptresponsibility(row) {
  288. let that = this
  289. let par = {
  290. defKey: "dwkpmbxd",
  291. businessKey: row.id,
  292. action: "start",
  293. opinion: "年度单位考评",
  294. iamCode: getToken('code')
  295. }
  296. apiGetdoAction(par).then(datas =>{
  297. if (datas && datas.data) {
  298. if (datas.data.isOk) {
  299. let params = {
  300. evaluationIds: row.id
  301. }
  302. apiGetgenerateUnitYearEvaluation(params).then(datas =>{
  303. if (datas && datas.data) {
  304. if (!datas.success) {
  305. that.$message({
  306. message: datas.message,
  307. type: 'error'
  308. });
  309. } else {
  310. that.$message({
  311. message: '年度考评目标已启动',
  312. type: 'success'
  313. });
  314. that.getevaluStartList()
  315. }
  316. }
  317. })
  318. } else {
  319. that.$message({
  320. message: datas.data.msg,
  321. type: 'error'
  322. });
  323. }
  324. }
  325. })
  326. },
  327. //明细
  328. getDetail(row) {
  329. this.$refs.startFromDetail.init(row)
  330. },
  331. getSeachData() {
  332. this.page.currentPage = 1
  333. this.getevaluStartList('seach')
  334. },
  335. resetSeach() {
  336. this.page.currentPage = 1
  337. this.rescode = ''
  338. this.resDes = ''
  339. this.getevaluStartList()
  340. },
  341. handleSizeChange(val){
  342. this.page.pagesize = val
  343. this.getevaluStartList()
  344. },
  345. handleCurrentChange(val){
  346. this.page.currentPage =val
  347. this.getevaluStartList()
  348. },
  349. rowClick(selection, row) {
  350. this.changeDateSelect = selection
  351. },
  352. handleAdd() {
  353. this.dialogVisible = true
  354. this.title = '新建表单填报'
  355. },
  356. //删除
  357. handleDelete() {
  358. this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
  359. confirmButtonText: '确定',
  360. cancelButtonText: '取消',
  361. type: 'warning'
  362. }).then(() => {
  363. let that = this
  364. let paramsArr = []
  365. that.changeDateSelect.forEach(it =>{
  366. paramsArr.push(it.id)
  367. })
  368. apiPostOrgevaluationDelete(paramsArr.join(',')).then(datas =>{
  369. that.$message({
  370. type: 'success',
  371. message: '删除成功!'
  372. });
  373. that.getevaluStartList()
  374. that.changeDateSelect = []
  375. })
  376. })
  377. },
  378. }
  379. }
  380. </script>
  381. <style lang="less">
  382. .evaluationYear{
  383. .evaluationYearBtn{
  384. .collectSeach{
  385. display: flex;
  386. padding: 24px 20px;
  387. border-bottom: 1px solid#D6DBEA;
  388. .exceed{
  389. display: flex;
  390. .exceedSpan{
  391. width: 100px;
  392. height: 12px;
  393. font-size: 14px;
  394. font-family: Microsoft YaHei;
  395. font-weight: 400;
  396. color: #8991B0;
  397. line-height: 12px;
  398. margin-top: 10px;
  399. }
  400. .el-input{
  401. margin-right:10px;
  402. height: 40px;
  403. .el-input__inner{
  404. height:40px;
  405. }
  406. .el-input__suffix{
  407. .el-select__caret{
  408. line-height:30px;
  409. }
  410. }
  411. }
  412. }
  413. .el-select{
  414. margin-right:10px;
  415. .el-input__inner{
  416. height:30px;
  417. }
  418. .el-input__suffix{
  419. .el-select__caret{
  420. line-height:30px;
  421. }
  422. }
  423. }
  424. }
  425. span{
  426. font-size:14px;
  427. }
  428. .PeriodBtn{
  429. display: flex;
  430. justify-content: end;
  431. padding: 20px 0;
  432. }
  433. .el-button{
  434. height: 30px;
  435. // width:100px;
  436. padding: 0 20px ;
  437. // padding-top: 8px;
  438. span{
  439. margin:0;
  440. }
  441. }
  442. .evaluationYearTableData{
  443. .el-table{
  444. .el-table__body-wrapper{
  445. height: 64vh !important;
  446. }
  447. .el-input__inner{
  448. height: 30px !important;
  449. }
  450. .el-radio__label{
  451. display: none;
  452. }
  453. .tooltipCC{
  454. width: 300px;
  455. display: inline-block;
  456. overflow: hidden;
  457. text-overflow: ellipsis;
  458. white-space: nowrap;
  459. }
  460. .tooltipCCDes{
  461. width: 200px;
  462. display: inline-block;
  463. overflow: hidden;
  464. text-overflow: ellipsis;
  465. white-space: nowrap;
  466. }
  467. .indicitem{
  468. color: #409EFF;
  469. font-size: 12px;
  470. margin-right: 20px;
  471. cursor:pointer;
  472. &:hover{
  473. text-decoration: underline;
  474. }
  475. }
  476. }
  477. .el-pagination{
  478. margin-top: 20px;
  479. text-align: end;
  480. position: relative;
  481. }
  482. }
  483. .el-overlay{
  484. .el-dialog{
  485. .el-dialog__body{
  486. padding: 30px 60px 30px 20px !important;
  487. .periodFrom{
  488. .el-select, .el-input{
  489. width: 100%;
  490. }
  491. .el-input{
  492. height: 30px;
  493. }
  494. }
  495. }
  496. }
  497. }
  498. }
  499. }
  500. </style>