evaluationCompanyPage.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  1. <template>
  2. <div class="evaluationCompany" v-loading="loadingImport">
  3. <div class="evaluationCompanyBtn">
  4. <div class="collectSeach">
  5. <div class="exceed">
  6. <span class="exceedSpan">单位名称:</span>
  7. <el-input v-model="companyS" placeholder="请输入单位名称"></el-input>
  8. </div>
  9. <el-button type="primary" style="margin-left: 10px;" @click="getSeachData">搜索</el-button>
  10. <el-button style="margin-left: 10px;" @click="resetSeach">重置</el-button>
  11. </div>
  12. <div class="PeriodBtn">
  13. <btns
  14. :showImport="false"
  15. :showExport="false"
  16. :showAdd="$utils.havePurview('evalCompany:oneLevel:add')"
  17. :showSave="$utils.havePurview('evalCompany:oneLevel:save')"
  18. :showDelete="$utils.havePurview('evalCompany:oneLevel:delete')"
  19. :disSave="changeDateSelect.length === 0 || changeDateSelect.length>1"
  20. :disDelete="changeDateSelect.length === 0"
  21. :disImport="true"
  22. :disExport="true"
  23. @handleAdd="handleAdd"
  24. @handleEdit="handleEdit"
  25. @handleDelete="handleDelete"
  26. @handleImport="handleImport"
  27. @handleExport="handleExport"
  28. ></btns>
  29. </div>
  30. <div class="evaluationCompanyTableData">
  31. <el-table :data="evaluationCompanyData" 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="organizationName" width="300">
  34. <template #default="scope">
  35. <el-tooltip
  36. class="box-item"
  37. effect="customized"
  38. :content="scope.row.organizationName"
  39. placement="top"
  40. >
  41. <span class="tooltipCC">{{scope.row.organizationName}}</span>
  42. </el-tooltip>
  43. </template>
  44. </el-table-column>
  45. <!-- <el-table-column label="考评类别" prop="organizationType" /> -->
  46. <el-table-column label="考评周期" prop="evaluationCycle">
  47. <template #default="scope">
  48. <span>{{scope.row.evaluationCycle==='YDKP'?'月度考评':scope.row.evaluationCycle==='JDKP'?'季度考评':'年度考评'}}</span>
  49. </template>
  50. </el-table-column>
  51. <el-table-column label="业务属性" prop="binSectionName" />
  52. <el-table-column label="考评规则" prop="evaluateRuleName" width="300">
  53. <template #default="scope">
  54. <el-tooltip
  55. class="box-item"
  56. effect="customized"
  57. :content="scope.row.evaluateRuleName"
  58. placement="top"
  59. >
  60. <span class="tooltipCC">{{scope.row.evaluateRuleName}}</span>
  61. </el-tooltip>
  62. </template>
  63. </el-table-column>
  64. <el-table-column label="业务阶段" prop="binStageName" width="200" />
  65. <el-table-column label="是否考评" prop="binSectionName">
  66. <template #default="scope">
  67. <span>{{scope.row.isCheck?'是':'否'}}</span>
  68. </template>
  69. </el-table-column>
  70. <el-table-column label="生产经营权重" prop="scjyWeight">
  71. <template #default="scope">
  72. <span>{{(scope.row.scjyWeight.toFixed(2))*100}}%</span>
  73. </template>
  74. </el-table-column>
  75. <el-table-column label="前期权重" prop="qqWeight">
  76. <template #default="scope">
  77. <span>{{(scope.row.qqWeight.toFixed(2))*100}}%</span>
  78. </template>
  79. </el-table-column>
  80. <el-table-column label="基建权重" prop="jjWeight">
  81. <template #default="scope">
  82. <span>{{(scope.row.jjWeight.toFixed(2))*100}}%</span>
  83. </template>
  84. </el-table-column>
  85. <!-- <el-table-column label="年" prop="year" />
  86. <el-table-column label="月" prop="month" /> -->
  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="organizationName">
  102. <el-select v-model="ruleForm.organizationName" filterable placeholder="请选择单位名称">
  103. <el-option
  104. v-for="item in companyDatas"
  105. :key="item.id"
  106. :label="item.name"
  107. :value="item.id">
  108. </el-option>
  109. </el-select>
  110. </el-form-item>
  111. <el-form-item label="业务属性" prop="binSection">
  112. <el-select v-model="ruleForm.binSection" placeholder="请选择业务属性" @change="changeBinsection">
  113. <el-option
  114. v-for="item in moduleData"
  115. :key="item.id"
  116. :label="item.sectionName"
  117. :value="item.id">
  118. </el-option>
  119. </el-select>
  120. </el-form-item>
  121. <el-form-item label="考评规则" prop="evaluateRule">
  122. <el-select v-model="ruleForm.evaluateRule" multiple collapse-tags placeholder="请选择考评规则" @change="changeRule">
  123. <el-option
  124. v-for="item in ruleDataAll"
  125. :key="item.id"
  126. :label="item.ruleName"
  127. :value="item.id">
  128. </el-option>
  129. </el-select>
  130. </el-form-item>
  131. <el-form-item label="业务阶段">
  132. <el-select v-model="ruleForm.binStage" multiple placeholder="请选择业务阶段" disabled>
  133. <el-option
  134. v-for="item in stageData"
  135. :key="item.id"
  136. :label="item.stageName"
  137. :value="item.id">
  138. </el-option>
  139. </el-select>
  140. </el-form-item>
  141. <el-form-item label="考评周期" prop="evaluationCycle">
  142. <el-select v-model="ruleForm.evaluationCycle" placeholder="请选择业务阶段">
  143. <el-option
  144. v-for="item in periodData"
  145. :key="item.keyValue"
  146. :label="item.keyName"
  147. :value="item.keyValue">
  148. </el-option>
  149. </el-select>
  150. </el-form-item>
  151. <el-form-item label="是否考评">
  152. <el-radio-group v-model="ruleForm.isCheck">
  153. <el-radio border label="是" />
  154. <el-radio border label="否" />
  155. </el-radio-group>
  156. </el-form-item>
  157. <el-form-item label="生产经营权重" prop="scjyWeight">
  158. <el-input-number v-model="ruleForm.scjyWeight" :precision="2" :step="0.1" :min="0" :max="1" placeholder="请输入生产经营权重" />
  159. </el-form-item>
  160. <el-form-item label="前期权重" prop="qqWeight">
  161. <el-input-number v-model="ruleForm.qqWeight" :precision="2" :step="0.1" :min="0" :max="1" placeholder="请输入前期权重" />
  162. </el-form-item>
  163. <el-form-item label="基建权重" prop="jjWeight">
  164. <el-input-number v-model="ruleForm.jjWeight" :precision="2" :step="0.1" :min="0" :max="1" placeholder="请输入基建权重" />
  165. </el-form-item>
  166. <!-- <el-form-item label="年份" prop="year">
  167. <el-date-picker
  168. v-model="ruleForm.year"
  169. type="year"
  170. value-format="YYYY"
  171. placeholder="请选择年份"
  172. />
  173. </el-form-item>
  174. <el-form-item label="月份">
  175. <el-input-number v-model="ruleForm.month" :min="1" :max="12" />
  176. </el-form-item> -->
  177. <el-form-item label="指标顺序">
  178. <el-input-number v-model="ruleForm.orderNum" :min="1" />
  179. </el-form-item>
  180. </el-form>
  181. </div>
  182. <template #footer>
  183. <span class="dialog-footer">
  184. <el-button @click="dialogVisible = false">取 消</el-button>
  185. <el-button type="primary" @click="saveevaluationCompanyMsg('ruleForm')">确 定</el-button>
  186. </span>
  187. </template>
  188. </el-dialog>
  189. </div>
  190. <indicator-item ref="indicatorItem"></indicator-item>
  191. </div>
  192. <import-dailog ref="importPage" @successImport="successImport" @importLoading="importLoading"></import-dailog>
  193. </div>
  194. </template>
  195. <script>
  196. import importDailog from '../importPage/importDailog.vue'
  197. import btns from '../elbuttonS.vue'
  198. import {apiGetOrganizationList, apiGetorganizationSaveList, apiGetorganizationdeleteList,apiGetorganizationgetTree,
  199. apiGetdatadictionaryList, apiGetbinstageList,apiGetbinsectionList, apiGetevaluateListAll} from '../../api/api'
  200. export default {
  201. components: { importDailog, btns },
  202. data() {
  203. return {
  204. dialogVisible: false,
  205. title: '',
  206. isSave: false,
  207. changeDateSelect: [],
  208. indicatoroptions: [],
  209. companyS: '',
  210. evaluationCompanyData:[],
  211. moduleData: [],
  212. stageData: [],
  213. ruleDataAll: [],
  214. periodData: [],
  215. ruleForm: {
  216. organizationName: '',
  217. evaluateRule: [],
  218. binSection: '',
  219. binStage: [],
  220. evaluationCycle: '',
  221. isCheck: '是',
  222. scjyWeight: 0,
  223. qqWeight: 0,
  224. jjWeight: 0,
  225. // year: '',
  226. // month: 1,
  227. orderNum: 1
  228. },
  229. rules: {
  230. organizationName: [
  231. { required: true, message: '请选择单位名称', trigger: 'change' }
  232. ],
  233. binSection: [
  234. { required: true, message: '请选择业务属性', trigger: 'change' }
  235. ],
  236. evaluateRule: [
  237. { required: true, message: '请选择考评规则', trigger: 'change' }
  238. ],
  239. evaluationCycle: [
  240. { required: true, message: '请选择考评周期', trigger: 'change' }
  241. ],
  242. year: [
  243. { required: true, message: '请选择年份', trigger: 'change' }
  244. ]
  245. },
  246. page:{
  247. pagesize: 12,
  248. currentPage: 1,
  249. total: 0
  250. },
  251. evalradio: {},
  252. loadingImport: false,
  253. companyDatas: []
  254. }
  255. },
  256. created() {
  257. this.getEvalCompanyData()
  258. this.getRuleallData()
  259. this.getDataDictionary() //模块 阶段
  260. this.getPeriodData()
  261. this.getOrganizetionData(23031000, 2)
  262. },
  263. methods:{
  264. // 查询单位数据
  265. getEvalCompanyData() {
  266. let that = this
  267. let params = {
  268. pageNum: this.page.currentPage,
  269. pageSize: this.page.pagesize,
  270. organizationType: 'DWKP',
  271. organizationName: that.companyS
  272. }
  273. apiGetOrganizationList(params).then(datas =>{
  274. if (datas && datas.data) {
  275. that.evaluationCompanyData = datas.data.records
  276. that.page.total = datas.data.total
  277. }
  278. })
  279. },
  280. //查询组织数据
  281. getOrganizetionData(id, num) {
  282. let that = this
  283. let params = {
  284. id: id,
  285. num: num
  286. }
  287. apiGetorganizationgetTree(params).then(datas =>{
  288. if (datas && datas.data && datas.data[0].children.length>0) {
  289. that.companyDatas = datas.data[0].children
  290. }
  291. })
  292. },
  293. // 查询规则模块和阶段数据
  294. getDataDictionary() {
  295. let that = this
  296. apiGetbinsectionList().then(datas =>{
  297. if (datas && datas.data) {
  298. that.moduleData = datas.data
  299. }
  300. })
  301. apiGetbinstageList().then(datas =>{
  302. if (datas && datas.data) {
  303. that.stageData = datas.data
  304. }
  305. })
  306. },
  307. getRuleallData(val) {
  308. let that = this
  309. let params = {
  310. // pageNum: 1,
  311. // pageSize: 50,
  312. binSection: val
  313. }
  314. apiGetevaluateListAll(params).then(datas =>{
  315. if (datas && datas.data) {
  316. that.ruleDataAll = datas.data
  317. }
  318. })
  319. },
  320. //考评周期
  321. getPeriodData() {
  322. let that = this
  323. let params = {
  324. superKey: 'KPZQ0001'
  325. }
  326. apiGetdatadictionaryList(params).then(datas =>{
  327. if (datas && datas.data) {
  328. that.periodData = datas.data
  329. }
  330. })
  331. },
  332. changeBinsection(val) {
  333. this.getRuleallData(val)
  334. },
  335. changeRule(val) {
  336. let binStageArr = []
  337. for(let i =0; i<this.ruleDataAll.length; i++) {
  338. let item = this.ruleDataAll[i]
  339. for(let j =0; j<val.length; j++) {
  340. let itn = val[j]
  341. if (item.id === itn) {
  342. binStageArr.push(item.binStage)
  343. }
  344. }
  345. }
  346. this.ruleForm.binStage = this.useFilter(binStageArr)
  347. },
  348. useFilter(arr) {
  349. return arr.filter(function(item,index){
  350. return arr.indexOf(item) === index; // 因为indexOf 只能查找到第一个
  351. })
  352. },
  353. handleAdd() {
  354. this.dialogVisible = true
  355. this.isSave = false
  356. this.title = '新增考评单位'
  357. this.$nextTick(() =>{
  358. // this.$refs['ruleForm'].resetFields()
  359. this.ruleForm = {
  360. organizationName: '',
  361. evaluateRule: [],
  362. binSection: '',
  363. binStage: [],
  364. evaluationCycle: '',
  365. isCheck: '是',
  366. scjyWeight: 0,
  367. qqWeight: 0,
  368. jjWeight: 0,
  369. // year: '',
  370. // month: 1,
  371. orderNum: 1
  372. }
  373. })
  374. },
  375. handleEdit() {
  376. this.dialogVisible = true
  377. this.isSave = true
  378. this.title = '修改考评单位'
  379. this.evalradio = this.changeDateSelect[0]
  380. this.ruleForm = {
  381. organizationName: this.evalradio.organizationId,
  382. evaluationCycle: this.evalradio.evaluationCycle,
  383. evaluateRule: this.evalradio.evaluateRuleId.split(','),
  384. binSection: this.evalradio.binSection,
  385. binStage: this.evalradio.binStage.split(','),
  386. isCheck: this.evalradio.isCheck?'是':'否',
  387. scjyWeight: this.evalradio.scjyWeight,
  388. qqWeight: this.evalradio.qqWeight,
  389. jjWeight: this.evalradio.jjWeight,
  390. // year: this.evalradio.year,
  391. // month: this.evalradio.month,
  392. orderNum: this.evalradio.orderNum
  393. }
  394. },
  395. saveevaluationCompanyMsg(formName) {
  396. let that = this
  397. that.$refs[formName].validate((valid) => {
  398. if (valid) {
  399. that.saveAndEditIndicatorData()
  400. }
  401. });
  402. },
  403. //新增/修改指标数据
  404. saveAndEditIndicatorData() {
  405. let that = this
  406. let orgName = ''
  407. that.companyDatas.forEach(item =>{
  408. if (item.id === that.ruleForm.organizationName) {
  409. orgName = item.name
  410. }
  411. })
  412. let params = {
  413. organizationName: orgName,
  414. evaluationCycle: that.ruleForm.evaluationCycle,
  415. organizationType: 'DWKP',
  416. evaluateRuleId: that.ruleForm.evaluateRule.join(','),
  417. binSection: that.ruleForm.binSection,
  418. binStage: that.ruleForm.binStage.join(','),
  419. orderNum: that.ruleForm.orderNum,
  420. isCheck: that.ruleForm.isCheck === '是'?true:false,
  421. scjyWeight: that.ruleForm.scjyWeight,
  422. qqWeight: that.ruleForm.qqWeight,
  423. jjWeight: that.ruleForm.jjWeight,
  424. // year: that.ruleForm.year,
  425. // month: that.ruleForm.month
  426. }
  427. if (that.isSave) {
  428. params.id = this.evalradio.id
  429. params.organizationId = that.evalradio.organizationId
  430. } else {
  431. params.organizationId = that.ruleForm.organizationName
  432. }
  433. apiGetorganizationSaveList(params).then(datas =>{
  434. if (!datas.success) {
  435. that.$message({
  436. message: datas.message,
  437. type: 'error'
  438. });
  439. } else {
  440. if (!that.isSave) {
  441. that.$message({
  442. message: '考评单位新增成功',
  443. type: 'success'
  444. });
  445. } else {
  446. that.$message({
  447. message: '考评单位修改成功',
  448. type: 'success'
  449. });
  450. }
  451. that.dialogVisible = false
  452. that.changeDateSelect = []
  453. that.getEvalCompanyData()
  454. }
  455. })
  456. },
  457. //删除指标数据
  458. handleDelete() {
  459. this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
  460. confirmButtonText: '确定',
  461. cancelButtonText: '取消',
  462. type: 'warning'
  463. }).then(() => {
  464. let that = this
  465. let paramsArr = []
  466. that.changeDateSelect.forEach(it =>{
  467. paramsArr.push(it.id)
  468. })
  469. apiGetorganizationdeleteList(paramsArr.join(',')).then(datas =>{
  470. if (datas) {
  471. that.$message({
  472. type: 'success',
  473. message: '删除成功!'
  474. });
  475. that.changeDateSelect = []
  476. that.getEvalCompanyData()
  477. }
  478. })
  479. })
  480. },
  481. rowClick(selection, row) {
  482. this.changeDateSelect = selection
  483. },
  484. getSeachData() {
  485. this.page.currentPage = 1
  486. this.getEvalCompanyData()
  487. },
  488. resetSeach() {
  489. this.page.currentPage = 1
  490. this.companyS = ''
  491. this.getEvalCompanyData()
  492. },
  493. successImport(val) {
  494. this.loadingImport = false
  495. this.getEvalCompanyData()
  496. },
  497. importLoading(val) {
  498. this.loadingImport = true
  499. },
  500. handleSizeChange(val){
  501. this.page.pagesize = val
  502. this.getEvalCompanyData()
  503. },
  504. handleCurrentChange(val){
  505. this.page.currentPage =val
  506. this.getEvalCompanyData()
  507. },
  508. handleImport() {
  509. this.$refs.importPage.upload.title = "考评指标管理信息导入"
  510. this.$refs.importPage.upload.open = true
  511. },
  512. }
  513. }
  514. </script>
  515. <style lang="less">
  516. .evaluationCompany{
  517. .evaluationCompanyBtn{
  518. .collectSeach{
  519. display: flex;
  520. padding: 24px 20px;
  521. border-bottom: 1px solid#D6DBEA;
  522. .exceed{
  523. display: flex;
  524. .exceedSpan{
  525. width: 100px;
  526. height: 12px;
  527. font-size: 14px;
  528. font-family: Microsoft YaHei;
  529. font-weight: 400;
  530. color: #8991B0;
  531. line-height: 12px;
  532. margin-top: 10px;
  533. }
  534. .el-input{
  535. margin-right:10px;
  536. .el-input__inner{
  537. height:30px;
  538. }
  539. .el-input__suffix{
  540. .el-select__caret{
  541. line-height:30px;
  542. }
  543. }
  544. }
  545. }
  546. .el-select{
  547. margin-right:10px;
  548. .el-input__inner{
  549. height:30px;
  550. }
  551. .el-input__suffix{
  552. .el-select__caret{
  553. line-height:30px;
  554. }
  555. }
  556. }
  557. }
  558. span{
  559. font-size:14px;
  560. }
  561. .PeriodBtn{
  562. display: flex;
  563. justify-content: end;
  564. padding: 20px 0;
  565. }
  566. .el-button{
  567. height: 30px;
  568. // width:100px;
  569. padding: 0 30px ;
  570. // padding-top: 8px;
  571. span{
  572. margin:0;
  573. }
  574. }
  575. .indexdialog{
  576. .el-overlay{
  577. .el-dialog{
  578. .el-dialog__body{
  579. padding: 30px 60px 30px 20px !important;
  580. .periodFrom{
  581. .el-select, .el-input{
  582. width: 100%;
  583. }
  584. .el-input{
  585. height: 30px;
  586. }
  587. }
  588. }
  589. }
  590. }
  591. }
  592. }
  593. .evaluationCompanyTableData{
  594. .el-table{
  595. .el-table__body-wrapper{
  596. height: 60vh !important;
  597. }
  598. .el-input__inner{
  599. height: 30px !important;
  600. }
  601. .el-radio__label{
  602. display: none;
  603. }
  604. .tooltipCC{
  605. width: 300px;
  606. display: inline-block;
  607. overflow: hidden;
  608. text-overflow: ellipsis;
  609. white-space: nowrap;
  610. }
  611. .indicitem{
  612. color: #409EFF;
  613. font-size: 12px;
  614. margin-right: 20px;
  615. cursor:pointer;
  616. &:hover{
  617. text-decoration: underline;
  618. }
  619. }
  620. }
  621. .el-pagination{
  622. margin-top: 20px;
  623. text-align: end;
  624. position: relative;
  625. }
  626. }
  627. }
  628. </style>