evaluationIndexPage.vue 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044
  1. <template>
  2. <div class="evaluationIndex" v-loading="loadingImport">
  3. <div class="evaluationIndexBtn">
  4. <div class="collectSeach" :style="$utils.collectSeachSty()">
  5. <div class="exceed">
  6. <span class="exceedSpan">指标名称:</span>
  7. <el-input v-model="indicatorIdS" placeholder="请输入指标名称"></el-input>
  8. </div>
  9. <div class="exceed">
  10. <span class="exceedSpan" style="width: 80px">业务属性:</span>
  11. <el-select v-model="binSectionIds" placeholder="请选择业务属性">
  12. <el-option
  13. v-for="item in moduleData"
  14. :key="item.id"
  15. :label="item.sectionName"
  16. :value="item.id">
  17. </el-option>
  18. </el-select>
  19. </div>
  20. <div class="exceed">
  21. <span class="exceedSpan" style="width: 80px;margin-left:10px">考评周期:</span>
  22. <el-select v-model="evaluationCycleStr" placeholder="请选择考评周期">
  23. <el-option
  24. v-for="item in periodData"
  25. :key="item.keyValue"
  26. :label="item.keyName"
  27. :value="item.keyValue"
  28. :disabled="item.keyValue === 'YDKP'">
  29. </el-option>
  30. </el-select>
  31. </div>
  32. <seachs @handleSeach="getSeachData" @handleRest="resetSeach"></seachs>
  33. </div>
  34. <div class="PeriodBtn" :style="$utils.PeriodBtnSty()">
  35. <!-- $utils.havePurview('evalIndex:oneLevel:save') -->
  36. <btns
  37. :showImport="false"
  38. :showExport="false"
  39. :showAdd="$utils.havePurview('evalIndex:oneLevel:add')"
  40. :showSave="$utils.havePurview('evalIndex:oneLevel:save')"
  41. :showDelete="$utils.havePurview('evalIndex:oneLevel:delete')"
  42. :disSave="changeDateSelect.length === 0 || changeDateSelect.length>1"
  43. :disDelete="changeDateSelect.length === 0"
  44. :disImport="true"
  45. :disExport="true"
  46. @handleAdd="handleAdd"
  47. @handleEdit="handleEdit"
  48. @handleDelete="handleDelete"
  49. @handleImport="handleImport"
  50. @handleExport="handleExport"
  51. ></btns>
  52. </div>
  53. <div class="evaluationIndexTableData">
  54. <el-table :data="evaluationIndexData" style="width: 100%" :class="evaluationIndexTableSty()"
  55. @select="rowClick" @select-all="rowClick" @row-dblclick="editEvaluaIndex">
  56. <el-table-column type="selection" label="操作" align="center"></el-table-column>
  57. <el-table-column label="指标编码" prop="indicatorCode" width="200" />
  58. <el-table-column label="业务属性" prop="binSectionName" />
  59. <el-table-column label="业务阶段" prop="binStageName" />
  60. <el-table-column label="指标类型" prop="indicatorTypeName" width="200" />
  61. <el-table-column label="指标名称" prop="indicatorName" width="300" />
  62. <el-table-column label="考评周期" prop="evaluationCycle" />
  63. <el-table-column label="指标单位" prop="unit" />
  64. <!-- <el-table-column label="公司" prop="company" /> -->
  65. <!-- <el-table-column label="部门" prop="deptName" width="150" /> -->
  66. <el-table-column label="是否专项" prop="isAdditional" />
  67. <!-- <el-table-column label="是否量化" prop="isQuantified" /> -->
  68. <!-- <el-table-column label="是否子指标">
  69. <template #default="scope">
  70. <span>{{scope.row.isChild === true?'是':'否'}}</span>
  71. </template>
  72. </el-table-column> -->
  73. <el-table-column label="描述" width="250">
  74. <template #default="scope">
  75. <span>{{scope.row.des}}</span>
  76. </template>
  77. </el-table-column>
  78. <!-- <el-table-column label="操作">
  79. <template #default="scope">
  80. <p class="indicitem" @click="editEvaluaIndex(scope.row)">详情</p>
  81. </template>
  82. </el-table-column> -->
  83. </el-table>
  84. <el-pagination
  85. @size-change="handleSizeChange"
  86. @current-change="handleCurrentChange"
  87. :current-page="page.currentPage"
  88. :page-size="page.pagesize"
  89. layout="total, prev, pager, next, jumper"
  90. :total="page.total">
  91. </el-pagination>
  92. </div>
  93. <div class="indexdialog">
  94. <el-dialog :title="title" v-model="dialogVisible" :fullscreen="true" :close-on-click-modal="false">
  95. <el-row class="periodFrom">
  96. <el-col :span="7">
  97. <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="DruleForm" :validate-on-rule-change="false">
  98. <el-form-item label="指标名称" prop="indicatorName">
  99. <el-input v-model="ruleForm.indicatorName" placeholder="请输入指标名称" @blur="blurInput"></el-input>
  100. </el-form-item>
  101. <el-form-item label="指标编码" prop="indicatorCode">
  102. <el-input v-model="ruleForm.indicatorCode" placeholder="请输入指标编码" :disabled="isSave" @blur="blurInput"></el-input>
  103. </el-form-item>
  104. <el-form-item label="指标类别" prop="indicatorType">
  105. <el-select v-model="ruleForm.indicatorType" placeholder="请选择指标类别">
  106. <el-option
  107. v-for="item in indicatorTypeData"
  108. :key="item.id"
  109. :label="item.typeName"
  110. :value="item.id">
  111. </el-option>
  112. </el-select>
  113. </el-form-item>
  114. <el-form-item label="指标单位" prop="indicatorUnit">
  115. <el-input v-model="ruleForm.indicatorUnit" placeholder="请输入指标单位"></el-input>
  116. </el-form-item>
  117. <el-form-item label="考评周期" prop="evaluationCycle">
  118. <el-select v-model="ruleForm.evaluationCycle" placeholder="请选择考评周期">
  119. <el-option
  120. v-for="item in periodData"
  121. :key="item.keyValue"
  122. :label="item.keyName"
  123. :value="item.keyValue"
  124. :disabled="item.keyValue === 'YDKP'">
  125. </el-option>
  126. </el-select>
  127. </el-form-item>
  128. <el-form-item label="所属部门" prop="department">
  129. <el-select v-model="ruleForm.department" placeholder="请选择所属部门">
  130. <el-option
  131. v-for="item in departData"
  132. :key="item.dataKey"
  133. :label="item.keyName"
  134. :value="item.dataKey">
  135. </el-option>
  136. </el-select>
  137. </el-form-item>
  138. <el-form-item label="业务阶段" prop="binStage">
  139. <el-select v-model="ruleForm.binStage" placeholder="请选择业务阶段">
  140. <el-option
  141. v-for="item in stageData"
  142. :key="item.id"
  143. :label="item.stageName"
  144. :value="item.id">
  145. </el-option>
  146. </el-select>
  147. </el-form-item>
  148. <el-form-item label="业务属性" prop="binSection">
  149. <el-select v-model="ruleForm.binSection" placeholder="请选择业务属性">
  150. <el-option
  151. v-for="item in moduleData"
  152. :key="item.id"
  153. :label="item.sectionName"
  154. :value="item.id">
  155. </el-option>
  156. </el-select>
  157. </el-form-item>
  158. <el-form-item label="是否量化">
  159. <el-radio-group v-model="ruleForm.isQuantified">
  160. <el-radio border label="是" />
  161. <el-radio border label="否" />
  162. </el-radio-group>
  163. </el-form-item>
  164. <el-form-item label="是否专项">
  165. <el-radio-group v-model="ruleForm.isAdditional">
  166. <el-radio border label="是" />
  167. <el-radio border label="否" />
  168. </el-radio-group>
  169. </el-form-item>
  170. <el-form-item label="是否子指标">
  171. <el-radio-group v-model="ruleForm.isChild" @change="changeRadio" :disabled="isSave">
  172. <el-radio border label="是" />
  173. <el-radio border label="否" />
  174. </el-radio-group>
  175. </el-form-item>
  176. <el-form-item label="指标顺序" prop="orderNum">
  177. <el-input-number v-model="ruleForm.orderNum" :min="1" />
  178. </el-form-item>
  179. <el-form-item label="描述" prop="desc">
  180. <el-input v-model="ruleForm.desc" :rows="5" type="textarea" placeholder="请输入描述"></el-input>
  181. </el-form-item>
  182. </el-form>
  183. </el-col>
  184. <el-col :span="17" class="indicatorItemBtn">
  185. <div class="PeriodBtnDia">
  186. <p class="indItemC">指标项配置管理</p>
  187. <el-button
  188. type="primary"
  189. size="mini"
  190. :disabled="ruleForm.isChild === '否'"
  191. @click="handleAddChild"
  192. >
  193. <img :src="addW" style="margin-right: 10px">
  194. <span>新增</span>
  195. </el-button>
  196. </div>
  197. <div class="indicatorItemTableData">
  198. <div class="datasMsg" v-if="indicatoroptions.length>0" >
  199. <el-collapse accordion>
  200. <el-collapse-item v-for="item in indicatoroptions" :key="item" :name="item.id">
  201. <template #title>
  202. <div style="display:flex;height:30px">
  203. <div style="display:flex;height:30px">
  204. <span class="nameTit">子指标名称:</span>
  205. <el-input v-model="item.childName" placeholder="请输入子指标项名称"></el-input>
  206. </div>
  207. <div style="display:flex">
  208. <span class="nameTit">子指标编码:</span>
  209. <el-input v-model="item.childCode" placeholder="请输入子指标项编码"></el-input>
  210. </div>
  211. </div>
  212. </template>
  213. <div style="padding:10px 20px;max-height: 50vh;overflow-y: auto;">
  214. <div class="tableBtn add" @click="handleAddTableChild(item)">
  215. <img :src="addIcon" alt="">
  216. <span>新增</span>
  217. </div>
  218. <el-table :data="item.list">
  219. <el-table-column label="序号" type="index" align="center" />
  220. <el-table-column label="指标项名称" prop="optionName">
  221. <template #default="scope">
  222. <el-select v-model="scope.row.optionName" filterable placeholder="请选择指标项名称" @change="(val)=>changeOptionName(val,scope.row)">
  223. <el-option
  224. v-for="item in indicItemoptions"
  225. :key="item.keyValue"
  226. :label="item.keyName"
  227. :value="item.keyName">
  228. </el-option>
  229. </el-select>
  230. </template>
  231. </el-table-column>
  232. <el-table-column label="指标项编码" prop="optionCode">
  233. <template #default="scope">
  234. <span>{{scope.row.optionCode}}</span>
  235. </template>
  236. </el-table-column>
  237. <el-table-column label="计算公式">
  238. <template #default="scope">
  239. <el-input v-model="scope.row.formula" :rows="1" type="textarea" placeholder="请输入计算公式"></el-input>
  240. </template>
  241. </el-table-column>
  242. <el-table-column label="是否显示">
  243. <template #default="scope">
  244. <el-select v-model="scope.row.isShow" placeholder="请选择是否显示">
  245. <el-option
  246. v-for="item in isShowEvaluation"
  247. :key="item.value"
  248. :label="item.label"
  249. :value="item.value">
  250. </el-option>
  251. </el-select>
  252. </template>
  253. </el-table-column>
  254. <el-table-column label="是否量化">
  255. <template #default="scope">
  256. <el-select v-model="scope.row.isQuantified" placeholder="请选择是否显示">
  257. <el-option
  258. v-for="item in isShowEvaluation"
  259. :key="item.value"
  260. :label="item.label"
  261. :value="item.value">
  262. </el-option>
  263. </el-select>
  264. </template>
  265. </el-table-column>
  266. <!-- <el-table-column label="描述">
  267. <template #default="scope">
  268. <el-input v-model="scope.row.des" :rows="1" type="textarea" placeholder="请输入描述"></el-input>
  269. </template>
  270. </el-table-column> -->
  271. <el-table-column label="排序">
  272. <template #default="scope">
  273. <el-input-number v-model="scope.row.optionOrder" :min="1" />
  274. </template>
  275. </el-table-column>
  276. <el-table-column label="操作" width="100">
  277. <template #default="scope">
  278. <p class="indicitem" @click="handleDeleteTableChild(item, scope.row)">删除</p>
  279. </template>
  280. </el-table-column>
  281. </el-table>
  282. </div>
  283. </el-collapse-item>
  284. </el-collapse>
  285. </div>
  286. <div v-else>
  287. <span class="emptyData">暂无数据</span>
  288. </div>
  289. </div>
  290. </el-col>
  291. </el-row>
  292. <template #footer>
  293. <span class="dialog-footer">
  294. <el-button @click="dialogVisible = false">取 消</el-button>
  295. <el-button type="primary" @click="saveEvaluationIndexMsg('ruleForm')">确 定</el-button>
  296. </span>
  297. </template>
  298. </el-dialog>
  299. </div>
  300. <indicator-item ref="indicatorItem"></indicator-item>
  301. </div>
  302. <import-dailog ref="importPage" @successImport="successImport" @importLoading="importLoading"></import-dailog>
  303. </div>
  304. </template>
  305. <script>
  306. import importDailog from '../importPage/importDailog.vue'
  307. import indicatorItem from './IndicatorItemPage.vue'
  308. import btns from '../elbuttonS.vue'
  309. import seachs from '../seachGroup.vue'
  310. import addW from '../../assets/btnIcon/addW.png'
  311. import saveW from '../../assets/btnIcon/saveW.png'
  312. import addIcon from '../../assets/btnIcon/add.png'
  313. import {apiGetIndicatorList, apiPostindicatorsaveGroup, apiGetIndicatorDelete,apiGetbinsectionList,apiGetIndicatordicdeleteList,
  314. apiGetIndicatorTypeList, apiGetdatadictionaryList, apiGetbinstageList, apiGetdataZBXList, apiGetIndidicselectById} from '../../api/api'
  315. export default {
  316. components: { importDailog, indicatorItem, btns, seachs },
  317. data() {
  318. return {
  319. dialogVisible: false,
  320. title: '',
  321. isSave: false,
  322. changeDateSelect: [],
  323. indicatorIdS: '',
  324. binSectionIds: '',
  325. evaluationCycleStr: '',
  326. evaluationIndexData:[],
  327. moduleData: [],
  328. stageData: [],
  329. departData: [],
  330. indicatorTypeData: [],
  331. periodData: [],
  332. ruleForm: {
  333. indicatorName: '',
  334. indicatorCode: '',
  335. indicatorType: '',
  336. indicatorUnit: '',
  337. evaluationCycle: '',
  338. department: '',
  339. binSection: '',
  340. binStage: '',
  341. isQuantified: '是',
  342. isAdditional: '否',
  343. isChild: '否',
  344. orderNum: 1,
  345. desc: ''
  346. },
  347. rules: {
  348. indicatorName: [
  349. { required: true, message: '请输入指标名称', trigger: 'blur' }
  350. ],
  351. indicatorCode: [
  352. { required: true, message: '请输入指标编码', trigger: 'blur' }
  353. ],
  354. indicatorType: [
  355. { required: true, message: '请选择指标类别', trigger: 'change' }
  356. ],
  357. indicatorUnit: [
  358. { required: true, message: '请输入指标单位', trigger: 'blur' }
  359. ],
  360. evaluationCycle: [
  361. { required: true, message: '请选择考评周期', trigger: 'change' }
  362. ],
  363. department: [
  364. { required: true, message: '请选择所属部门', trigger: 'change' }
  365. ],
  366. binSection: [
  367. { required: true, message: '请选择业务属性', trigger: 'change' }
  368. ],
  369. binStage: [
  370. { required: true, message: '请输入业务阶段', trigger: 'change' }
  371. ],
  372. orderNum: [
  373. { required: true, message: '请输入指标顺序', trigger: 'blur' }
  374. ],
  375. desc: [
  376. { required: true, message: '请输入描述', trigger: 'blur' }
  377. ]
  378. },
  379. page:{
  380. pagesize: 12,
  381. currentPage: 1,
  382. total: 0
  383. },
  384. evalradio: {},
  385. loadingImport: false,
  386. addW: addW,
  387. saveW: saveW,
  388. addIcon: addIcon,
  389. indicatoroptions: [],
  390. indicItemoptions: [],
  391. isShowEvaluation: [],
  392. winPix: window.devicePixelRatio,
  393. }
  394. },
  395. created() {
  396. this.isShowEvaluation = [
  397. {
  398. label: '是',
  399. value: true
  400. },
  401. {
  402. label: '否',
  403. value: false
  404. }
  405. ]
  406. this.getEvaluationData()
  407. this.getDataDictionary('BM0001') //部门//模块//阶段
  408. this.getindicatorTypeData()
  409. this.getindicItemData()
  410. this.getPeriodData()
  411. },
  412. methods:{
  413. // 查询指标数据
  414. getEvaluationData() {
  415. let that = this
  416. let params = {
  417. pageNum: that.page.currentPage,
  418. pageSize: that.page.pagesize,
  419. indicatorName: that.indicatorIdS,
  420. binSection: that.binSectionIds,
  421. evaluationCycle: that.evaluationCycleStr
  422. }
  423. // if (type) {
  424. // params.indicatorName = that.indicatorIdS
  425. // params.binSection = that.binSectionIds
  426. // }
  427. apiGetIndicatorList(params).then(datas =>{
  428. if (datas && datas.data) {
  429. that.evaluationIndexData = datas.data.records
  430. that.page.total = datas.data.total
  431. }
  432. })
  433. },
  434. // 查询指标类别
  435. getindicatorTypeData() {
  436. let that = this
  437. apiGetIndicatorTypeList().then(datas =>{
  438. if (datas && datas.data) {
  439. that.indicatorTypeData = datas.data
  440. }
  441. })
  442. },
  443. changeOptionName(val, row) {
  444. this.indicItemoptions.forEach(item =>{
  445. if (item.keyName === val) {
  446. row.optionCode = item.keyValue
  447. }
  448. })
  449. },
  450. // 查询指标项条目
  451. getindicItemData() {
  452. let that = this
  453. let params = {
  454. superKey: 'ZBX0001'
  455. }
  456. apiGetdataZBXList(params).then(datas =>{
  457. if (datas && datas.data) {
  458. that.indicItemoptions = datas.data
  459. }
  460. })
  461. },
  462. //考评周期
  463. getPeriodData() {
  464. let that = this
  465. let params = {
  466. superKey: 'KPZQ0001'
  467. }
  468. apiGetdatadictionaryList(params).then(datas =>{
  469. if (datas && datas.data) {
  470. that.periodData = datas.data
  471. }
  472. })
  473. },
  474. // 查询部门
  475. // 查询规则模块和阶段数据
  476. getDataDictionary(val) {
  477. let that = this
  478. let params = {
  479. superKey: val
  480. }
  481. apiGetdatadictionaryList(params).then(datas =>{
  482. if (datas && datas.data) {
  483. that.departData = datas.data
  484. }
  485. })
  486. apiGetbinsectionList().then(datas =>{
  487. if (datas && datas.data) {
  488. that.moduleData = datas.data
  489. }
  490. })
  491. apiGetbinstageList().then(datas =>{
  492. if (datas && datas.data) {
  493. that.stageData = datas.data
  494. }
  495. })
  496. },
  497. changeRadio(val) {
  498. if (val === '否') {
  499. if (this.indicatoroptions.length === 0) {
  500. if (this.ruleForm.indicatorName !== '' && this.ruleForm.indicatorCode !== '') {
  501. let childitemForm = {
  502. childName: this.ruleForm.indicatorName,
  503. childCode: this.ruleForm.indicatorCode,
  504. list: []
  505. }
  506. this.indicatoroptions.push(childitemForm)
  507. }
  508. }
  509. } else {
  510. this.indicatoroptions = []
  511. }
  512. },
  513. blurInput(val) {
  514. if (this.ruleForm.isChild === '否') {
  515. if (this.indicatoroptions.length === 0) {
  516. if (this.ruleForm.indicatorName !== '' && this.ruleForm.indicatorCode !== '') {
  517. let childitemForm = {
  518. childName: this.ruleForm.indicatorName,
  519. childCode: this.ruleForm.indicatorCode,
  520. list: []
  521. }
  522. this.indicatoroptions.push(childitemForm)
  523. }
  524. }
  525. }
  526. },
  527. //新增子指标
  528. handleAddTableChild(row) {
  529. let childitemForm = {
  530. optionName: '',
  531. optionCode: '',
  532. isShow: true,
  533. isQuantified: true
  534. }
  535. row.list.push(childitemForm)
  536. },
  537. handleAdd() {
  538. this.dialogVisible = true
  539. this.isSave = false
  540. this.title = '新增考评指标'
  541. this.$nextTick(() =>{
  542. this.$refs['ruleForm'].resetFields()
  543. this.ruleForm = {
  544. indicatorName: '',
  545. indicatorCode: '',
  546. indicatorType: '',
  547. indicatorUnit: '',
  548. evaluationCycle: '',
  549. department: '',
  550. binSection: '',
  551. binStage: '',
  552. isQuantified: '是',
  553. isAdditional: '否',
  554. isChild: '否',
  555. orderNum: 1,
  556. desc: ''
  557. }
  558. this.indicatoroptions = []
  559. })
  560. },
  561. handleEdit() {
  562. this.dialogVisible = true
  563. this.isSave = true
  564. this.title = '修改考评指标'
  565. this.evalradio = this.changeDateSelect[0]
  566. this.ruleForm = {
  567. indicatorName: this.evalradio.indicatorName,
  568. indicatorCode: this.evalradio.indicatorCode,
  569. indicatorType: this.evalradio.indicatorTypeId,
  570. indicatorUnit: this.evalradio.unit,
  571. evaluationCycle: this.evalradio.evaluationCycle,
  572. department: this.evalradio.deptId,
  573. binSection: this.evalradio.binSection,
  574. binStage: this.evalradio.binStage,
  575. isQuantified: this.evalradio.isQuantified,
  576. isAdditional: this.evalradio.isAdditional,
  577. isChild: this.evalradio.isChild === true? '是': '否',
  578. orderNum: this.evalradio.orderNum,
  579. desc: this.evalradio.des
  580. }
  581. this.getIndidicselectById(this.evalradio.id)
  582. },
  583. // 根据指标id获取主子指标-list
  584. getIndidicselectById(id) {
  585. let that = this
  586. let params = {
  587. id: id
  588. }
  589. apiGetIndidicselectById(params).then(datas =>{
  590. if (datas && datas.data) {
  591. that.indicatoroptions = datas.data.dtoList
  592. }
  593. })
  594. },
  595. //新增子指标
  596. handleAddChild() {
  597. this.$nextTick(() =>{
  598. let itemForm = {
  599. childName: '输入子指标名称',
  600. childCode: '输入子指标编码',
  601. list: [],
  602. }
  603. this.indicatoroptions.push(itemForm)
  604. })
  605. },
  606. saveEvaluationIndexMsg(formName) {
  607. let that = this
  608. that.$refs[formName].validate((valid) => {
  609. if (valid) {
  610. that.saveAndEditIndicatorData()
  611. }
  612. });
  613. },
  614. //新增/修改指标数据
  615. saveAndEditIndicatorData() {
  616. let that = this
  617. let deptName = ''
  618. that.departData.forEach(item =>{
  619. if (item.dataKey === that.ruleForm.department) {
  620. deptName = item.keyName
  621. }
  622. })
  623. that.indicatoroptions.forEach(item =>{
  624. if (item.list.length>0) {
  625. item.list.forEach(itv =>{
  626. itv.formula = itv.formula ? encodeURI(itv.formula) : ''
  627. })
  628. }
  629. })
  630. let params = {
  631. indicatorName: that.ruleForm.indicatorName,
  632. indicatorCode: that.ruleForm.indicatorCode,
  633. indicatorTypeId: that.ruleForm.indicatorType,
  634. unit: that.ruleForm.indicatorUnit,
  635. evaluationCycle: that.ruleForm.evaluationCycle,
  636. deptId: that.ruleForm.department,
  637. deptName: deptName,
  638. binSection: that.ruleForm.binSection,
  639. binStage: that.ruleForm.binStage,
  640. isQuantified: that.ruleForm.isQuantified,
  641. isAdditional: that.ruleForm.isAdditional,
  642. isChild: that.ruleForm.isChild === '是'?true:false,
  643. orderNum: that.ruleForm.orderNum,
  644. des: that.ruleForm.desc,
  645. dtoList: that.indicatoroptions
  646. }
  647. if (that.isSave) {
  648. params.id = that.evalradio.id
  649. }
  650. apiPostindicatorsaveGroup(params).then(datas =>{
  651. if (!datas.success) {
  652. that.$message({
  653. message: datas.message,
  654. type: 'error'
  655. });
  656. } else {
  657. if (!that.isSave) {
  658. that.$message({
  659. message: '指标新增成功',
  660. type: 'success'
  661. });
  662. } else {
  663. that.$message({
  664. message: '指标修改成功',
  665. type: 'success'
  666. });
  667. }
  668. that.dialogVisible = false
  669. that.changeDateSelect = []
  670. that.getEvaluationData()
  671. }
  672. })
  673. },
  674. //删除指标数据
  675. handleDelete() {
  676. this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
  677. confirmButtonText: '确定',
  678. cancelButtonText: '取消',
  679. type: 'warning'
  680. }).then(() => {
  681. let that = this
  682. let paramsArr = []
  683. that.changeDateSelect.forEach(it =>{
  684. paramsArr.push(it.id)
  685. })
  686. apiGetIndicatorDelete(paramsArr.join(',')).then(datas =>{
  687. that.$message({
  688. type: 'success',
  689. message: '删除成功!'
  690. });
  691. that.getEvaluationData()
  692. that.changeDateSelect = []
  693. })
  694. })
  695. },
  696. //删除指标数据
  697. handleDeleteTableChild(data, row) {
  698. this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
  699. confirmButtonText: '确定',
  700. cancelButtonText: '取消',
  701. type: 'warning'
  702. }).then(() => {
  703. if (row.id) {
  704. let that = this
  705. let paramsArr = [row.id]
  706. apiGetIndicatordicdeleteList(paramsArr.join(',')).then(datas =>{
  707. that.$message({
  708. type: 'success',
  709. message: '删除成功!'
  710. });
  711. that.getIndidicselectById(this.evalradio.id)
  712. })
  713. } else {
  714. if (data.list && data.list.length>0) {
  715. data.list.forEach((it,index) =>{
  716. if (it.optionCode === row.optionCode) {
  717. data.list.splice(index, 1)
  718. }
  719. })
  720. }
  721. }
  722. })
  723. },
  724. rowClick(selection, row) {
  725. this.changeDateSelect = selection
  726. },
  727. getSeachData() {
  728. this.page.currentPage = 1
  729. this.getEvaluationData()
  730. },
  731. resetSeach() {
  732. this.page.currentPage = 1
  733. this.indicatorIdS = ''
  734. this.binSectionIds = ''
  735. this.evaluationCycleStr = ''
  736. this.getEvaluationData()
  737. },
  738. successImport(val) {
  739. this.loadingImport = false
  740. this.getEvaluationData()
  741. },
  742. importLoading(val) {
  743. this.loadingImport = true
  744. },
  745. handleSizeChange(val){
  746. this.page.pagesize = val
  747. this.getEvaluationData()
  748. },
  749. handleCurrentChange(val){
  750. this.page.currentPage =val
  751. this.getEvaluationData()
  752. },
  753. handleImport() {
  754. this.$refs.importPage.upload.title = "考评指标管理信息导入"
  755. this.$refs.importPage.upload.open = true
  756. },
  757. //指标项配置
  758. editEvaluaIndex(row) {
  759. this.dialogVisible = true
  760. this.title = '修改考评指标'
  761. this.isSave = true
  762. this.evalradio = row
  763. this.ruleForm = {
  764. indicatorName: row.indicatorName,
  765. indicatorCode: row.indicatorCode,
  766. indicatorType: row.indicatorTypeId,
  767. indicatorUnit: row.unit,
  768. evaluationCycle: row.evaluationCycle,
  769. department: row.deptId,
  770. binSection: row.binSection,
  771. binStage: row.binStage,
  772. isQuantified: row.isQuantified,
  773. isAdditional: row.isAdditional,
  774. isChild: row.isChild === true? '是': '否',
  775. orderNum: row.orderNum,
  776. desc: row.des
  777. }
  778. this.getIndidicselectById(row.id)
  779. },
  780. evaluationIndexTableSty() {
  781. if (this.winPix === 1.25) {
  782. return 'evalIndex125Table'
  783. } else {
  784. return 'evalIndex100Table'
  785. }
  786. }
  787. }
  788. }
  789. </script>
  790. <style lang="less">
  791. .evaluationIndex{
  792. .evaluationIndexBtn{
  793. .collectSeach{
  794. display: flex;
  795. padding: 24px 20px;
  796. border-bottom: 1px solid#D6DBEA;
  797. .exceed{
  798. display: flex;
  799. .exceedSpan{
  800. width: 100px;
  801. height: 12px;
  802. font-size: 14px;
  803. font-family: Microsoft YaHei;
  804. font-weight: 400;
  805. color: #8991B0;
  806. line-height: 12px;
  807. margin-top: 14px;
  808. }
  809. .el-input{
  810. margin-right:10px;
  811. .el-input__inner{
  812. height:30px;
  813. }
  814. .el-input__suffix{
  815. .el-select__caret{
  816. line-height:30px;
  817. }
  818. }
  819. }
  820. .el-select{
  821. line-height: 40px !important;
  822. .el-input__inner, .is-disabled{
  823. height:40px !important;
  824. }
  825. .el-input__suffix{
  826. .el-select__caret{
  827. line-height:40px;
  828. }
  829. }
  830. }
  831. }
  832. }
  833. span{
  834. font-size:14px;
  835. }
  836. .PeriodBtn{
  837. display: flex;
  838. justify-content: end;
  839. padding: 20px 0;
  840. }
  841. .el-button{
  842. height: 30px;
  843. // width:100px;
  844. padding: 0 30px ;
  845. // padding-top: 8px;
  846. span{
  847. margin:0;
  848. }
  849. }
  850. .indexdialog{
  851. .el-overlay{
  852. .el-dialog{
  853. .el-dialog__body{
  854. padding: 0px 20px 0px 20px !important;
  855. border-top: 1px solid #D6DBEA;
  856. border-bottom: 1px solid #D6DBEA;
  857. .periodFrom{
  858. .el-select, .el-input{
  859. width: 100%;
  860. }
  861. .el-select{
  862. .el-input__inner, .is-disabled{
  863. height:30px !important;
  864. }
  865. }
  866. .DruleForm{
  867. padding: 20px 60px 20px 20px;
  868. }
  869. .indicatorItemBtn{
  870. padding: 10px 20px 0 20px;
  871. border-left: 1px solid #D6DBEA;
  872. span{
  873. font-size:14px;
  874. }
  875. .PeriodBtnDia{
  876. display: flex;
  877. justify-content: space-between;
  878. padding: 20px 0;
  879. .indItemC{
  880. position: relative;
  881. // left: -600px;
  882. top: 15px;
  883. font-size: 16px;
  884. font-family: Microsoft YaHei;
  885. font-weight: 600;
  886. color: #3B7AD1;
  887. }
  888. .el-button{
  889. height: 30px;
  890. padding: 0 30px ;
  891. span{
  892. margin:0;
  893. }
  894. }
  895. .is-disabled{
  896. opacity: 0.5;
  897. }
  898. }
  899. .indicatorItemTableData{
  900. // max-height: 75vh !important;
  901. height: 75vh !important;
  902. overflow-y: auto;
  903. .datasMsg{
  904. .tableBtn {
  905. display: flex;
  906. justify-content: end;
  907. margin-right: 30px;
  908. img{
  909. margin-right: 5px;
  910. margin-top: 1px;
  911. width: 18px;
  912. height: 18px;
  913. }
  914. span{
  915. position: relative;
  916. top: -2px;
  917. font-size: 14px;
  918. font-family: Microsoft YaHei;
  919. font-weight: 400;
  920. }
  921. }
  922. .add{
  923. cursor: pointer;
  924. span{
  925. color: #3B7AD1;
  926. }
  927. }
  928. .el-collapse{
  929. .el-collapse-item{
  930. .el-collapse-item__header{
  931. .nameTit{
  932. display: inline-block;
  933. height: 20px;
  934. font-size: 12px;
  935. font-weight: bold;
  936. position: relative;
  937. top: -8px;
  938. }
  939. .el-input{
  940. width: 150px;
  941. margin-right: 10px;
  942. }
  943. }
  944. .el-table{
  945. .el-table__body-wrapper{
  946. }
  947. .el-input__inner{
  948. height: 30px !important;
  949. }
  950. .el-radio__label{
  951. display: none;
  952. }
  953. }
  954. .indicitem{
  955. color: #409EFF;
  956. font-size: 12px;
  957. margin-right: 20px;
  958. cursor:pointer;
  959. &:hover{
  960. text-decoration: underline;
  961. }
  962. }
  963. .el-pagination{
  964. margin-top: 20px;
  965. text-align: end;
  966. position: relative;
  967. }
  968. .el-button{
  969. height: 26px;
  970. padding: 0 15px ;
  971. span{
  972. margin:0;
  973. }
  974. }
  975. }
  976. }
  977. }
  978. .emptyData{
  979. display: inline-block;
  980. width: 100%;
  981. // border: 1px solid #d9d9d9;
  982. text-align: center;
  983. margin-top: 50px;
  984. }
  985. }
  986. }
  987. }
  988. }
  989. .el-dialog__footer{
  990. .dialog-footer{
  991. display: flex;
  992. justify-content: center;
  993. .el-button{
  994. width: 180px !important;
  995. height: 40px !important;
  996. }
  997. }
  998. }
  999. }
  1000. }
  1001. }
  1002. }
  1003. .evaluationIndexTableData{
  1004. .evalIndex125Table{
  1005. .el-table__body-wrapper{
  1006. height: 53vh !important;
  1007. }
  1008. }
  1009. .evalIndex100Table{
  1010. .el-table__body-wrapper{
  1011. height: 60vh !important;
  1012. }
  1013. }
  1014. .el-table{
  1015. .el-input__inner{
  1016. height: 30px !important;
  1017. }
  1018. .el-radio__label{
  1019. display: none;
  1020. }
  1021. .indicitem{
  1022. color: #409EFF;
  1023. font-size: 12px;
  1024. margin-right: 20px;
  1025. cursor:pointer;
  1026. &:hover{
  1027. text-decoration: underline;
  1028. }
  1029. }
  1030. }
  1031. .el-pagination{
  1032. margin-top: 20px;
  1033. text-align: end;
  1034. position: relative;
  1035. }
  1036. }
  1037. }
  1038. </style>