communication.vue 11 KB

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