partyBuildingKPage.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  1. <template>
  2. <div class="partyBuildingK" v-loading="loadingImport">
  3. <div class="partyBuildingBtn">
  4. <div class="collectSeach">
  5. <div class="exceed">
  6. <span class="exceedSpan">业务属性:</span>
  7. <el-select v-model="sectionStr" placeholder="请选择业务属性">
  8. <el-option
  9. v-for="item in moduleData"
  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">考评时间:</span>
  18. <el-date-picker v-model="resAnnual" value-format="YYYY" type="year" placeholder="选择时间" />
  19. </div>
  20. <seachs @handleSeach="getSeachData" @handleRest="resetSeach"></seachs>
  21. </div>
  22. <div class="PeriodBtn">
  23. <btns
  24. :showImport="true"
  25. :showExport="true"
  26. :showAdd="$utils.havePurview('partBuildK:oneLevel:add')"
  27. :showSave="$utils.havePurview('partBuildK:oneLevel:save')"
  28. :showDelete="$utils.havePurview('partBuildK:oneLevel:delete')"
  29. :disSave="changeDateSelect.length === 0 || changeDateSelect.length>1"
  30. :disDelete="changeDateSelect.length === 0"
  31. :disImport="false"
  32. :disExport="false"
  33. @handleAdd="handleAdd"
  34. @handleEdit="handleEdit"
  35. @handleDelete="handleDelete"
  36. @handleImport="handleImport"
  37. @handleExport="handleExport"
  38. ></btns>
  39. </div>
  40. <div class="partyBuildingTableData">
  41. <el-table :data="partyBuildingData" style="width: 100%" @select="rowClick" @select-all="rowClick">
  42. <el-table-column type="selection" label="操作" align="center"></el-table-column>
  43. <el-table-column label="序号" type="index" />
  44. <el-table-column label="单位名称" prop="organizationName" width="300" />
  45. <el-table-column label="业务属性" prop="sectionName" />
  46. <el-table-column label="年度" prop="year" />
  47. <el-table-column label="党建系数" prop="multiplier">
  48. <template #default="scope">
  49. <span>{{scope.row.multiplier}}</span>
  50. </template>
  51. </el-table-column>
  52. <el-table-column label="备注" prop="remarks" width="350" />
  53. </el-table>
  54. <el-pagination
  55. @size-change="handleSizeChange"
  56. @current-change="handleCurrentChange"
  57. :current-page="page.currentPage"
  58. :page-size="page.pagesize"
  59. layout="total, prev, pager, next, jumper"
  60. :total="page.total">
  61. </el-pagination>
  62. </div>
  63. <el-dialog :title="title" v-model="dialogVisible" width="600px" :close-on-click-modal="false">
  64. <div class="periodFrom">
  65. <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm" :validate-on-rule-change="false">
  66. <el-form-item label="单位名称" prop="organizationName">
  67. <el-select v-model="ruleForm.organizationName" filterable placeholder="请选择单位名称">
  68. <el-option
  69. v-for="item in companyDatas"
  70. :key="item.id"
  71. :label="item.shortName"
  72. :value="item.id">
  73. </el-option>
  74. </el-select>
  75. </el-form-item>
  76. <el-form-item label="业务属性" prop="sectionName">
  77. <el-select v-model="ruleForm.sectionName" placeholder="请选择业务属性">
  78. <el-option
  79. v-for="item in moduleData"
  80. :key="item.id"
  81. :label="item.sectionName"
  82. :value="item.id">
  83. </el-option>
  84. </el-select>
  85. </el-form-item>
  86. <el-form-item label="年份" prop="year">
  87. <el-date-picker
  88. v-model="ruleForm.year"
  89. type="year"
  90. value-format="YYYY"
  91. placeholder="请选择年份"
  92. />
  93. </el-form-item>
  94. <el-form-item label="党建系数" prop="multiplier">
  95. <el-input-number v-model="ruleForm.multiplier" :precision="2" :step="0.1" :min="0" :max="1" placeholder="请输入党建系数" />
  96. </el-form-item>
  97. <el-form-item label="描述" prop="remarks">
  98. <el-input v-model="ruleForm.remarks" :rows="5" type="textarea" placeholder="请输入描述"></el-input>
  99. </el-form-item>
  100. </el-form>
  101. </div>
  102. <template #footer>
  103. <span class="dialog-footer">
  104. <el-button @click="dialogVisible = false">取 消</el-button>
  105. <el-button type="primary" @click="saveevaluaStart('ruleForm')">确 定</el-button>
  106. </span>
  107. </template>
  108. </el-dialog>
  109. <indicator-item ref="indicatorItem"></indicator-item>
  110. </div>
  111. <import-dailog ref="importPage" @successImport="successImport"></import-dailog>
  112. </div>
  113. </template>
  114. <script>
  115. import importDailog from '../importPage/importDailog.vue'
  116. // import partyBuildingDetail from './partyBuildingKDetail.vue'
  117. import btns from '../elbuttonS.vue'
  118. import seachs from '../seachGroup.vue'
  119. import {apiGetpartybuildingList, apiDeletepartyBuildRemove,apiGetbinsectionList,
  120. apiGetorganizationgetTree, apiPostpartybuildSave} from '../../api/api'
  121. export default {
  122. components: { btns, importDailog, seachs },
  123. data() {
  124. return {
  125. dialogVisible: false,
  126. title: '',
  127. isSave: false,
  128. changeDateSelect: [],
  129. sectionStr: '',
  130. resAnnual: '',
  131. partyBuildingData:[],
  132. departmentDataAll: [],
  133. companyDatas: [],
  134. moduleData: [],
  135. ruleForm: {
  136. organizationName: '',
  137. sectionName: '',
  138. year: '',
  139. multiplier: 0,
  140. remarks: ''
  141. },
  142. rules: {
  143. organizationName: [
  144. { required: true, message: '请选择单位名称', trigger: 'change' }
  145. ],
  146. sectionName: [
  147. { required: true, message: '请选择业务属性', trigger: 'change' }
  148. ],
  149. year: [
  150. { required: true, message: '请选择年份', trigger: 'change' }
  151. ],
  152. multiplier: [
  153. { required: true, message: '请输入党建系数', trigger: 'blur' }
  154. ],
  155. remarks: [
  156. { required: true, message: '请输入描述', trigger: 'blur' }
  157. ]
  158. },
  159. page:{
  160. pagesize: 12,
  161. currentPage: 1,
  162. total: 0
  163. },
  164. evalradio: {},
  165. loadingImport: false
  166. }
  167. },
  168. created() {
  169. this.resAnnual = new Date().getFullYear().toString()
  170. this.getpartyBuildingData()
  171. this.getOrganizetionData()
  172. this.getBinSectionS()
  173. },
  174. methods:{
  175. getpartyBuildingData() {
  176. let that = this
  177. let params = {
  178. pageNum: that.page.currentPage,
  179. pageSize: that.page.pagesize,
  180. sectionId: that.sectionStr,
  181. year: that.resAnnual
  182. }
  183. apiGetpartybuildingList(params).then(datas =>{
  184. if (datas && datas.data) {
  185. that.partyBuildingData = datas.data.records
  186. that.page.total = datas.data.total
  187. }
  188. })
  189. },
  190. // 查询业务属性
  191. getBinSectionS() {
  192. let that = this
  193. apiGetbinsectionList().then(datas =>{
  194. if (datas && datas.data) {
  195. that.moduleData = datas.data
  196. }
  197. })
  198. },
  199. //查询组织数据
  200. getOrganizetionData() {
  201. let that = this
  202. let params = {
  203. id: '23031000',
  204. num: 1
  205. }
  206. apiGetorganizationgetTree(params).then(datas =>{
  207. if (datas && datas.data && datas.data[0].children.length>0) {
  208. that.companyDatas = datas.data[0].children
  209. }
  210. })
  211. },
  212. handleAdd() {
  213. this.dialogVisible = true
  214. this.isSave = false
  215. this.title = '新增党建考核系数'
  216. this.ruleForm = {
  217. organizationName: '',
  218. sectionName: '',
  219. year: '',
  220. multiplier: 0,
  221. remarks: ''
  222. }
  223. },
  224. handleEdit() {
  225. this.dialogVisible = true
  226. this.isSave = true
  227. this.title = '修改党建考核系数'
  228. this.evalradio = this.changeDateSelect[0]
  229. this.ruleForm = {
  230. organizationName: this.evalradio.departId,
  231. sectionName: this.evalradio.sectionId,
  232. year: this.evalradio.year,
  233. multiplier: this.evalradio.multiplier,
  234. remarks: this.evalradio.remarks
  235. }
  236. },
  237. saveevaluaStart(formName) {
  238. let that = this
  239. that.$refs[formName].validate((valid) => {
  240. if (valid) {
  241. that.saveAndEditpartBuildData()
  242. }
  243. });
  244. },
  245. saveAndEditpartBuildData() {
  246. let that = this
  247. let userMes = JSON.parse(window.sessionStorage.getItem('user'))
  248. let comName = ''
  249. that.companyDatas.forEach(item =>{
  250. if (item.id === that.ruleForm.organizationName) {
  251. comName = item.shortName
  252. }
  253. })
  254. let params = {
  255. departId: that.ruleForm.organizationName,
  256. organizationName: comName,
  257. sectionId: that.ruleForm.sectionName,
  258. year: that.ruleForm.year,
  259. multiplier: that.ruleForm.multiplier,
  260. remarks: that.ruleForm.remarks,
  261. createOrgId: userMes.unitId,
  262. createOrgName: userMes.unitName,
  263. createBy: userMes.id,
  264. createName: userMes.name
  265. }
  266. if (that.isSave) {
  267. params.id = that.evalradio.id
  268. }
  269. apiPostpartybuildSave(params).then(datas =>{
  270. if (!datas.success) {
  271. that.$message({
  272. message: datas.message,
  273. type: 'error'
  274. });
  275. } else {
  276. if (!that.isSave) {
  277. that.$message({
  278. message: '党建考核系数新增成功',
  279. type: 'success'
  280. });
  281. } else {
  282. that.$message({
  283. message: '党建考核系数修改成功',
  284. type: 'success'
  285. });
  286. }
  287. that.dialogVisible = false
  288. that.changeDateSelect = []
  289. that.getpartyBuildingData()
  290. }
  291. })
  292. },
  293. //删除指标数据
  294. handleDelete() {
  295. this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
  296. confirmButtonText: '确定',
  297. cancelButtonText: '取消',
  298. type: 'warning'
  299. }).then(() => {
  300. let that = this
  301. let paramsArr = []
  302. that.changeDateSelect.forEach(it =>{
  303. paramsArr.push(it.id)
  304. })
  305. apiDeletepartyBuildRemove(paramsArr.join(',')).then(datas =>{
  306. if (datas) {
  307. that.$message({
  308. type: 'success',
  309. message: '删除成功!'
  310. });
  311. that.changeDateSelect = []
  312. that.getpartyBuildingData()
  313. }
  314. })
  315. })
  316. },
  317. rowClick(selection, row) {
  318. this.changeDateSelect = selection
  319. },
  320. getSeachData() {
  321. this.page.currentPage = 1
  322. this.getpartyBuildingData()
  323. },
  324. resetSeach() {
  325. this.page.currentPage = 1
  326. this.sectionStr = ''
  327. this.resAnnual = ''
  328. this.getpartyBuildingData()
  329. },
  330. successImport(val) {
  331. this.loadingImport = false
  332. this.getpartyBuildingData()
  333. },
  334. handleSizeChange(val){
  335. this.page.pagesize = val
  336. this.getpartyBuildingData()
  337. },
  338. handleCurrentChange(val){
  339. this.page.currentPage =val
  340. this.getpartyBuildingData()
  341. },
  342. handleImport() {
  343. this.$refs.importPage.upload.title = "党建考核系数信息导入"
  344. this.$refs.importPage.upload.open = true
  345. this.$refs.importPage.upload.url = '/party-building-multiplier/import'
  346. },
  347. handleExport() {
  348. this.$utils.downloadPer('party-building-multiplier/export1', '党建考核系数信息数据.xlsx')
  349. },
  350. }
  351. }
  352. </script>
  353. <style lang="less">
  354. .partyBuildingK{
  355. .partyBuildingBtn{
  356. .collectSeach{
  357. display: flex;
  358. padding: 24px 20px;
  359. border-bottom: 1px solid#D6DBEA;
  360. .exceed{
  361. display: flex;
  362. .exceedSpan{
  363. width: 80px;
  364. height: 12px;
  365. font-size: 14px;
  366. font-family: Microsoft YaHei;
  367. font-weight: 400;
  368. color: #8991B0;
  369. line-height: 12px;
  370. margin-top: 14px;
  371. }
  372. .el-select{
  373. margin-right:10px;
  374. line-height: 40px !important;
  375. .el-input__inner, .is-disabled{
  376. height:40px !important;
  377. }
  378. .el-input__suffix{
  379. .el-select__caret{
  380. line-height:40px;
  381. }
  382. }
  383. }
  384. .el-input{
  385. margin-right:10px;
  386. height: 40px;
  387. .el-input__inner{
  388. height:40px;
  389. }
  390. .el-input__suffix{
  391. .el-select__caret{
  392. line-height:30px;
  393. }
  394. }
  395. }
  396. }
  397. }
  398. span{
  399. font-size:14px;
  400. }
  401. .PeriodBtn{
  402. display: flex;
  403. justify-content: end;
  404. padding: 20px 0;
  405. }
  406. .el-button{
  407. height: 30px;
  408. // width:100px;
  409. padding: 0 30px ;
  410. // padding-top: 8px;
  411. span{
  412. margin:0;
  413. }
  414. }
  415. .partyBuildingTableData{
  416. .el-table{
  417. .el-table__body-wrapper{
  418. height: 60vh !important;
  419. }
  420. .el-input__inner{
  421. height: 30px !important;
  422. }
  423. .el-radio__label{
  424. display: none;
  425. }
  426. .indicitem{
  427. color: #409EFF;
  428. font-size: 12px;
  429. margin-right: 20px;
  430. cursor:pointer;
  431. &:hover{
  432. text-decoration: underline;
  433. }
  434. }
  435. }
  436. .el-pagination{
  437. margin-top: 20px;
  438. text-align: end;
  439. position: relative;
  440. }
  441. }
  442. .el-overlay{
  443. .el-dialog{
  444. .el-dialog__body{
  445. padding: 30px 60px 30px 20px !important;
  446. .periodFrom{
  447. .el-select, .el-input{
  448. width: 100%;
  449. }
  450. .el-input{
  451. height: 30px;
  452. }
  453. }
  454. }
  455. }
  456. }
  457. }
  458. }
  459. </style>