communication.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736
  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. this.$uploades.selectUpload(file).then(res => {
  274. res.forEach(item => {
  275. this.fuJianShangChuanArray.push(item)
  276. })
  277. })
  278. },
  279. // 删除
  280. deleteMe(id) {
  281. this.fuJianShangChuanArray = this.fuJianShangChuanArray.filter(item => item.id !== id)
  282. },
  283. // 获取上传进度
  284. progress(e) {},
  285. // 上传成功
  286. success(file) {},
  287. // 上传失败
  288. fail(e) {},
  289. //弹出框显示
  290. qianming(index) {
  291. this.popupShow = true
  292. },
  293. //清除签名
  294. deqianming(index) {
  295. this.form.keHu = ''
  296. },
  297. //保存签名
  298. save(val) {
  299. this.form.keHu = val
  300. this.popupShow = false
  301. },
  302. //清除签名
  303. clear(val) {
  304. this.form.keHu = ''
  305. },
  306. /**
  307. * 关闭签名弹窗
  308. */
  309. close() {
  310. this.popupShow = false
  311. },
  312. //获取样品编号
  313. getGtbh(callback) {
  314. let smsParams = {
  315. alias: "gtbh"
  316. };
  317. let this_ = this
  318. this.$http.post("/ibps/business/v3/jc/sys/getNextIdByAlias", smsParams).then(res => {
  319. if (res.data.state == 200) {
  320. const data = res.data.data
  321. this.form.biaoDanBianHao = data
  322. }
  323. });
  324. },
  325. getKehu() {
  326. let info = uni.getStorageSync(USER_INFO);
  327. if (info) {
  328. this.form.xuanZeKeHu = info.user.qq
  329. this.form.lianXiDianHua = info.user.mobile
  330. this.form.keHuDanWeiMingChe = info.user.id
  331. this.form.keHuLianXiRen = info.user.fullname
  332. this.form.keHuDanWeiMingChe = info.user.id
  333. }
  334. this.getWeiTuoList()
  335. },
  336. getDe(id) {
  337. uni.showLoading({
  338. mask: true,
  339. title: '加载中'
  340. });
  341. let sql =
  342. `select * from t_khgtjlb where id_ = ${id}`
  343. let requestData = this.$sig(sql)
  344. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  345. if (res.data.state == 200) {
  346. const data = res.data.variables.data[0]
  347. this.form = {
  348. id: data.id_,
  349. xuanZeKeHu: data.xuan_ze_ke_hu_,
  350. biaoDanBianHao: data.biao_dan_bian_hao,
  351. buMenName: data.xuan_ze_ke_hu_,
  352. keHuDanWeiMingChe: data.ke_hu_dan_wei_min,
  353. keHuLianXiRen: data.ke_hu_lian_xi_ren,
  354. weiTuoDanHao: data.wei_tuo_dan_hao_,
  355. lianXiDianHua: data.lian_xi_dian_hua_,
  356. yangPinMingCheng: data.yang_pin_ming_che,
  357. yangPinBianHao: data.yang_pin_bian_hao,
  358. yangPinLeiXing: data.yang_pin_lei_xing,
  359. baoGaoBianHao: data.bao_gao_bian_hao_,
  360. gouTongLeiXing: data.gou_tong_lei_xing,
  361. gouTongNeiRong: data.gou_tong_nei_rong,
  362. keHu: data.ke_hu_,
  363. gouTongQueDingNei: data.gou_tong_que_ding,
  364. leiXing: data.lei_xing_,
  365. bianZhiShiJian: data.bian_zhi_shi_jian,
  366. gouTongRiQi: data.gou_tong_ri_qi_
  367. }
  368. if (data.fu_jian_ && data.fu_jian_ != '') {
  369. this.getFileList(data.fu_jian_)
  370. }
  371. //data.lei_xing_ == '2' && data.shi_fou_guo_shen_ == '已编制'
  372. if (this.typeValue == '2' || this.typeValue == '4') {
  373. this.getTaskId(data.id_)
  374. }
  375. if (data.bian_zhi_ren_) {
  376. this.getBianZhiRen(data.bian_zhi_ren_, res => {
  377. this.bianZhiRenName = res.NAME_
  378. })
  379. }
  380. if (data.gou_tong_ren_yuan) {
  381. this.getBianZhiRen(data.gou_tong_ren_yuan, res => {
  382. this.queDingRenName = res.NAME_
  383. })
  384. }
  385. uni.hideLoading()
  386. }
  387. })
  388. },
  389. getFileList(ids) {
  390. this.$uploades.getFilesList(ids, this).then(res => {
  391. this.fuJianShangChuanArray = res
  392. })
  393. },
  394. onSubmit() {
  395. uni.showLoading({
  396. title: '加载中',
  397. mask: true
  398. })
  399. let suList = ['keHuLianXiRen', 'lianXiDianHua']
  400. let suListName = ['客户联系人', '联系电话']
  401. for (let item in suList) {
  402. if (!this.form[suList[item]]) {
  403. uni.showToast({
  404. title: '请输入' + suListName[item],
  405. icon: 'none',
  406. duration: 2000
  407. })
  408. return
  409. }
  410. }
  411. let selList = ['weiTuoDanHao', 'gouTongLeiXing']
  412. let selListName = ['委托单号', '沟通类型']
  413. for (let item in suList) {
  414. if (!this.form[selList[item]]) {
  415. uni.showToast({
  416. title: '请选择' + selListName[item],
  417. icon: 'none',
  418. duration: 2000
  419. })
  420. return
  421. }
  422. }
  423. let tmpArray = []
  424. this.fuJianShangChuanArray.forEach((item) => {
  425. tmpArray.push(item.id)
  426. })
  427. let info = uni.getStorageSync(USER_INFO);
  428. let useId = info.user.id
  429. let detpId = info.org.id
  430. var nowDate = new Date((new Date).getTime() + 8 * 60 * 60 * 1000)
  431. var time = nowDate.toJSON().split('T').join(' ').substr(0, 10);
  432. let para = {
  433. "parameters": [{
  434. "key": "defId",
  435. "value": "1056942070293331968"
  436. },
  437. {
  438. "key": "version",
  439. "value": "0"
  440. },
  441. {
  442. "key": "data",
  443. "value": ""
  444. }
  445. ]
  446. }
  447. this.form.fuJian = tmpArray.join(",")
  448. this.form.bianZhiRen = useId
  449. this.form.bianZhiShiJian = time
  450. this.form.bianZhiBuMen = detpId
  451. this.form.shiFouGuoShen = "已编制"
  452. para.parameters[2].value = JSON.stringify(this.form);
  453. let that = this;
  454. this.$http.post("ibps/business/v3/bpm/instance/start", para).then(res => {
  455. if (res.data.state == 200) {
  456. this.$methCommon.getPrompt('提交成功!')
  457. uni.hideLoading();
  458. this.getPageA()
  459. }
  460. }).catch((err) => {
  461. });
  462. },
  463. onAgree(shiFouGuoShen, opinion, type) {
  464. uni.showLoading({
  465. title: '加载中',
  466. mask: true
  467. })
  468. let info = uni.getStorageSync(USER_INFO);
  469. let useId = info.user.id
  470. let detpId = info.org.id
  471. this.form.gouTongRenYuan = useId
  472. this.form.gouTongRiQi = this.$methCommon.time(10)
  473. this.form.gouTongBuMen = detpId
  474. this.form.shiFouGuoShen = shiFouGuoShen
  475. let editData = {
  476. data: JSON.stringify(this.form),
  477. opinion: opinion,
  478. taskId: this.taskId
  479. }
  480. this.$http.post("/ibps/business/v3/bpm/task/agree", editData).then(res => {
  481. if (res.data.state == 200) {
  482. this.$methCommon.getPrompt(type + '成功!')
  483. uni.hideLoading();
  484. this.getPageA()
  485. } else {
  486. this.$methCommon.getPrompt(type + '异常!', 'fail')
  487. uni.hideLoading()
  488. }
  489. });
  490. },
  491. //根据委托单id查询 taskId
  492. getTaskId(id) {
  493. let sql = ``
  494. if (this.typeValue == '2') {
  495. sql =
  496. `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`
  497. } else if (this.typeValue == '4') {
  498. sql =
  499. `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`
  500. }
  501. let requestData = this.$sig(sql)
  502. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  503. if (res.data.state == 200) {
  504. let result = res.data.variables.data[0]
  505. this.taskId = result.TASK_ID_
  506. this.getProcInstId(result.PROC_INST_ID_)
  507. }
  508. })
  509. },
  510. //根据委托单id查询 taskId
  511. getProcInstId(id) {
  512. let sql =
  513. `select OPTION_ from ibps_bpm_oper_log where PROC_INST_ID_ = '${id}' order by create_time_ desc limit 1`
  514. let requestData = this.$sig(sql)
  515. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  516. if (res.data.state == 200) {
  517. let result = res.data.variables.data[0]
  518. this.option = result.OPTION_
  519. }
  520. })
  521. },
  522. //委托信息
  523. getWeiTuoList() {
  524. let info = uni.getStorageSync(USER_INFO);
  525. let useId = info.user.id
  526. let sql =
  527. `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`
  528. let requestData = this.$sig(sql)
  529. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  530. if (res.data.state == 200) {
  531. const datas = res.data.variables.data
  532. if (datas.length > 0) {
  533. datas.forEach((item, index) => {
  534. this.$set(item, 'name', item.wei_tuo_bian_hao_)
  535. })
  536. this.weiTuoList = datas
  537. }
  538. }
  539. })
  540. },
  541. // 拉取样品列表数据
  542. getData(id) {
  543. let info = uni.getStorageSync(USER_INFO);
  544. let useId = info.user.id
  545. let sql =
  546. `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`
  547. let requestData = this.$sig(sql)
  548. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  549. if (res.data.state == 200) {
  550. const datas = res.data.variables.data
  551. if (datas.length > 0) {
  552. let list = []
  553. let list1 = []
  554. let list3 = []
  555. datas.forEach(item => {
  556. if (item.yang_pin_lei_xing) {
  557. list.push(item.yang_pin_lei_xing)
  558. }
  559. if (item.yang_pin_lei_er_) {
  560. list.push(item.yang_pin_lei_er_)
  561. }
  562. if (item.yang_pin_lei_san_) {
  563. list.push(item.yang_pin_lei_san_)
  564. }
  565. if (item.yang_pin_lei_si_) {
  566. list.push(item.yang_pin_lei_si_)
  567. }
  568. list1.push(item.yang_pin_bian_hao)
  569. list3.push(item.yang_pin_ming_che)
  570. })
  571. var list2 = [...new Set(list)]
  572. this.form.yangPinLeiXing = list2.join(",")
  573. this.form.yangPinBianHao = list1.join(",")
  574. this.form.yangPinMingCheng = list3.join(",")
  575. }
  576. }
  577. })
  578. },
  579. getBaoGaoList(id) {
  580. let info = uni.getStorageSync(USER_INFO);
  581. let useId = info.user.id
  582. let sql =
  583. `select id_,bao_gao_bian_hao_ from t_lhjcbgb where wei_tuo_id_ = '${id}'`
  584. let requestData = this.$sig(sql)
  585. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  586. if (res.data.state == 200) {
  587. const datas = res.data.variables.data
  588. if (datas.length > 0) {
  589. let list = []
  590. datas.forEach((item, index) => {
  591. list.push(item.bao_gao_bian_hao_)
  592. })
  593. this.form.baoGaoBianHao = list.join(",")
  594. }
  595. }
  596. })
  597. },
  598. getShow() {
  599. if (this.id != '') {
  600. return
  601. }
  602. this.$refs['picker'].show();
  603. },
  604. onConfirm(index, item) {
  605. this.form.weiTuoDanHao = item.id_
  606. this.getData(item.id_)
  607. this.getBaoGaoList(item.id_)
  608. },
  609. getWeiTuo(id) {
  610. if (id) {
  611. let itemData = this.weiTuoList.find(item => item.id_ == id)
  612. if (itemData) {
  613. return itemData.wei_tuo_bian_hao_
  614. } else {
  615. return ''
  616. }
  617. } else {
  618. return ''
  619. }
  620. },
  621. getPageA() {
  622. let pages = getCurrentPages()
  623. let prevPage = pages[pages.length - 2]
  624. prevPage.$vm.getValue()
  625. uni.navigateBack({
  626. dalta: 1
  627. })
  628. },
  629. uploadClick(id, item) {
  630. uni.showLoading({
  631. title: '下载中',
  632. mask: true
  633. })
  634. let requestData = {
  635. attachmentId: id
  636. }
  637. this.$http.get(`/ibps/platform/v3/file/download?attachmentId=${id}`, {
  638. responseType: 'arraybuffer'
  639. }).then(res => {
  640. const blob = new Blob([
  641. res.data
  642. ], {
  643. type: 'application/octet-stream'
  644. })
  645. const url = window.URL.createObjectURL(blob)
  646. const link = document.createElement('a')
  647. link.style.display = 'none'
  648. link.href = url
  649. link.setAttribute('download', item)
  650. document.body.appendChild(link)
  651. link.click()
  652. window.URL.revokeObjectURL(link.href)
  653. document.body.removeChild(link)
  654. uni.hideLoading()
  655. })
  656. },
  657. getBianZhiRen(id, callback) {
  658. let sql = `select * from ibps_party_employee where ID_ = '${id}'`
  659. let requestData = this.$sig(sql)
  660. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  661. const datas = res.data.variables.data
  662. if (datas.length > 0) {
  663. callback(datas[0])
  664. }
  665. })
  666. },
  667. //退回原因
  668. getBack() {
  669. this.content = this.option
  670. this.backShow = true
  671. },
  672. cancel() {
  673. this.backShow = false
  674. },
  675. }
  676. }
  677. </script>
  678. <style lang="scss" scoped>
  679. .cu-form-group .title {
  680. min-width: 180rpx;
  681. }
  682. .btn {
  683. margin: 15rpx;
  684. }
  685. .fileBox {
  686. line-height: 50rpx;
  687. color: #888888;
  688. display: flex;
  689. align-items: center;
  690. justify-content: space-between;
  691. border: 1rpx solid #DDDDDD;
  692. border-radius: 8rpx;
  693. padding: 5rpx;
  694. margin-top: 10rpx;
  695. }
  696. .u-update-content {
  697. font-size: 26rpx;
  698. color: $u-content-color;
  699. line-height: 1.7;
  700. padding: 30rpx;
  701. }
  702. </style>