sheet.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916
  1. <!--
  2. * @Author : yuanrunwei
  3. * @Date : 2021-12-04 14:23:58
  4. * @LastEditors: Please set LastEditors
  5. * @LastEditTime: 2022-01-21 18:55:09
  6. * @FilePath : \spfm-market-front\src\pages\main\performance\components\sheet.vue
  7. -->
  8. <template>
  9. <div class="sheet-container">
  10. <div class="flex-justify-align-end margin-bottom-20">
  11. <el-button
  12. type="primary"
  13. @click="handleVisible"
  14. v-if="['template'].includes(attribute)"
  15. >权限设置</el-button
  16. >
  17. <el-button type="primary" @click="handleDownload">导出</el-button>
  18. <el-button type="primary" @click="handleFullscreen()">全屏显示</el-button>
  19. <template v-if="['edit'].includes(type)">
  20. <el-upload
  21. v-if="!id"
  22. class="margin-right-10 margin-left-10"
  23. action
  24. :on-change="handleChange"
  25. :show-file-list="false"
  26. >
  27. <el-button type="primary">上传</el-button>
  28. </el-upload>
  29. <el-button
  30. v-if="addFlag === '0'"
  31. type="primary"
  32. @click="handleSave"
  33. :disabled="handleForbid()"
  34. ><span>{{ id ? "提交" : "新增" }}</span
  35. ><span>{{
  36. handleForbid() ? `(请先设置权限)` : ""
  37. }}</span></el-button
  38. >
  39. </template>
  40. </div>
  41. <div id="luckysheet" class="sheet-container-block"></div>
  42. <simple-dialog
  43. title="权限设置"
  44. :visible="visible"
  45. :modal="false"
  46. width="1400px"
  47. @confirm="handleAuth"
  48. @cancel="handleVisible"
  49. >
  50. <el-form ref="form" :model="form" label-width="80px">
  51. <el-radio-group v-model="form.permission_type">
  52. <el-form-item>
  53. <el-radio :label="0"><span>无特殊权限</span></el-radio>
  54. <div>
  55. <span class="form-content">负责人</span>
  56. <el-select
  57. v-model="form.person"
  58. multiple
  59. placeholder="请选择负责人"
  60. >
  61. <el-option
  62. v-for="({ label, value }, index) in charge_list"
  63. :key="index"
  64. :label="label"
  65. :value="value"
  66. ></el-option>
  67. </el-select>
  68. </div>
  69. <!-- <div class="form-input">
  70. <span class="form-content"> 可编辑行:从</span>
  71. <el-input v-model="form.col_start" />
  72. <span class="form-content">到</span
  73. ><el-input v-model="form.col_end" />
  74. </div>
  75. <div class="form-input">
  76. <span class="form-content">可编辑列:从</span>
  77. <el-input v-model="form.row_start" />
  78. <span class="form-content">到</span>
  79. <el-input v-model="form.row_end" />
  80. </div> -->
  81. </el-form-item>
  82. <el-form-item>
  83. <el-radio :label="1"><span>特殊权限:</span></el-radio>
  84. <el-form-item
  85. label="负责人"
  86. prop="charge"
  87. v-for="(item, index) in form.charge"
  88. :key="index"
  89. :rules="{
  90. required: true,
  91. message: '负责人不能为空',
  92. trigger: 'blur',
  93. }"
  94. >
  95. <div class="flex">
  96. <el-select
  97. class="margin-bottom-20 margin-right-10"
  98. placeholder="请选择负责人"
  99. v-model="item.person"
  100. filterable
  101. >
  102. <el-option
  103. v-for="({ label, value }, index) in charge_list"
  104. :key="index"
  105. :label="label"
  106. :value="value"
  107. ></el-option>
  108. </el-select>
  109. <div class="form-select">
  110. <span class="form-content">可编辑行:从</span>
  111. <el-input v-model="item.row_start" />
  112. <span class="form-content">到</span>
  113. <el-input v-model="item.row_end" />
  114. </div>
  115. <div class="form-select">
  116. <span class="form-content">可编辑列:从</span>
  117. <el-input v-model="item.col_start" />
  118. <span class="form-content">到</span>
  119. <el-input v-model="item.col_end" />
  120. </div>
  121. </div>
  122. </el-form-item>
  123. <div>
  124. <el-button @click.prevent="handleCharge('add')">添加</el-button>
  125. <el-button
  126. v-if="form.charge.length - 1"
  127. @click.prevent="handleCharge('delete')"
  128. >删除</el-button
  129. >
  130. </div>
  131. </el-form-item>
  132. </el-radio-group>
  133. <!-- <el-form-item
  134. label="可编辑列"
  135. prop="array"
  136. ><el-select
  137. v-model="form.array"
  138. placeholder="可编辑列"
  139. multiple
  140. >
  141. <el-option
  142. v-for="(value, index) in 10"
  143. :key="index"
  144. :label="index + 1"
  145. :value="index + 1"
  146. >
  147. </el-option> </el-select
  148. ></el-form-item>
  149. <el-form-item
  150. label="权限规则"
  151. prop="type"
  152. :rules="{
  153. required: true,
  154. message: '权限规则不能为空',
  155. trigger: 'change',
  156. }"
  157. >
  158. <el-select v-model="form.type">
  159. <el-option
  160. v-for="item in type_options"
  161. :key="item.value"
  162. :label="item.label"
  163. :value="item.value"
  164. ></el-option> </el-select
  165. ></el-form-item>
  166. <el-form-item
  167. label="负责人"
  168. prop="charge"
  169. :rules="{
  170. required: true,
  171. message: '负责人不能为空',
  172. trigger: 'blur',
  173. }"
  174. >
  175. <div
  176. class="flex-justify-start"
  177. v-for="(item, index) in form.charge"
  178. :key="index"
  179. >
  180. <el-select
  181. v-model="item.key"
  182. class="margin-bottom-20 margin-right-10 flex-1"
  183. placeholder="请选择指定列/行"
  184. multiple
  185. >
  186. <el-option
  187. v-for="(value, index) in 10"
  188. :key="index"
  189. :label="index + 1"
  190. :value="index + 1"
  191. >
  192. </el-option>
  193. </el-select>
  194. <el-select
  195. class="margin-bottom-20"
  196. placeholder="请选择负责人"
  197. v-model="item.value"
  198. filterable
  199. >
  200. <el-option
  201. v-for="({ label, value }, index) in charge_list"
  202. :key="index"
  203. :label="label"
  204. :value="value"
  205. ></el-option>
  206. </el-select>
  207. </div>
  208. <div>
  209. <el-button @click.prevent="handleCharge('add')"
  210. >添加</el-button
  211. >
  212. <el-button
  213. v-if="form.charge.length - 1"
  214. @click.prevent="handleCharge('delete')"
  215. >删除</el-button
  216. >
  217. </div>
  218. </el-form-item> -->
  219. </el-form>
  220. <template v-if="id" v-slot:footer><div></div></template>
  221. </simple-dialog>
  222. <simpleDialog
  223. title="提交"
  224. :visible="manager_approve"
  225. :modal="false"
  226. @cancel="handleApprove"
  227. >
  228. <el-form
  229. :model="approveForm"
  230. label-width="120px"
  231. :rules="{
  232. required: true,
  233. message: '请选择审批意见',
  234. trigger: 'change',
  235. }"
  236. >
  237. <el-form-item label="审批意见:">
  238. <el-select v-model="approveForm.type">
  239. <el-option
  240. v-for="item in approveForm.list"
  241. :key="item.value"
  242. :label="item.label"
  243. :value="item.value"
  244. >
  245. </el-option>
  246. </el-select>
  247. </el-form-item>
  248. <el-form-item
  249. v-if="approveForm.type === '3'"
  250. label="其它审批意见:"
  251. :rules="{
  252. required: true,
  253. message: '请输入审批意见',
  254. trigger: 'blur',
  255. }"
  256. ><el-input v-model="approveForm.comments"
  257. /></el-form-item>
  258. </el-form>
  259. <template v-slot:footer>
  260. <div>
  261. <el-button @click.prevent="handleApprove('1')">结束</el-button>
  262. <el-button @click.prevent="handleApprove('4')" type="primary"
  263. >转副总审批</el-button
  264. >
  265. <el-button @click.prevent="handleApprove('3')" type="primary"
  266. >转总经理审批</el-button
  267. >
  268. </div>
  269. </template>
  270. </simpleDialog>
  271. </div>
  272. </template>
  273. <script>
  274. import luckyexcel from "luckyexcel";
  275. import { exportExcel } from "../common/export";
  276. import simpleDialog from "./dialog.vue";
  277. export default {
  278. components: {
  279. simpleDialog,
  280. },
  281. props: {
  282. type: {
  283. type: String,
  284. default: "view", // view 查看 edit 编辑
  285. },
  286. attribute: {
  287. type: String,
  288. default: "template", // template 模板 order 工单 file 文件
  289. },
  290. id: {
  291. default: null,
  292. },
  293. },
  294. data() {
  295. return {
  296. form: {
  297. charge: [
  298. {
  299. person: [],
  300. col_start: "",
  301. col_end: "",
  302. row_start: "",
  303. row_end: "",
  304. },
  305. ],
  306. array: [],
  307. type: null,
  308. permission_type: null,
  309. col_start: "",
  310. col_end: "",
  311. row_start: "",
  312. row_end: "",
  313. },
  314. approveForm: {
  315. type: "",
  316. comments: "",
  317. list: [
  318. {
  319. label: "同意",
  320. value: "1",
  321. },
  322. {
  323. label: "不同意",
  324. value: "2",
  325. },
  326. {
  327. label: "其他",
  328. value: "3",
  329. },
  330. ],
  331. },
  332. // 可提交标志
  333. addFlag: "0",
  334. isDisable: true,
  335. issued_id: null,
  336. template_id: null,
  337. visible: false,
  338. manager_approve: false,
  339. row_list: [],
  340. column_list: [],
  341. charge_list: [],
  342. type_options: [
  343. {
  344. value: 1,
  345. label: "按行",
  346. },
  347. // {
  348. // value: 2,
  349. // label: "按列",
  350. // },
  351. ],
  352. };
  353. },
  354. methods: {
  355. handleInit() {
  356. if (this.id) {
  357. this.handleQuery();
  358. } else {
  359. this.handleCreate();
  360. }
  361. },
  362. // // 权限选择
  363. // handleRadio(e){
  364. // console.log(e,'e');
  365. // },
  366. handleAllow({ row, column }) {
  367. return (
  368. (!this.form.permission_type && this.type === "edit") ||
  369. (this.row_list.includes(row) && this.column_list.includes(column))
  370. );
  371. },
  372. async handleQuery() {
  373. let url = "";
  374. let key = "";
  375. switch (this.attribute) {
  376. case "template":
  377. url = "/market/CMKFileTemplate/QueryCMKFileTemplateById";
  378. key = "templateId";
  379. break;
  380. case "order":
  381. url = "/market/CMKIssued/CMKQueryIssuedById";
  382. key = "id";
  383. break;
  384. case "file":
  385. url = "/market/CMKIssued/CMKIssuedProcessByUser";
  386. key = "id";
  387. break;
  388. }
  389. const {
  390. data: {
  391. templateContent,
  392. templateName,
  393. issuedId,
  394. templateId,
  395. list,
  396. addFlag,
  397. },
  398. } = await this.$http({
  399. url,
  400. method: "post",
  401. headers: {
  402. "Content-Type": "application/json",
  403. },
  404. data: {
  405. [key]: this.id,
  406. },
  407. });
  408. this.template_id = templateId;
  409. this.issued_id = issuedId;
  410. this.addFlag = addFlag;
  411. console.log(addFlag, "addFlag");
  412. if (list && list.length) {
  413. const { type } = list[0];
  414. if (type === "1") {
  415. // 公共权限
  416. // const { allowEditingColumns, rowNum } = list[0];
  417. this.form = {
  418. permission_type: Number(type) - 1,
  419. person: list.map((el) => {
  420. return `${el.principalId},${el.principalName}`;
  421. }),
  422. charge: [
  423. {
  424. person: "",
  425. col_start: "",
  426. col_end: "",
  427. row_start: "",
  428. row_end: "",
  429. },
  430. ],
  431. };
  432. } else {
  433. // 特殊权限
  434. this.form = {
  435. permission_type: Number(type) - 1,
  436. col_start: "",
  437. col_end: "",
  438. row_start: "",
  439. row_end: "",
  440. charge: list.map((el) => ({
  441. person: el.principalId + "," + el.principalName,
  442. col_start: el.allowEditingColumns.split(",")[0],
  443. col_end:
  444. el.allowEditingColumns.split(",")[
  445. el.allowEditingColumns.split(",").length - 1
  446. ],
  447. row_start: el.rowNum.split(",")[0],
  448. row_end: el.rowNum.split(",")[el.rowNum.split(",").length - 1],
  449. })),
  450. };
  451. }
  452. // this.form = {
  453. // ...this.form,
  454. // type: type,
  455. // array: allowEditingColumns ? allowEditingColumns.split(",") : [],
  456. // charge: list.map(({ principalId, principalName, rowNum }) => ({
  457. // value: `${principalId},${principalName}`,
  458. // key: rowNum.split(","),
  459. // })),
  460. // };
  461. // this.form = {};
  462. this.row_list =
  463. this.type === "edit" && list[0].rowNum
  464. ? list[0].rowNum
  465. .split(",")
  466. .map((element) => JSON.parse(element) - 1)
  467. : [];
  468. this.column_list =
  469. this.type === "edit" && list[0].allowEditingColumns
  470. ? list[0].allowEditingColumns
  471. .split(",")
  472. .map((element) => JSON.parse(element) - 1)
  473. : [];
  474. }
  475. this.handleCreate({
  476. json: templateContent ? JSON.parse(templateContent) : {},
  477. name: templateName,
  478. type: "json",
  479. });
  480. },
  481. handleForbid() {
  482. // const object = {};
  483. const { permission_type } = this.form;
  484. if (permission_type === 0) {
  485. // 公共权限 暂时不用可编辑行和列
  486. const { person } = this.form;
  487. if (person.length) {
  488. return false;
  489. }
  490. return true;
  491. } else if (permission_type === 1) {
  492. // 特殊权限
  493. let flag = 1;
  494. const { charge } = this.form;
  495. charge.forEach((el) => {
  496. if (
  497. Object.values(el).filter((v) => {
  498. return v !== "";
  499. }).length === 5
  500. ) {
  501. flag = flag * 1;
  502. } else {
  503. flag = flag * 0;
  504. }
  505. });
  506. return !flag;
  507. } else {
  508. return true;
  509. }
  510. // form: {
  511. // charge: [
  512. // {
  513. // person: "",
  514. // col_start: "",
  515. // col_End: "",
  516. // row_start: "",
  517. // row_end: "",
  518. // },
  519. // ],
  520. // array: [],
  521. // type: null,
  522. // permission_type: 0,
  523. // col_start: "",
  524. // col_end: "",
  525. // row_start: "",
  526. // row_end: "",
  527. // },
  528. // charge.map(({ key }) => {
  529. // console.log(key);
  530. // // if (key && value) {
  531. // // object[key] = value;
  532. // // }
  533. // });
  534. // return !(Object.keys(object).length && type);
  535. },
  536. async handleCreate({ file, json, type, name } = {}) {
  537. let that = this;
  538. const options = {
  539. container: "luckysheet",
  540. lang: "zh",
  541. showsheetbar: false,
  542. hook: {
  543. cellEditBefore: function ([
  544. { row_focus: row, column_focus: column },
  545. ]) {
  546. if (!that.handleAllow({ row, column })) {
  547. that.$message.error("您没有编辑权限");
  548. }
  549. },
  550. cellUpdateBefore: function (row, column) {
  551. if (!that.handleAllow({ row, column })) {
  552. return false;
  553. }
  554. },
  555. cellRenderAfter: function (cell, position) {
  556. const { r: row, c: column } = position;
  557. if (cell) {
  558. if (!that.handleAllow({ row, column })) {
  559. cell.bg = "#d5d5d5";
  560. } else {
  561. cell.bg = "#ffffff";
  562. }
  563. }
  564. },
  565. },
  566. };
  567. switch (type) {
  568. case "file":
  569. if (file) {
  570. await new Promise((resolve) => {
  571. luckyexcel.transformExcelToLucky(file, (export_json) => {
  572. options.data = [
  573. ...export_json.sheets.map((element) => ({
  574. ...element,
  575. zoomRatio: 0.75,
  576. })),
  577. ];
  578. options.title = export_json.info.name;
  579. resolve();
  580. });
  581. });
  582. }
  583. break;
  584. case "json":
  585. if (json) {
  586. options.data = [
  587. {
  588. ...json,
  589. zoomRatio: 0.75,
  590. },
  591. ];
  592. options.title = name;
  593. }
  594. break;
  595. }
  596. window.luckysheet.create(options);
  597. let clock = setInterval(() => {
  598. if (window.luckysheet) {
  599. window.luckysheet.refresh();
  600. clearInterval(clock);
  601. }
  602. }, 1000);
  603. },
  604. async handleChange(response) {
  605. this.handleCreate({ file: response.raw, type: "file" });
  606. },
  607. handleDownload() {
  608. exportExcel(
  609. window.luckysheet.getAllSheets(),
  610. window.luckysheet.getWorkbookName()
  611. );
  612. },
  613. async handleAddAuth({ id }) {
  614. // const object = {};
  615. const { permission_type } = this.form;
  616. console.log(id, permission_type);
  617. let reqdata = {
  618. templateId: id,
  619. type: permission_type ? 2 : 1,
  620. };
  621. if (!permission_type) {
  622. // 公共权限
  623. const { person } = this.form;
  624. const principalId = [];
  625. const principalName = [];
  626. person.forEach((el) => {
  627. principalId.push(el.split(",")[0]);
  628. principalName.push(el.split(",")[1]);
  629. });
  630. reqdata.principalId = principalId.join(",");
  631. reqdata.principalName = principalName.join(",");
  632. } else {
  633. const { charge } = this.form;
  634. // 特殊权限
  635. reqdata.specialAuth = charge.map((el) =>
  636. JSON.stringify({
  637. allowEditingColumns: `${el.col_start},${el.col_end}`,
  638. rowNum: `${el.row_start},${el.row_end}`,
  639. principalId: el.person.split(",")[0],
  640. principalName: el.person.split(",")[1],
  641. })
  642. );
  643. }
  644. await this.$http({
  645. url: this.id
  646. ? "/market/CMKFileTemplateAuthority/CMKFileTemplateAuthorityUpdate"
  647. : "/market/CMKFileTemplateAuthority/CMKFileTemplateAuthorityAdd",
  648. method: "post",
  649. headers: {
  650. "Content-Type": "application/json",
  651. },
  652. data: reqdata,
  653. });
  654. this.$message.success("操作成功");
  655. },
  656. async handleSave() {
  657. let edit_url = "";
  658. switch (this.attribute) {
  659. case "template":
  660. edit_url = "";
  661. break;
  662. case "order":
  663. edit_url = "";
  664. break;
  665. case "file":
  666. edit_url = "/market/CMKIssued/CMKIssuedSubmit";
  667. break;
  668. }
  669. const sheet_name = window.luckysheet.getSheet().name;
  670. const data = window.luckysheet.getSheet(sheet_name);
  671. const workbook_name = window.luckysheet.getWorkbookName();
  672. if (!this.id) {
  673. // 新增时添加权限
  674. const {
  675. data: { body },
  676. } = await this.$http({
  677. url: "/market/CMKFileTemplate/CMKFileTemplateAdd", // 新增
  678. method: "post",
  679. headers: {
  680. "Content-Type": "application/json",
  681. },
  682. data: {
  683. id: this.template_id,
  684. templateContent: JSON.stringify(data),
  685. templateName: workbook_name,
  686. issuedId: this.issued_id,
  687. },
  688. });
  689. this.handleAddAuth({ id: body });
  690. this.$emit("save");
  691. } else {
  692. // 职位
  693. let duty = JSON.parse(sessionStorage.userInfo).duty;
  694. if (duty === "7") {
  695. this.manager_approve = true;
  696. } else {
  697. // 员工提交
  698. await this.$http({
  699. url: edit_url, // 新增
  700. method: "post",
  701. headers: {
  702. "Content-Type": "application/json",
  703. },
  704. data: {
  705. id: this.template_id,
  706. templateContent: JSON.stringify(data),
  707. templateName: workbook_name,
  708. issuedId: this.issued_id,
  709. },
  710. });
  711. this.$emit("save");
  712. }
  713. }
  714. },
  715. handleAuth() {
  716. this.$refs["form"].validate((valid) => {
  717. if (valid) {
  718. if (this.handleForbid()) {
  719. this.$message.error("请完善可编辑信息");
  720. return false;
  721. }
  722. this.handleVisible();
  723. if (this.id) {
  724. this.handleAddAuth({ id: this.id });
  725. } else {
  726. this.$message.success("设置成功");
  727. }
  728. }
  729. });
  730. },
  731. // 通用方法用于转化全局
  732. paramsArr(start, end) {
  733. const arr = [];
  734. console.log(start, end);
  735. for (let i = Number(start); i <= Number(end); i++) {
  736. arr.push(i);
  737. }
  738. return arr.join(",");
  739. },
  740. filterName(id, arr) {
  741. return arr.filter((el) => el.secLeaderLogin === id)[0].secLeaderName;
  742. },
  743. handleCharge(type) {
  744. switch (type) {
  745. case "add":
  746. this.form.charge.push({
  747. person: "",
  748. });
  749. this.handleForbid();
  750. break;
  751. case "delete":
  752. this.form.charge.pop();
  753. this.handleForbid();
  754. break;
  755. }
  756. },
  757. handleVisible() {
  758. console.log(this.form, "aada");
  759. this.visible = !this.visible;
  760. },
  761. async handleApprove(type) {
  762. if (type) {
  763. const sheet_name = window.luckysheet.getSheet().name;
  764. const data = window.luckysheet.getSheet(sheet_name);
  765. const workbook_name = window.luckysheet.getWorkbookName();
  766. await this.$http({
  767. url: "/market/CMKIssued/CMKIssuedSubmit", // 新增
  768. method: "post",
  769. headers: {
  770. "Content-Type": "application/json",
  771. },
  772. data: {
  773. id: this.template_id,
  774. templateContent: JSON.stringify(data),
  775. templateName: workbook_name,
  776. issuedId: this.issued_id,
  777. },
  778. });
  779. let params = {
  780. id: this.issued_id,
  781. reviewOpinion:
  782. this.approveForm.type === "3" ? this.approveForm.comments : this.approveForm.type,
  783. };
  784. switch (type) {
  785. case "1":
  786. params = {
  787. ...params,
  788. operateName: "结束",
  789. status: 3,
  790. };
  791. break;
  792. case "4":
  793. params = {
  794. ...params,
  795. operateName: "转副总审批",
  796. reviewType: 2,
  797. };
  798. break;
  799. case "3":
  800. params = {
  801. ...params,
  802. operateName: "转总经理审批",
  803. reviewType: 3,
  804. };
  805. break;
  806. }
  807. await this.$http({
  808. url: "/market/CMKIssued/CMKIssuedCheck", // 新增
  809. method: "post",
  810. headers: {
  811. "Content-Type": "application/json",
  812. },
  813. data: params,
  814. });
  815. this.$message({
  816. type: "success",
  817. message: "审批成功",
  818. });
  819. this.manager_approve = false;
  820. this.$emit("save");
  821. } else {
  822. this.manager_approve = false;
  823. }
  824. },
  825. handleFullscreen() {
  826. const element = document.body;
  827. const is_fullscreen =
  828. document.fullScreen ||
  829. document.mozFullScreen ||
  830. document.webkitIsFullScreen;
  831. if (!is_fullscreen) {
  832. //进入全屏,多重短路表达式
  833. (element.requestFullscreen && element.requestFullscreen()) ||
  834. (element.mozRequestFullScreen && element.mozRequestFullScreen()) ||
  835. (element.webkitRequestFullscreen &&
  836. element.webkitRequestFullscreen()) ||
  837. (element.msRequestFullscreen && element.msRequestFullscreen());
  838. } else {
  839. //退出全屏,三目运算符
  840. document.exitFullscreen
  841. ? document.exitFullscreen()
  842. : document.mozCancelFullScreen
  843. ? document.mozCancelFullScreen()
  844. : document.webkitExitFullscreen
  845. ? document.webkitExitFullscreen()
  846. : "";
  847. }
  848. },
  849. handleChargeList() {
  850. this.$http({
  851. url: "/market/techcentergj/queryLeaderList",
  852. method: "post",
  853. headers: {
  854. "Content-Type": "application/json",
  855. },
  856. data: {},
  857. }).then((response) => {
  858. this.charge_list = response.data.map((element) => ({
  859. label: `${element.ou} ${element.secLeaderName}`,
  860. value: `${element.secLeaderLogin},${element.secLeaderName}`,
  861. }));
  862. });
  863. },
  864. },
  865. mounted() {
  866. this.handleInit();
  867. this.handleChargeList();
  868. },
  869. };
  870. </script>
  871. <style lang="scss" scope>
  872. .sheet-container {
  873. position: fixed;
  874. width: calc(100% - 40px);
  875. height: 100%;
  876. &-block {
  877. overflow: hidden;
  878. position: absolute;
  879. width: 100%;
  880. height: 75%;
  881. }
  882. }
  883. .form {
  884. &-input {
  885. margin-top: 5px;
  886. .el-input {
  887. width: 150px;
  888. .el-input__inner {
  889. height: 30px !important;
  890. line-height: 30px !important;
  891. }
  892. }
  893. }
  894. &-content {
  895. margin: 0px 10px;
  896. }
  897. &-select {
  898. .el-input {
  899. width: 100px;
  900. .el-input__inner {
  901. height: 30px !important;
  902. line-height: 30px !important;
  903. }
  904. }
  905. }
  906. }
  907. </style>