scoringRulesPage.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. <template>
  2. <div class="scoringRules" v-loading="loadingImport">
  3. <div class="scoringRulesBtn">
  4. <div class="collectSeach">
  5. <div class="exceed">
  6. <span class="exceedSpan">业务属性:</span>
  7. <el-select v-model="businessStr" placeholder="请选择业务属性" clearable >
  8. <el-option
  9. v-for="item in binSectionoptions"
  10. :key="item.id"
  11. :label="item.sectionName"
  12. :value="item.id">
  13. </el-option>
  14. </el-select>
  15. </div>
  16. <div class="exceed">
  17. <span class="exceedSpan" style="width:100px">规则名称:</span>
  18. <el-input v-model="indicatorStr" placeholder="请输入规则名称"></el-input>
  19. </div>
  20. <seachs @handleSeach="getSeachData" @handleRest="reset"></seachs>
  21. </div>
  22. <div class="PeriodBtn">
  23. <btns
  24. :showImport="false"
  25. :showExport="false"
  26. :showAdd="$utils.havePurview('scoringRules:oneLevel:add')"
  27. :showSave="$utils.havePurview('scoringRules:oneLevel:save')"
  28. :showDelete="$utils.havePurview('scoringRules:oneLevel:delete')"
  29. :disSave="changeDateSelect.length === 0 || changeDateSelect.length>1"
  30. :disDelete="changeDateSelect.length === 0"
  31. :disImport="true"
  32. :disExport="true"
  33. @handleAdd="handleAdd"
  34. @handleEdit="handleEdit"
  35. @handleDelete="handleDelete"
  36. ></btns>
  37. </div>
  38. <div class="scoringRulesTableData">
  39. <el-table :data="scoringRulesData" style="width: 100%" @select="rowClick" @select-all="allSelect" @row-dblclick="scoringRuleDetail">
  40. <el-table-column type="selection" label="操作" align="center" />
  41. <el-table-column label="规则名称" prop="scoreRuleName" />
  42. <el-table-column label="业务属性" prop="businessName" width="200" />
  43. <el-table-column label="指标名称" width="300">
  44. <template #default="scope">
  45. <span>{{scope.row.indicatorNames.join(',')}}</span>
  46. </template>
  47. </el-table-column>
  48. <el-table-column label="描述">
  49. <template #default="scope">
  50. <el-tooltip
  51. class="box-item"
  52. effect="customized"
  53. :content="scope.row.describe"
  54. placement="top"
  55. >
  56. <span class="tooltipCC">{{scope.row.describe}}</span>
  57. </el-tooltip>
  58. </template>
  59. </el-table-column>
  60. <el-table-column label="操作" width="100">
  61. <template #default="scope">
  62. <p class="indicitem" @click="scoringRuleDetail(scope.row)">详情</p>
  63. </template>
  64. </el-table-column>
  65. </el-table>
  66. <el-pagination
  67. @size-change="handleSizeChange"
  68. @current-change="handleCurrentChange"
  69. :current-page="page.currentPage"
  70. :page-size="page.pagesize"
  71. layout="total, prev, pager, next, jumper"
  72. :total="page.total">
  73. </el-pagination>
  74. </div>
  75. <el-dialog :title="title" v-model="dialogVisible" width="600px" :close-on-click-modal="false">
  76. <div class="periodFrom">
  77. <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm" :validate-on-rule-change="false">
  78. <el-form-item label="规则名称" prop="ruleName">
  79. <el-input v-model="ruleForm.ruleName" placeholder="请输入规则名称"></el-input>
  80. </el-form-item>
  81. <el-form-item label="业务属性" prop="binSection">
  82. <el-select v-model="ruleForm.binSection" placeholder="请选择业务属性" :disabled="isSave" @change="changeBinstation">
  83. <el-option
  84. v-for="item in binSectionoptions"
  85. :key="item.id"
  86. :label="item.sectionName"
  87. :value="item.id">
  88. </el-option>
  89. </el-select>
  90. </el-form-item>
  91. <el-form-item label="指标名称" prop="indicatorId">
  92. <!-- multiple collapse-tags -->
  93. <el-select v-model="ruleForm.indicatorId" placeholder="请选择指标名称" :disabled="isSave">
  94. <el-option
  95. v-for="item in indicItemoptions"
  96. :key="item.indicatorCode"
  97. :label="item.indicatorName"
  98. :value="item.indicatorCode">
  99. </el-option>
  100. </el-select>
  101. </el-form-item>
  102. <el-form-item label="描述" prop="desc">
  103. <el-input v-model="ruleForm.desc" :rows="5" type="textarea" placeholder="请输入描述"></el-input>
  104. </el-form-item>
  105. </el-form>
  106. </div>
  107. <template #footer>
  108. <span class="dialog-footer">
  109. <el-button @click="dialogVisible = false">取 消</el-button>
  110. <el-button type="primary" @click="saveevaluscoringruleMsg('ruleForm')">确 定</el-button>
  111. </span>
  112. </template>
  113. </el-dialog>
  114. <scoring-rules-detail-page ref="rulesDetail"></scoring-rules-detail-page>
  115. </div>
  116. </div>
  117. </template>
  118. <script>
  119. import scoringRulesDetailPage from './scoringRulesDetailPage.vue'
  120. import btns from '../elbuttonS.vue'
  121. import seachs from '../seachGroup.vue'
  122. import {apiGetevaluationscoringruleList, apiGetindicatorListAll, apiGetbinsectionList, apiGetevaluationscoringSaveList, apiGetevaluationruleRemove} from '../../api/api'
  123. export default {
  124. //
  125. components: { scoringRulesDetailPage,btns,seachs },
  126. data() {
  127. return {
  128. dialogVisible: false,
  129. title: '',
  130. indicItemoptions: [],
  131. binSectionoptions: [],
  132. indicatorItems: [],
  133. indicatorStr: '',
  134. businessStr: '',
  135. rowdataMsg: {},
  136. changeDateSelect: [],
  137. isSave: false,
  138. ruleForm: {
  139. ruleName: '',
  140. binSection: '',
  141. indicatorId: '',
  142. desc: ''
  143. },
  144. rules: {
  145. ruleName: [
  146. { required: true, message: '请输入规则名称', trigger: 'blur' }
  147. ],
  148. binSection: [
  149. { required: true, message: '请选择业务属性', trigger: 'change' }
  150. ],
  151. indicatorId: [
  152. { required: true, message: '请选择指标名称', trigger: 'change' }
  153. ],
  154. desc: [
  155. { required: true, message: '请输入描述', trigger: 'blur' }
  156. ]
  157. },
  158. loadingImport: false,
  159. scoringRulesData:[],
  160. page:{
  161. pagesize: 12,
  162. currentPage: 1,
  163. total: 0
  164. }
  165. }
  166. },
  167. created() {
  168. this.getEvalscoringData()
  169. this.getDataDictionary()
  170. this.getEvaluationData()
  171. },
  172. methods:{
  173. // 查询得分规则数据
  174. getEvalscoringData() {
  175. let that = this
  176. let params = {
  177. pageNum: that.page.currentPage,
  178. pageSize: that.page.pagesize,
  179. scoreRuleName: that.indicatorStr,
  180. businessPhase: that.businessStr
  181. }
  182. apiGetevaluationscoringruleList(params).then(datas =>{
  183. if (datas && datas.data) {
  184. that.scoringRulesData = datas.data.records
  185. that.page.total = datas.data.total
  186. }
  187. })
  188. },
  189. // 查询模块
  190. getDataDictionary() {
  191. let that = this
  192. apiGetbinsectionList().then(datas =>{
  193. if (datas && datas.data) {
  194. that.binSectionoptions = datas.data
  195. }
  196. })
  197. },
  198. changeBinstation(val) {
  199. this.getEvaluationData(val)
  200. },
  201. // 查询指标数据
  202. getEvaluationData(val) {
  203. let that = this
  204. let params = {
  205. binSection: val
  206. }
  207. apiGetindicatorListAll(params).then(datas =>{
  208. if (datas && datas.data) {
  209. that.indicItemoptions = datas.data
  210. }
  211. })
  212. },
  213. handleAdd() {
  214. this.dialogVisible = true
  215. this.isSave = false
  216. this.title = '新增考评得分规则'
  217. this.$nextTick(() =>{
  218. this.ruleForm = {
  219. ruleName: '',
  220. binSection: '',
  221. indicatorId: '',
  222. desc: ''
  223. }
  224. })
  225. },
  226. handleEdit() {
  227. this.dialogVisible = true
  228. this.isSave = true
  229. this.title = '修改考评得分规则'
  230. let evalradio = this.changeDateSelect[0]
  231. this.ruleForm = {
  232. ruleName: evalradio.scoreRuleName,
  233. binSection: evalradio.businessPhase,
  234. indicatorId: evalradio.indicatorId,
  235. desc: evalradio.describe
  236. }
  237. this.getEvaluationData(evalradio.businessPhase)
  238. },
  239. saveevaluscoringruleMsg(formName) {
  240. let that = this
  241. that.$refs[formName].validate((valid) => {
  242. if (valid) {
  243. that.saveAndEditIndicatorData()
  244. }
  245. });
  246. },
  247. //新增/修改指标数据
  248. saveAndEditIndicatorData() {
  249. let that = this
  250. let params = {
  251. scoreRuleName: that.ruleForm.ruleName,
  252. businessPhase: that.ruleForm.binSection,
  253. indicatorId: that.ruleForm.indicatorId,
  254. describe: that.ruleForm.desc
  255. }
  256. if (that.isSave) {
  257. let evalradio = this.changeDateSelect[0]
  258. params.id = evalradio.id
  259. }
  260. apiGetevaluationscoringSaveList(params).then(datas =>{
  261. if (!that.isSave) {
  262. that.$message({
  263. message: '考评得分规则新增成功',
  264. type: 'success'
  265. });
  266. } else {
  267. that.$message({
  268. message: '考评得分规则修改成功',
  269. type: 'success'
  270. });
  271. }
  272. that.dialogVisible = false
  273. that.changeDateSelect = []
  274. that.getEvalscoringData()
  275. })
  276. },
  277. //删除指标数据
  278. handleDelete() {
  279. this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
  280. confirmButtonText: '确定',
  281. cancelButtonText: '取消',
  282. type: 'warning'
  283. }).then(() => {
  284. let that = this
  285. let paramsArr = []
  286. that.changeDateSelect.forEach(it =>{
  287. paramsArr.push(it.id)
  288. })
  289. apiGetevaluationruleRemove(paramsArr.join(',')).then(datas =>{
  290. if (datas) {
  291. that.$message({
  292. type: 'success',
  293. message: '删除成功!'
  294. });
  295. that.changeDateSelect = []
  296. that.getEvalscoringData()
  297. }
  298. })
  299. })
  300. },
  301. showCounter() {
  302. this.$refs.counter.init(this.ruleForm.optionName)
  303. },
  304. counterStr(val) {
  305. this.ruleForm.optionName = val
  306. },
  307. scoringRuleDetail(row) {
  308. this.$refs.rulesDetail.init(row)
  309. },
  310. getSeachData() {
  311. this.page.currentPage = 1
  312. this.getEvalscoringData()
  313. },
  314. reset() {
  315. this.page.currentPage = 1
  316. this.indicatorStr = ''
  317. this.businessStr = ''
  318. this.getEvalscoringData()
  319. },
  320. handleSizeChange(val){
  321. this.page.pagesize = val
  322. this.getEvalscoringData()
  323. },
  324. handleCurrentChange(val){
  325. this.page.currentPage =val
  326. this.getEvalscoringData()
  327. },
  328. rowClick(selection, row) {
  329. this.changeDateSelect = selection
  330. }
  331. }
  332. }
  333. </script>
  334. <style lang="less">
  335. .scoringRules{
  336. .scoringRulesBtn{
  337. .collectSeach{
  338. display: flex;
  339. padding: 24px 20px;
  340. border-bottom: 1px solid#D6DBEA;
  341. .exceed{
  342. display: flex;
  343. .exceedSpan{
  344. width: 75px;
  345. height: 12px;
  346. font-size: 14px;
  347. font-family: Microsoft YaHei;
  348. font-weight: 400;
  349. color: #8991B0;
  350. line-height: 12px;
  351. margin-top: 14px;
  352. }
  353. .el-input{
  354. margin-right:10px;
  355. .el-input__inner{
  356. height:40px;
  357. }
  358. .el-input__suffix{
  359. .el-select__caret{
  360. line-height:30px;
  361. }
  362. }
  363. }
  364. }
  365. .el-select{
  366. margin-right:10px;
  367. .el-input__inner{
  368. height:30px;
  369. }
  370. .el-input__suffix{
  371. .el-select__caret{
  372. line-height:30px;
  373. }
  374. }
  375. }
  376. }
  377. span{
  378. font-size:14px;
  379. }
  380. .PeriodBtn{
  381. display: flex;
  382. justify-content: end;
  383. padding: 20px 0;
  384. }
  385. .el-button{
  386. height: 30px;
  387. // width:100px;
  388. padding: 0 30px ;
  389. // padding-top: 8px;
  390. span{
  391. margin:0;
  392. }
  393. }
  394. }
  395. .scoringRulesTableData{
  396. .el-table{
  397. .el-table__body-wrapper{
  398. height: 60vh !important;
  399. }
  400. .el-input__inner{
  401. height: 30px !important;
  402. }
  403. .el-radio__label{
  404. display: none;
  405. }
  406. .tooltipCC{
  407. width: 400px;
  408. display: inline-block;
  409. overflow: hidden;
  410. text-overflow: ellipsis;
  411. white-space: nowrap;
  412. }
  413. .indicitem{
  414. color: #409EFF;
  415. font-size: 12px;
  416. margin-right: 20px;
  417. cursor:pointer;
  418. &:hover{
  419. text-decoration: underline;
  420. }
  421. }
  422. }
  423. .el-pagination{
  424. margin-top: 20px;
  425. text-align: end;
  426. position: relative;
  427. }
  428. }
  429. .el-overlay{
  430. .el-dialog{
  431. .el-dialog__body{
  432. padding: 30px 60px 30px 20px;
  433. .periodFrom{
  434. .counterSx{
  435. width: 420px;
  436. height: 27px;
  437. border: 1px solid #dcdfe6;
  438. border-radius: 5px;
  439. cursor: pointer;
  440. }
  441. .el-select, .el-input{
  442. width: 100%;
  443. }
  444. }
  445. }
  446. }
  447. }
  448. }
  449. </style>