content.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736
  1. <template>
  2. <view class="oa-notice-detail">
  3. <view class="covers-body covers-uploader oa-uploader">
  4. <view class="input-title">
  5. <view class="contentTitle">紧急程度:</view>
  6. <view class="contentDetail">{{content.ponderance}}</view>
  7. </view>
  8. <view class="input-title">
  9. <view class="contentTitle">文件类别:</view>
  10. <view class="contentDetail">{{content.securityClass}}</view>
  11. </view>
  12. <view class="input-title">
  13. <view class="contentTitle">来文机关:</view>
  14. <view class="contentDetail">{{content.office}}</view>
  15. </view>
  16. <view class="input-title" v-if="zhshow">
  17. <view class="contentTitle">文&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号:</view>
  18. <view class="contentDetail">{{content.referenceNumber}}</view>
  19. </view>
  20. <view class="input-title">
  21. <view class="contentTitle">文件名称:</view>
  22. <view class="contentDetail">{{content.fwtitle}}</view>
  23. </view>
  24. <view class="input-title">
  25. <view class="contentTitle">正&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;文:</view>
  26. <view class="uni-uploader contentDetail">
  27. <view class="uni-uploader-body" v-for="(item,i) in contentFile" :key="i">
  28. <view class="uni-uploader_files" @click="showFile(item.path)">
  29. <block>
  30. <view class="uni-uploader__file" style="position: relative; text-decoration: underline;">
  31. {{item.name}}
  32. </view>
  33. </block>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="input-title">
  39. <view class="contentTitle">拟办意见:</view>
  40. <view class="contentDetail">{{content.opinion}}</view>
  41. </view>
  42. <view class="input-title" v-if="zgldshow">
  43. <view class="contentTitle">主管领</br>导意见:</view>
  44. <view class="contentDetail">{{content.leaderOpinion}}</view>
  45. </view>
  46. <view class="input-title" v-if="cardshow">
  47. <view class="contentTitle">主要领</br>导意见:</view>
  48. <view class="uni-uploader contentDetail">
  49. <view class="uni-uploader-body" v-for="(item,i) in cardFile" :key="i">
  50. <view class="uni-uploader_files" @click="showFile(item.path)">
  51. <block>
  52. <view class="uni-uploader__file" style="position: relative; text-decoration: underline;">
  53. {{item.name}}
  54. </view>
  55. </block>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. <view class="input-title" v-if="!isme">
  61. <view class="contentTitle">发送人:</view>
  62. <view class="contentDetail">{{content.applyUser}}</view>
  63. </view>
  64. <view class="input-title" v-if="!isme">
  65. <view class="contentTitle">发送时间:</view>
  66. <view class="contentDetail">{{content.createTime}}</view>
  67. </view>
  68. <view class="input-title" v-if="!isme && examineshow">
  69. <view class="contentTitle">签收意见:</view>
  70. <view class="contentDetail">{{content.examineMe[0].examine}}</view>
  71. </view>
  72. <!-- 进度条 -->
  73. <view>
  74. <rfLoadProgress :progress="progress" :height="0"></rfLoadProgress>
  75. </view>
  76. <!-- <view class="input-title">
  77. <view class="contentTitle">附件:</view>
  78. <view class="uni-uploader contentDetail">
  79. <view class="uni-uploader-body" v-for="(item,i) in file" :key="i">
  80. <view class="uni-uploader_files" @click="showFile(item.path)">
  81. <block>
  82. <view class="uni-uploader__file" style="position: relative;">
  83. {{item.name}}
  84. </view>
  85. </block>
  86. </view>
  87. </view>
  88. </view>
  89. </view> -->
  90. </view>
  91. <view class="covers-body covers-uploader oa-uploader" v-if="ismine&&isme">
  92. <view class="input-title">签收详情:</view>
  93. <view class="uni-timeline">
  94. <view class="uni-timeline-item" :class="[
  95. item.signfor === '未签收' ? `text-${themeColor.name} uni-timeline-first-item` : 'uni-timeline-last-item']"
  96. v-for="(item, index) in approveDetail" :key="index">
  97. <view class="uni-timeline-item-content">
  98. <view v-if="item.signfor=='未签收'">
  99. {{ item.userName }} ----- {{ item.signfor }}
  100. </view>
  101. <view v-if="item.signfor=='已签收'">
  102. <!-- {{ item.userName }} ----- {{ item.signfor }} -->
  103. {{ item.userName }} 签收意见: {{ item.examine }}
  104. </view>
  105. <view class="datetime" v-if="item.signforDate!=null">
  106. {{ item.signforDate|time}}
  107. </view>
  108. </view>
  109. </view>
  110. </view>
  111. </view>
  112. <!-- <view class="footer" v-if="qianshou">
  113. <view class="input-title">
  114. <text>签收时间:</text>
  115. <text>{{content.updateTime|time}}</text>
  116. </view>
  117. </view> -->
  118. <!-- <view class="covers-body covers-uploader oa-uploader" v-else-if="ismine===false">
  119. <view v-for="(item, index) in radioList" :key="index">
  120. <button class="action-btn" :class="'text-' + themeColor.name" @tap="handleWorksOperation(item.key)">
  121. {{item.value}}
  122. </button>
  123. </view>
  124. </view> -->
  125. <view class="covers-body covers-uploader oa-uploader" v-else-if="ismine===false">
  126. <view v-for="(item, index) in radioList" :key="index">
  127. <button class="action-btn" :class="'text-' + themeColor.name" @tap="openDialog()">
  128. {{item.value}}
  129. </button>
  130. </view>
  131. </view>
  132. <popup-layer ref="popupRef">
  133. <view class="zidingyiBox">
  134. <view class="input-title">
  135. <view class="input-content">签收意见:</view>
  136. </view>
  137. <view class="input-item">
  138. <text class="tit"></text>
  139. <!-- <input v-model="examine" placeholder="请输入签收意见" style="height: 40px;line-height: 40px;"/> -->
  140. <textarea v-model="examine" placeholder="请输入签收意见">
  141. </textarea>
  142. </view>
  143. <view>
  144. <button class="action-btn action-btn1" @tap="handleWorksOperation()">
  145. 签收
  146. </button>
  147. </view>
  148. </view>
  149. </popup-layer>
  150. </view>
  151. </template>
  152. <script>
  153. import moment from '@/common/moment';
  154. import { toastMsg } from '@/pages/toast/toast.js';
  155. export default {
  156. data() {
  157. return {
  158. id: '',
  159. businessKey: '',
  160. taskid: '',
  161. definitionId:'',
  162. content: {},
  163. cardFile: {},
  164. zhshow:false,
  165. cardshow:false,
  166. zgldshow:false,
  167. contentFile: {},
  168. file: {},
  169. qianshou: false,
  170. ismine: false,
  171. isme: false,
  172. examineshow: false,
  173. approveDetail: [],
  174. radioList: [{
  175. "key": "/fw/updateInfo",
  176. "value": "签收"
  177. }],
  178. examine:'',
  179. progress:0,
  180. }
  181. },
  182. filters: {
  183. time(val) {
  184. var date = new Date(val);
  185. return moment(date).format('YYYY-MM-DD HH:mm:ss');
  186. },
  187. },
  188. onLoad: function(opt) {
  189. this.businessKey = opt.businessKey;
  190. if (opt.qianshou == "true") this.qianshou = true;
  191. if (opt.ismine == "true") this.ismine = true;
  192. if (opt.isme == "true") this.isme = true;
  193. this.initData();
  194. },
  195. methods: {
  196. // 数据初始化
  197. initData() {
  198. this.getContent();
  199. uni.setNavigationBarColor({
  200. frontColor: '#ffffff',
  201. backgroundColor: this.themeColor.color,
  202. animation: {
  203. duration: 400,
  204. timingFunc: 'easeIn'
  205. }
  206. })
  207. },
  208. getContent() {
  209. var url = this.$mConfig.baseUrl + '/fw/getFormData';
  210. var token = this.$preToken + ' ' + this.$store.state.accessToken;
  211. var that = this;
  212. this.$http.request({
  213. url: url,
  214. header: {
  215. 'content-type': 'application/json',
  216. 'Authorization': token
  217. },
  218. data: {
  219. formkey: this.businessKey
  220. }
  221. }).then(r => {
  222. if (r.code == "200") {
  223. that.content = r.data;
  224. that.id = r.data.id;
  225. that.taskid = r.data.taskid;
  226. that.definitionId = r.data.instanceid;
  227. if(r.data.ponderance=='1'){
  228. r.data.ponderance='普通'
  229. }else{
  230. r.data.ponderance='加急'
  231. }
  232. that.examineshow=false
  233. if(that.content.examineMe[0]){
  234. that.examineshow=true
  235. }
  236. //console.log(JSON.stringify(r.data))
  237. //字号
  238. that.zhshow=false
  239. if(r.data.referenceNumber){
  240. that.zhshow=true
  241. }
  242. that.zgldshow=false
  243. if(r.data.leaderOpinion){
  244. that.zgldshow=true
  245. }
  246. //阅文卡
  247. that.cardshow=false
  248. if(r.data.cardFilePath!=undefined){
  249. that.cardshow=true
  250. var cardarr = [];
  251. var name=r.data.cardFileName.split(",")
  252. var path=r.data.cardFilePath.split(",")
  253. for (let i=0;i<name.length-1;i++){
  254. cardarr.push({
  255. "name": name[i],
  256. "path": path[i]
  257. })
  258. }
  259. /* cardarr.push({
  260. "name": r.data.cardFileInfo.fileName,
  261. "path": r.data.cardFileInfo.filePath+".png"
  262. }); */
  263. }
  264. var arr = [];
  265. var name=r.data.fileName.split(",")
  266. var path=r.data.filePath.split(",")
  267. for (let i=0;i<name.length-1;i++){
  268. arr.push({
  269. "name": name[i],
  270. "path": path[i]
  271. })
  272. }
  273. /* arr.push({
  274. "name": r.data.fileInfo.fileName,
  275. "path": r.data.fileInfo.filePath+".pdf"
  276. }); */
  277. /* if (r.data.content) var contentfilelist = r.data.content.substr(0, r.data
  278. .content.length - 1).split(',');
  279. else var contentfilelist = [];
  280. for (var i = 0; i < contentfilelist.length; i++) {
  281. arr.push({
  282. "name": contentfilelist[i],
  283. "path": r.data.contentPath.substr(0, r.data.contentPath.length - 1).split(
  284. ',')[i]
  285. });
  286. } */
  287. that.cardFile = cardarr;
  288. that.contentFile = arr;
  289. //附件文件
  290. /* var filearr = [];
  291. if (r.data.fileName) var filelist = r.data.fileName.substr(0, r.data.fileName
  292. .length - 1).split(',');
  293. else var filelist = [];
  294. for (var i = 0; i < filelist.length; i++) {
  295. filearr.push({
  296. "name": filelist[i],
  297. "path": r.data.filePath.substr(0, r.data.filePath.length - 1).split(',')[i]
  298. });
  299. }
  300. that.file = filearr; */
  301. } else {
  302. }
  303. }).then(res => {
  304. if (that.ismine) {
  305. var detailUrl = this.$mConfig.baseUrl + '/fw/signFor';
  306. this.$http.request({
  307. url: detailUrl,
  308. header: {
  309. 'content-type': 'application/json',
  310. 'Authorization': token
  311. },
  312. params: {
  313. businessKey: that.businessKey,
  314. id: that.definitionId
  315. }
  316. }).then(r => {
  317. if (r.code == "200") {
  318. that.approveDetail = r.rows;
  319. }
  320. })
  321. }
  322. })
  323. },
  324. openDialog() {
  325. this.$refs.popupRef.show();
  326. },
  327. showFile(path) {
  328. var type = path.split('.')[1].toLocaleLowerCase();
  329. var url = this.$mConfig.baseUrl + path;
  330. if (type == 'jpg' || type == 'jpeg' || type == 'bmp' || type == 'gif' || type == 'png') {
  331. console.log("2");
  332. var arr = [];
  333. arr.push(url);
  334. uni.previewImage({
  335. urls: arr
  336. });
  337. } else if (type == 'doc' || type == 'xls' || type == 'ppt' || type == 'pdf' || type == 'docx' || type ==
  338. 'xlsx' || type == 'pptx') {
  339. let watiting = plus.nativeUI.showWaiting("下载文件....");
  340. const downloadTask = uni.downloadFile({
  341. url: url,
  342. success: function(res) {
  343. var filePath = res.tempFilePath;
  344. uni.openDocument({
  345. filePath: filePath,
  346. success: function(res) {
  347. console.log(res);
  348. }
  349. });
  350. }
  351. });
  352. downloadTask.onProgressUpdate((res) => {undefined
  353. if(res.progress>90){undefined
  354. this.percent = res.progress
  355. }
  356. if(res.progress==100){undefined
  357. setTimeout(function () {undefined
  358. uni.hideLoading();
  359. /* uni.showToast({undefined,
  360. title:"保存成功",
  361. icon:"success"
  362. }); */
  363. }, 4000);
  364. }
  365. watiting.setTitle("下载进度:" + res.progress + "%");
  366. this.progress = res.progress;
  367. if (res.progress === 100) {
  368. watiting.close();
  369. this.progress = 0;
  370. }
  371. /* console.log('下载进度' + res.progress);
  372. console.log('已经下载的数据长度' + res.totalBytesWritten);
  373. console.log('预期需要下载的数据总长度' + res.totalBytesExpectedToWrite); */
  374. });
  375. } else {
  376. if(type=='rar' || type=='zip'){
  377. this.$mHelper.toast('请在电脑上下载查看压缩包');
  378. return;
  379. }
  380. uni.downloadFile({
  381. url: url,
  382. success: (res) => {
  383. if (res.statusCode === 200) {
  384. var tempFilePaths = res.tempFilePath;
  385. uni.saveFile({
  386. tempFilePath: tempFilePaths[0],
  387. success: function(res) {
  388. var savedFilePath = res.savedFilePath;
  389. toastMsg('success', "已保存文件至:" + savedFilePath);
  390. }
  391. });
  392. }
  393. }
  394. })
  395. }
  396. },
  397. handleWorksOperation(path) {
  398. if(this.examine==''){
  399. toastMsg('warning', '请填写签收意见')
  400. return false;
  401. }
  402. var url = this.$mConfig.baseUrl + "/fw/updateInfo";
  403. var qianshouUrl = this.$mConfig.baseUrl + '/fw/submitToDoItem/' + this.taskid+","+this.examine;
  404. var token = this.$preToken + ' ' + this.$store.state.accessToken;
  405. var that = this;
  406. /* this.$http.request({
  407. url: qianshouUrl,
  408. method: "PUT",
  409. header: {
  410. 'content-type': 'application/json',
  411. 'Authorization': token
  412. },
  413. data: {
  414. SelectUserType: "end",
  415. sendUser: "",
  416. sendUserRealName: ""
  417. }
  418. }).then(res => {
  419. if (res.code == "200") {
  420. toastMsg('success', '签收成功');
  421. that.qianshou = true;
  422. that.content.updateTime = new Date();
  423. that.ismine='';
  424. that.$refs.popupRef.close();
  425. that.getTabBarBadge();
  426. //重新查询列表数量
  427. }
  428. }) */
  429. this.$http.request({
  430. url: url,
  431. method: "POST",
  432. header: {
  433. 'content-type': 'application/json',
  434. 'Authorization': token
  435. },
  436. params: {
  437. id: that.id,
  438. taskid: that.definitionId
  439. }
  440. }).then(r => {
  441. if (r.code = "200") {
  442. this.$http.request({
  443. url: qianshouUrl,
  444. method: "PUT",
  445. header: {
  446. 'content-type': 'application/json',
  447. 'Authorization': token
  448. },
  449. data: {
  450. SelectUserType: "end",
  451. sendUser: "",
  452. sendUserRealName: ""
  453. }
  454. }).then(res => {
  455. if (res.code == "200") {
  456. /* that.qianshou = true;
  457. that.content.updateTime = new Date();
  458. that.ismine='';
  459. that.getTabBarBadge(); */
  460. //重新查询列表数量
  461. toastMsg('success', '签收成功');
  462. that.qianshou = true;
  463. that.content.updateTime = new Date();
  464. that.ismine='';
  465. that.$refs.popupRef.close();
  466. that.getTabBarBadge();
  467. //重新查询列表数量
  468. }
  469. })
  470. }
  471. })
  472. }
  473. }
  474. }
  475. </script>
  476. <style lang="scss">
  477. .oa-notice-detail {
  478. .uni-timeline {
  479. padding: $spacing-lg;
  480. background-color: $color-white;
  481. }
  482. .feedback-title {
  483. display: flex;
  484. flex-direction: row;
  485. justify-content: space-between;
  486. align-items: center;
  487. padding: $spacing-base;
  488. margin-top: $spacing-base;
  489. font-size: $font-base;
  490. }
  491. .feedback-star-view.feedback-title {
  492. justify-content: flex-start;
  493. margin: 0;
  494. }
  495. .feedback-quick {
  496. position: relative;
  497. padding-right: 40upx;
  498. .iconfont {
  499. font-size: $font-sm;
  500. }
  501. }
  502. .feedback-body {
  503. background: $color-white;
  504. padding: $spacing-sm $spacing-base;
  505. .gender-item {
  506. margin-right: 20upx;
  507. .gender-item-text {
  508. padding-left: 10upx;
  509. }
  510. radio .wx-radio-input.wx-radio-input-checked {
  511. background: $uni-color-primary;
  512. border-color: $uni-color-primary;
  513. }
  514. }
  515. }
  516. .feedback-textare {
  517. height: 200upx;
  518. font-size: 34upx;
  519. line-height: 50upx;
  520. width: 100%;
  521. box-sizing: border-box;
  522. padding: 20upx 30upx 0;
  523. }
  524. .footer {
  525. position: fixed;
  526. left: 0;
  527. top: 0;
  528. z-index: 98;
  529. width: 100%;
  530. background-color: $color-white;
  531. color: $font-color-base;
  532. box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.1);
  533. display: flex;
  534. justify-content: flex-end;
  535. align-items: center;
  536. padding: 15upx $spacing-base;
  537. .action-btn {
  538. font-size: $font-sm;
  539. margin: 0 0 0 15upx;
  540. padding: 0 $spacing-lg;
  541. text-align: center;
  542. height: 60upx;
  543. line-height: 60upx;
  544. }
  545. }
  546. .banner {
  547. overflow: hidden;
  548. position: relative;
  549. background-color: #ccc;
  550. .banner-img {
  551. height: 300upx;
  552. width: 100%;
  553. }
  554. .banner-title {
  555. max-height: 84upx;
  556. overflow: hidden;
  557. position: absolute;
  558. bottom: 0;
  559. width: 100%;
  560. font-size: 32upx;
  561. font-weight: 400;
  562. line-height: 42upx;
  563. color: white;
  564. z-index: 11;
  565. background-color: rgba(0, 0, 0, 0.25);
  566. padding: 4upx 20upx;
  567. }
  568. }
  569. .banner-title {
  570. padding: $spacing-lg $spacing-lg 0;
  571. font-size: $font-lg;
  572. }
  573. .article-meta {
  574. padding: 20upx 40upx;
  575. display: flex;
  576. flex-direction: row;
  577. justify-content: flex-start;
  578. color: gray;
  579. .article-text {
  580. font-size: 26upx;
  581. line-height: 50upx;
  582. margin: 0 20upx;
  583. }
  584. .article-author,
  585. .article-time {
  586. font-size: 30upx;
  587. }
  588. }
  589. .article-content {
  590. padding: 0 30upx;
  591. overflow: hidden;
  592. font-size: 30upx;
  593. margin-bottom: 30upx;
  594. }
  595. .input-title {
  596. display: flex;
  597. flex-direction: row;
  598. justify-content: flex-start;
  599. align-items: center;
  600. padding: $spacing-base;
  601. margin-top: $spacing-base;
  602. font-size: $font-base;
  603. width: 100%;
  604. }
  605. .contentTitle {
  606. width: 30%;
  607. }
  608. .contentDetail {
  609. width: 60%;
  610. }
  611. .input-body {
  612. background: $color-white;
  613. padding: $spacing-sm $spacing-base;
  614. }
  615. .covers-title {
  616. display: flex;
  617. flex-direction: row;
  618. justify-content: space-between;
  619. align-items: center;
  620. padding: $spacing-base;
  621. margin-top: $spacing-base;
  622. font-size: $font-base;
  623. }
  624. .covers-body {
  625. background: $color-white;
  626. padding: $spacing-sm $spacing-base;
  627. .gender-item {
  628. margin-right: 20upx;
  629. .gender-item-text {
  630. padding-left: 10upx;
  631. }
  632. radio .wx-radio-input.wx-radio-input-checked {
  633. background: $uni-color-primary;
  634. border-color: $uni-color-primary;
  635. }
  636. }
  637. }
  638. .covers-uploader {
  639. padding: 22upx 20upx;
  640. margin: 22upx 20upx;
  641. }
  642. .tit {
  643. height: 40px;
  644. width:7vw;
  645. text-align: right;
  646. float:left;
  647. line-height: 40px;
  648. font-size: $font-sm + 2upx;
  649. color: $font-color-base;
  650. }
  651. textarea {
  652. border: 1px solid #b9b9b9;
  653. height: 200rpx;
  654. width: 90%;
  655. margin-left:5%;
  656. word-wrap : break-word;
  657. }
  658. }
  659. .action-btn1{
  660. background: #0081FF !important;
  661. color: #fff;
  662. margin:50upx 30upx;
  663. }
  664. </style>