evaluationIndexPage.vue 20 KB

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