communication.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609
  1. <template>
  2. <view>
  3. <cu-custom bgColor="bg-luohu" :isBack="true">
  4. <block slot="backText">返回</block>
  5. <block slot="content">沟通记录</block>
  6. </cu-custom>
  7. <view>
  8. <view class="cu-form-group">
  9. <view class="title">表单编号:</view>
  10. <input placeholder="请输入表单编号" v-model="form.biaoDanBianHao" name="input" :disabled="true"></input>
  11. </view>
  12. <view class="cu-form-group">
  13. <view class="title">客户单位名称:</view>
  14. <input placeholder="请输入客户单位名称" v-model="form.xuanZeKeHu" name="input" disabled></input>
  15. <!-- <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42"
  16. v-if="form.keHuDanWeiMingChe != ''" @click="form.keHuDanWeiMingChe = ''"></u-icon> -->
  17. </view>
  18. <view class="cu-form-group">
  19. <view class="title">客户联系人:</view>
  20. <input placeholder="请输入客户联系人" v-model="form.keHuLianXiRen" name="input" :disabled="id && id != '' ? true: false"></input>
  21. <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42" v-if="form.keHuLianXiRen != '' && id == ''" @click="form.keHuLianXiRen = ''"></u-icon>
  22. </view>
  23. <view class="cu-form-group">
  24. <view class="title">委托单号:</view>
  25. <text style="width: 100%;" @click="getShow">{{getWeiTuo(form.weiTuoDanHao)}}</text>
  26. <u-button type="success" size="mini" @click="getShow" v-if="form.weiTuoDanHao == '' && id == ''">选择
  27. </u-button>
  28. <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42" v-if="form.weiTuoDanHao != '' && id == ''" @click="form.weiTuoDanHao = ''"></u-icon>
  29. </view>
  30. <view class="cu-form-group">
  31. <view class="title">联系电话:</view>
  32. <input placeholder="请输入联系电话" v-model="form.lianXiDianHua" name="input" :disabled="id && id != '' ? true: false"></input>
  33. <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42" v-if="form.lianXiDianHua != '' && id == ''" @click="form.lianXiDianHua = ''"></u-icon>
  34. </view>
  35. <view class="cu-form-group">
  36. <view class="title">样品名称:</view>
  37. <textarea maxlength="-1" v-model="form.yangPinMingCheng" placeholder="请输入样品名称" auto-height="true" :disabled="id && id != '' ? true: false"></textarea>
  38. <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42" v-if="form.yangPinMingCheng != '' && id == ''" @click="form.yangPinMingCheng = ''"></u-icon>
  39. </view>
  40. <view class="cu-form-group">
  41. <view class="title">样品编号:</view>
  42. <textarea maxlength="-1" v-model="form.yangPinBianHao" placeholder="请输入样品编号" auto-height="true" :disabled="id && id != '' ? true: false"></textarea>
  43. <!-- <input placeholder="请输入样品编号" v-model="form.yangPinBianHao" name="input"
  44. :disabled="id && id != '' ? true: false"></input> -->
  45. <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42" v-if="form.yangPinBianHao != '' && id == ''" @click="form.yangPinBianHao = '' && id == ''"></u-icon>
  46. </view>
  47. <view class="cu-form-group">
  48. <view class="title">样品类型:</view>
  49. <textarea maxlength="-1" v-model="form.yangPinLeiXing" placeholder="请输入样品类型" auto-height="true" :disabled="id && id != '' ? true: false"></textarea>
  50. <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42" v-if="form.yangPinLeiXing != '' && id == ''" @click="form.yangPinLeiXing = ''"></u-icon>
  51. </view>
  52. <view class="cu-form-group">
  53. <view class="title">报告编号:</view>
  54. <textarea maxlength="-1" v-model="form.baoGaoBianHao" placeholder="请输入报告编号" auto-height="true" :disabled="id && id != '' ? true: false"></textarea>
  55. <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42" v-if="form.baoGaoBianHao != '' && id == ''" @click="form.baoGaoBianHao = ''"></u-icon>
  56. </view>
  57. <view class="cu-form-group">
  58. <view class="title">沟通类型:</view>
  59. <input placeholder="请选择沟通类型" v-model="form.gouTongLeiXing" name="input" disabled></input>
  60. <u-button type="success" size="mini" @click="sheetShow = true" v-if="id == ''">选择</u-button>
  61. </view>
  62. <uni-section title="沟通内容" type="line" padding>
  63. <textarea maxlength="-1" v-model="form.gouTongNeiRong" placeholder="意见和建议" :disabled="id && id != '' ? true: false"></textarea>
  64. </uni-section>
  65. <uni-section title="上传附件" type="line">
  66. <view class="example-body" v-if="id == ''">
  67. <uni-file-picker limit="5" file-mediatype="all" @select="select" @progress="progress" @success="success" @fail="fail" @delete="deleteMe" :auto-upload="false" ref="uploadMe">
  68. </uni-file-picker>
  69. </view>
  70. <view v-else>
  71. <view v-for="(item,index) in fuJianShangChuanArray" :key="index" style="margin: 0 10rpx;">
  72. <view style="line-height: 50rpx;" @click="uploadClick(item.id,item.fileName,item.ext)">{{item.fileName + '.' + item.ext}}</view>
  73. </view>
  74. </view>
  75. </uni-section>
  76. <uni-section title="签名" type="line" padding>
  77. <view style="width: 100%;">
  78. <view style="text-align: right;width: 100%;" v-if="typeValue != '1'">
  79. <view>
  80. <u-button type="primary" size="mini" @click="qianming()" class="btn-back-color">
  81. 签名</u-button>
  82. <u-button type="error" size="mini" @click="deqianming()" style="margin-left: 15rpx;" v-if="form.keHu != ''">
  83. 取消</u-button>
  84. </view>
  85. </view>
  86. <view style="width: 100%;margin-top: 10rpx;" v-if="form.keHu != ''">
  87. <image :src="form.keHu" style="width: 100%;height: 500rpx;border: 1px #eee solid;">
  88. </image>
  89. </view>
  90. </view>
  91. </uni-section>
  92. <uni-section title="沟通内容确定" type="line" padding v-if="id != '' && form.leiXing != '2'">
  93. <textarea maxlength="-1" v-model="form.gouTongQueDingNei" placeholder="意见和建议" :disabled="true"></textarea>
  94. </uni-section>
  95. <view class="padding flex flex-direction" v-if="typeValue == '3'">
  96. <u-button type="success" class="btn btn-back-color" @click="onSubmit">提交
  97. </u-button>
  98. </view>
  99. <view class="padding flex flex-direction" v-if="typeValue == '2'">
  100. <u-button type="success" class="btn btn-back-color" @click="onAgree">同意
  101. </u-button>
  102. </view>
  103. </view>
  104. <u-action-sheet :list="list" v-model="sheetShow" @click="actionSheetCallback"></u-action-sheet>
  105. <u-popup mode="center" v-model="popupShow">
  106. <view style="padding: 30rpx;background: #FFFFFF;width: 100%;">
  107. <view class="cu-form-group ">
  108. <view class="title">签名</view>
  109. </view>
  110. <autograph @save="save" @clear="clear" @close="close"></autograph>
  111. </view>
  112. </u-popup>
  113. <lin-popup ref="picker" :title="'委托单选择'" :list="weiTuoList" @onConfirm="onConfirm"></lin-popup>
  114. </view>
  115. </template>
  116. <script>
  117. import {
  118. ACCESS_TOKEN,
  119. USER_NAME,
  120. USER_INFO
  121. } from "@/common/util/constants" // 拉取登录token,userName,userInfo
  122. import http from '@/common/service/http.js'
  123. import autograph from '@/components/autograph/autograph'
  124. export default {
  125. components: {
  126. autograph
  127. },
  128. data() {
  129. return {
  130. typeValue: '3',
  131. id: '',
  132. sheetShow: false,
  133. taskId: '',
  134. form: {
  135. xuanZeKeHu: '',
  136. biaoDanBianHao: '',
  137. buMenName: '',
  138. keHuDanWeiMingChe: '',
  139. keHuLianXiRen: '',
  140. weiTuoDanHao: '',
  141. lianXiDianHua: '',
  142. yangPinMingCheng: '',
  143. yangPinBianHao: '',
  144. yangPinLeiXing: '',
  145. baoGaoBianHao: '',
  146. gouTongLeiXing: '',
  147. gouTongNeiRong: '',
  148. keHu: '',
  149. gouTongQueDingNei: '',
  150. leiXing: '1'
  151. },
  152. fuJianShangChuanArray: [],
  153. popupShow: false,
  154. list: [{
  155. text: '委托单'
  156. }, {
  157. text: '检测项目'
  158. }, {
  159. text: '样品信息修改'
  160. }, {
  161. text: '检测结果'
  162. }, {
  163. text: '检测报告退回'
  164. }, {
  165. text: '其它'
  166. }],
  167. kehuXinXinList: [],
  168. weiTuoList: []
  169. }
  170. },
  171. onLoad(options) {
  172. this.getKehu()
  173. if (options.id) {
  174. this.id = options.id
  175. this.getDe(options.id)
  176. } else {
  177. this.getGtbh()
  178. }
  179. if (options.id) {
  180. this.typeValue = options.typeValue
  181. }
  182. },
  183. methods: {
  184. actionSheetCallback(e) {
  185. this.form.gouTongLeiXing = this.list[e].text
  186. },
  187. // 获取上传状态
  188. select(file) {
  189. //读取文件大小
  190. var fileSize = file.size;
  191. let token = uni.getStorageSync(ACCESS_TOKEN)
  192. if (fileSize > 1048576) {
  193. that.$message({
  194. type: 'error',
  195. showClose: true,
  196. duration: 3000,
  197. message: '文件大于1M!'
  198. });
  199. return
  200. }
  201. let that = this
  202. uni.showToast({
  203. title: '上传中',
  204. mask: true
  205. })
  206. for (let e in file.tempFilePaths) {
  207. var extName = file.tempFiles[e].file.name.substring(file.tempFiles[e].file.name.lastIndexOf(
  208. '.'));
  209. const path = file.tempFilePaths[e];
  210. uni.uploadFile({
  211. // url: http.apiHosp + 'ibps/platform/v3/file/upload/mobile', //仅为示例,非真实的接口地址
  212. url: http.apiHosp + '/ibps/platform/v3/file/upload', //仅为示例,非真实的接口地址
  213. filePath: path,
  214. name: 'file',
  215. formData: {
  216. 'ext': '.jpg'
  217. },
  218. header: {
  219. 'X-Authorization-access_token': token,
  220. 'X-Authorization-systemid': ''
  221. },
  222. success: (uploadFileRes) => {
  223. let data = JSON.parse(uploadFileRes.data)
  224. that.fuJianShangChuanArray.push({
  225. fileid: file.tempFiles[e].file.uuid,
  226. uploadid: data.data.id
  227. })
  228. uni.hideLoading()
  229. }
  230. });
  231. }
  232. },
  233. // 删除
  234. deleteMe(file) {
  235. for (let e in this.fuJianShangChuanArray) {
  236. if (this.fuJianShangChuanArray[e].fileid == file.tempFile.uuid) {
  237. this.fuJianShangChuanArray.splice(e, 1)
  238. }
  239. }
  240. },
  241. // 获取上传进度
  242. progress(e) {},
  243. // 上传成功
  244. success(file) {},
  245. // 上传失败
  246. fail(e) {},
  247. //弹出框显示
  248. qianming(index) {
  249. this.popupShow = true
  250. },
  251. //清除签名
  252. deqianming(index) {
  253. this.form.keHu = ''
  254. },
  255. //保存签名
  256. save(val) {
  257. this.form.keHu = val
  258. this.popupShow = false
  259. },
  260. //清除签名
  261. clear(val) {
  262. this.form.keHu = ''
  263. },
  264. /**
  265. * 关闭签名弹窗
  266. */
  267. close() {
  268. this.popupShow = false
  269. },
  270. //获取样品编号
  271. getGtbh(callback) {
  272. let smsParams = {
  273. alias: "gtbh"
  274. };
  275. let this_ = this
  276. this.$http.post("/ibps/business/v3/jc/sys/getNextIdByAlias", smsParams).then(res => {
  277. if (res.data.state == 200) {
  278. const data = res.data.data
  279. this.form.biaoDanBianHao = data
  280. }
  281. });
  282. },
  283. getKehu() {
  284. let info = uni.getStorageSync(USER_INFO);
  285. if (info) {
  286. this.form.xuanZeKeHu = info.user.qq
  287. this.form.lianXiDianHua = info.user.mobile
  288. this.form.keHuDanWeiMingChe = info.user.id
  289. this.form.keHuLianXiRen = info.user.fullname
  290. this.form.keHuDanWeiMingChe = info.user.id
  291. }
  292. this.getWeiTuoList()
  293. },
  294. getDe(id) {
  295. uni.showLoading({
  296. mask: true,
  297. title: 'loading'
  298. });
  299. let sql =
  300. `select * from t_khgtjlb where id_ = ${id}`
  301. let requestData = this.$sig(sql)
  302. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  303. if (res.data.state == 200) {
  304. const data = res.data.variables.data[0]
  305. this.form = {
  306. id: data.id_,
  307. xuanZeKeHu: data.xuan_ze_ke_hu_,
  308. biaoDanBianHao: data.biao_dan_bian_hao,
  309. buMenName: data.xuan_ze_ke_hu_,
  310. keHuDanWeiMingChe: data.ke_hu_dan_wei_min,
  311. keHuLianXiRen: data.ke_hu_lian_xi_ren,
  312. weiTuoDanHao: data.wei_tuo_dan_hao_,
  313. lianXiDianHua: data.lian_xi_dian_hua_,
  314. yangPinMingCheng: data.yang_pin_ming_che,
  315. yangPinBianHao: data.yang_pin_bian_hao,
  316. yangPinLeiXing: data.yang_pin_lei_xing,
  317. baoGaoBianHao: data.bao_gao_bian_hao_,
  318. gouTongLeiXing: data.gou_tong_lei_xing,
  319. gouTongNeiRong: data.gou_tong_nei_rong,
  320. keHu: data.ke_hu_,
  321. gouTongQueDingNei: data.gou_tong_que_ding,
  322. leiXing: data.lei_xing_
  323. }
  324. if (data.fu_jian_ && data.fu_jian_ != '') {
  325. this.getFileList(data.fu_jian_)
  326. }
  327. if (data.lei_xing_ == '2' && data.shi_fou_guo_shen_ == '已编制') {
  328. this.getTaskId(data.id_)
  329. }
  330. uni.hideLoading()
  331. }
  332. })
  333. },
  334. getFileList(ids) {
  335. let lists = ids.split(",")
  336. let params = {}
  337. params.ids = lists
  338. this.$http.post("/ibps/platform/v3/file/attachment/transfer", params).then(res => {
  339. if (res.data.state == 200) {
  340. const data = res.data.data
  341. lists.forEach(item => {
  342. let obj = {
  343. id: item,
  344. fileName: data[item].fileName,
  345. ext: data[item].ext
  346. }
  347. this.fuJianShangChuanArray.push(obj)
  348. })
  349. }
  350. })
  351. },
  352. onSubmit() {
  353. uni.showLoading({
  354. title: '加载中',
  355. mask: true
  356. })
  357. let tmpArray = []
  358. for (let e in this.fuJianShangChuanArray) {
  359. tmpArray.push(this.fuJianShangChuanArray[e].uploadid)
  360. }
  361. let info = uni.getStorageSync(USER_INFO);
  362. let useId = info.user.id
  363. let detpId = info.org.id
  364. var nowDate = new Date((new Date).getTime() + 8 * 60 * 60 * 1000)
  365. var time = nowDate.toJSON().split('T').join(' ').substr(0, 10);
  366. let para = {
  367. "parameters": [{
  368. "key": "defId",
  369. "value": "1056942070293331968"
  370. },
  371. {
  372. "key": "version",
  373. "value": "0"
  374. },
  375. {
  376. "key": "data",
  377. "value": ""
  378. }
  379. ]
  380. }
  381. this.form.fuJian = tmpArray.join(",")
  382. this.form.bianZhiRen = useId
  383. this.form.bianZhiShiJian = time
  384. this.form.bianZhiBuMen = detpId
  385. this.form.shiFouGuoShen = "已编制"
  386. para.parameters[2].value = JSON.stringify(this.form);
  387. let that = this;
  388. this.$http.post("ibps/business/v3/bpm/instance/start", para).then(res => {
  389. if (res.data.state == 200) {
  390. this.$methCommon.getPrompt('提交成功!')
  391. uni.hideLoading();
  392. this.getPageA()
  393. }
  394. }).catch((err) => {
  395. });
  396. },
  397. onAgree() {
  398. uni.showLoading({
  399. title: '加载中',
  400. mask: true
  401. })
  402. let info = uni.getStorageSync(USER_INFO);
  403. let useId = info.user.id
  404. let detpId = info.org.id
  405. this.form.gouTongRenYuan = useId
  406. this.form.gouTongRiQi = this.$methCommon.time(10)
  407. this.form.gouTongBuMen = detpId
  408. this.form.shiFouGuoShen = "1"
  409. let editData = {
  410. data: JSON.stringify(this.form),
  411. opinion: '同意',
  412. taskId: this.taskId
  413. }
  414. this.$http.post("/ibps/business/v3/bpm/task/agree", editData).then(res => {
  415. if (res.data.state == 200) {
  416. this.$methCommon.getPrompt('同意成功!')
  417. uni.hideLoading();
  418. this.getPageA()
  419. } else {
  420. this.$methCommon.getPrompt('同意异常!', 'fail')
  421. uni.hideLoading()
  422. }
  423. });
  424. },
  425. //根据委托单id查询 taskId
  426. getTaskId(id) {
  427. let sql =
  428. `select TASK_ID_ from ibps_bpm_tasks where NAME_ = '确认' and NODE_ID_ = 'Activity_1vrp3i4' and PROC_DEF_KEY_ = 'Process_183pepd' and EXEC_ID_ = (select PROC_INST_ID_ from act_ru_execution where ACT_ID_ = 'Activity_1vrp3i4' and BUSINESS_KEY_ = '${id}') ORDER BY CREATE_TIME_ desc`
  429. let requestData = this.$sig(sql)
  430. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  431. if (res.data.state == 200) {
  432. let result = res.data.variables.data[0]
  433. this.taskId = result.TASK_ID_
  434. }
  435. })
  436. },
  437. //委托信息
  438. getWeiTuoList() {
  439. let info = uni.getStorageSync(USER_INFO);
  440. let useId = info.user.id
  441. let sql =
  442. `select id_,wei_tuo_bian_hao_ from t_lhwtsqb where create_by_ = '${useId}' order by create_time_ desc`
  443. let requestData = this.$sig(sql)
  444. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  445. if (res.data.state == 200) {
  446. const datas = res.data.variables.data
  447. if (datas.length > 0) {
  448. datas.forEach((item, index) => {
  449. this.$set(item, 'name', item.wei_tuo_bian_hao_)
  450. })
  451. this.weiTuoList = datas
  452. }
  453. }
  454. })
  455. },
  456. // 拉取样品列表数据
  457. getData(id) {
  458. let info = uni.getStorageSync(USER_INFO);
  459. let useId = info.user.id
  460. let sql =
  461. `select id_,yang_pin_bian_hao,yang_pin_ming_che,yang_pin_lei_xing,yang_pin_lei_er_,yang_pin_lei_san_,yang_pin_lei_si_ from t_lhypb where parent_id_ = '${id}' order by create_time_ desc`
  462. let requestData = this.$sig(sql)
  463. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  464. if (res.data.state == 200) {
  465. const datas = res.data.variables.data
  466. if (datas.length > 0) {
  467. let list = []
  468. let list1 = []
  469. let list3 = []
  470. datas.forEach(item => {
  471. if (item.yang_pin_lei_xing) {
  472. list.push(item.yang_pin_lei_xing)
  473. }
  474. if (item.yang_pin_lei_er_) {
  475. list.push(item.yang_pin_lei_er_)
  476. }
  477. if (item.yang_pin_lei_san_) {
  478. list.push(item.yang_pin_lei_san_)
  479. }
  480. if (item.yang_pin_lei_si_) {
  481. list.push(item.yang_pin_lei_si_)
  482. }
  483. list1.push(item.yang_pin_bian_hao)
  484. list3.push(item.yang_pin_ming_che)
  485. })
  486. var list2 = [...new Set(list)]
  487. this.form.yangPinLeiXing = list2.join(",")
  488. this.form.yangPinBianHao = list1.join(",")
  489. this.form.yangPinMingCheng = list3.join(",")
  490. }
  491. }
  492. })
  493. },
  494. getBaoGaoList(id) {
  495. let info = uni.getStorageSync(USER_INFO);
  496. let useId = info.user.id
  497. let sql =
  498. `select id_,bao_gao_bian_hao_ from t_lhjcbgb where wei_tuo_id_ = '${id}'`
  499. let requestData = this.$sig(sql)
  500. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  501. if (res.data.state == 200) {
  502. const datas = res.data.variables.data
  503. if (datas.length > 0) {
  504. let list = []
  505. datas.forEach((item, index) => {
  506. list.push(item.bao_gao_bian_hao_)
  507. })
  508. this.form.baoGaoBianHao = list.join(",")
  509. }
  510. }
  511. })
  512. },
  513. getShow() {
  514. if (this.id != '') {
  515. return
  516. }
  517. this.$refs['picker'].show();
  518. },
  519. onConfirm(index, item) {
  520. this.form.weiTuoDanHao = item.id_
  521. this.getData(item.id_)
  522. this.getBaoGaoList(item.id_)
  523. },
  524. getWeiTuo(id) {
  525. if (id) {
  526. let itemData = this.weiTuoList.find(item => item.id_ == id)
  527. if (itemData) {
  528. return itemData.wei_tuo_bian_hao_
  529. } else {
  530. return ''
  531. }
  532. } else {
  533. return ''
  534. }
  535. },
  536. getPageA() {
  537. let pages = getCurrentPages()
  538. let prevPage = pages[pages.length - 2]
  539. prevPage.$vm.getValue()
  540. uni.navigateBack({
  541. dalta: 1
  542. })
  543. },
  544. uploadClick(id, item, type) {
  545. uni.showLoading({
  546. title: '下载中',
  547. mask: true
  548. })
  549. let requestData = {
  550. attachmentId: id
  551. }
  552. this.$http.get(`/ibps/platform/v3/file/download?attachmentId=${id}`, {
  553. responseType: 'arraybuffer'
  554. }).then(res => {
  555. const blob = new Blob([
  556. res.data
  557. ], {
  558. type: 'application/octet-stream'
  559. })
  560. const url = window.URL.createObjectURL(blob)
  561. const link = document.createElement('a')
  562. link.style.display = 'none'
  563. link.href = url
  564. link.setAttribute('download', item + '.' + type)
  565. document.body.appendChild(link)
  566. link.click()
  567. window.URL.revokeObjectURL(link.href)
  568. document.body.removeChild(link)
  569. uni.hideLoading()
  570. })
  571. }
  572. }
  573. }
  574. </script>
  575. <style lang="scss" scoped>
  576. .cu-form-group .title {
  577. min-width: 180rpx;
  578. }
  579. .btn {
  580. margin: 15rpx
  581. }
  582. </style>