partyBuildingKPage.vue 17 KB

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