fileList.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736
  1. <template>
  2. <!-- <div style="height: 95%"> -->
  3. <div class="container" style="margin: 15px 0 0 0">
  4. <fullscreen
  5. :fullscreen.sync="fullscreen"
  6. class="container-box"
  7. style="margin: 0 !important; padding: 0 !important"
  8. >
  9. <div class="titbox">
  10. <!-- <h2>部门预算模板管理</h2> -->
  11. <h2>在线文档编辑</h2>
  12. <div>
  13. <i class="el-icon-refresh" @click="iconCli(1)"></i>
  14. <i class="el-icon-full-screen" @click="iconCli(2)"></i>
  15. <!-- <i class="el-icon-folder-opened"></i>-->
  16. <!-- <i class="el-icon-view"></i>-->
  17. <!-- <i class="el-icon-more"></i>-->
  18. </div>
  19. </div>
  20. <div class="search">
  21. <mySearch :searchList="searchList" @searchInfo="searchInfo"></mySearch>
  22. <el-button
  23. size="small"
  24. @click="addExcel"
  25. type="primary"
  26. v-show="quanxian"
  27. >新增文件</el-button
  28. >
  29. </div>
  30. <div class="tabbox">
  31. <el-table
  32. height="calc(100% - 40px)"
  33. v-loading="loading"
  34. class="com-table"
  35. ref="multipleTable"
  36. :data="tableData"
  37. tooltip-effect="dark"
  38. size="small"
  39. border
  40. style="width: 100%"
  41. >
  42. <el-table-column
  43. align="center"
  44. prop="tempName"
  45. label="在线文档名称"
  46. show-overflow-tooltip
  47. >
  48. </el-table-column>
  49. <el-table-column
  50. align="center"
  51. prop="opTime"
  52. show-overflow-tooltip
  53. label="创建文档时间"
  54. >
  55. </el-table-column>
  56. <el-table-column
  57. align="center"
  58. prop="opNo"
  59. show-overflow-tooltip
  60. label="创建文档工号"
  61. >
  62. </el-table-column>
  63. <el-table-column
  64. align="center"
  65. prop="opName"
  66. show-overflow-tooltip
  67. label="创建文档姓名"
  68. >
  69. </el-table-column>
  70. <!-- <el-table-column
  71. align="center"
  72. prop="tempStsDesc"
  73. show-overflow-tooltip
  74. label="模板状态"
  75. >
  76. </el-table-column> -->
  77. <!-- <el-table-column align="center" prop="tempTypeDesc" label="模板类型">
  78. </el-table-column> -->
  79. <el-table-column
  80. align="center"
  81. prop="tempStsDesc"
  82. show-overflow-tooltip
  83. label="权限状态"
  84. >
  85. <template slot-scope="scope">
  86. {{ scope.row.powerFlag == 0 ? "开" : "关" }}
  87. </template>
  88. </el-table-column>
  89. <el-table-column
  90. v-if="caozuo1"
  91. align="center"
  92. prop="hotline"
  93. width="200"
  94. label="無權操作"
  95. >
  96. <template slot-scope="scope">
  97. <el-button
  98. size="mini"
  99. type="primary"
  100. plain
  101. @click="detailes(scope.row)"
  102. >查看</el-button
  103. >
  104. <el-button
  105. :disabled="scope.row.powerFlag != 0"
  106. size="mini"
  107. type="danger"
  108. plain
  109. @click="updates(scope.row)"
  110. >修改</el-button
  111. >
  112. </template>
  113. </el-table-column>
  114. <el-table-column
  115. v-if="caozuo2"
  116. align="center"
  117. prop="hotline"
  118. width="200"
  119. label="有權操作"
  120. >
  121. <template slot-scope="scope">
  122. <el-button
  123. size="mini"
  124. type="primary"
  125. plain
  126. @click="detailes(scope.row)"
  127. >查看</el-button
  128. >
  129. <el-button
  130. size="mini"
  131. type="danger"
  132. plain
  133. @click="updates(scope.row)"
  134. >修改</el-button
  135. >
  136. </template>
  137. </el-table-column>
  138. </el-table>
  139. <el-pagination
  140. class="pageBox"
  141. @current-change="currchange"
  142. layout="prev, pager, next"
  143. background
  144. :total="total"
  145. >
  146. </el-pagination>
  147. </div>
  148. <myMessage
  149. :messTit="messTit"
  150. @closeMessage="closeMessage"
  151. :centerDialogVisible="centerDialogVisible"
  152. v-if="centerDialogVisible"
  153. ></myMessage>
  154. </fullscreen>
  155. <!--
  156. <el-dialog
  157. title="选择接收人"
  158. :visible.sync="dialogStatus"
  159. width="50%"
  160. :close-on-press-escape="false"
  161. :show-close="false"
  162. :destroy-on-close="true"
  163. :modal-append-to-body="false"
  164. :close-on-click-modal="false"
  165. >
  166. <el-form
  167. ref="ruleForm"
  168. :rules="rules"
  169. :model="formData"
  170. label-width="80px"
  171. >
  172. <el-form-item class="info-line online" prop="fileList">
  173. <deptTree
  174. v-if="!disableStatus"
  175. :closeList="closeList"
  176. class="tree"
  177. @treeCheck="treeCheck"
  178. >
  179. </deptTree>
  180. <div :class="!disableStatus ? 'tree treeUser' : 'tree treeUserb'">
  181. <p v-for="(item, index) in treeList" :key="index">
  182. {{ item.receiveName }}
  183. <i @click="deletes(item, index)" class="el-icon-error"></i>
  184. </p>
  185. </div>
  186. </el-form-item>
  187. <el-form-item label="接收人" prop="sendNoArr">
  188. <el-select
  189. placeholder="选择接收人"
  190. v-model="formData.sendNoArr"
  191. multiple
  192. filterable
  193. style="width: 100%"
  194. >
  195. <el-option
  196. v-for="items in options"
  197. :key="items.value"
  198. :label="items.label"
  199. :value="items.value"
  200. >
  201. </el-option>
  202. </el-select>
  203. </el-form-item>
  204. </el-form>
  205. <div slot="footer" class="dialog-footer">
  206. <el-button @click="resetUser('ruleForm')">取 消</el-button>
  207. <el-button @click="subUser('ruleForm')">确 定</el-button>
  208. </div>
  209. </el-dialog> -->
  210. </div>
  211. </template>
  212. <script>
  213. import mySearch from "../../../components/search";
  214. import myMessage from "../../../components/myMessage.vue";
  215. import deptTree from "../../../components/deptTreeUser.vue";
  216. export default {
  217. components: {
  218. mySearch,
  219. myMessage,
  220. deptTree,
  221. },
  222. data() {
  223. return {
  224. treeList: [],
  225. quanxian: false,
  226. caozuo1: false,
  227. caozuo2: true,
  228. closeList: [],
  229. disableStatus: false,
  230. centerDialogVisible: false,
  231. messTit: "",
  232. dataId: "",
  233. typeFlag: "",
  234. value1: "",
  235. options: [],
  236. dialogStatus: false,
  237. formData: {
  238. woTitle: "",
  239. woDesc: "",
  240. requiredTime: "",
  241. sendNoArr: "",
  242. sendYear: "",
  243. sendMonth: "",
  244. sendQuarter: "",
  245. needReply: "是",
  246. },
  247. rules: {
  248. // woTitle: [
  249. // { required: true, message: "请输入预算标题", trigger: "blur" },
  250. // ],
  251. // woDesc: [
  252. // { required: true, message: "请输入预算备注", trigger: "change" },
  253. // ],
  254. // requiredTime: [
  255. // {
  256. // required: true,
  257. // message: "请选择反馈时间",
  258. // trigger: "change",
  259. // },
  260. // ],
  261. // sendNoArr: [
  262. // {
  263. // required: true,
  264. // message: "请选择接收人",
  265. // trigger: "change",
  266. // },
  267. // ],
  268. // sendYear: [
  269. // {
  270. // required: true,
  271. // message: "请选择下发年份",
  272. // trigger: "change",
  273. // },
  274. // ],
  275. // sendMonth: [
  276. // {
  277. // required: true,
  278. // message: "请选择下发月份",
  279. // trigger: "change",
  280. // },
  281. // ],
  282. // sendQuarter: [
  283. // {
  284. // required: true,
  285. // message: "请选择下发季度",
  286. // trigger: "change",
  287. // },
  288. // ],
  289. },
  290. headers: {
  291. agileauthtoken: sessionStorage.agileauthtoken.replace(/"/g, ""),
  292. },
  293. fullscreen: false,
  294. total: 0,
  295. pageSize: 1,
  296. tableData: [
  297. {
  298. name: "黑龙江公司移动成本预算简表",
  299. cNo: "admin",
  300. cUser: "admin",
  301. ctime: "2021-03-10",
  302. status: "已下发",
  303. },
  304. {
  305. name: "黑龙江公司移动成本预算简表1",
  306. cNo: "admin",
  307. cUser: "admin",
  308. ctime: "2021-03-10",
  309. status: "草稿",
  310. },
  311. ],
  312. searchList: [
  313. {
  314. type: "input",
  315. tit: "文档模板名称",
  316. value: "",
  317. width: "100%",
  318. options: [],
  319. },
  320. // {
  321. // type: "input",
  322. // tit: "创建时间",
  323. // value: "",
  324. // width: "100%",
  325. // options: [],
  326. // },
  327. // {
  328. // type: "input",
  329. // tit: "模板状态",
  330. // value: "",
  331. // width: "100%",
  332. // options: [],
  333. // },
  334. ],
  335. params: {
  336. tempName: "",
  337. },
  338. loading: false,
  339. fileList: [],
  340. fileName: "",
  341. };
  342. },
  343. methods: {
  344. treeCheck(v) {
  345. this.treeList = v;
  346. },
  347. deletes(val, index) {
  348. this.treeList.splice(index, 1);
  349. this.closeList = this.treeList;
  350. },
  351. chenckType(val) {
  352. if (val.tempStsDesc == "草稿") {
  353. this.$http({
  354. url: "/market/filepre/updateType",
  355. method: "post",
  356. headers: {
  357. "Content-Type": "application/json",
  358. },
  359. data: {
  360. id: val.id,
  361. tempType: val.tempType,
  362. tempTypeDesc: val.tempTypeDesc,
  363. },
  364. }).then((res) => {
  365. this.$message({
  366. message: "操作成功",
  367. type: "success",
  368. });
  369. this.getList(this.params, this.pageSize);
  370. });
  371. }
  372. },
  373. chenck(val) {
  374. if (val.tempStsDesc == "草稿") {
  375. this.$http({
  376. url: "/market/filepre/updatePower",
  377. method: "post",
  378. headers: {
  379. "Content-Type": "application/json",
  380. },
  381. data: { id: val.id },
  382. }).then((res) => {
  383. this.$message({
  384. message: "操作成功",
  385. type: "success",
  386. });
  387. this.getList(this.params, this.pageSize);
  388. });
  389. }
  390. },
  391. detailes(val) {
  392. this.$router.push("/initExcelsee1?status=see&id=" + val.id + "");
  393. },
  394. // 增加表单处理
  395. subUser(formName) {
  396. // console.log(this.treeList);
  397. // console.log(formName)
  398. // formData.SendNoArr=this.treeList
  399. let sendNoArr = [];
  400. // for (var i = 0; i <= this.treeList.length; i++) {}
  401. // let sendNoArr = this.treeList;
  402. this.$refs[formName].validate((valid) => {
  403. // console.log(valid)
  404. if (valid) {
  405. this.formData.sendNoArr.map((item) => {
  406. this.options.map((row) => {
  407. if (item == row.value) {
  408. sendNoArr.push({
  409. receiveNo: item,
  410. receiveName: row.label,
  411. deptCode: row.deptCode,
  412. deptName: row.deptName,
  413. });
  414. }
  415. });
  416. });
  417. let data = {
  418. // woTitle: this.formData.woTitle,
  419. // woDesc: this.formData.woDesc,
  420. // requiredTime: this.formData.requiredTime,
  421. sendNoArr: JSON.stringify(sendNoArr),
  422. // sendNoArr: this.treeList,
  423. // needReply: this.formData.needReply,
  424. preTempId: this.preTempId,
  425. // sendYear: this.typeFlag == "1" ? "" : this.formData.sendYear,
  426. // sendMonth: this.formData.sendMonth,
  427. // sendQuarter:
  428. // this.typeFlag == "1"
  429. // ? this.formData.sendYear + "-" + this.formData.sendQuarter
  430. // : "",
  431. // tempType: this.typeFlag,
  432. funcCode:
  433. this.typeFlag == "0"
  434. ? "1000"
  435. : this.typeFlag == "1"
  436. ? "1004"
  437. : this.typeFlag == "2"
  438. ? "1001"
  439. : this.typeFlag == "3"
  440. ? "1003"
  441. : "",
  442. };
  443. console.log(data);
  444. this.$http({
  445. url: "/market/filepre/pub",
  446. method: "post",
  447. headers: {
  448. "Content-Type": "application/json",
  449. },
  450. data: data,
  451. }).then((res) => {
  452. if (res.data.result == 0) {
  453. this.$message({
  454. type: "success",
  455. message: "下发成功",
  456. });
  457. } else {
  458. this.$message({
  459. type: "error",
  460. message: res.data.desc,
  461. });
  462. }
  463. this.resetUser(formName);
  464. this.dialogStatus = false;
  465. this.getList(this.params, this.pageSize);
  466. });
  467. }
  468. });
  469. },
  470. // 取消提交
  471. resetUser(formName) {
  472. this.$refs[formName].resetFields();
  473. this.dialogStatus = false;
  474. },
  475. closeDialog() {
  476. this.dialogStatus = false;
  477. },
  478. issue(val) {
  479. this.typeFlag = val.tempType;
  480. console.log(this.typeFlag);
  481. this.preTempId = val.id;
  482. this.dialogStatus = true;
  483. },
  484. defaultMenu(path, name) {
  485. let defaults = this.$store.state.tabList.filter((item) => {
  486. if (item.rountPath == path) {
  487. return item;
  488. }
  489. });
  490. if (defaults.length == 1) {
  491. return;
  492. }
  493. let params = {
  494. children: "",
  495. name: name,
  496. rountPath: path,
  497. target: "_self",
  498. };
  499. let set = new Set([...this.$store.state.tabList, params]);
  500. this.$store.commit("setDefaultActive", path);
  501. this.$store.commit("setTabList", Array.from(set));
  502. },
  503. closeMessage(v) {
  504. this.centerDialogVisible = false;
  505. if (v === 1) {
  506. this.$http({
  507. url: "/market/filepre/cancelPre",
  508. method: "post",
  509. headers: {
  510. "Content-Type": "application/json",
  511. },
  512. data: { id: this.dataId },
  513. }).then((res) => {
  514. if (res.data.result == "0") {
  515. this.$message({
  516. message: "删除成功",
  517. type: "success",
  518. });
  519. }
  520. this.getList(this.params, this.pageSize);
  521. });
  522. }
  523. },
  524. addExcel() {
  525. this.$router.push("/initExceladd1?status=add");
  526. // this.defaultMenu("/initExceladd?status=add", "新增预算模板");
  527. },
  528. updates(val) {
  529. this.$router.push("/initExcelupdate1?status=update&id=" + val.id + "");
  530. // this.defaultMenu("/initExcelupdate?status=update", "修改预算模板");
  531. },
  532. //搜索数据
  533. searchInfo(v) {
  534. this.params = {};
  535. v[0] ? (this.params.tempName = v[0]) : "";
  536. this.getList(this.params, this.pageSize);
  537. },
  538. //获取列表
  539. getList(v, n) {
  540. this.loading = true;
  541. this.pageSize = n;
  542. this.$http({
  543. url: "/market/filepre/queryPage",
  544. method: "post",
  545. headers: {
  546. "Content-Type": "application/json",
  547. page: '{"pageNo":"' + n + '","pageSize":"10"}',
  548. },
  549. data: v,
  550. }).then((res) => {
  551. this.loading = false;
  552. this.tableData = res.data.data;
  553. this.total = res.data.totalRecord;
  554. console.log(this.tableData);
  555. });
  556. this.$http({
  557. url: "/market/filepre/queryRole",
  558. method: "post",
  559. headers: {
  560. "Content-Type": "application/json",
  561. },
  562. data: { isFile: "0" },
  563. }).then((res) => {
  564. console.log(res.data);
  565. if (res.data) {
  566. this.quanxian = true;
  567. } else {
  568. this.caozuo1 = true;
  569. this.caozuo2 = false;
  570. }
  571. });
  572. },
  573. //功能栏
  574. iconCli(v) {
  575. if (v === 1) {
  576. this.getList(this.params, this.pageSize);
  577. }
  578. if (v === 2) {
  579. this.fullscreen = !this.fullscreen;
  580. }
  581. },
  582. // 分页
  583. currchange(v) {
  584. this.pageSize = v;
  585. this.getList(this.params, this.pageSize);
  586. },
  587. getOpations() {
  588. this.$http({
  589. url: "/sysmgr/sys/mk/offices/queryList",
  590. method: "post",
  591. headers: {
  592. "Content-Type": "application/json",
  593. },
  594. data: {},
  595. }).then((res) => {
  596. res.data.body.map((item) => {
  597. this.options.push({
  598. label: item.loginName,
  599. value: item.loginNo,
  600. deptCode: item.groupId,
  601. deptName: item.groupName,
  602. });
  603. });
  604. });
  605. },
  606. },
  607. mounted() {
  608. this.getOpations();
  609. this.getList(this.params, this.pageSize);
  610. // 获取权限
  611. },
  612. watch: {
  613. $route() {
  614. this.getList(this.params, this.pageSize);
  615. },
  616. },
  617. };
  618. </script>
  619. <style scoped>
  620. .el-upload-list {
  621. float: right;
  622. }
  623. .el-input__suffix {
  624. cursor: pointer;
  625. }
  626. .container .el-upload {
  627. width: auto !important;
  628. }
  629. </style>
  630. <style scoped lang="scss">
  631. .btn-default {
  632. display: inline;
  633. margin-left: 10px;
  634. }
  635. .titbox {
  636. div {
  637. float: right;
  638. i {
  639. font-size: 22px;
  640. margin-left: 20px;
  641. cursor: pointer;
  642. }
  643. }
  644. }
  645. .tabbox {
  646. margin-top: 15px;
  647. }
  648. .pageBox {
  649. text-align: right;
  650. margin-top: 10px;
  651. }
  652. .info-line {
  653. width: 100%;
  654. display: block;
  655. span {
  656. width: 80px;
  657. display: inline-block;
  658. text-align: left;
  659. i {
  660. color: red;
  661. display: inline-block;
  662. padding-right: 5px;
  663. }
  664. }
  665. .el-select,
  666. .el-input {
  667. width: calc(100% - 100px);
  668. }
  669. }
  670. .online {
  671. width: 100%;
  672. .el-select {
  673. width: calc(100% - 100px);
  674. }
  675. span {
  676. vertical-align: top;
  677. }
  678. .el-textarea {
  679. width: calc(100% - 100px);
  680. }
  681. .tree {
  682. width: calc(50% - 60px);
  683. display: inline-block;
  684. margin-right: 20px;
  685. height: 300px;
  686. overflow-y: scroll;
  687. .el-icon-error {
  688. float: right;
  689. font-size: 20px;
  690. margin-top: 9px;
  691. cursor: pointer;
  692. }
  693. }
  694. .treeUser {
  695. margin: 0;
  696. border: 1px solid #ddd;
  697. p {
  698. background: #f4f4f4;
  699. padding: 0 20px;
  700. margin-bottom: 5px;
  701. }
  702. }
  703. .treeUserb {
  704. width: calc(100% - 100px);
  705. border: 1px solid #ddd;
  706. background: #f4f4f4;
  707. border-radius: 3px;
  708. height: auto;
  709. overflow: hidden;
  710. p {
  711. display: inline-block;
  712. padding: 0 20px;
  713. margin-bottom: 5px;
  714. }
  715. }
  716. }
  717. </style>