communication.vue 26 KB

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