rehearsalTaskSign.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837
  1. <template>
  2. <div>
  3. <NavBar />
  4. <div class="bigbox">
  5. <div class="mainItem">
  6. <van-row>
  7. <van-col :span="8" class="label">
  8. <div>标题</div>
  9. </van-col>
  10. <van-col :span="16">
  11. <div>{{ trainingData.title }}</div>
  12. </van-col>
  13. </van-row>
  14. </div>
  15. <div class="mainItem">
  16. <van-row>
  17. <van-col :span="8" class="label">
  18. <div>单位名称</div>
  19. </van-col>
  20. <van-col :span="16">
  21. <div>{{ trainingData.orgName }}</div>
  22. </van-col>
  23. </van-row>
  24. </div>
  25. <div class="mainItem">
  26. <van-row>
  27. <van-col :span="8" class="label">
  28. <div>演练开始时间</div>
  29. </van-col>
  30. <van-col :span="16">
  31. <div>{{ trainingData.drillStartTime }}</div>
  32. </van-col>
  33. </van-row>
  34. </div>
  35. <div class="mainItem">
  36. <van-row>
  37. <van-col :span="8" class="label">
  38. <div>演练结束时间</div>
  39. </van-col>
  40. <van-col :span="16">
  41. <div>{{ trainingData.drillEndTime }}</div>
  42. </van-col>
  43. </van-row>
  44. </div>
  45. <div class="mainItem">
  46. <van-row>
  47. <van-col :span="8" class="label">
  48. <div>演练地点</div>
  49. </van-col>
  50. <van-col :span="16">
  51. <div>{{ trainingData.drillSite }}</div>
  52. </van-col>
  53. </van-row>
  54. </div>
  55. <!-- <div class="mainItem">
  56. <div class="label">演练类型</div>
  57. <div>{{ trainingData.categoryText }}</div>
  58. </div> -->
  59. <div class="mainItem">
  60. <van-row>
  61. <van-col :span="8" class="label">
  62. <div>演练文件</div>
  63. </van-col>
  64. <van-col :span="16" class="zl">
  65. <div v-for="item in studyList" :key="item.name">
  66. <van-tag type="primary" class="tagCls" plain @click="tagHandler(item)">{{ item.name }}</van-tag>
  67. </div>
  68. </van-col>
  69. </van-row>
  70. </div>
  71. <div class="mainItem">
  72. <van-row>
  73. <van-col :span="8" class="label">
  74. <div>指挥人</div>
  75. </van-col>
  76. <van-col :span="16">
  77. <div>{{ trainingData.hostName }}</div>
  78. </van-col>
  79. </van-row>
  80. </div>
  81. <div class="mainItem">
  82. <van-row>
  83. <van-col :span="8" class="label">
  84. <div>演练类型</div>
  85. </van-col>
  86. <van-col :span="16">
  87. <div>{{ trainingData.typeText }}</div>
  88. </van-col>
  89. </van-row>
  90. </div>
  91. <div class="mainItem">
  92. <van-row>
  93. <van-col :span="8" class="label">
  94. <div>预设案由</div>
  95. </van-col>
  96. <van-col :span="16">
  97. <div>{{ trainingData.presetCase }}</div>
  98. </van-col>
  99. </van-row>
  100. </div>
  101. <div class="mainItem">
  102. <van-row>
  103. <van-col :span="8" class="label">
  104. <div>演练情况</div>
  105. </van-col>
  106. <van-col :span="16">
  107. <div>{{ trainingData.drillSituation }}</div>
  108. </van-col>
  109. </van-row>
  110. </div>
  111. <div class="mainItem">
  112. <van-row>
  113. <van-col :span="8" class="label">
  114. <div>点评总结</div>
  115. </van-col>
  116. <van-col :span="16">
  117. <div>{{ trainingData.comment }}</div>
  118. </van-col>
  119. </van-row>
  120. </div>
  121. <div class="mainItem">
  122. <van-row>
  123. <van-col :span="8" class="label">
  124. <div>参演人员</div>
  125. </van-col>
  126. <van-col :span="16">
  127. <div>{{ taskUserList }}</div>
  128. </van-col>
  129. </van-row>
  130. </div>
  131. <div class="mainItem">
  132. <van-row>
  133. <van-col :span="8" class="label">
  134. <div>缺席人员</div>
  135. </van-col>
  136. <van-col :span="16">
  137. <div>{{ qsUserList }}</div>
  138. </van-col>
  139. </van-row>
  140. </div>
  141. <div class="mainItem">
  142. <van-row>
  143. <van-col :span="8" class="label">
  144. <div>上传图片</div>
  145. </van-col>
  146. <van-col :span="16">
  147. <imgCom
  148. :width="'100'"
  149. v-for="item in imgList"
  150. :list="imgList"
  151. :key="item"
  152. :height="'100'"
  153. :src="item"
  154. ></imgCom>
  155. </van-col>
  156. </van-row>
  157. </div>
  158. <div class="mainItem" v-if="peopleShow">
  159. <van-row>
  160. <van-col :span="8" class="label">
  161. <div>参演人员签字</div>
  162. </van-col>
  163. <van-col :span="16">
  164. <!-- signUserList -->
  165. <template v-for="item in signUserList">
  166. <imgCom
  167. v-if="item.signImage"
  168. :width="'100'"
  169. :list="signUserListMap"
  170. :key="item.userId"
  171. :height="'100'"
  172. :src="item.signImage"
  173. ></imgCom>
  174. </template>
  175. </van-col>
  176. </van-row>
  177. </div>
  178. <div class="mainItem" v-if="evaluate">
  179. <van-row>
  180. <van-col :span="8" class="label">
  181. <div>评分</div>
  182. </van-col>
  183. <van-col :span="16">
  184. <van-rate :disabled="disabledShow" v-model="value" :count="10" />
  185. </van-col>
  186. </van-row>
  187. </div>
  188. <div class="mainItem" v-if="disabledShow">
  189. <van-row>
  190. <van-col :span="8" class="label">
  191. <div>评分</div>
  192. </van-col>
  193. <van-col :span="16"> {{ value }}分 </van-col>
  194. </van-row>
  195. </div>
  196. <div class="mainItem" v-if="islearning">
  197. <van-row>
  198. <van-col :span="8" class="label">
  199. <div>评优状态</div>
  200. </van-col>
  201. <van-col :span="16"> {{ trainingData.recStatusText }}分 </van-col>
  202. </van-row>
  203. </div>
  204. <div class="mainItem" v-if="$route.params.id.split('_')[1] === 'comment'">
  205. <van-row>
  206. <van-col :span="24" class="label bgc">
  207. <van-checkbox-group v-model="result" direction="horizontal" @change="clickChekcBox($event)">
  208. <van-checkbox
  209. v-for="item in checkBoxList"
  210. :key="item.value"
  211. :disabled="item.disabled"
  212. shape="square"
  213. :checked="item.checked"
  214. :name="item.value"
  215. >{{ item.name }}</van-checkbox
  216. >
  217. </van-checkbox-group>
  218. </van-col>
  219. </van-row>
  220. </div>
  221. </div>
  222. <van-row>
  223. <van-col span="24" class="btns">
  224. <!-- 签名 -->
  225. <van-button
  226. type="info"
  227. class="btn"
  228. v-if="this.$route.params.id.split('_')[1] === 'edit'"
  229. @click="signatureHandler"
  230. >签名</van-button
  231. >
  232. <!-- 评价 || 评优推优选 -->
  233. <van-button
  234. type="info"
  235. class="btn"
  236. v-if="this.$route.params.id.split('_')[1] === 'evaluate' || this.$route.params.id.split('_')[1] === 'comment'"
  237. @click="submitHandler"
  238. >提交</van-button
  239. >
  240. </van-col>
  241. </van-row>
  242. <van-action-sheet v-model="show" title="签名" class="sheet">
  243. <writingPad ref="esign" :old-signature-seal="oldSignatureSeal" @resultImg="resultImg" @cancelSign="cancelSign"></writingPad>
  244. </van-action-sheet>
  245. <van-dialog v-model="confirmShow" title="引入签名" show-cancel-button @confirm="confirmSignImg">
  246. <van-image :src="this_window + oldSignatureSeal" />
  247. </van-dialog>
  248. </div>
  249. </template>
  250. <script>
  251. import NavBar from '@/components/NavBar'
  252. import writingPad from '@/components/writingPad/index.vue'
  253. import { getrehearsalInfo, singrehearsalTask, drillSignInfo } from '@/api/drillTask.js'
  254. import { submitRecTask } from '@/api/optimalLearning.js'
  255. import { upload } from '@/api/public'
  256. import imgCom from '@/components/imgCom/index.vue'
  257. import { base64ToBlob } from '@/utils/base64TurnImg.js'
  258. import config from '@/config/index'
  259. import { Toast, Dialog } from 'vant'
  260. import VuePdf from '@/components/pdfCom/index.vue'
  261. export default {
  262. name: 'SocAppAddTraining',
  263. components: {
  264. NavBar,
  265. Dialog,
  266. Toast,
  267. VuePdf,
  268. imgCom,
  269. writingPad
  270. },
  271. data() {
  272. return {
  273. result: [],
  274. orgType: '', //机构类型
  275. activeTab:null, // 当前推优活动的Tab
  276. content: '', //评语
  277. value: 0, //评分
  278. confirmShow:false,
  279. this_window: process.env.NODE_ENV === 'development' ? '/dev' : window.origin,
  280. show: false,
  281. checkBoxList: [],
  282. taskUserList: [], //参演人员
  283. qsUserList: [], //缺席人员
  284. imgList: [
  285. ], //图片数组
  286. signUserList: [
  287. ], //参演人员签名数组
  288. signUserListMap: [], //参演人员签名数组Map
  289. studyList: [], //学习资料数组
  290. trainingData: {}, //详情数据
  291. oldSignatureSeal:""
  292. }
  293. },
  294. computed: {
  295. goBack() {
  296. this.$router.go(-1)
  297. // if (
  298. // this.$route.params.id.split('_')[1] === 'evaluate' ||
  299. // this.$route.params.id.split('_')[1] === 'edit' ||
  300. // this.$route.params.id.split('_')[1] === 'info'
  301. // ) {
  302. // return '/rehearsalTask'
  303. // } else if (this.$route.params.id.split('_')[1] === 'comment') {
  304. // return '/rehearsaloptimal'
  305. // } else if (this.$route.params.id.split('_')[1] === 'learning') {
  306. // return '/rehearsallearning'
  307. // } else if (this.$route.params.id.split('_')[1] === 'info1') {
  308. // return '/rehearsaloptimal'
  309. // }
  310. },
  311. evaluate() {
  312. if (this.$route.params.id.split('_')[1] === 'evaluate') {
  313. return true
  314. } else {
  315. return false
  316. }
  317. },
  318. disabledShow() {
  319. if (
  320. this.$route.params.id.split('_')[1] === 'info' ||
  321. this.$route.params.id.split('_')[1] === 'info1' ||
  322. this.$route.params.id.split('_')[1] === 'comment' ||
  323. this.$route.params.id.split('_')[1] === 'learning'
  324. ) {
  325. return true
  326. } else {
  327. return false
  328. }
  329. },
  330. islearning() {
  331. if (this.$route.params.id.split('_')[1] === 'learning') {
  332. return true
  333. } else {
  334. return false
  335. }
  336. },
  337. peopleShow() {
  338. if (
  339. this.$route.params.id.split('_')[1] === 'info' ||
  340. this.$route.params.id.split('_')[1] === 'info1' ||
  341. this.$route.params.id.split('_')[1] === 'comment' ||
  342. this.$route.params.id.split('_')[1] === 'learning'
  343. ) {
  344. return true
  345. } else {
  346. return false
  347. }
  348. }
  349. },
  350. created() {
  351. //获取详情信息
  352. getrehearsalInfo(this.$route.params.id.split('_')[0]).then(res => {
  353. let { code, data, msg } = res
  354. if (code == 200) {
  355. this.content = data.comment
  356. this.value = +data.commentScore
  357. this.trainingData = data
  358. if (this.trainingData.taskUserList && this.trainingData.taskUserList.length > 0) {
  359. this.trainingData.taskUserList.forEach(item => {
  360. if (item.type == 1) {
  361. this.taskUserList.push(item.userName)
  362. } else {
  363. this.qsUserList.push(item.userName)
  364. }
  365. })
  366. }
  367. this.taskUserList = this.taskUserList.join(',')
  368. this.qsUserList = this.qsUserList.join(',')
  369. this.signUserList = data.taskUserList || []
  370. if (data.taskUserList) {
  371. data.taskUserList.forEach(item=>{
  372. if (item.sign==1){
  373. this.signUserListMap.push(item.signImage)
  374. }
  375. })
  376. //this.signUserListMap = data.taskUserList.map(item => item.signImage) || []
  377. }
  378. let list = data.fileList || []
  379. if (list.length > 0) {
  380. list.forEach(item => {
  381. let i = JSON.parse(item)
  382. if (i.url.split('.')[1] == 'pdf') {
  383. i.type = 1
  384. } else {
  385. i.type = 0
  386. }
  387. this.studyList.push(i)
  388. })
  389. }
  390. if (this.trainingData.imageList) {
  391. this.imgList = this.trainingData.imageList.split(',') || []
  392. }
  393. //获取当前登录人机构类型
  394. this.orgType = window.sessionStorage.getItem('SET_USER_ORGTYPE');
  395. this.activeTab =this.$route.params.id.split('_')[2];
  396. this.getCheckBoxList();
  397. }
  398. })
  399. },
  400. mounted() {
  401. this.oldSignatureSeal = JSON.parse(window.sessionStorage.getItem('SET_MASTER_SIGNATURE_SEAL')) + '';
  402. },
  403. methods: {
  404. getCheckBoxList()
  405. {
  406. console.log(this.orgType, 'this.orgType')
  407. if (this.orgType == 1) {
  408. //行社评定地区
  409. let checkBoxList1 = [
  410. {
  411. name: '行社优秀(不推荐地区)',
  412. value: 7,
  413. disabled: false
  414. },
  415. {
  416. name: '评定地区优秀',
  417. value: 3,
  418. disabled: false
  419. },
  420. {
  421. name: '推荐为省级优秀',
  422. value: 4,
  423. disabled: true
  424. }
  425. ]
  426. //省联社评定
  427. let checkBoxList2 = [
  428. {
  429. name: '地区优秀(不推荐省级)',
  430. value: 8,
  431. disabled: false
  432. },
  433. {
  434. name: '评定省级优秀',
  435. value: 5,
  436. disabled: false
  437. }
  438. ]
  439. //从管理页面调整进入 评优界面
  440. if(this.activeTab=='1'){
  441. //办事处
  442. this.checkBoxList = checkBoxList1;
  443. }
  444. // 省联社处理 厦门、莆田 地区推优评优
  445. if(this.activeTab=='3') {
  446. // 地区优秀
  447. if(this.trainingData.recStatus ==3 && !this.trainingData.unRecStatus)
  448. {
  449. //省联社
  450. this.checkBoxList =checkBoxList1;
  451. }
  452. // 地区优秀 不推荐省级优秀
  453. if(this.trainingData.recStatus ==3 && this.trainingData.unRecStatus)
  454. {
  455. //省联社
  456. this.checkBoxList =checkBoxList2;
  457. }
  458. // 已推荐省级优秀
  459. if(this.trainingData.recStatus ==4)
  460. {
  461. //省联社
  462. this.checkBoxList =checkBoxList2;
  463. }
  464. }
  465. // 从待办直接进入 评优界面
  466. if(!this.activeTab)
  467. {
  468. // 行社已推荐地区
  469. if(this.trainingData.recStatus ==2)
  470. {
  471. //办事处
  472. this.checkBoxList = checkBoxList1;
  473. }
  474. // 地区已推荐省级
  475. if(this.trainingData.recStatus ==4)
  476. {
  477. this.checkBoxList = checkBoxList2;
  478. }
  479. }
  480. if (this.trainingData.recStatus == 5) {
  481. this.result = [5]
  482. }
  483. } else if (this.orgType == 2) {
  484. if(this.activeTab=='1' || !this.activeTab){
  485. //办事处
  486. this.checkBoxList = [
  487. {
  488. name: '行社优秀(不推荐地区)',
  489. value: 7,
  490. disabled: false
  491. },
  492. {
  493. name: '评定地区优秀',
  494. value: 3,
  495. disabled: false
  496. },
  497. {
  498. name: '推荐为省级优秀',
  499. value: 4,
  500. disabled: true
  501. }
  502. ]
  503. }
  504. else{
  505. //办事处
  506. this.checkBoxList = [
  507. {
  508. name: '地区优秀(不推荐省级)',
  509. value: 8,
  510. disabled: false
  511. },
  512. {
  513. name: '推荐为省级优秀',
  514. value: 4,
  515. disabled: false
  516. }
  517. ]
  518. }
  519. if (this.trainingData.recStatus == 4) {
  520. this.result = [3, 4]
  521. } else if (this.trainingData.recStatus == 3) {
  522. this.result = [3]
  523. }
  524. } else if (this.orgType == 3) {
  525. if(this.activeTab=='0' || !this.activeTab)
  526. {
  527. //行社
  528. this.checkBoxList = [
  529. {
  530. name: '普通案例(不推荐行优)',
  531. value: 6,
  532. disabled: false
  533. },
  534. {
  535. name: '评定行社优秀案例',
  536. value: 1,
  537. disabled: false
  538. },
  539. {
  540. name: '推荐地区优秀案例',
  541. value: 2,
  542. disabled: true
  543. }
  544. ]
  545. }
  546. else if(this.activeTab='1'){
  547. //行社
  548. this.checkBoxList = [
  549. {
  550. name: '行社优秀(不推荐地区)',
  551. value: 7,
  552. disabled: false
  553. },
  554. {
  555. name: '推荐地区优秀案例',
  556. value: 2,
  557. disabled: false
  558. }
  559. ]
  560. }
  561. if (this.trainingData.recStatus == 2) {
  562. this.result = [1, 2]
  563. }
  564. // else if (this.trainingData.recStatus == 1) {
  565. // this.result = [1]
  566. // }
  567. }
  568. },
  569. disabledCheck(item) {
  570. if (item == 'false') return false
  571. if (item == 'true') return true
  572. //当前是最后一个复选框禁用
  573. // if (this.checkBoxList.length > 1 && item.value == this.checkBoxList[this.checkBoxList.length - 1].value) {
  574. // return true
  575. // } else {
  576. // return false
  577. // }
  578. },
  579. clickChekcBox(v) {
  580. // console.log(v)
  581. // console.log(this.resultList[0])
  582. console.log("clickChekcBox",v,this.checkBoxList)
  583. // console.log("clickChekcBoxx",v[0] < this.resultList[0].value,v[0],,v[0]==this.resultList[1])
  584. // 当前选中的是第一个 选择框 未 “不推荐”
  585. if (v[0] == this.checkBoxList[0].value) {
  586. if (this.checkBoxList[1]) {
  587. this.checkBoxList[1].disabled = this.disabledCheck('true')
  588. }
  589. if (this.checkBoxList[2]) {
  590. this.checkBoxList[2].disabled = this.disabledCheck('true')
  591. }
  592. console.log("clickChekcBox1",v,this.checkBoxList)
  593. } else if (v[0] < this.checkBoxList[0].value && v[0]==this.checkBoxList[1].value) {
  594. this.checkBoxList[0].disabled = this.disabledCheck('true')
  595. if(this.checkBoxList[2]) this.checkBoxList[2].disabled = this.disabledCheck('false')
  596. console.log("clickChekcBox2",v,this.checkBoxList)
  597. }
  598. else if (v[0] < this.checkBoxList[0].value && v[0]>this.checkBoxList[1].value) {
  599. this.result=[];
  600. }
  601. else {
  602. this.checkBoxList[0].disabled = this.disabledCheck('false')
  603. this.checkBoxList[1].disabled = this.disabledCheck('false')
  604. if(this.checkBoxList[2])this.checkBoxList[2].disabled = this.disabledCheck('true')
  605. console.log("clickChekcBox3",v,this.checkBoxList)
  606. }
  607. },
  608. signatureHandler() {
  609. this.show = true
  610. },
  611. //评价提交
  612. submitHandler() {
  613. //判断当前是评价 还是评价推优
  614. if (this.$route.params.id.split('_')[1] === 'evaluate') {
  615. //评价
  616. if (this.value == 0) {
  617. //评分不能为0分
  618. Toast('评分不能为0分')
  619. return
  620. }
  621. Dialog.confirm({
  622. title: '',
  623. message: `是否提交评价?`
  624. })
  625. .then(() => {
  626. drillSignInfo({
  627. taskId: this.trainingData.id,
  628. // type: this.trainingData.type,
  629. score: this.value,
  630. comment: this.content
  631. }).then(res => {
  632. let { code, msg } = res
  633. if (code == 200) {
  634. Toast('评价成功')
  635. setTimeout(() => {
  636. this.$router.go(-1)
  637. }, 1000)
  638. } else {
  639. Toast(msg)
  640. }
  641. })
  642. })
  643. .catch(() => {
  644. // on cancel
  645. })
  646. } else {
  647. //评价推优
  648. if(!this.result || this.result.length==0)
  649. {
  650. this.$toast.fail('请至少选择一项评优推优选项');
  651. return;
  652. }
  653. submitRecTask({
  654. drillTaskId: this.trainingData.id,
  655. recStatus: Math.max(...this.result)
  656. }).then(res => {
  657. if (this.result && this.result.length > 0) {
  658. Toast('评优成功')
  659. } else {
  660. Toast('取消成功')
  661. }
  662. setTimeout(() => {
  663. this.$router.go(-1)
  664. }, 1000)
  665. })
  666. }
  667. },
  668. clearHandler() {
  669. this.$refs.esign.handleReset()
  670. },
  671. cancelSign()
  672. {
  673. this.show = false;
  674. },
  675. confirmSignImg(){
  676. this.cancelSign();
  677. this.submitSign(this.oldSignatureSeal);
  678. },
  679. //上传签名图到服务器
  680. resultImg(img,oldImgUrl) {
  681. if (oldImgUrl !== "" && oldImgUrl !== null && oldImgUrl !== "null"){
  682. //this.submitSign(oldImgUrl)
  683. this.confirmShow =true;
  684. this.oldSignatureSeal = oldImgUrl;
  685. }else {
  686. let obj = base64ToBlob(img)
  687. let formData = new FormData()
  688. obj.name = '签名.jpg'
  689. formData.append('file', base64ToBlob(img))
  690. upload(formData, 'image')
  691. .then(res => {
  692. console.log(process.env.NODE_ENV)
  693. /*上传成功*/
  694. let imgUrl = process.env.NODE_ENV === 'development' ? res.data.url : res.data.url
  695. this.submitSign(imgUrl)
  696. // this.$emit("imgUrl", res.data.url);
  697. })
  698. .catch(err => {
  699. /*上传失败*/
  700. })
  701. }
  702. },
  703. tagHandler(i) {
  704. let str = i.name.split('.')[1]
  705. if (str == 'png' || str == 'jpg' || str == 'jpeg' || str == 'pdf') {
  706. //当前是图片||PDF
  707. this.openFilePreview(i)
  708. } else {
  709. const filePath = `${process.env.NODE_ENV === 'development' ? '/dev' : window.origin}${i.url}`
  710. const tempLink = document.createElement('a')
  711. tempLink.style.display = 'none'
  712. tempLink.href = filePath
  713. tempLink.setAttribute('download', i.name)
  714. tempLink.setAttribute('target', '_blank')
  715. document.body.appendChild(tempLink)
  716. tempLink.click()
  717. document.body.removeChild(tempLink)
  718. }
  719. },
  720. //提交到后端数据
  721. submitSign(url) {
  722. singrehearsalTask({
  723. id: this.trainingData.id,
  724. signImage: url
  725. }).then(res => {
  726. this.$router.go(-1)
  727. })
  728. }
  729. }
  730. }
  731. </script>
  732. <style lang="scss" scoped>
  733. .mainItem {
  734. font-size: 28px;
  735. width: 100%;
  736. }
  737. .mainItemData {
  738. justify-content: end;
  739. }
  740. .bigbox {
  741. margin: 20px;
  742. box-shadow: 0 8px 12px #ebedf0;
  743. }
  744. .tagCls {
  745. margin-bottom: 20px;
  746. margin-left: 10px;
  747. }
  748. .btns {
  749. background-color: #fff;
  750. width: 100%;
  751. }
  752. .btn {
  753. width: 100%;
  754. }
  755. .sheet {
  756. height: 45%;
  757. }
  758. .van-row {
  759. background-color: #f0f0f0;
  760. display: flex;
  761. border-bottom: 1px solid #ccc;
  762. align-items: center;
  763. // margin-top: -1px;
  764. // border: 1px solid #ccc;
  765. .van-col--8 {
  766. min-height: 100px;
  767. display: flex;
  768. justify-content: center;
  769. align-items: center;
  770. padding: 10px;
  771. background-color: rgb(230, 230, 230, 0.4);
  772. opacity: 1;
  773. }
  774. .van-col {
  775. text-align: justify;
  776. white-space: pre-wrap;
  777. .van-checkbox-group--horizontal{
  778. .van-checkbox--horizontal{
  779. margin-top:3.2vw;
  780. }
  781. }
  782. }
  783. .zl {
  784. display: block !important;
  785. flex: none !important;
  786. padding-left: 10px;
  787. }
  788. .van-col--16 {
  789. min-height: 100px;
  790. display: flex;
  791. align-items: center;
  792. padding-left: 10px;
  793. background-color: #fff;
  794. padding: 10px;
  795. flex-flow: wrap;
  796. // opacity: 0.9;
  797. }
  798. .tagCls {
  799. margin-top: 10px;
  800. }
  801. .bgc {
  802. background-color: #fff;
  803. padding: 10px;
  804. }
  805. }
  806. </style>