evaluationIndexPage.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  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="binSectionName" />
  72. <el-table-column label="业务阶段" prop="binStageName" />
  73. <!-- <el-table-column label="公司" prop="company" />
  74. <el-table-column label="部门" prop="dept" /> -->
  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.des}}</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="请输入指标编码" :disabled="isSave"></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.keyValue">
  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.keyValue">
  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: 1,
  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: 'change' }
  203. ],
  204. binStage: [
  205. { required: true, message: '请输入业务阶段', trigger: 'change' }
  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. handleAdd() {
  277. this.dialogVisible = true
  278. this.isSave = false
  279. this.title = '新增考评指标'
  280. this.$nextTick(() =>{
  281. // this.$refs['ruleForm'].resetFields()
  282. this.ruleForm = {
  283. indicatorName: '',
  284. indicatorCode: '',
  285. indicatorUnit: '',
  286. binSection: '',
  287. binStage: '',
  288. isQuantified: '否',
  289. isAdditional: '否',
  290. orderNum: 1,
  291. desc: ''
  292. }
  293. })
  294. },
  295. handleEdit() {
  296. this.dialogVisible = true
  297. this.isSave = true
  298. this.title = '修改考评指标'
  299. this.evalradio = this.changeDateSelect[0]
  300. this.ruleForm = {
  301. indicatorName: this.evalradio.indicatorName,
  302. indicatorCode: this.evalradio.indicatorCode,
  303. indicatorUnit: this.evalradio.unit,
  304. binSection: this.evalradio.binSection,
  305. binStage: this.evalradio.binStage,
  306. isQuantified: this.evalradio.isQuantified,
  307. isAdditional: this.evalradio.isAdditional,
  308. orderNum: this.evalradio.orderNum,
  309. desc: this.evalradio.des
  310. }
  311. },
  312. saveEvaluationIndexMsg(formName) {
  313. let that = this
  314. that.$refs[formName].validate((valid) => {
  315. if (valid) {
  316. that.saveAndEditIndicatorData()
  317. }
  318. });
  319. },
  320. //新增/修改指标数据
  321. saveAndEditIndicatorData() {
  322. let that = this
  323. let params = {
  324. indicatorName: that.ruleForm.indicatorName,
  325. indicatorCode: that.ruleForm.indicatorCode,
  326. unit: that.ruleForm.indicatorUnit,
  327. binSection: that.ruleForm.binSection,
  328. binStage: that.ruleForm.binStage,
  329. isQuantified: that.ruleForm.isQuantified,
  330. isAdditional: that.ruleForm.isAdditional,
  331. orderNum: that.ruleForm.orderNum,
  332. des: that.ruleForm.desc
  333. }
  334. if (that.isSave) {
  335. params.id = this.evalradio.id
  336. }
  337. apiGetIndicatorSave(params).then(datas =>{
  338. if (!that.isSave) {
  339. that.$message({
  340. message: '指标新增成功',
  341. type: 'success'
  342. });
  343. } else {
  344. that.$message({
  345. message: '指标修改成功',
  346. type: 'success'
  347. });
  348. }
  349. that.dialogVisible = false
  350. that.changeDateSelect = []
  351. that.getEvaluationData()
  352. })
  353. },
  354. //删除指标数据
  355. handleDelete() {
  356. this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
  357. confirmButtonText: '确定',
  358. cancelButtonText: '取消',
  359. type: 'warning'
  360. }).then(() => {
  361. let that = this
  362. let paramsArr = []
  363. that.changeDateSelect.forEach(it =>{
  364. paramsArr.push(it.id)
  365. })
  366. apiGetIndicatorDelete(paramsArr.join(',')).then(datas =>{
  367. that.$message({
  368. type: 'success',
  369. message: '删除成功!'
  370. });
  371. that.getEvaluationData()
  372. that.changeDateSelect = []
  373. })
  374. })
  375. },
  376. rowClick(selection, row) {
  377. this.changeDateSelect = selection
  378. },
  379. getSeachData() {
  380. this.page.currentPage = 1
  381. this.getEvaluationData('seach')
  382. },
  383. resetSeach() {
  384. this.page.currentPage = 1
  385. this.indicatorIdS = ''
  386. this.getEvaluationData()
  387. },
  388. successImport(val) {
  389. this.loadingImport = false
  390. this.getEvaluationData()
  391. },
  392. importLoading(val) {
  393. this.loadingImport = true
  394. },
  395. handleSizeChange(val){
  396. this.page.pagesize = val
  397. },
  398. handleCurrentChange(val){
  399. this.page.currentPage =val
  400. },
  401. handleImport() {
  402. this.$refs.importPage.upload.title = "考评指标管理信息导入"
  403. this.$refs.importPage.upload.open = true
  404. },
  405. //指标项配置
  406. editEvaluaIndex(row) {
  407. this.$refs.indicatorItem.init(row)
  408. }
  409. }
  410. }
  411. </script>
  412. <style lang="less">
  413. .evaluationIndex{
  414. .evaluationIndexBtn{
  415. // background: #fff;
  416. padding: 10px 20px 0 20px;
  417. .collectSeach{
  418. display: flex;
  419. margin: 20px 20px 10px;
  420. .exceed{
  421. display: flex;
  422. .exceedSpan{
  423. margin-top: 3px;
  424. width: 100px;
  425. display: inline-block;
  426. }
  427. .el-input{
  428. margin-right:10px;
  429. .el-input__inner{
  430. height:30px;
  431. }
  432. .el-input__suffix{
  433. .el-select__caret{
  434. line-height:30px;
  435. }
  436. }
  437. }
  438. }
  439. .el-select{
  440. margin-right:10px;
  441. .el-input__inner{
  442. height:30px;
  443. }
  444. .el-input__suffix{
  445. .el-select__caret{
  446. line-height:30px;
  447. }
  448. }
  449. }
  450. }
  451. .titleSty{
  452. border-left: 4px solid #007aab;
  453. padding-left: 5px;
  454. font-size: 16px;
  455. font-weight: bold;
  456. font-family: '微软雅黑';
  457. margin-left:20px;
  458. }
  459. span{
  460. font-size:14px;
  461. }
  462. .PeriodBtn{
  463. padding-left: 10px;
  464. }
  465. .el-button{
  466. height: 30px;
  467. // width:100px;
  468. padding: 0 30px ;
  469. // padding-top: 8px;
  470. span{
  471. margin:0;
  472. }
  473. }
  474. .indexdialog{
  475. .el-overlay{
  476. .el-dialog{
  477. .el-dialog__body{
  478. padding: 30px 60px 30px 20px !important;
  479. .periodFrom{
  480. .el-select, .el-input{
  481. width: 100%;
  482. }
  483. }
  484. }
  485. }
  486. }
  487. }
  488. }
  489. .evaluationIndexTableData{
  490. padding: 10px 20px;
  491. .el-table{
  492. .el-table__body-wrapper{
  493. max-height: 64vh !important;
  494. }
  495. .el-input__inner{
  496. height: 30px !important;
  497. }
  498. .el-radio__label{
  499. display: none;
  500. }
  501. .indicitem{
  502. color: #409EFF;
  503. font-size: 12px;
  504. margin-right: 20px;
  505. cursor:pointer;
  506. &:hover{
  507. text-decoration: underline;
  508. }
  509. }
  510. }
  511. .el-pagination{
  512. margin-top: 20px;
  513. text-align: end;
  514. position: relative;
  515. }
  516. }
  517. }
  518. </style>