index.vue 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282
  1. <template>
  2. <div class="app-container">
  3. <div class="app-containergt" style="padding: 0;">
  4. <el-row :gutter="10" class="mb8">
  5. <el-col :span="1.5">
  6. <el-button
  7. type="primary"
  8. plain
  9. icon="el-icon-plus"
  10. size="mini"
  11. @click="handleAdd"
  12. >添加报表</el-button>
  13. </el-col>
  14. <el-col :span="1.5">
  15. <el-button
  16. type="danger"
  17. plain
  18. icon="el-icon-delete"
  19. size="mini"
  20. :disabled="multiple"
  21. @click="handleDelete"
  22. >删除</el-button>
  23. </el-col>
  24. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  25. </el-row>
  26. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
  27. <el-form-item label="报表标题" prop="reportName">
  28. <el-input
  29. v-model="queryParams.reportName"
  30. placeholder="请输入报表标题"
  31. clearable
  32. size="small"
  33. @keyup.enter.native="handleQuery"
  34. />
  35. </el-form-item>
  36. <el-form-item label="开始时间:" prop="sTime">
  37. <el-date-picker
  38. v-model="queryParams.sTime"
  39. type="datetime"
  40. value-format="yyyy-MM-dd HH:mm:ss"
  41. format="yyyy-MM-dd HH:mm:ss"
  42. placeholder="选择日期">
  43. </el-date-picker>
  44. </el-form-item>
  45. <el-form-item label="截止时间:" prop="eTime">
  46. <el-date-picker
  47. v-model="queryParams.eTime"
  48. type="datetime"
  49. value-format="yyyy-MM-dd HH:mm:ss"
  50. format="yyyy-MM-dd HH:mm:ss"
  51. placeholder="选择日期">
  52. </el-date-picker>
  53. </el-form-item>
  54. <el-form-item label="状态" prop="status">
  55. <el-select v-model="queryParams.status" placeholder="状态" clearable size="small">
  56. <el-option
  57. v-for="dict in statusOptions"
  58. :key="dict.dictValue"
  59. :label="dict.dictLabel"
  60. :value="dict.dictValue"
  61. />
  62. </el-select>
  63. </el-form-item>
  64. <el-form-item>
  65. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  66. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  67. </el-form-item>
  68. </el-form>
  69. <el-table
  70. v-loading="loading"
  71. :data="reportList"
  72. row-key="id"
  73. default-expand-all
  74. :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
  75. @selection-change="handleSelectionChange" >
  76. <el-table-column type="selection" width="55" align="center" />
  77. <el-table-column prop="id" label="序号" width="60"></el-table-column>
  78. <el-table-column prop="reportName" label="标题" width="200" align="center"></el-table-column>
  79. <el-table-column label="开始时间" align="center" prop="startTime" width="180">
  80. <!-- <template slot-scope="scope">
  81. <span>{{ parseTime(scope.row.startTime) }}</span>
  82. </template> -->
  83. </el-table-column>
  84. <el-table-column label="截止时间" align="center" prop="endTime" width="180">
  85. <!-- <template slot-scope="scope">
  86. <span>{{ parseTime(scope.row.endTime) }}</span>
  87. </template> -->
  88. </el-table-column>
  89. <el-table-column label="当前状态" align="center" prop="reportStatus" width="100">
  90. <template slot-scope="scope">
  91. <span :class="[scope.row.reportStatus == 1 ? 'jheuy' : scope.row.reportStatus == 2? 'neuiq' : 'bgeyy']">{{scope.row.reportStatus == 1 ? '未开始' : scope.row.reportStatus == 2? '进行中' : '已结束' }}</span>
  92. </template>
  93. </el-table-column>
  94. <!-- //走字典 -->
  95. <el-table-column label="状态" align="center" key="status" >
  96. <!-- v-if="columns[5].visible" -->
  97. <template slot-scope="scope">
  98. <el-switch
  99. v-model="scope.row.status"
  100. active-value="2"
  101. inactive-value="1"
  102. @change="handleStatusChange(scope.row)"
  103. ></el-switch>
  104. </template>
  105. </el-table-column>
  106. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  107. <template slot-scope="scope">
  108. <el-button
  109. size="mini"
  110. type="text"
  111. icon="el-icon-edit"
  112. @click="handleUpdatety(scope.row)"
  113. v-hasPermi="['sys_dept:M']"
  114. >编辑</el-button>
  115. <el-button
  116. size="mini"
  117. type="text"
  118. icon="el-icon-view"
  119. @click="handleAddchak(scope.row)"
  120. v-hasPermi="['sys_dept:A']"
  121. >查看</el-button>
  122. <!-- <el-button
  123. size="mini"
  124. type="text"
  125. icon="el-icon-upload2"
  126. @click="handleUpdate(scope.row)"
  127. v-hasPermi="['sys_dept:A']"
  128. >上传</el-button> -->
  129. <el-button
  130. v-if="scope.row.id != 0"
  131. size="mini"
  132. type="text"
  133. icon="el-icon-delete"
  134. @click="handleDelete(scope.row)"
  135. v-hasPermi="['sys_dept:D']"
  136. >删除</el-button>
  137. </template>
  138. </el-table-column>
  139. </el-table>
  140. <pagination
  141. v-show="total>0"
  142. :total="total"
  143. :page.sync="queryParams.pageNum"
  144. :limit.sync="queryParams.pageSize"
  145. @pagination="getReportList"
  146. />
  147. <!-- 添加或修改部门对话框 -->
  148. <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="open" width="900px" append-to-body >
  149. <el-form ref="form" :model="form" :rules="rules" label-width="120px">
  150. <el-row>
  151. <el-col :span="24" v-if="!xiug">
  152. <el-form-item label="报表名称:" prop="reportName">
  153. <el-input v-model="form.reportName" placeholder="请输入报表名称" />
  154. </el-form-item>
  155. </el-col>
  156. <el-col :span="24" v-if="!xiug">
  157. <el-form-item label="报表设计器:" prop="reportId" :rules="[
  158. { required: true, message: '请选择报表设计器', trigger: 'blur' },
  159. ]">
  160. <treeselect v-model="form.reportId" :options="deptOptionstwofr" :normalizer="normalizerghy" placeholder="选择报表设计器" />
  161. </el-form-item>
  162. </el-col>
  163. <el-col :span="24" v-if="!xiug">
  164. <el-form-item label="参与人员:" prop="userName">
  165. <!-- <treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="选择报表设计器" /> -->
  166. <el-button style="padding: 9px 15px; font-size: 12px; border-radius: 3px; margin-bottom: 5px;" size="small" type="primary" @click="changeren">选择人员</el-button>
  167. <!-- slot="prepend" -->
  168. <el-input v-model="messageReun" :disabled="true" type="textarea" >
  169. </el-input>
  170. </el-form-item>
  171. </el-col>
  172. <el-col :span="24" >
  173. <el-form-item :label="xiug == true? '上传报表:' : '表格模板:'" prop="orderNum">
  174. <el-upload
  175. :disabled="false" class="upload-demo" :headers="{Authorization: 'Bearer ' + getToken()}"
  176. :action="process + '/boman-file/upload'" :on-change="handleChangert"
  177. :on-success="upImageFn"
  178. :on-error="err"
  179. :on-remove="reseImage"
  180. :file-list="configtwo"
  181. :on-preview="handlePictureCardPreview"
  182. :before-upload="befors"
  183. :multiple="false" >
  184. <el-button size="small" type="primary">点击上传</el-button>
  185. <div slot="tip" class="el-upload__tip" style="color: red; font-size: 14px;">只能上传xls/xlsx文件,且不超过50MB</div>
  186. </el-upload>
  187. </el-form-item>
  188. </el-col>
  189. <el-col :span="24" v-if="!xiug">
  190. <el-form-item label="开始时间:" prop="startTime" :rules="[
  191. { required: true, message: '请选择开始时间', trigger: 'blur' },
  192. ]">
  193. <el-date-picker
  194. v-model="form.startTime"
  195. type="datetime"
  196. value-format="yyyy-MM-dd HH:mm:ss"
  197. format="yyyy-MM-dd HH:mm:ss"
  198. placeholder="选择日期">
  199. </el-date-picker>
  200. </el-form-item>
  201. </el-col>
  202. <el-col :span="24" v-if="!xiug">
  203. <el-form-item label="截止时间:" prop="endTime" :rules="[
  204. { required: true, message: '请选择截止时间', trigger: 'blur' },
  205. ]">
  206. <el-date-picker
  207. v-model="form.endTime"
  208. type="datetime"
  209. value-format="yyyy-MM-dd HH:mm:ss"
  210. format="yyyy-MM-dd HH:mm:ss"
  211. placeholder="选择日期">
  212. </el-date-picker>
  213. </el-form-item>
  214. </el-col>
  215. <el-col :span="24" v-if="!xiug">
  216. <el-form-item label="注意事项:">
  217. <el-input type="textarea"
  218. :rows="2" v-model="form.remark" placeholder="请输入注意事项" style="width: 100%;" />
  219. </el-form-item>
  220. </el-col>
  221. </el-row>
  222. </el-form>
  223. <div slot="footer" class="dialog-footer">
  224. <el-button type="primary" @click="submitForm">确 定</el-button>
  225. <el-button @click="cancel">取 消</el-button>
  226. </div>
  227. </el-dialog>
  228. <!-- 分配角色数据权限对话框 -->
  229. <el-dialog :close-on-click-modal="false" title="选择人员" :visible.sync="modalShow" width="980px" append-to-body>
  230. <!-- <Flowshoe :instanceId="instanceId"></Flowshoe> -->
  231. <div class="tab_bott">
  232. <div class="tabBot_oje">
  233. <el-tabs type="border-card" v-model="activeName" @tab-click="handleClick">
  234. <!-- :setCheckedKeys='setCheckedKeys' :getCheckedKeys = "getCheckedKeys" -->
  235. <el-tab-pane label="按部门" name="first">
  236. <div class="head-container">
  237. <el-input
  238. v-model="deptName"
  239. placeholder="请输入部门名称"
  240. clearable
  241. size="small"
  242. prefix-icon="el-icon-search"
  243. style="margin-bottom: 20px"
  244. />
  245. </div>
  246. <div class="head-container">
  247. <el-tree
  248. :data="deptOptions"
  249. :expand-on-click-node="false"
  250. :props="defaultProps"
  251. :filter-node-method="filterNode"
  252. ref="tree"
  253. default-expand-all
  254. @node-click="handleNodeClick"
  255. />
  256. </div>
  257. </el-tab-pane>
  258. <el-tab-pane label="按角色" name="second" style="height: 400px;">
  259. <treeselect v-model="form.parentId" :options="deptOptionstwo" :normalizer="normalizer" :flat="true" :maxHeight="150" @select="djieskle" placeholder="点击选择角色" />
  260. </el-tab-pane>
  261. <el-tab-pane label="按组" name="third" style="height: 400px;">
  262. <treeselect v-model="form.parentIdty" :options="deptOptionsthre" :normalizer="normalizerty" :flat="true" @select="djieskletwo" :maxHeight="350" placeholder="点击选择组" />
  263. </el-tab-pane>
  264. </el-tabs>
  265. </div>
  266. <div class="tabBot_two">
  267. <el-card class="box-card box-cardtt" shadow="always">
  268. <div slot="header" class="clearfix">
  269. <span>人员</span>
  270. <el-button style=" float: right; padding: 3px 10px;" type="danger" plain @click="eledelte">删除</el-button>
  271. <el-button style=" float: right; padding: 3px 10px;margin-right: 20px;" type="primary" plain @click="quande">全选</el-button>
  272. </div>
  273. <ul class="infinite-list infinite-listty" v-infinite-scroll="load" style="overflow:auto">
  274. <li
  275. v-for="(item, index) in liseh"
  276. :class="[ quandet==true? 'infinite-list-itemty infinite-list-itemss' : item.id == idneese.id ? 'infinite-list-itemty infinite-list-itemss' : 'infinite-list-itemty']"
  277. :key="index"
  278. @click="reyantt(item)"
  279. >
  280. {{ item.nickName }}
  281. </li>
  282. </ul>
  283. </el-card>
  284. <el-card class="box-card box-cardtt" shadow="always">
  285. <div slot="header" class="clearfix">
  286. <span>已选择</span>
  287. <el-button style="float: right; padding: 3px 0" type="text" @click = 'determine'>确定</el-button>
  288. </div>
  289. <ul class="infinite-list infinite-listty" v-infinite-scroll="load" style="overflow:auto">
  290. <li v-for="item in lisehtwo" @click="lidele(item)" :key="item.id" class="infinite-list-item">
  291. {{ item.nickName }}
  292. <img src="../../../assets/images/dele.png" alt="" class="index_navTimeimg" />
  293. </li>
  294. </ul>
  295. </el-card>
  296. </div>
  297. </div>
  298. </el-dialog>
  299. <!-- 修改 -->
  300. <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="opentr" width="900px" append-to-body >
  301. <el-form ref="formty" :model="formty" :rules="rulesty" label-width="120px">
  302. <el-row>
  303. <el-col :span="24" >
  304. <el-form-item label="报表名称:" prop="reportName" >
  305. <el-input v-model="formty.reportName" placeholder="请输入报表名称" />
  306. </el-form-item>
  307. </el-col>
  308. <el-col :span="24" >
  309. <el-form-item label="报表设计器:" prop="reportId" :rules="[
  310. { required: true, message: '请选择报表设计器', trigger: 'blur' },
  311. ]">
  312. <treeselect v-model="formty.reportId" :options="deptOptionstwofr" :normalizer="normalizerghy" placeholder="选择报表设计器" />
  313. </el-form-item>
  314. </el-col>
  315. <el-col :span="24" >
  316. <el-form-item label="参与人员:" prop="userName">
  317. <!-- <treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="选择报表设计器" /> -->
  318. <el-button style="padding: 9px 15px; font-size: 12px; border-radius: 3px; margin-bottom: 5px;" size="small" type="primary" @click="changeren">选择人员</el-button>
  319. <!-- slot="prepend" -->
  320. <el-input v-model="messageReun" :disabled="true" type="textarea" />
  321. </el-form-item>
  322. </el-col>
  323. <el-col :span="24" >
  324. <el-form-item label="'表格模板:" prop="repUploadFile" :rules="[
  325. { required: true, message: '请上传表格模板', trigger: 'blur' },
  326. ]">
  327. <el-upload
  328. :disabled="false" class="upload-demo" :headers="{Authorization: 'Bearer ' + getToken()}"
  329. :action="process + '/boman-file/upload'" :on-change="handleChangert"
  330. :on-success="upImageFn"
  331. :on-error="err"
  332. :on-remove="reseImage"
  333. :file-list="configtwo"
  334. :on-preview="handlePictureCardPreview"
  335. :before-upload="befors"
  336. :multiple="false" >
  337. <el-button size="small" type="primary">点击上传</el-button>
  338. <div slot="tip" class="el-upload__tip" style="color: red; font-size: 14px;">只能上传xls/xlsx文件,且不超过50MB</div>
  339. </el-upload>
  340. </el-form-item>
  341. </el-col>
  342. <el-col :span="24" >
  343. <el-form-item label="开始时间:" prop="startTime" :rules="[
  344. { required: true, message: '请选择开始时间', trigger: 'blur' },
  345. ]">
  346. <el-date-picker
  347. v-model="formty.startTime"
  348. type="datetime"
  349. value-format="yyyy-MM-dd HH:mm:ss"
  350. format="yyyy-MM-dd HH:mm:ss"
  351. placeholder="选择日期">
  352. </el-date-picker>
  353. </el-form-item>
  354. </el-col>
  355. <el-col :span="24" >
  356. <el-form-item label="截止时间:" prop="endTime" :rules="[
  357. { required: true, message: '请选择截止时间', trigger: 'blur' },
  358. ]">
  359. <el-date-picker
  360. v-model="formty.endTime"
  361. type="datetime"
  362. value-format="yyyy-MM-dd HH:mm:ss"
  363. format="yyyy-MM-dd HH:mm:ss"
  364. placeholder="选择日期">
  365. </el-date-picker>
  366. </el-form-item>
  367. </el-col>
  368. <el-col :span="12" >
  369. <el-form-item label="注意事项:">
  370. <el-input type="textarea"
  371. :rows="2" v-model="formty.remark" placeholder="请输入注意事项" style="width: 100%;" />
  372. </el-form-item>
  373. </el-col>
  374. </el-row>
  375. </el-form>
  376. <div slot="footer" class="dialog-footer">
  377. <el-button type="primary" @click="submitFormty">确 定</el-button>
  378. <el-button @click="cancel">取 消</el-button>
  379. </div>
  380. </el-dialog>
  381. </div>
  382. </div>
  383. </template>
  384. <script>
  385. import { listDept, updateDept, listDeptExcludeChild } from "@/api/system/dept";
  386. import { tistDept,addDeptiu,reportList,reportListrt,delDept,addDeptiugt,getDept,addDeptiyuit } from "@/api/system/tatementsetr";
  387. import { listRoles,listIndex, delRole, addRole,addbjectSave, updateRole, exportRole, dataScope, changeRoleStatus, buent,issdanelist,issdaneid,weiduhegw,addbjectSawen } from "@/api/system/isses";
  388. import { treeselect } from "@/api/system/dept";
  389. import Treeselect from "@riophae/vue-treeselect";
  390. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  391. import {
  392. getToken
  393. } from "@/utils/auth";
  394. import { group , getRole, getPersonnel, getMembers,delRoleses } from '@/api/system/election';
  395. import { listRole } from "@/api/system/role";
  396. export default {
  397. name: "Dept",
  398. components: { Treeselect },
  399. data() {
  400. return {
  401. // 遮罩层
  402. loading: true,
  403. // 显示搜索条件
  404. showSearch: true,
  405. // 表格树数据
  406. reportList: [],
  407. deptOptionstwofr:[],
  408. // 总条数
  409. total: 0,
  410. opentr:false,
  411. // 选中数组
  412. ids: [],
  413. // 非单个禁用
  414. single: true,
  415. // 非多个禁用
  416. multiple: true,
  417. // 部门树选项
  418. deptOptions: [],
  419. // 角色
  420. deptOptionstwo:[],
  421. deptOptionsthre:[],
  422. configtwo: [],
  423. // 弹出层标题
  424. title: "添加报表",
  425. process: process.env.VUE_APP_BASE_API,
  426. // 是否显示弹出层
  427. open: false,
  428. // 状态数据字典
  429. statusOptions: [],
  430. // 查询参数
  431. queryParams: {
  432. pageNum: 1,
  433. pageSize: 10,
  434. reportName: undefined,
  435. startTime: undefined,
  436. endTime: undefined,
  437. status: undefined
  438. },
  439. queryParamsjuegt:{
  440. pageNum:1,
  441. pageSize:1000,
  442. reportType:'datainfo'
  443. },
  444. deptName:undefined,
  445. // 表单参数
  446. form: {
  447. personnels:[{
  448. deptId: 0,
  449. deptName: "",
  450. userId: 0,
  451. userName: ""
  452. }]
  453. },
  454. formty:{
  455. },
  456. activeName:'first',
  457. modalShow:false,
  458. // 表单校验
  459. rules: {
  460. reportName: [
  461. { required: true, message: "报表名称不能为空", trigger: "blur" }
  462. ],
  463. },
  464. rulesty:{
  465. reportName: [
  466. { required: true, message: "报表名称不能为空", trigger: "blur" }
  467. ],
  468. },
  469. quandet:false,
  470. lisehtwo:[
  471. ],
  472. liseh: [
  473. ],
  474. idneese: {},
  475. messageReun:'',
  476. frowtse:{
  477. },
  478. // 单位 名称
  479. mpany:{
  480. ompany:[],
  481. name:[]
  482. },
  483. config:[],
  484. defaultProps: {
  485. children: "children",
  486. label: "label"
  487. },
  488. xiug:false, //false为新增报表 true 为上传报表
  489. bieoa:{
  490. tableName:'',
  491. personnelId:undefined,
  492. },
  493. hyeqa:false, //false 修改取消 true 修改确定
  494. };
  495. },
  496. created() {
  497. //this.getList();
  498. this.getReportList();
  499. this.getDicts("report_status").then(response => {
  500. this.statusOptions = response.data;
  501. });
  502. this.getTreeselect()
  503. },
  504. methods: {
  505. dateString() {
  506. let year = new Date().toLocaleDateString().substring(0, 4);
  507. let month = new Date().toLocaleDateString().substring(5, 6);
  508. let day = new Date().toLocaleDateString().substring(7, 9);
  509. return year+"-"+month+"-"+day+" "+"20:30:00";
  510. },
  511. /** 查询部门列表 */
  512. getList() {
  513. this.loading = true;
  514. tistDept().then(response => {
  515. this.deptOptionstwofr = response.data.reports
  516. this.loading = false;
  517. });
  518. },
  519. /** 查询报表列表 */
  520. getReportList() {
  521. this.loading = true;
  522. reportListrt(this.queryParams).then(response => {
  523. this.reportList = response.rows
  524. this.total = response.total;
  525. this.loading = false;
  526. });
  527. },
  528. /** 转换部门数据结构 */
  529. /** 转换角色数据结构 */
  530. normalizer(node) {
  531. // if (node.children && !node.children.length) {
  532. // delete node.children;
  533. // }
  534. return {
  535. id: node.id,
  536. label: node.roleName,
  537. };
  538. },
  539. /** 转换组数据结构 */
  540. normalizerty(node) {
  541. return {
  542. id: node.id,
  543. label: node.groupName,
  544. };
  545. },
  546. normalizerghy(node){
  547. return {
  548. id: node.id,
  549. label: node.name,
  550. };
  551. },
  552. // 字典状态字典翻译
  553. statusFormat(row, column) {
  554. return this.selectDictLabel(this.statusOptions, row.status);
  555. },
  556. // 取消按钮
  557. cancel() {
  558. this.open = false;
  559. this.opentr = false;
  560. this.hyeqa = false;
  561. this.messageReun = ''
  562. this.configtwo = []
  563. this.reset();
  564. },
  565. // 表单重置
  566. reset() {
  567. this.form = {
  568. personnels:[{
  569. deptId: 0,
  570. deptName: "",
  571. userId: 0,
  572. userName: ""
  573. }]
  574. };
  575. this.resetForm("form");
  576. },
  577. /** 搜索按钮操作 */
  578. handleQuery() {
  579. this.getReportList();
  580. // this.getList();
  581. },
  582. /** 重置按钮操作 */
  583. resetQuery() {
  584. this.resetForm("queryForm");
  585. this.handleQuery();
  586. },
  587. /** 新增按钮操作 */
  588. handleAdd(row) {
  589. this.reset();
  590. if (row != undefined) {
  591. // this.form.parentId = row.id;
  592. }
  593. this.open = true;
  594. this.title = "添加报表";
  595. this.xiug = false
  596. this.configtwo = []
  597. this.messageReun = ''
  598. this.lisehtwo = []
  599. this.getList()
  600. // listDept().then(response => {
  601. // this.deptOptions = this.handleTree(response.data, "id");
  602. // });
  603. },
  604. /** 上传按钮操作 */
  605. handleUpdate(row) {
  606. this.reset();
  607. // getDept(row.id).then(response => {
  608. // this.form = response.data;
  609. this.open = true;
  610. this.title = "上传报表";
  611. this.bieoa.personnelId = row.personnelId
  612. this.bieoa.tableName = row.tableName
  613. this.configtwo = []
  614. this.xiug = true
  615. // this.getList()
  616. // });
  617. // listDeptExcludeChild(row.id).then(response => {
  618. // this.deptOptions = this.handleTree(response.data, "id");
  619. // });
  620. },
  621. /** 修改按钮操作 */
  622. handleUpdatety(row){
  623. this.reset();
  624. console.log(row,34)
  625. this.hyeqa = true
  626. this.formty.startTime = row.startTime
  627. this.formty.endTime = row.endTime
  628. this.formty.reportName = row.reportName
  629. this.formty.reportId = row.reportId
  630. this.formty.templateName = row.templateName
  631. this.formty.remark = row.remark
  632. if(row.repUploadFile !== null){
  633. }
  634. getDept(row.id).then(response => {
  635. // this.form = response.data;
  636. this.formty = response.data;
  637. if(response.data.personnels !== null){
  638. let jues = []
  639. response.data.personnels.filter( route=>{
  640. jues.push(route.userName)
  641. })
  642. console.log(jues)
  643. let nahe = jues.join(',')
  644. this.messageReun = '已选择' +nahe
  645. }
  646. if(response.data.repUploadFile !== null){
  647. console.log(JSON.parse(response.data.repUploadFile).name)
  648. this.configtwo = [{name:'',url:''}]
  649. this.configtwo[0].url = JSON.parse(response.data.repUploadFile).url
  650. this.configtwo[0].name = JSON.parse(response.data.repUploadFile).name
  651. // this.formty.repUploadFile = row.repUploadFile
  652. console.log(this.configtwo)
  653. }
  654. this.opentr = true;
  655. this.title = "编辑信息";
  656. // this.xiug = false
  657. this.getList()
  658. // this.getList()
  659. });
  660. // listDeptExcludeChild(row.id).then(response => {
  661. // this.deptOptions = this.handleTree(response.data, "id");
  662. // });
  663. },
  664. // 查看按钮
  665. handleAddchak(row){
  666. this.$router.push({
  667. path: '/business/sonnel',
  668. query: {
  669. id:row.id,
  670. },
  671. })
  672. },
  673. /** 提交按钮 */
  674. submitForm: function() {
  675. if(this.xiug == false){
  676. this.$refs["form"].validate(valid => {
  677. console.log(this.lisehtwo)
  678. if(this.form.templateName == undefined || this.form.templateName == ''){
  679. this.msgSuccess("请上传表格模板");
  680. return false
  681. }
  682. if(this.lisehtwo.length == 0){
  683. this.msgSuccess("请选择分发人员");
  684. return false
  685. }
  686. for(var i = 0 ; i < this.lisehtwo.length; i++){
  687. this.form.personnels[i] = {deptId:0,deptName:'',userId:0,userName:''}
  688. this.form.personnels[i].userId = this.lisehtwo[i].id
  689. this.form.personnels[i].userName = this.lisehtwo[i].userName
  690. this.form.personnels[i].deptId = this.lisehtwo[i].deptId
  691. if(this.lisehtwo[i].dept !== undefined && this.lisehtwo[i].dept !==null){
  692. this.form.personnels[i].deptName = this.lisehtwo[i].dept.deptName
  693. // this.form.personnels[i].deptId = this.lisehtwo[i].dept.deptId
  694. }else{
  695. this.form.personnels[i].deptName = this.lisehtwo[i].deptName
  696. }
  697. }
  698. console.log(this.form)
  699. addDeptiu(this.form).then(response => {
  700. this.msgSuccess("新增成功");
  701. this.open = false;
  702. this.getReportList();
  703. // this.getList();
  704. });
  705. // if (valid) {
  706. // if (this.form.id != undefined) {
  707. // updateDept(this.form).then(response => {
  708. // this.msgSuccess("修改成功");
  709. // this.open = false;
  710. // this.getList();
  711. // });
  712. // } else {
  713. // addDept(this.form).then(response => {
  714. // this.msgSuccess("新增成功");
  715. // this.open = false;
  716. // this.getList();
  717. // });
  718. // }
  719. // }
  720. });
  721. }else{
  722. if(this.bieoa.file == undefined || this.form.templateName == '{}'){
  723. this.msgSuccess("请上传报表");
  724. return false
  725. }
  726. addDeptiugt(this.bieoa).then(response => {
  727. this.msgSuccess("新增成功");
  728. this.open = false;
  729. this.getReportList();
  730. // this.getList();
  731. });
  732. }
  733. },
  734. /** 修改按钮 */
  735. submitFormty: function() {
  736. // if(this.xiug == false){
  737. this.$refs["formty"].validate(valid => {
  738. console.log(this.lisehtwo)
  739. if(this.formty.personnels == null){
  740. if(this.lisehtwo.length == 0){
  741. this.msgSuccess("请选择分发人员");
  742. return false
  743. }
  744. for(var i = 0 ; i < this.lisehtwo.length; i++){
  745. this.formty.personnels[i] = {deptId:0,deptName:'',userId:0,userName:''}
  746. this.formty.personnels[i].userId = this.lisehtwo[i].id
  747. this.formty.personnels[i].userName = this.lisehtwo[i].userName
  748. this.formty.personnels[i].deptId = this.lisehtwo[i].deptId
  749. if(this.lisehtwo[i].dept !== undefined && this.lisehtwo[i].dept !==null){
  750. this.formty.personnels[i].deptName = this.lisehtwo[i].dept.deptName
  751. // this.form.personnels[i].deptId = this.lisehtwo[i].dept.deptId
  752. }else{
  753. this.formty.personnels[i].deptName = this.lisehtwo[i].deptName
  754. }
  755. }
  756. }else{
  757. if(this.lisehtwo.length !== 0){
  758. console.log(345)
  759. for(var i = 0 ; i < this.lisehtwo.length; i++){
  760. this.formty.personnels[i] = {deptId:0,deptName:'',userId:0,userName:''}
  761. this.formty.personnels[i].userId = this.lisehtwo[i].id
  762. this.formty.personnels[i].userName = this.lisehtwo[i].userName
  763. this.formty.personnels[i].deptId = this.lisehtwo[i].deptId
  764. if(this.lisehtwo[i].dept !== undefined && this.lisehtwo[i].dept !==null){
  765. this.formty.personnels[i].deptName = this.lisehtwo[i].dept.deptName
  766. // this.form.personnels[i].deptId = this.lisehtwo[i].dept.deptId
  767. }else{
  768. this.formty.personnels[i].deptName = this.lisehtwo[i].deptName
  769. }
  770. }
  771. }
  772. }
  773. console.log(this.formty)
  774. addDeptiu(this.formty).then(response => {
  775. this.msgSuccess("修改成功");
  776. this.opentr = false;
  777. this.hyeqa = false;
  778. this.getReportList();
  779. // this.getList();
  780. });
  781. // if (valid) {
  782. // if (this.form.id != undefined) {
  783. // updateDept(this.form).then(response => {
  784. // this.msgSuccess("修改成功");
  785. // this.open = false;
  786. // this.getList();
  787. // });
  788. // } else {
  789. // addDept(this.form).then(response => {
  790. // this.msgSuccess("新增成功");
  791. // this.open = false;
  792. // this.getList();
  793. // });
  794. // }
  795. // }
  796. });
  797. // }else{
  798. // }
  799. },
  800. // 多选框选中数据
  801. handleSelectionChange(selection) {
  802. this.ids = selection.map(item => item.id)
  803. this.single = selection.length!=1
  804. this.multiple = !selection.length
  805. },
  806. /** 删除按钮操作 */
  807. handleDelete(row) {
  808. let ids = []
  809. if(row.id !== undefined){
  810. const id = []
  811. id.push(row.id)
  812. ids = id
  813. }else{
  814. ids = this.ids
  815. }
  816. let hue= {}
  817. hue.idList = ids
  818. hue.table = 'statistic_report'
  819. hue.logicDelName ="is_del",
  820. hue.logicDelValue ="Y",
  821. this.$confirm('是否确认删除', "警告", {
  822. confirmButtonText: "确定",
  823. cancelButtonText: "取消",
  824. type: "warning"
  825. }).then(function() {
  826. return delDept(hue);
  827. }).then(() => {
  828. this.getReportList();
  829. //this.getList();
  830. this.msgSuccess("删除成功");
  831. })
  832. },
  833. // 上传文件
  834. handleChangert(file, fileList) {
  835. // this.configtwo = []
  836. const jieg = []
  837. jieg.push(fileList[fileList.length - 1])
  838. console.log(jieg)
  839. this.configtwo = jieg.slice(-3);
  840. },
  841. upImageFn(res, file) {
  842. if(res.code !== 200){
  843. this.msgInfo('上传失败');
  844. return false
  845. }else{
  846. this.msgSuccess('上传成功');
  847. // this.msgInfo('上传失败');
  848. this.config= res.data
  849. console.log(res.data)
  850. console.log(res.data.name.substr(0,res.data.name.length-4))
  851. // this.querjtgoe.message_upload = this.config
  852. // console.log(this.querjtgoe.message_upload)
  853. if(this.xiug == false){
  854. console.log(3456)
  855. this.form.templateName = res.data.name
  856. this.form.repUploadFile = JSON.stringify(this.config)
  857. }else{
  858. this.bieoa.file = this.config
  859. }
  860. if(this.hyeqa == true){
  861. this.formty.templateName = res.data.name
  862. this.formty.repUploadFile = JSON.stringify(this.config)
  863. }
  864. // this.querjtgoe.message_title = res.data.name.substr(0,res.data.name.length-4)
  865. // this.querjtgoe.message_upload = JSON.stringify(this.querjtgoe.message_upload)
  866. }
  867. // querjtgoe.message_title
  868. console.log(res)
  869. // console.log(res.data.name.substr(-4))
  870. },
  871. err(){
  872. this.msgSuccess("上传失败");
  873. console.log(35)
  874. },
  875. reseImage(file, fileList) {
  876. let urls = ""
  877. this.configtwo = []
  878. // if (file.response) {
  879. // urls = file.response.url
  880. // } else {
  881. // urls = file.url
  882. // }
  883. // for (let i = this.configtwo.length - 1; i >= 0; i--) {
  884. // if (this.configtwo[i].url == urls) {
  885. // this.configtwo.splice(i, 1);
  886. // }
  887. // }
  888. console.log(this.configtwo)
  889. // if(this.configtwo.length == 0){
  890. // this.querjtgoe.message_enclosure = undefined
  891. // }else{
  892. // this.querjtgoe.message_enclosure = JSON.stringify(this.configtwo)
  893. // }
  894. },
  895. getToken() {
  896. return getToken()
  897. },
  898. // 上传前控制
  899. befors(res, file){
  900. console.log(res,file)
  901. console.log(res.name.substr(0,res.name.length-4))
  902. if(res.type !== 'application/vnd.ms-excel' ){
  903. if(res.type !== 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'){
  904. this.msgSuccess('只能上传xls文件');
  905. return false
  906. }
  907. }else{
  908. return true
  909. }
  910. // return true
  911. },
  912. // 图片预览
  913. handlePictureCardPreview(file) {
  914. console.log(file,87)
  915. console.log(file.name.split('.'))
  916. let hegs = file.name.split('.')
  917. console.log(hegs[hegs.length - 1])
  918. // if(hegs[hegs.length - 1] == 'pdf'){
  919. // this.shouewhu = true
  920. // }else{
  921. // this.shouewhu = false
  922. // }
  923. this.dialogImageUrl = file.url;
  924. this.dialogVisible = true;
  925. this.imashow = true
  926. },
  927. // 人员选择
  928. changeren(){
  929. this.modalShow = true
  930. },
  931. handleClick(index){
  932. if(index.index == 0){
  933. this.getTreeselect()
  934. }else if(index.index == 1){
  935. this.getTreeselectjue()
  936. }else if(index.index == 2){
  937. this.getTreeselecu()
  938. }
  939. },
  940. /** 查询部门下拉树结构 */
  941. getTreeselect() {
  942. treeselect().then(response => {
  943. this.deptOptions = response.data;
  944. });
  945. },
  946. // 查询角色
  947. getTreeselectjue() {
  948. this.loading = true;
  949. listRole(this.queryParams).then(response => {
  950. this.deptOptionstwo = this.handleTree(response.rows, "id");
  951. this.loading = false;
  952. });
  953. },
  954. // 查询组
  955. getTreeselecu() {
  956. this.loading = true;
  957. group(this.queryParams).then(response => {
  958. this.deptOptionsthre = this.handleTree(response.data, "id");
  959. this.loading = false;
  960. });
  961. },
  962. // 筛选节点
  963. filterNode(value, data) {
  964. if (!value) return true;
  965. return data.label.indexOf(value) !== -1;
  966. },
  967. // 节点单击事件
  968. handleNodeClick(data) {
  969. console.log(data);
  970. // this.queryParams.deptId = data.id;
  971. this.staff(data.id);
  972. this.quandet = false
  973. // this.getList();
  974. },
  975. // 点击组/角色
  976. djieskle(node, instanceId) {
  977. this.personnel(node.id);
  978. console.log(node, instanceId);
  979. },
  980. djieskletwo(node, instanceId) {
  981. this.members(node.id);
  982. this.elezu = node.id
  983. console.log(node, instanceId);
  984. },
  985. // 点击全部删除
  986. eledelte(){
  987. this.lisehtwo = []
  988. },
  989. // 点击全选
  990. quande(){
  991. var dueg = []
  992. dueg = (this.dhiuw)
  993. this.quandet = true
  994. var that = this
  995. // dueg.push(index)
  996. // this.lisehtwo = dueg
  997. // this.lisehtwo.push(index);
  998. // this.lisehtwo = [...new Set(this.lisehtwo)];
  999. // that.positions.map(train => {
  1000. // that.new_Positions.push(train.trainId);
  1001. // });
  1002. // that.resultArr = []; //去重后的数组
  1003. var flag;
  1004. for (var i in dueg) {
  1005. flag = true;
  1006. for (var j in that.lisehtwo) {
  1007. if (that.lisehtwo[j].id == dueg[i].id) {
  1008. flag = false;
  1009. break;
  1010. }
  1011. }
  1012. if (flag) {
  1013. that.lisehtwo.push(dueg[i]);
  1014. }
  1015. }
  1016. },
  1017. // 点击添加
  1018. reyantt(index) {
  1019. var dueg = [];
  1020. this.idneese = index;
  1021. var that = this
  1022. dueg.push(index)
  1023. // this.lisehtwo = dueg
  1024. // this.lisehtwo.push(index);
  1025. // this.lisehtwo = [...new Set(this.lisehtwo)];
  1026. // that.positions.map(train => {
  1027. // that.new_Positions.push(train.trainId);
  1028. // });
  1029. // that.resultArr = []; //去重后的数组
  1030. var flag;
  1031. for (var i in dueg) {
  1032. flag = true;
  1033. for (var j in that.lisehtwo) {
  1034. if (that.lisehtwo[j].id == dueg[i].id) {
  1035. flag = false;
  1036. break;
  1037. }
  1038. }
  1039. if (flag) {
  1040. that.lisehtwo.push(dueg[i]);
  1041. }
  1042. }
  1043. // for(var i = 0 ; i <this.lisehtwo.length; i++ ){
  1044. // if(this.lisehtwo[i].id == index.id){
  1045. // this.lisehtwo.splice(i,1)
  1046. // }
  1047. // }
  1048. // })
  1049. },
  1050. // 点击确定
  1051. determine(){
  1052. var eledete = []
  1053. this.lisehtwo.filter(route=>{
  1054. eledete.push(route.id)
  1055. })
  1056. eledete = eledete.join(',')
  1057. console.log(this.lisehtwo)
  1058. // this.elezu
  1059. this.loading = true;
  1060. buent(this.lisehtwo).then(response => {
  1061. // this.lisehtwo = response.data;
  1062. // this.dhiuw = response.data
  1063. this.mpany.ompany = response.deptNameList
  1064. this.mpany.name = response.nikeNameList
  1065. console.log( this.mpany.ompany)
  1066. let nahe = this.mpany.name.join(',')
  1067. console.log( nahe)
  1068. this.messageReun = '已选择' +nahe
  1069. if(response.code == 200){
  1070. this.msgSuccess('操作成功');
  1071. this.modalShow = false
  1072. }
  1073. this.loading = false;
  1074. });
  1075. },
  1076. load(){
  1077. },
  1078. // 按照部门查询人员
  1079. staff(index) {
  1080. this.loading = true;
  1081. var that = this;
  1082. getRole(index).then(response => {
  1083. // this.deptOptionsthre = this.handleTree(response.data, "id");
  1084. // this.rtuer = true
  1085. this.liseh = []
  1086. this.liseh = response.data;
  1087. this.dhiuw = response.data
  1088. this.loading = false;
  1089. });
  1090. },
  1091. // 按照角色查询人员
  1092. personnel(index) {
  1093. this.loading = true;
  1094. getPersonnel(index).then(response => {
  1095. // this.deptOptionsthre = this.handleTree(response.data, "id"); this.liseh = response.data;
  1096. this.liseh = []
  1097. this.liseh = response.data;
  1098. this.dhiuw = response.data
  1099. this.loading = false;
  1100. });
  1101. },
  1102. // 按照组查询人员
  1103. members(index) {
  1104. this.loading = true;
  1105. getMembers(index).then(response => {
  1106. // this.deptOptionsthre = this.handleTree(response.data, "id");
  1107. // this.liseh = response.data;
  1108. // response.data
  1109. // this.lisehtwo.push(response.data)
  1110. this.liseh = []
  1111. this.liseh = response.data;
  1112. this.dhiuw = response.data
  1113. // this.dhiuw.filter(route=>{
  1114. // this.lisehtwo.push(route)
  1115. // })
  1116. this.loading = false;
  1117. });
  1118. },
  1119. // 点击删除
  1120. lidele(index) {
  1121. for (let i = this.lisehtwo.length - 1; i >= 0; i--) {
  1122. if (this.lisehtwo[i].id == index.id) {
  1123. this.lisehtwo.splice(i, 1)
  1124. }
  1125. }
  1126. this.jeihqdcee = this.lisehtwo
  1127. },
  1128. handleStatusChange(row) {
  1129. let text = row.status === "0" ? "启用" : "停用";
  1130. let nheu = {
  1131. condition:{
  1132. },
  1133. commitData:{
  1134. }
  1135. }
  1136. nheu.tableName = 'statistic_report'
  1137. nheu.condition.id = row.id
  1138. nheu.commitData.status = row.status
  1139. this.$confirm('确认要改变此用户状态值吗?', "警告", {
  1140. confirmButtonText: "确定",
  1141. cancelButtonText: "取消",
  1142. type: "warning"
  1143. }).then(function() {
  1144. return addDeptiyuit(nheu);
  1145. }).then(() => {
  1146. this.msgSuccess('操作成功');
  1147. }).catch(function() {
  1148. row.status = row.status === "0" ? "1" : "0";
  1149. });
  1150. },
  1151. }
  1152. };
  1153. </script>
  1154. <style lang="scss">
  1155. .infinite-list {
  1156. // height: 150px;
  1157. margin-bottom: 20px;
  1158. flex-wrap: wrap;
  1159. .infinite-list-item {
  1160. // flex:1!important;
  1161. display: flex;
  1162. // justify-content: space-between;
  1163. align-items: center;
  1164. text-align: center;
  1165. list-style: none;
  1166. height: 23px;
  1167. margin-left: 10px;
  1168. // line-height: 30px;
  1169. }
  1170. .infinite-list-itemss {
  1171. color: #1890ff;
  1172. }
  1173. }
  1174. .infinite-listty {
  1175. display: flex;
  1176. flex-wrap: wrap;
  1177. .infinite-list-itemty {
  1178. // flex:1;
  1179. display: flex;
  1180. // justify-content: space-between;
  1181. height: 23px;
  1182. line-height: 23px;
  1183. // text-align: center;
  1184. list-style: none;
  1185. margin-left: 10px;
  1186. // border-radius: 40px;
  1187. // border: 1px solid #eee;
  1188. // border-bottom: 1px solid #eee;
  1189. }
  1190. }
  1191. // 分发人员
  1192. .infinite-listopma{
  1193. width: 100%;
  1194. display: flex;
  1195. flex-wrap: wrap;
  1196. justify-content: flex-start;
  1197. align-items: center;
  1198. li{
  1199. list-style: none;
  1200. // width: 20%;
  1201. margin-left: 10px;
  1202. line-height: 23px;
  1203. }
  1204. }
  1205. </style>
  1206. <style lang="scss" scoped="">
  1207. .app-container{
  1208. padding: 0 20px !important;
  1209. padding-top: 20px !important;
  1210. background-color: #eef0ff;
  1211. }
  1212. .app-containergt{
  1213. background-color: #fff;
  1214. border-radius: 6px;
  1215. padding: 23px !important;
  1216. }
  1217. .tab_bott {
  1218. display: flex;
  1219. }
  1220. .tabBot_oje {
  1221. width: 40%;
  1222. }
  1223. .tabBot_two {
  1224. width: 50%;
  1225. margin-left: 30px;
  1226. }
  1227. .box-cardtt{
  1228. margin-top: 30px;
  1229. }
  1230. .index_navTimeimg {
  1231. width: 10px;
  1232. height: 10px;
  1233. margin-left: 5px;
  1234. }
  1235. .jheuy{
  1236. color: #FE4141;
  1237. }
  1238. .neuiq{
  1239. color: #FE9A41;
  1240. }
  1241. .bgeyy{
  1242. color: #27C949;
  1243. }
  1244. </style>