VisitSchedule.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853
  1. <template>
  2. <div class="VisitSchedule-all" v-loading.fullscreen.lock="fullscreenLoading" element-loading-text="耗时较长请耐心等待">
  3. <el-dialog :before-close="handleBeforeClose" :close-on-click-modal="false" title="请示文件预览" :visible.sync="RequestDocumentVisible" @close="handleDialogClose">
  4. <div>
  5. <div class="RequestDocument-box" style="white-space:pre-line;height: 500px;overflow-y: auto;"
  6. v-html="RequestDocument"></div>
  7. <div class="RequestDocument-btn">
  8. <el-button @click="BusinessInvitationInstructionsFileDown" type="primary">下载请示文件</el-button>
  9. <el-button @click="cancelStream" type="primary">取消生成</el-button>
  10. </div>
  11. </div>
  12. </el-dialog>
  13. <el-dialog :close-on-click-modal="false" width="400px" title="单位" :visible.sync="UnitVisible">
  14. <el-form>
  15. <el-form-item label="团组单位:" :label-width="formLabelWidth">
  16. <el-input v-model="unitone" autocomplete="off"></el-input>
  17. </el-form-item>
  18. <el-form-item label="拜访单位:" :label-width="formLabelWidth">
  19. <el-input v-model="unittwo" autocomplete="off"></el-input>
  20. </el-form-item>
  21. </el-form>
  22. <div slot="footer" class="dialog-footer">
  23. <el-button type="primary" @click="UnitSave('覆盖', unitid)">覆 盖</el-button>
  24. <el-button type="primary" @click="UnitSave('追加', unitid)">追 加</el-button>
  25. </div>
  26. </el-dialog>
  27. <div class="VisitSchedule-search-head">
  28. <el-form ref="form" label-width="75px">
  29. <el-form-item style="width: 340px;" label="团组名称:">
  30. <el-select @change="ApprovalJourneyInit" filterable v-model="diid" placeholder="请选择团组名称">
  31. <el-option v-for="(item, index) in groupList" :key="index" :label="item.teamName"
  32. :value="item.id"></el-option>
  33. </el-select>
  34. </el-form-item>
  35. </el-form>
  36. <div style="display: flex;gap: 5px;">
  37. <div style="flex: 1">
  38. <el-select filterable v-model="blackCodeId" placeholder="请选择黑屏代码">
  39. <el-option v-for="(item, index) in blackCodeList" :key="index" :label="item.title"
  40. :value="item.id"></el-option>
  41. </el-select>
  42. </div>
  43. <div>
  44. <el-button style="margin-left: 0px;" @click="CreateApprovalJourney"
  45. type="primary">导入机票信息</el-button>
  46. <el-button style="margin-left: 0px;" @click="BusinessEnterpriseContinueWrite"
  47. type="primary">整篇AI编写</el-button>
  48. <el-button style="margin-left: 0px;" @click="BusinessJourneyFileDown"
  49. type="primary">AI生成公务行程</el-button>
  50. <!-- <el-button style="margin-left: 0px;" @click="BusinessInvitationInstructionsFile" type="primary">AI生成请示文件</el-button> -->
  51. <el-button style="margin-left: 0px;" @click="BusinessInvitationInstructionsFileContentStream"
  52. type="primary">AI生成请示文件</el-button>
  53. <el-select style="width: auto;" filterable v-model="fileIndex" placeholder="请选择文件类型">
  54. <el-option v-for="(item, index) in fileTempList" :key="index" :label="item.fileName"
  55. :value="item.index"></el-option>
  56. </el-select>
  57. <el-button @click="ExportApprovalJourneyWord" type="primary">导出日程</el-button>
  58. <el-button style="margin-left: 0px;" @click="SaveApprovalJourney" type="primary">保存</el-button>
  59. <el-button style="margin-left: 0px;" @click="DeleteApprovalJourney" type="primary">删除</el-button>
  60. </div>
  61. </div>
  62. </div>
  63. <div class="VisitSchedule-content">
  64. <div class="VisitSchedule-content-title">出访行程</div>
  65. <div class="VisitSchedule-content-info">
  66. 团组名:{{ groupInfo.teamName }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;团组号:{{ groupInfo.tourCode
  67. }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;出访日期:{{ groupInfo.visitStartDate + '~' + groupInfo.visitEndDate
  68. }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ groupInfo.visitDays + '天/' + groupInfo.visitPNumber + '人' }}
  69. </div>
  70. <div class="VisitSchedule-content-table">
  71. <div v-for="(item, index) in tablearr" :key="index" class="VisitSchedule-content-ul">
  72. <div class="content-ul-title">{{ item.date }}</div>
  73. <div v-for="(items, index) in item.chiList" :key="index" class="VisitSchedule-content-li">
  74. <div class="VisitSchedule-content-time">
  75. <el-time-picker is-range format='HH:mm' value-format='HH:mm' v-model="items.timeInterval"
  76. :default-value="value1" range-separator="至" start-placeholder="开始时间"
  77. end-placeholder="结束时间" placeholder="选择时间范围">
  78. </el-time-picker>
  79. </div>
  80. <div class="VisitSchedule-content-remark">
  81. <el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="items.details">
  82. </el-input>
  83. </div>
  84. <div class="VisitSchedule-content-btn">
  85. <el-button @click="openunit(items)" type="primary">AI续写</el-button>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. </template>
  93. <script>
  94. import { streamRequestGET, streamRequestPOST } from '@/store/streamRequest';
  95. export default {
  96. data() {
  97. return {
  98. diid: '',
  99. groupList: [],
  100. tablearr: [],
  101. userId: '',
  102. value1: ['', ''],
  103. textarea: '',
  104. ss: [0, 0],
  105. groupInfo: {},
  106. fullscreenLoading: false,
  107. blackCodeId: '',
  108. blackCodeList: [],
  109. fileTempList: [],
  110. fileIndex: 1,
  111. UnitVisible: false,
  112. formLabelWidth: '70px',
  113. unitone: '',
  114. unittwo: '',
  115. RequestDocumentVisible: false,
  116. RequestDocument: '',
  117. typewriterText: '',
  118. typewriterTimer: null,
  119. typewriterQueue: [],
  120. isTyping: false,
  121. isStreaming: false, // 是否正在流式传输
  122. autoScrollEnabled: true,
  123. streamController: null, // 保存控制器,用于中断
  124. downbtn:true,
  125. downbtns:false,
  126. ContentText:''
  127. }
  128. },
  129. computed: {
  130. displayContent() {
  131. // 如果需要 Markdown 渲染
  132. if (this.$marked && typeof this.$marked === 'function') {
  133. return this.$marked(this.typewriterText || this.RequestDocument);
  134. }
  135. return (this.typewriterText || this.RequestDocument).replace(/\n/g, '<br/>');
  136. }
  137. },
  138. watch: {
  139. // 监听打字机文本变化,智能滚动
  140. typewriterText() {
  141. if (this.autoScrollEnabled) {
  142. this.scrollToBottom();
  143. }
  144. }
  145. },
  146. methods: {
  147. //报批行程初始化
  148. ApprovalJourneyInit() {
  149. this.groupInfo = {};
  150. this.tablearr = [];
  151. this.fullscreenLoading = true;
  152. this.blackCodeId = '';
  153. this.blackCodeList = [];
  154. var url = "/api/Groups/ApprovalJourneyInit"
  155. var that = this
  156. this.$axios({
  157. method: 'post',
  158. url: url,
  159. headers: {
  160. Authorization: 'Bearer '
  161. },
  162. data: {
  163. diid: that.diid == '' ? -1 : that.diid,
  164. userId: that.userId,
  165. }
  166. }).then(function (res) {
  167. if (res.data.code == 200) {
  168. that.groupList = res.data.data.groupList;
  169. if (that.diid == '') {
  170. that.diid = that.groupList[0].id;
  171. }
  172. that.tablearr = res.data.data.content;
  173. for (let i = 0; i < that.tablearr.length; i++) {
  174. for (let a = 0; a < that.tablearr[i].chiList.length; a++) {
  175. if (that.tablearr[i].chiList[a].timeInterval.length == 1) {
  176. that.tablearr[i].chiList[a].timeInterval = that.value1;
  177. }
  178. }
  179. }
  180. that.unitone = res.data.data.groupInfo.clientUnit;
  181. that.groupInfo = res.data.data.groupInfo;
  182. that.fullscreenLoading = false;
  183. that.blackCodeList = res.data.data.blackCodeList;
  184. that.fileTempList = res.data.data.fileTempList;
  185. } else {
  186. that.$message({
  187. message: res.data.msg,
  188. duration: 1000,
  189. type: "error"
  190. });
  191. that.fullscreenLoading = false;
  192. }
  193. }).catch(function (error) {
  194. that.$message.error('请联系信息部!');
  195. });
  196. },
  197. openunit(val) {
  198. this.UnitVisible = true;
  199. this.unitid = val;
  200. this.unittwo = "";
  201. },
  202. //单位保存
  203. UnitSave(val, id) {
  204. this.fullscreenLoading = true;
  205. var url = "/api/Groups/ApprovalJourneyAiWrite"
  206. var that = this
  207. this.$axios({
  208. method: 'post',
  209. url: url,
  210. headers: {
  211. Authorization: 'Bearer '
  212. },
  213. data: {
  214. clientName: that.unitone,
  215. clientPurpose: that.unittwo
  216. }
  217. }).then(function (res) {
  218. if (res.data.code == 200) {
  219. that.fullscreenLoading = false;
  220. if (val == '追加') {
  221. id.details += ',' + res.data.data;
  222. } else {
  223. id.details = res.data.data;
  224. }
  225. that.$message({
  226. message: res.data.msg,
  227. type: 'success'
  228. });
  229. that.UnitVisible = false;
  230. } else {
  231. that.fullscreenLoading = false;
  232. that.$message({
  233. message: res.data.msg,
  234. duration: 1000,
  235. type: "error"
  236. });
  237. }
  238. }).catch(function (error) {
  239. that.$message.error('请联系信息部!');
  240. });
  241. },
  242. //报批行程保存
  243. SaveApprovalJourney() {
  244. var url = "/api/Groups/SaveApprovalJourney"
  245. var that = this
  246. this.$axios({
  247. method: 'post',
  248. url: url,
  249. headers: {
  250. Authorization: 'Bearer '
  251. },
  252. data: {
  253. userId: that.userId,
  254. arr: that.tablearr
  255. }
  256. }).then(function (res) {
  257. if (res.data.code == 200) {
  258. that.$message({
  259. message: res.data.msg,
  260. type: 'success'
  261. });
  262. that.ApprovalJourneyInit();
  263. } else {
  264. that.$message({
  265. message: res.data.msg,
  266. duration: 1000,
  267. type: "error"
  268. });
  269. }
  270. }).catch(function (error) {
  271. that.$message.error('请联系信息部!');
  272. });
  273. },
  274. /**
  275. * 滚动到底部
  276. */
  277. scrollToBottom() {
  278. this.$nextTick(() => {
  279. const container = document.querySelector('.RequestDocument-box');
  280. if (container && this.autoScrollEnabled) {
  281. container.scrollTop = container.scrollHeight;
  282. }
  283. });
  284. },
  285. /**
  286. * 滚动事件处理
  287. */
  288. handleScroll(e) {
  289. const container = e.target;
  290. const isAtBottom = container.scrollHeight - container.scrollTop <= container.clientHeight + 50;
  291. if (isAtBottom) {
  292. this.autoScrollEnabled = true;
  293. } else {
  294. this.autoScrollEnabled = false;
  295. }
  296. },
  297. /**
  298. * 打字机效果
  299. */
  300. startTypewriter(text, speed = 0) {
  301. if (this.isTyping) {
  302. this.typewriterQueue.push(text);
  303. return;
  304. }
  305. this.isTyping = true;
  306. let index = 0;
  307. const fullText = text;
  308. const type = () => {
  309. if (index < fullText.length) {
  310. this.typewriterText += fullText[index];
  311. index++;
  312. this.typewriterTimer = setTimeout(type, speed);
  313. } else {
  314. this.isTyping = false;
  315. this.RequestDocument = this.typewriterText;
  316. // 处理队列中的下一个文本
  317. if (this.typewriterQueue.length > 0) {
  318. const nextText = this.typewriterQueue.shift();
  319. this.startTypewriter(nextText, speed);
  320. }
  321. }
  322. };
  323. type();
  324. },
  325. /**
  326. * 重置打字机状态
  327. */
  328. resetTypewriter() {
  329. if (this.typewriterTimer) {
  330. clearTimeout(this.typewriterTimer);
  331. this.typewriterTimer = null;
  332. }
  333. this.typewriterText = '';
  334. this.RequestDocument = '';
  335. this.typewriterQueue = [];
  336. this.isTyping = false;
  337. this.autoScrollEnabled = true;
  338. },
  339. /**
  340. * 流式传输完成后的处理
  341. */
  342. onStreamComplete() {
  343. console.log('✅ 流式传输已完成');
  344. this.isStreaming = false;
  345. },
  346. /**
  347. * 流式接收并显示请示文件(带完成回调)
  348. */
  349. BusinessInvitationInstructionsFileContentStream() {
  350. // 重置状态
  351. this.resetTypewriter();
  352. this.isStreaming = true;
  353. this.fullscreenLoading = true;
  354. // 绑定滚动事件
  355. this.$nextTick(() => {
  356. const container = document.querySelector('.RequestDocument-box');
  357. if (container) {
  358. container.addEventListener('scroll', this.handleScroll);
  359. }
  360. });
  361. const url = "http://132.232.92.186:8888/api/Groups/BusinessInvitationInstructionsFileContentStream";
  362. const that = this;
  363. this.ContentText = '';
  364. // 发起流式请求,传入完成回调
  365. this.streamController = streamRequestPOST(
  366. url,
  367. { diid: that.diid },
  368. (data) => {
  369. that.RequestDocumentVisible = true;
  370. that.fullscreenLoading = false;
  371. // 处理流式返回的数据
  372. let newText = '';
  373. if (typeof data === 'string') {
  374. newText = data;
  375. } else if (data.text) {
  376. newText = data.text;
  377. } else if (data.content) {
  378. newText = data.content;
  379. } else {
  380. newText = JSON.stringify(data);
  381. }
  382. if (newText) {
  383. that.startTypewriter(newText, 0);
  384. }
  385. if (data.phase=='content') {
  386. that.ContentText += data.text;
  387. }
  388. },(error) => {
  389. // 错误处理
  390. console.error('流式请求失败:', error);
  391. that.isStreaming = false;
  392. that.$message.error('获取请示文件失败,请关闭弹窗界面后,再重试!');
  393. },(res) => {
  394. // 完成回调 - 流式传输真正结束时触发
  395. if (that.RequestDocumentVisible==false&&that.fullscreenLoading == true) {
  396. that.$message.error('没有信息无法生成!');
  397. }
  398. that.fullscreenLoading = false;
  399. that.onStreamComplete();
  400. }
  401. );
  402. },
  403. /**
  404. * 手动中断流式请求
  405. */
  406. cancelStream() {
  407. this.$confirm('此操作将停止生成数据,且下次操作需要重新开始生成, 是否继续?', '提示', {
  408. confirmButtonText: '确定',
  409. cancelButtonText: '取消',
  410. type: 'warning'
  411. }).then(() => {
  412. if (this.streamController) {
  413. this.RequestDocumentVisible = false;
  414. this.streamController.abort();
  415. this.isStreaming = false;
  416. this.$message.info('已停止生成');
  417. }else {
  418. this.$message.warning('没有正在生成的数据数据已生成完毕');
  419. }
  420. }).catch(() => {});
  421. },
  422. /**
  423. * Dialog 关闭时的处理
  424. */
  425. handleBeforeClose(done){
  426. if (this.isStreaming) {
  427. this.$confirm('内容正在生成中,确定要关闭吗?下次将需要重新开始生成。', '提示', {
  428. confirmButtonText: '确定关闭',
  429. cancelButtonText: '继续生成',
  430. type: 'warning',
  431. distinguishCancelAndClose: true
  432. }).then(() => {
  433. // 用户确认关闭
  434. // 中断进行中的请求
  435. if (this.streamController) {
  436. this.streamController.abort();
  437. }
  438. done(); // 执行关闭
  439. }).catch(() => {
  440. // 用户取消关闭,不做任何操作
  441. console.log('用户取消关闭,继续生成');
  442. });
  443. return;
  444. }
  445. done();
  446. },
  447. handleDialogClose() {
  448. // 移除滚动事件监听
  449. const container = document.querySelector('.RequestDocument-box');
  450. if (container) {
  451. container.removeEventListener('scroll', this.handleScroll);
  452. }
  453. // 重置状态
  454. this.resetTypewriter();
  455. this.isStreaming = false;
  456. },
  457. //下载请示文件
  458. BusinessInvitationInstructionsFileDown() {
  459. if (this.isStreaming) {
  460. this.$message.warning('请等待内容生成完毕后再下载!');
  461. return;
  462. }
  463. this.fullscreenLoading = true;
  464. var url = "/api/Groups/BusinessInvitationInstructionsFileDown"
  465. var that = this
  466. this.$axios({
  467. method: 'post',
  468. url: url,
  469. headers: {
  470. Authorization: 'Bearer '
  471. },
  472. data: {
  473. diid: that.diid,
  474. content: that.ContentText
  475. }
  476. }).then(function (res) {
  477. if (res.data.code == 200) {
  478. that.fullscreenLoading = false;
  479. that.$message({
  480. message: "导出成功!",
  481. type: 'success'
  482. });
  483. window.open(res.data.data)
  484. } else {
  485. that.fullscreenLoading = false;
  486. that.$message({
  487. message: res.data.msg,
  488. type: "error"
  489. });
  490. }
  491. })
  492. },
  493. //报批行程删除
  494. DeleteApprovalJourney() {
  495. var url = "/api/Groups/DeleteApprovalJourney"
  496. var that = this
  497. this.$axios({
  498. method: 'post',
  499. url: url,
  500. headers: {
  501. Authorization: 'Bearer '
  502. },
  503. data: {
  504. diid: that.diid,
  505. userId: that.userId,
  506. }
  507. }).then(function (res) {
  508. if (res.data.code == 200) {
  509. that.$message({
  510. message: res.data.msg,
  511. type: 'success'
  512. });
  513. that.ApprovalJourneyInit();
  514. } else {
  515. that.$message({
  516. message: res.data.msg,
  517. duration: 1000,
  518. type: "error"
  519. });
  520. }
  521. }).catch(function (error) {
  522. that.$message.error('请联系信息部!');
  523. });
  524. },
  525. //报批行程导入机票信息
  526. CreateApprovalJourney() {
  527. if (!this.blackCodeId) {
  528. this.$message({
  529. message: '请选择黑屏代码',
  530. duration: 1000,
  531. type: "error"
  532. });
  533. return;
  534. }
  535. var url = "/api/Groups/CreateApprovalJourney"
  536. var that = this
  537. this.$axios({
  538. method: 'post',
  539. url: url,
  540. headers: {
  541. Authorization: 'Bearer '
  542. },
  543. data: {
  544. diid: that.diid,
  545. userid: that.userId,
  546. BlackCodeId: that.blackCodeId
  547. }
  548. }).then(function (res) {
  549. if (res.data.code == 200) {
  550. that.$message({
  551. message: res.data.msg,
  552. type: 'success'
  553. });
  554. that.tablearr = res.data.data;
  555. for (let i = 0; i < that.tablearr.length; i++) {
  556. for (let a = 0; a < that.tablearr[i].chiList.length; a++) {
  557. if (that.tablearr[i].chiList[a].timeInterval.length == 1) {
  558. that.tablearr[i].chiList[a].timeInterval = that.value1;
  559. }
  560. }
  561. }
  562. } else {
  563. that.$message({
  564. message: res.data.msg,
  565. duration: 1000,
  566. type: "error"
  567. });
  568. }
  569. }).catch(function (error) {
  570. that.$message.error('请联系信息部!');
  571. });
  572. },
  573. //报批行程导出
  574. ExportApprovalJourneyWord() {
  575. if (!this.fileIndex) {
  576. this.$message({
  577. message: '请选择文件类型',
  578. duration: 1000,
  579. type: "error"
  580. });
  581. return;
  582. }
  583. this.fullscreenLoading = true;
  584. var url = "/api/Groups/ExportApprovalJourneyWord"
  585. var that = this
  586. this.$axios({
  587. method: 'post',
  588. url: url,
  589. headers: {
  590. Authorization: 'Bearer '
  591. },
  592. data: {
  593. diid: that.diid,
  594. fileIndex: this.fileIndex
  595. }
  596. }).then(function (res) {
  597. if (res.data.code == 200) {
  598. that.$message({
  599. message: "导出成功!",
  600. type: 'success'
  601. });
  602. that.fullscreenLoading = false;
  603. window.open(res.data.data)
  604. } else {
  605. that.fullscreenLoading = false;
  606. that.$message({
  607. message: res.data.msg,
  608. duration: 1000,
  609. type: "error"
  610. });
  611. }
  612. }).catch(function (error) {
  613. that.fullscreenLoading = false;
  614. that.$message.error('请联系信息部!');
  615. });
  616. },
  617. //报批行程框架导出
  618. BusinessJourneyFileDown() {
  619. if (!this.blackCodeId) {
  620. this.$message({
  621. message: '请选择文件类型',
  622. duration: 1000,
  623. type: "error"
  624. });
  625. return;
  626. }
  627. this.fullscreenLoading = true;
  628. var url = "/api/Groups/BusinessJourneyFileDown"
  629. var that = this
  630. this.$axios({
  631. method: 'post',
  632. url: url,
  633. headers: {
  634. Authorization: 'Bearer '
  635. },
  636. data: {
  637. diid: that.diid,
  638. blackCodeId: this.blackCodeId
  639. }
  640. }).then(function (res) {
  641. if (res.data.code == 200) {
  642. that.$message({
  643. message: "导出成功!",
  644. type: 'success'
  645. });
  646. that.fullscreenLoading = false;
  647. window.open(res.data.data)
  648. } else {
  649. that.fullscreenLoading = false;
  650. that.$message({
  651. message: res.data.msg,
  652. duration: 1000,
  653. type: "error"
  654. });
  655. }
  656. }).catch(function (error) {
  657. that.fullscreenLoading = false;
  658. that.$message.error('请联系信息部!');
  659. });
  660. },
  661. //请示文件导出
  662. BusinessInvitationInstructionsFile() {
  663. this.fullscreenLoading = true;
  664. var url = "/api/Groups/BusinessInvitationInstructionsFile"
  665. var that = this
  666. this.$axios({
  667. method: 'post',
  668. url: url,
  669. headers: {
  670. Authorization: 'Bearer '
  671. },
  672. data: {
  673. diid: that.diid,
  674. }
  675. }).then(function (res) {
  676. if (res.data.code == 200) {
  677. that.fullscreenLoading = false;
  678. that.$message({
  679. message: "导出成功!",
  680. type: 'success'
  681. });
  682. window.open(res.data.data)
  683. } else {
  684. that.fullscreenLoading = false;
  685. that.$message({
  686. message: res.data.msg,
  687. duration: 1000,
  688. type: "error"
  689. });
  690. }
  691. }).catch(function (error) {
  692. that.fullscreenLoading = false;
  693. that.$message.error('请联系信息部!');
  694. });
  695. },
  696. //拜访内容续写
  697. BusinessEnterpriseContinueWrite() {
  698. this.fullscreenLoading = true;
  699. var url = "/api/Groups/BusinessEnterpriseContinueWrite"
  700. var that = this
  701. this.$axios({
  702. method: 'post',
  703. url: url,
  704. headers: {
  705. Authorization: 'Bearer '
  706. },
  707. data: {
  708. diid: that.diid,
  709. }
  710. }).then(function (res) {
  711. if (res.data.code == 200) {
  712. that.fullscreenLoading = false;
  713. that.$message({
  714. message: res.data.msg,
  715. type: 'success'
  716. });
  717. that.tablearr = res.data.data.jsonResult;
  718. for (let i = 0; i < that.tablearr.length; i++) {
  719. for (let a = 0; a < that.tablearr[i].chiList.length; a++) {
  720. if (that.tablearr[i].chiList[a].timeInterval.length == 1) {
  721. that.tablearr[i].chiList[a].timeInterval = that.value1;
  722. }
  723. }
  724. }
  725. } else {
  726. that.fullscreenLoading = false;
  727. that.$message({
  728. message: res.data.msg,
  729. duration: 1000,
  730. type: "error"
  731. });
  732. }
  733. }).catch(function (error) {
  734. that.fullscreenLoading = false;
  735. that.$message.error('请联系信息部!');
  736. });
  737. },
  738. },
  739. mounted() {
  740. this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
  741. this.ApprovalJourneyInit();
  742. },
  743. beforeDestroy() {
  744. // 组件销毁时清理
  745. if (this.streamController) {
  746. this.streamController.abort();
  747. }
  748. if (this.typewriterTimer) {
  749. clearTimeout(this.typewriterTimer);
  750. }
  751. const container = document.querySelector('.RequestDocument-box');
  752. if (container) {
  753. container.removeEventListener('scroll', this.handleScroll);
  754. }
  755. }
  756. }
  757. </script>
  758. <style>
  759. .VisitSchedule-all {
  760. background-color: #fff;
  761. padding: 10px;
  762. box-shadow: 0 0 5px #0005;
  763. border-radius: 10px;
  764. min-height: 830px;
  765. }
  766. .VisitSchedule-search-head {
  767. display: flex;
  768. justify-content: space-between;
  769. }
  770. .VisitSchedule-search-head .el-select {
  771. width: 100%;
  772. }
  773. .VisitSchedule-content-table {
  774. padding: 10px 0;
  775. border: 1px solid #DCDFE6;
  776. }
  777. .VisitSchedule-content-li {
  778. border-top: 1px solid #DCDFE6;
  779. display: flex;
  780. align-items: center;
  781. }
  782. .VisitSchedule-content-time {
  783. padding: 10px;
  784. width: 25%;
  785. }
  786. .VisitSchedule-content-remark {
  787. width: 70%;
  788. padding: 10px;
  789. }
  790. .VisitSchedule-content-btn {
  791. width: 5%;
  792. padding: 10px;
  793. }
  794. .VisitSchedule-content-time .el-range-editor.el-input__inner {
  795. width: 100%;
  796. }
  797. .content-ul-title {
  798. padding: 10px;
  799. }
  800. .VisitSchedule-content-ul .VisitSchedule-content-li:last-child {
  801. border-bottom: 1px solid #DCDFE6;
  802. }
  803. .VisitSchedule-content-title {
  804. text-align: center;
  805. margin-bottom: 10px;
  806. color: #555;
  807. font-size: 17px;
  808. font-weight: 600;
  809. }
  810. .VisitSchedule-content-info {
  811. text-align: center;
  812. color: #555;
  813. font-size: 15px;
  814. margin-bottom: 20px;
  815. }
  816. .RequestDocument-btn{
  817. text-align: right;
  818. }
  819. </style>