communication.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  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.keHuDanWeiMingChe" name="input"></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"></input>
  21. <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42"
  22. v-if="form.keHuLianXiRen != ''" @click="form.keHuLianXiRen = ''"></u-icon>
  23. </view>
  24. <view class="cu-form-group">
  25. <view class="title">委托单号:</view>
  26. <!-- <input placeholder="请输入委托单号" v-model="form.weiTuoDanHao" name="input"></input>
  27. <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42"
  28. v-if="form.weiTuoDanHao != ''" @click="form.weiTuoDanHao = ''"></u-icon> -->
  29. <text style="width: 100%;" @click="getShow">{{getWeiTuo(form.weiTuoDanHao)}}</text>
  30. <u-button type="success" size="mini" @click="getShow" v-if="form.weiTuoDanHao == ''">选择
  31. </u-button>
  32. <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42"
  33. v-if="form.weiTuoDanHao != ''" @click="form.weiTuoDanHao = ''"></u-icon>
  34. </view>
  35. <view class="cu-form-group">
  36. <view class="title">联系电话:</view>
  37. <input placeholder="请输入联系电话" v-model="form.lianXiDianHua" name="input"></input>
  38. <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42"
  39. v-if="form.lianXiDianHua != ''" @click="form.lianXiDianHua = ''"></u-icon>
  40. </view>
  41. <view class="cu-form-group">
  42. <view class="title">样品名称:</view>
  43. <input placeholder="请输入样品名称" v-model="form.yangPinMingCheng" name="input"></input>
  44. <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42"
  45. v-if="form.yangPinMingCheng != ''" @click="form.yangPinMingCheng = ''"></u-icon>
  46. </view>
  47. <view class="cu-form-group">
  48. <view class="title">样品编号:</view>
  49. <input placeholder="请输入样品编号" v-model="form.yangPinBianHao" name="input"></input>
  50. <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42"
  51. v-if="form.yangPinBianHao != ''" @click="form.yangPinBianHao = ''"></u-icon>
  52. </view>
  53. <view class="cu-form-group">
  54. <view class="title">样品类型:</view>
  55. <input placeholder="请输入样品类型" v-model="form.yangPinLeiXing" name="input"></input>
  56. <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42"
  57. v-if="form.yangPinLeiXing != ''" @click="form.yangPinLeiXing = ''"></u-icon>
  58. </view>
  59. <view class="cu-form-group">
  60. <view class="title">报告编号:</view>
  61. <input placeholder="请输入报告编号" v-model="form.baoGaoBianHao" name="input"></input>
  62. <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42"
  63. v-if="form.baoGaoBianHao != ''" @click="form.baoGaoBianHao = ''"></u-icon>
  64. </view>
  65. <view class="cu-form-group">
  66. <view class="title">沟通类型:</view>
  67. <input placeholder="请选择沟通类型" v-model="form.gouTongLeiXing" name="input" disabled></input>
  68. <u-button type="success" size="mini" @click="sheetShow = true">选择</u-button>
  69. </view>
  70. <uni-section title="沟通内容" type="line" padding>
  71. <textarea maxlength="-1" v-model="form.gouTongNeiRong" placeholder="意见和建议"></textarea>
  72. </uni-section>
  73. <!-- <uni-section title="上传附件" type="line">
  74. <view class="example-body">
  75. <uni-file-picker limit="5" file-mediatype="all" @select="select" @progress="progress"
  76. @success="success" @fail="fail" @delete="deleteMe" :auto-upload="false" ref="uploadMe">
  77. </uni-file-picker>
  78. </view>
  79. </uni-section> -->
  80. <uni-section title="签名" type="line" padding>
  81. <view style="width: 100%;">
  82. <view style="text-align: right;width: 100%;">
  83. <view>
  84. <u-button type="primary" size="mini" @click="qianming(0)">
  85. 签名</u-button>
  86. <u-button type="primary" size="mini" @click="deqianming(0)" style="margin-left: 15rpx;"
  87. v-if="form.keHu != ''">
  88. 取消</u-button>
  89. </view>
  90. </view>
  91. <view style="width: 100%;" v-if="form.keHu != ''">
  92. <image :src="form.keHu" style="width: 100%;height: 500rpx;border: 1px #eee solid;">
  93. </image>
  94. </view>
  95. </view>
  96. </uni-section>
  97. <view class="padding flex flex-direction">
  98. <button class="cu-btn bg-blue lg" @click="onSubmit">提交</button>
  99. </view>
  100. </view>
  101. <u-action-sheet :list="list" v-model="sheetShow" @click="actionSheetCallback"></u-action-sheet>
  102. <u-popup mode="center" v-model="popupShow">
  103. <view style="padding: 30rpx;background: #FFFFFF;width: 100%;">
  104. <view class="cu-form-group ">
  105. <view class="title">签名</view>
  106. </view>
  107. <autograph @save="save" @clear="clear" @close="close"></autograph>
  108. </view>
  109. </u-popup>
  110. <lin-popup ref="picker" :title="'委托单选择'" :list="weiTuoList" @onConfirm="onConfirm"></lin-popup>
  111. </view>
  112. </template>
  113. <script>
  114. import {
  115. ACCESS_TOKEN,
  116. USER_NAME,
  117. USER_INFO
  118. } from "@/common/util/constants" // 拉取登录token,userName,userInfo
  119. import http from '@/common/service/http.js'
  120. import autograph from '@/components/autograph/autograph'
  121. export default {
  122. components: {
  123. autograph
  124. },
  125. data() {
  126. return {
  127. sheetShow: false,
  128. form: {
  129. xuanZeKeHu: '',
  130. biaoDanBianHao: '',
  131. buMenName: '',
  132. keHuDanWeiMingChe: '',
  133. keHuLianXiRen: '',
  134. weiTuoDanHao: '',
  135. lianXiDianHua: '',
  136. yangPinMingCheng: '',
  137. yangPinBianHao: '',
  138. yangPinLeiXing: '',
  139. baoGaoBianHao: '',
  140. gouTongLeiXing: '',
  141. gouTongNeiRong: '',
  142. keHu: ''
  143. },
  144. fuJianShangChuanArray: [],
  145. popupShow: false,
  146. list: [{
  147. text: '投诉'
  148. }, {
  149. text: '委托单'
  150. }, {
  151. text: '检测项目'
  152. }, {
  153. text: '样品信息修改'
  154. }, {
  155. text: '检测结果'
  156. }, {
  157. text: '检测报告退回'
  158. }, {
  159. text: '其它'
  160. }],
  161. kehuXinXinList: [],
  162. weiTuoList: []
  163. }
  164. },
  165. created() {
  166. this.getGtbh()
  167. this.getKehu()
  168. },
  169. methods: {
  170. actionSheetCallback(e) {
  171. this.form.gouTongLeiXing = this.list[e].text
  172. },
  173. // 获取上传状态
  174. select(file) {
  175. //读取文件大小
  176. var fileSize = file.size;
  177. let token = uni.getStorageSync(ACCESS_TOKEN)
  178. if (fileSize > 1048576) {
  179. that.$message({
  180. type: 'error',
  181. showClose: true,
  182. duration: 3000,
  183. message: '文件大于1M!'
  184. });
  185. return false;
  186. }
  187. let that = this
  188. for (let e in file.tempFilePaths) {
  189. console.log("000", file.tempFiles[e].file)
  190. var extName = file.tempFiles[e].file.name.substring(file.tempFiles[e].file.name.lastIndexOf('.'));
  191. const path = file.tempFilePaths[e];
  192. uni.uploadFile({
  193. // url: http.apiHosp + 'ibps/platform/v3/file/upload/mobile', //仅为示例,非真实的接口地址
  194. url: http.apiHosp + '/ibps/platform/v3/file/upload', //仅为示例,非真实的接口地址
  195. filePath: path,
  196. name: 'file',
  197. formData: {
  198. 'ext': '.jpg'
  199. },
  200. header: {
  201. 'X-Authorization-access_token': token,
  202. 'X-Authorization-systemid': ''
  203. },
  204. success: (uploadFileRes) => {
  205. let data = JSON.parse(uploadFileRes.data)
  206. that.fuJianShangChuanArray.push({
  207. fileid: file.tempFiles[e].file.uuid,
  208. uploadid: data.data.id
  209. })
  210. }
  211. });
  212. }
  213. return true;
  214. console.log('选择文件:')
  215. },
  216. // 删除
  217. deleteMe(file) {
  218. for (let e in this.fuJianShangChuanArray) {
  219. if (this.fuJianShangChuanArray[e].fileid == file.tempFile.uuid) {
  220. this.fuJianShangChuanArray.splice(e, 1)
  221. }
  222. }
  223. },
  224. // 获取上传进度
  225. progress(e) {
  226. console.log('上传进度:', e)
  227. },
  228. // 上传成功
  229. success(file) {
  230. console.log('上传成功', file)
  231. },
  232. // 上传失败
  233. fail(e) {
  234. console.log('上传失败:', e)
  235. },
  236. //弹出框显示
  237. qianming(index) {
  238. this.qianshow = true
  239. this.qianIndex = index
  240. this.popupShow = true
  241. },
  242. //清除签名
  243. deqianming(index) {
  244. if (index == 0) {
  245. this.form.keHu = ''
  246. }
  247. },
  248. //保存签名
  249. save(val) {
  250. if (this.qianIndex == 0) {
  251. this.form.keHu = val
  252. }
  253. this.qianshow = false
  254. this.popupShow = false
  255. },
  256. //清除签名
  257. clear(val) {
  258. if (this.qianIndex == 0) {
  259. this.form.keHu = ''
  260. }
  261. },
  262. /**
  263. * 关闭签名弹窗
  264. */
  265. close() {
  266. this.popupShow = false
  267. },
  268. //获取样品编号
  269. getGtbh(callback) {
  270. let smsParams = {
  271. alias: "gtbh"
  272. };
  273. let this_ = this
  274. this.$http.post("/ibps/business/v3/jc/sys/getNextIdByAlias", smsParams).then(res => {
  275. if (res.data.state == 200) {
  276. const data = res.data.data
  277. this.form.biaoDanBianHao = data
  278. }
  279. });
  280. },
  281. getKehu() {
  282. let info = uni.getStorageSync(USER_INFO);
  283. if (info) {
  284. this.form.xuanZeKeHu = info.user.id
  285. this.form.lianXiDianHua = info.user.mobile
  286. this.form.keHuDanWeiMingChe = info.user.fullname
  287. this.form.keHuLianXiRen = info.user.fullname
  288. }
  289. this.getWeiTuoList()
  290. },
  291. onSubmit() {
  292. let info = uni.getStorageSync(USER_INFO);
  293. let useId = info.user.id
  294. let detpId = info.org.id
  295. var nowDate = new Date((new Date).getTime() + 8 * 60 * 60 * 1000)
  296. var time = nowDate.toJSON().split('T').join(' ').substr(0, 10);
  297. let para = {
  298. "parameters": [{
  299. "key": "defId",
  300. "value": "1056942070293331968"
  301. },
  302. {
  303. "key": "version",
  304. "value": "0"
  305. },
  306. {
  307. "key": "data",
  308. "value": ""
  309. }
  310. ]
  311. }
  312. this.form.bianZhiRen = useId
  313. this.form.bianZhiShiJian = time
  314. this.form.bianZhiBuMen = detpId
  315. this.form.shiFouGuoShen = "已编制"
  316. para.parameters[2].value = JSON.stringify(this.form);
  317. let that = this;
  318. this.$http.post("ibps/business/v3/bpm/instance/start", para).then(res => {
  319. if (res.data.state == 200) {
  320. this.$tip.success("提交成功!")
  321. this.$Router.replace({
  322. name: 'index'
  323. })
  324. }
  325. }).catch((err) => {
  326. let msg = ((err.response || {}).data || {}).message || err.data.message || "请求出现错误,请稍后再试"
  327. this.$tip.error(msg);
  328. });
  329. },
  330. //委托信息
  331. getWeiTuoList() {
  332. let info = uni.getStorageSync(USER_INFO);
  333. let useId = info.user.id
  334. let sql =
  335. `select id_,wei_tuo_bian_hao_ from t_lhwtsqb where create_by_ = '${useId}' order by create_time_ desc`
  336. let requestData = this.$sig(sql)
  337. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  338. if (res.data.state == 200) {
  339. const datas = res.data.variables.data
  340. if (datas.length > 0) {
  341. datas.forEach((item, index) => {
  342. this.$set(item, 'name', item.wei_tuo_bian_hao_)
  343. })
  344. this.weiTuoList = datas
  345. }
  346. }
  347. })
  348. },
  349. // 拉取样品列表数据
  350. getData(id) {
  351. let info = uni.getStorageSync(USER_INFO);
  352. let useId = info.user.id
  353. let sql =
  354. `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`
  355. let requestData = this.$sig(sql)
  356. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  357. if (res.data.state == 200) {
  358. const datas = res.data.variables.data
  359. if (datas.length > 0) {
  360. let list = []
  361. let list1 = []
  362. let list3 = []
  363. datas.forEach(item => {
  364. if (item.yang_pin_lei_xing) {
  365. list.push(item.yang_pin_lei_xing)
  366. }
  367. if (item.yang_pin_lei_er_) {
  368. list.push(item.yang_pin_lei_er_)
  369. }
  370. if (item.yang_pin_lei_san_) {
  371. list.push(item.yang_pin_lei_san_)
  372. }
  373. if (item.yang_pin_lei_si_) {
  374. list.push(item.yang_pin_lei_si_)
  375. }
  376. list1.push(item.yang_pin_bian_hao)
  377. list3.push(item.yang_pin_ming_che)
  378. })
  379. var list2 = [...new Set(list)]
  380. this.form.yangPinLeiXing = list2.join(",")
  381. this.form.yangPinBianHao = list1.join(",")
  382. this.form.yangPinMingCheng = list3.join(",")
  383. }
  384. }
  385. })
  386. },
  387. getBaoGaoList(id) {
  388. let info = uni.getStorageSync(USER_INFO);
  389. let useId = info.user.id
  390. let sql =
  391. `select id_,bao_gao_bian_hao_ from t_lhjcbgb where wei_tuo_id_ = '${id}'`
  392. let requestData = this.$sig(sql)
  393. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  394. if (res.data.state == 200) {
  395. const datas = res.data.variables.data
  396. if (datas.length > 0) {
  397. let list = []
  398. datas.forEach((item, index) => {
  399. list.push(item.bao_gao_bian_hao_)
  400. })
  401. this.form.baoGaoBianHao = list.join(",")
  402. }
  403. }
  404. })
  405. },
  406. getShow() {
  407. this.$refs['picker'].show();
  408. },
  409. onConfirm(index, item) {
  410. this.form.weiTuoDanHao = item.id_
  411. this.getData(item.id_)
  412. this.getBaoGaoList(item.id_)
  413. },
  414. getWeiTuo(id) {
  415. if (id) {
  416. let itemData = this.weiTuoList.find(item => item.id_ == id)
  417. return itemData.wei_tuo_bian_hao_
  418. } else {
  419. return ''
  420. }
  421. }
  422. }
  423. }
  424. </script>
  425. <style lang="scss" scoped>
  426. .cu-form-group .title {
  427. min-width: 180rpx;
  428. }
  429. </style>