edit.vue 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120
  1. <template>
  2. <view class="main">
  3. <uni-nav-bar dark :fixed="true" background-color="#18C7B0" status-bar left-icon="left" height="62.5rpx" width="750rpx"
  4. title="调配详情" @clickLeft="handleBack"
  5. />
  6. <view class="content">
  7. <view class="header">
  8. <view class="ti">
  9. <view class="left">
  10. <view class="baracode">
  11. <w-barcode :options="preseObj"></w-barcode>
  12. <view class="barnum">{{v.preNo}}</view>
  13. </view>
  14. </view>
  15. <view class="mid">
  16. <text class="title">中药处方笺</text>
  17. </view>
  18. <view class="rig"><text class="title">{{v.type=='1'?"中药处方":v.type=='1'?"中药制剂":""}}</text></view>
  19. </view>
  20. <view class="patiinfo">
  21. <view class="r1">
  22. <view class="row"><span class="we">姓名:</span>{{v.name}}</view>
  23. <view class="row"><span class="we">性别:</span>{{v.sex}}</view>
  24. <view class="row"><span class="we">年龄:</span>{{v.age}}岁</view>
  25. <view class="row"><span class="we">电话:</span>{{v.contactNumber}}</view>
  26. <view class="row"><span class="we">当前处方状态:</span>{{v.state=="1"?"配药":v.state=="2"?"煎药":v.state=="3"?"发药":v.state=="4"?"配送":""}}</view>
  27. </view>
  28. <view class="r2">
  29. <view class="row"><span class="we">就诊科室:</span>{{v.department}}</view>
  30. <view class="row"><span class="we">临床诊断:</span>{{v.disName}}—{{v.symName}}</view>
  31. <view class="row"><span class="we">开方时间:</span>{{v.prescriptionTime}}</view>
  32. </view>
  33. <view class="r3"><span class="we">联系地址:</span>{{v.address}}</view>
  34. </view>
  35. </view>
  36. <view class="rp">
  37. <view class="title">
  38. <text class="text">Rp:</text>
  39. </view>
  40. <view class="lists">
  41. <view class="item" v-for="(x, i) in v.rp" :key="i">
  42. <view class="le tag-view" @click="handleGetRps(x)">
  43. <uni-tag :inverted="!selectRps.includes(x)" :text="x.matName+x.matDose+x.matUnitName" />
  44. </view>
  45. <view class="rig">
  46. <view class="up"> {{x.matUsageName}}</view>
  47. <view class="do"> {{x.sign}}</view>
  48. </view>
  49. </view>
  50. </view>
  51. <view class="footer">
  52. <view class="js">
  53. 剂数:{{v.number}}
  54. <view v-if="v.daijianCost!==''" class="pies_tips">
  55. (代煎)
  56. </view>
  57. </view>
  58. <view class="js">{{v.dosageForm}}</view>
  59. <view class="js">{{v.prescriptionUsage}}</view>
  60. <view class="js">每次{{v.concentration}}</view>
  61. <view class="js">{{v.frequency}}</view>
  62. <view class="freque">{{v.medicationTime}}</view>
  63. </view>
  64. <view class="rp-tips">{{v.entrust}}</view>
  65. </view>
  66. <view class="amountarea">
  67. <view class="amount">
  68. <view class="r1">
  69. <view class="pijw">药品金额:{{v.prescriptionSum}}</view>
  70. </view>
  71. <view class="r2">
  72. <view class="jyf">煎药费:{{v.daijianCost}}</view>
  73. <view class="psf">配送费:{{v.distributionCost}}</view>
  74. </view>
  75. <view class="r3">
  76. 总金额:{{v.prescriptionTotalSum}}
  77. <!-- <view class="zjw"></view> -->
  78. </view>
  79. </view>
  80. <view class="service">
  81. <view class="kf"><span class="we">开方:</span>{{v.operateList[0].operater || ''}}</view>
  82. <view class="kf"><span class="we">审核:</span>{{v.operateList[1].operater || ''}}</view>
  83. <view class="kf"><span class="we">调配:</span>{{v.operateList[2].operater || ''}}</view>
  84. <view class="kf"><span class="we">复核:</span>{{v.operateList[3].operater || ''}}</view>
  85. <view class="kf"><span class="we">浸泡:</span>{{v.operateList[4].operater || ''}}</view>
  86. <view class="kf"><span class="we">煎煮:</span>{{v.operateList[5].operater || ''}}</view>
  87. <view class="kf"><span class="we">打包:</span>{{v.operateList[6].operater || ''}}</view>
  88. <view class="kf"><span class="we">发药:</span>{{v.operateList[7].operater || ''}}</view>
  89. </view>
  90. </view>
  91. <view class="comment">
  92. <view class="z">注:</view>
  93. <text>{{v.entrust1111}}</text>
  94. </view>
  95. </view>
  96. <view class="upload">
  97. <view class="title">上传照片</view>
  98. <uni-file-picker
  99. :image-styles = "imageStyles"
  100. fileMediatype="image"
  101. mode="grid"
  102. :limit="3"
  103. :del-icon="false"
  104. :auto-upload="false"
  105. @select="selectUpload"
  106. />
  107. </view>
  108. <view class="cooment">
  109. <view class="title">备注内容</view>
  110. <view class="tex">
  111. <textarea placeholder="请输入备注内容" v-model="editForm.comments" placeholder-style="font-size: 15rpx;" height="60rpx" @input="bindTextInput" class="input" ></textarea>
  112. </view>
  113. </view>
  114. <view class="radio">
  115. <label for="">
  116. <switch :checked="isPrint" style="transform:scale(0.7)" @change="handleChange" /> 上传时直接打印标签
  117. </label>
  118. </view>
  119. <view class="submit">
  120. <button type="primary" class="bu" @click="handleSubmit">上传</button>
  121. </view>
  122. <view class="popup">
  123. <uni-popup ref="alertDialog" type="dialog">
  124. <uni-popup-dialog type="center" cancelText="不打印" confirmText="打印" title="打印标签" @confirm="dialogConfirm" @close="dialogClose">
  125. <view class="cotent" id="printMe">
  126. <view class="title">{{v.yljgName || '默默事中医院取药标签打印(门诊)'}}</view>
  127. <view class="body">
  128. <view class="lef">
  129. <view class="baracode">
  130. <w-barcode class="cav" :options="preseObj"></w-barcode>
  131. <view class="barnum">{{v.preNo}}</view>
  132. </view>
  133. </view>
  134. <view class="rig">
  135. <view class="hz">患者:<view class="bold">{{v.name}},{{v.sex}},{{v.age}}岁</view></view>
  136. <view class="hz">出生日期:<view class="bold">{{v.birth}}</view></view>
  137. </view>
  138. </view>
  139. </view>
  140. </uni-popup-dialog>
  141. </uni-popup>
  142. </view>
  143. </view>
  144. </template>
  145. <script>
  146. export default {
  147. name: ''
  148. }
  149. </script>
  150. <script setup>
  151. import { onMounted, ref, getCurrentInstance } from 'vue'
  152. import { selectOrderDetail, upload, sendToUser, updateOrderStatus } from "@/static/js/request.js"
  153. import { saveDepoly } from '@/static/js/api.js'
  154. import debounce from 'lodash.debounce'
  155. import { onLoad } from '@dcloudio/uni-app'
  156. const urlConfig = ref('http://zhongyao.fscuc.cn')
  157. // #ifdef APP-PLUS
  158. const plug= uni.requireNativePlugin('Html5app-Gprinter');
  159. // #endif
  160. // const preseId = ref(11220822134401)
  161. const preseObj = ref({
  162. code: '',
  163. color:['#000'], // 条形码的颜色
  164. bgColor: '#FFFFFF', // 背景色
  165. width: 200, // 宽度
  166. height: 50 // 高度
  167. })
  168. const statusArr = ref([
  169. {name:'配药',id:'1'},
  170. {name:'煎药',id:'2'},
  171. {name:'发药',id:'3'},
  172. {name:'配送',id:'4'}
  173. ])
  174. const typeArr = ref([
  175. {name:'中药处方',id:'1'},
  176. {name:'中药制剂',id:'2'}
  177. ])
  178. const {proxy} = getCurrentInstance()
  179. const imageStyles =ref({
  180. width:112.5,
  181. height:112.5,
  182. border:{
  183. color:"#DDDDDD",
  184. width:1,
  185. style:'solid',
  186. radius:'4px'
  187. }
  188. })
  189. const depolyImage = ref([])
  190. const barOpations = ref({
  191. height: 80,
  192. displayValue: false
  193. })
  194. const selectRps = ref([])
  195. const isPrint = ref(true)
  196. const initPrint =ref(uni.getStorageSync('initPrint'))
  197. const photos = ref([])
  198. const v=ref({
  199. preNo:'11220822134401',
  200. presType:'普通处方',
  201. name:'李某',
  202. sex:'男',
  203. age:35,
  204. contactNumber:'13888888888',
  205. state: '发药',
  206. department:'中医内科',
  207. disName:'胃脘痛病',
  208. symName:'脾胃虚寒证',
  209. prescriptionTime:'2023-06-01 15:58',
  210. address:'浙江省某某事某某去某某事中医院门诊楼三楼302是',
  211. birth:'',
  212. rp:[
  213. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
  214. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'先煎',sign:'医生签名'},
  215. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
  216. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
  217. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'先煎',sign:'医生签名'},
  218. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
  219. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'',sign:''},
  220. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'',sign:''},
  221. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'',sign:''},
  222. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'先煎',sign:''},
  223. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
  224. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'先煎',sign:'医生签名'},
  225. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
  226. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
  227. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'先煎',sign:'医生签名'},
  228. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
  229. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'',sign:''},
  230. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'',sign:''},
  231. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'',sign:''},
  232. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'先煎',sign:''},
  233. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
  234. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'先煎',sign:'医生签名'},
  235. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
  236. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
  237. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'先煎',sign:'医生签名'},
  238. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
  239. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'',sign:''},
  240. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'',sign:''},
  241. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'',sign:''},
  242. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'先煎',sign:''},
  243. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
  244. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'先煎',sign:'医生签名'},
  245. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
  246. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
  247. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'先煎',sign:'医生签名'},
  248. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
  249. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'',sign:''},
  250. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'',sign:''},
  251. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'',sign:''},
  252. {matName:'车前子',matDose:'6',matUnitName:'g',tips:'先煎',sign:''}
  253. ],
  254. number:3,
  255. pies_tips:'待见',
  256. dosageForm:'汤剂',
  257. prescriptionUsage:'煎服',
  258. concentration:'200ml',
  259. frequency:'一日三次',
  260. medicationTime:'饭后服',
  261. entrust:'注意多休息,饮食清单。',
  262. prescriptionSum: '187.00',
  263. daijianCost:'30.00',
  264. distributionCost:'10.00',
  265. prescriptionTotleSum: '227.00',
  266. yljgName:'杭州某某高级中医院',
  267. operateList:[
  268. {py:'kf',title:'开方',operater:''},
  269. {py:'sh',title:'审核',operater:''},
  270. {py:'tp',title:'调配',operater:''},
  271. {py:'fh',title:'复核',operater:''},
  272. {py:'jp',title:'浸泡',operater:''},
  273. {py:'jz',title:'煎煮',operater:''},
  274. {py:'db',title:'打包',operater:''},
  275. {py:'fy',title:'发药',operater:''},
  276. ],
  277. // extra_doc:'A医生',
  278. // check_doc:'B医生',
  279. // depoly:'调陪人',
  280. // review:'复核人',
  281. // steep:'浸泡',
  282. // cook:'煎煮人',
  283. // pack:'大宝人',
  284. // dispen:'发药人',
  285. // },
  286. entrust1111:'1、本处方当日有效\n 2、取药时请您当面核对药品名称、规格、数量 \n 3、延长处方用量时间原因:慢性病 其他老年病 外地 其他'
  287. })
  288. const editForm =ref({
  289. urls:[],
  290. userId:uni.getStorageSync('userId'),
  291. comments:'',
  292. weight:'',
  293. coreId: ''
  294. })
  295. onMounted(() => {
  296. })
  297. const handleRemove = (file, uploadFiles) => {
  298. console.log(file, uploadFiles)
  299. }
  300. const handlePreview = (uploadFile) => {
  301. console.log(uploadFile)
  302. }
  303. const bindTextInput = (e)=>{
  304. console.log(e.detail.value)
  305. }
  306. onLoad(async(options) => {
  307. console.log('options', options)
  308. const userId = uni.getStorageSync('userId')
  309. const params = {
  310. token: uni.getStorageSync('token'),
  311. data: {
  312. id: options.id || '',
  313. preNo: options.preId || '',
  314. depolyStatus: options.depolyStatus || ''
  315. }
  316. }
  317. console.log("params",params)
  318. const {data:res} = await selectOrderDetail(params)
  319. if (res.code === 200) {
  320. v.prescriptionTime = res.data.prescriptionTime,
  321. v.value.name = res.data.name,
  322. v.value.sex = res.data.sex,
  323. v.value.age = res.data.age,
  324. v.value.contactNumber = res.data.contactNumber
  325. v.value.address = res.data.address
  326. v.value.concentration = res.data.concentration
  327. v.value.frequency = res.data.frequency
  328. v.value.medicationTime = res.data.medicationTime
  329. editForm.value.coreId = v.value.id = res.data.id
  330. console.log('onLoad v.value.v.value.id', v.value.id)
  331. v.value.disName = res.data.disName,
  332. v.value.symName = res.data.symName,
  333. v.value.preNo = res.data.preNo,
  334. console.log('onLoad v.value.preNo', v.value.preNo)
  335. preseObj.value.code = v.value.preNo
  336. v.value.department = res.data.department,
  337. v.value.dosageForm = res.data.dosageForm,
  338. v.value.prescriptionUsage = res.data.prescriptionUsage,
  339. v.value.number = res.data.number,
  340. v.value.prescriptionSum = res.data.prescriptionSum,
  341. v.value.prescriptionTotalSum = res.data.prescriptionTotalSum,
  342. v.value.daijianCost = res.data.daijianCost,
  343. v.value.distributionCost = res.data.distributionCost,
  344. v.value.prescriptionTotleSum = res.data.prescriptionTotleSum,
  345. v.value.entrust = res.data.entrust
  346. v.value.rp = res.data.detailList
  347. v.value.yljgName = res.data.yljgName || ''
  348. v.value.birth = res.data.patientBirthday.substring(0,10) || ''
  349. v.value.state = res.data.state
  350. console.log('res.data.state',res.data.state)
  351. switch (res.data.state) {
  352. case '1':
  353. v.value.state = '配药'
  354. break
  355. case '2':
  356. v.value.state = '煎药'
  357. break
  358. case '3':
  359. v.value.state = '发药'
  360. break
  361. case '4':
  362. v.value.state = '配送'
  363. break
  364. case '5':
  365. v.value.state = '已分配'
  366. break
  367. case '6':
  368. v.value.state = '已传送'
  369. break
  370. default:
  371. v.value.state = '配药'
  372. }
  373. v.value.operateList[0].operater = res.data.doctor || ''
  374. v.value.operateList[1].operater = res.data.checkBy || ''
  375. v.value.operateList[2].operater = res.data.tiaopeiName || ''
  376. // 循环operateList
  377. const length = res.data.operateList
  378. if(length > 0){
  379. res.data.operateList.forEach((item)=>{
  380. switch(item.type){
  381. case '2':
  382. v.value.operateList[3].operater = item.createBy
  383. break
  384. case '3':
  385. v.value.operateList[4].operater = item.createBy
  386. break
  387. case '4':
  388. v.value.operateList[5].operater = item.createBy
  389. break
  390. case '5':
  391. v.value.operateList[6].operater = item.createBy
  392. break
  393. case '6':
  394. v.value.operateList[7].operater = item.createBy
  395. break
  396. defalut:console.log('处方签res.data.operateList数据异常',item.type)
  397. }
  398. })
  399. }
  400. }
  401. })
  402. const handleGetRps = (v)=>{
  403. console.log('handleGetRps', v)
  404. if(!selectRps.value.includes(v)) {
  405. selectRps.value.push(v)
  406. } else {
  407. selectRps.value.splice(selectRps.value.indexOf(v), 1)
  408. }
  409. }
  410. const handleChange = ()=>{
  411. isPrint.value = !isPrint.value
  412. console.log('handleChange', isPrint.value)
  413. }
  414. const handleBack =()=>{
  415. uni.navigateBack({
  416. delta: 1
  417. })
  418. }
  419. const handleSubmit = debounce(async()=>{
  420. console.log('handleSubmit>>>',editForm.value)
  421. const {data:res} = await saveDepoly({
  422. token: uni.getStorageSync('token'),
  423. data: JSON.stringify(editForm.value)
  424. })
  425. if(res.code===200){
  426. console.log('depoly success>>>')
  427. } else {
  428. uni.$showMsg(res.msg, 2000)
  429. }
  430. if(isPrint.value){
  431. // 直接调用接口,然后打印
  432. // print("#printMe")
  433. // 打印成功后调用/userPrescription/sendToUser
  434. // if(uni.getStorageSync('initPrint')==true){
  435. // // APP-PLUS
  436. // const ret = printerTsc()
  437. // console.log('ret',ret)
  438. // // APP-PLUS
  439. // } else {
  440. // uni.$showMsg('打印失败,打印机未连接,请先连接打印机', 2000)
  441. // return
  442. // }
  443. printerTsc()
  444. console.log("uni.getStorageSync('token')",uni.getStorageSync('token'))
  445. const res = await sendToUser({
  446. token: uni.getStorageSync('token'),
  447. data: JSON.stringify({id:uni.getStorageSync('userId')})
  448. })
  449. const ret = await updateOrderStatus({
  450. token: uni.getStorageSync('token'),
  451. data: {
  452. id:v.value.id,
  453. status:'1',
  454. }
  455. })
  456. uni.redirectTo({
  457. url:"/pages/index/index"
  458. })
  459. } else {
  460. // 弹窗提醒
  461. console.log("handleSubmit proxy.$refs.alertDialog",proxy.$refs.alertDialog)
  462. proxy.$refs.alertDialog.open('center')
  463. }
  464. },500)
  465. const dialogConfirm = debounce(async()=>{
  466. console.log('dialogConfirm直接调用接口,然后打印')
  467. // if(uni.getStorageSync('initPrint')==true){
  468. // // #ifdef APP-PLUS
  469. // const ret = printerTsc()
  470. // console.log('ret',ret)
  471. // // #endif
  472. // } else {
  473. // uni.$showMsg('打印失败,打印机未连接,请先连接打印机', 2000)
  474. // }
  475. printerTsc()
  476. // 打印成功后调用/userPrescription/sendToUser
  477. const res = await sendToUser({
  478. token: uni.getStorageSync('token'),
  479. data: JSON.stringify({id:uni.getStorageSync('userId')})
  480. })
  481. console.log('sendToUser res',res)
  482. if (res.code !== 200){
  483. uni.$showMsg(res.msg, 2000)
  484. }
  485. uni.redirectTo({
  486. url:"/pages/index/index"
  487. })
  488. },500)
  489. const dialogClose = debounce(async()=>{
  490. console.log('dialogClose直接调用接口,不打印')
  491. const ret = await updateOrderStatus({
  492. token: uni.getStorageSync('token'),
  493. data: {
  494. id:v.value.id,
  495. status:'1',
  496. }
  497. })
  498. uni.redirectTo({
  499. url:"/pages/index/index"
  500. })
  501. },500)
  502. const selectUpload = debounce((e)=>{
  503. uni.showLoading({
  504. title: "上传中"
  505. });
  506. const tempFilePaths = e.tempFilePaths;
  507. for (var i = 0; i < tempFilePaths.length; i++) {
  508. const tempFile = e.tempFiles[i];
  509. uni.uploadFile({
  510. url: urlConfig.value + '/common/upload',
  511. header: {
  512. 'Authorization': 'Bearer '+uni.getStorageSync('token')
  513. },
  514. formData: {
  515. secretFlag: 'N',
  516. fileLocation: 5
  517. },
  518. filePath: tempFilePaths[i],
  519. name: 'file',
  520. success: (uploadFileRes) => {
  521. uni.hideLoading();
  522. console.log('upload success>>',uploadFileRes)
  523. const back = JSON.parse(uploadFileRes.data);
  524. console.log('upload success back >>',back)
  525. if (back.code == 200) {
  526. editForm.value.urls.push(back.url)
  527. }
  528. },
  529. fail: () => {
  530. uni.hideLoading();
  531. uni.showToast("上传失败,请联系开发!")
  532. },
  533. complete: function() {
  534. uni.hideLoading();
  535. }
  536. });
  537. }
  538. },500)
  539. const printerTsc = ()=>{
  540. //制作标签格式,
  541. let data=[]; //定义一个数组
  542. let line={}; //每添加一个,代表一行字
  543. //设置标签纸大小
  544. line={};
  545. line.width=80; //mm
  546. line.height=50; //mm
  547. line.gap=2; //标签纸之间,间隙长度 mm
  548. line.page=1; //打印几份
  549. line.direction=0, //上下反面打印,0=>正方向,1=> 反方向
  550. data.push(line); //每添加一个,代表一行字
  551. let filePath=plus.io.convertLocalFileSystemURL("static/OpenSans-Bold.ttf")
  552. //添加文字
  553. line={};
  554. line.customText=v.value.yljgName;
  555. line.x=100;
  556. line.y=40;
  557. line.fontSize=20;
  558. line.fontPath='';
  559. data.push(line); //每添加一个,代表一行字
  560. //添加图片
  561. // var imgage=plus.io.convertLocalFileSystemURL("static/gprinter.png");
  562. // line={};
  563. // line.image=imgage;
  564. // line.x=20;
  565. // line.y=65;
  566. // line.width=80;
  567. // data.push(line);
  568. // //添加黑块
  569. // line={};
  570. // line.addBar={x:10,y:10,width:200,height:4};
  571. // data.push(line);
  572. // //添加方框
  573. // line={};
  574. // line.addBox={x:10,y:25,xend:180,yend:50,thickness:2};
  575. // data.push(line);
  576. // //添加二维码
  577. // line={};
  578. // line.qrcode="https://www.baidu.com/";
  579. // line.x=205; //横坐标
  580. // line.y=25; //纵坐标
  581. // line.width=3; //二维码大小,1-10 之间
  582. // line.rotation=0; // 角度:有四个值:0,90,180,270
  583. // data.push(line);
  584. //添加条型码
  585. line={};
  586. line.barcode=v.value.preNo;
  587. line.x=50; //横坐标
  588. line.y=150; //纵坐标
  589. line.type="CODE128"; //条型码类型
  590. line.height=80; //条型码高度
  591. line.readable=true; //是否显示文字在条型下方
  592. line.rotation=0; // 角度:有四个值:0,90,180,270
  593. data.push(line)
  594. //患者
  595. line={};
  596. line.text='患者:'+v.value.name+', '+v.value.sex+', '+v.value.age+'岁';
  597. line.x=300;
  598. line.y=180;
  599. line.fontSize=14;
  600. line.fontPath='';
  601. data.push(line); //每添加一个,代表一行字
  602. //出生
  603. line={};
  604. line.customText='出生日期:'+v.value.birth;
  605. line.x=300;
  606. line.y=240;
  607. line.fontSize=13;
  608. line.fontPath='';
  609. data.push(line); //每添加一个,代表一行字
  610. // let _this=this;
  611. // #ifdef APP-PLUS
  612. plug.printer({TSC:data}, ret => {
  613. // _this.tip = JSON.stringify(ret);
  614. // console.log('print data', data)
  615. // console.log('ret',ret)
  616. // console.log('ret.code',ret.code)
  617. // const err = JSON.parse(ret)
  618. // console.log('err',err)
  619. if(ret.code==1){
  620. uni.$showMsg('打印失败,打印机未连接,请先连接打印机', 2000)
  621. console.log('666')
  622. }
  623. })
  624. // #endif
  625. }
  626. </script>
  627. <style lang="scss">
  628. .main {
  629. display: flex;
  630. flex-direction:column;
  631. justify-content:flex-start;
  632. width: 750rpx;
  633. :deep(.uni-nav-bar-text){
  634. font-size: 20px;
  635. }
  636. :deep(.uni-navbar-btn-text){
  637. font-size: 16px;
  638. }
  639. .content{
  640. margin: 5rpx;
  641. background-color: #fff;
  642. flex-direction:column;
  643. align-items: center;
  644. .header{
  645. display: flex;
  646. flex-direction:column;
  647. margin:16rpx 16rpx 0;
  648. .ti{
  649. display: flex;
  650. flex-direction:row;
  651. justify-content: space-between;
  652. margin-top: 15.22rpx;
  653. .left{
  654. align-items: flex-start;
  655. .baracode{
  656. display: flex;
  657. flex-direction:column;
  658. .barnum{
  659. font-size: 15rpx;
  660. display: flex;
  661. justify-content:center;
  662. align-items: center;
  663. letter-spacing: 0.3em;
  664. }
  665. }
  666. }
  667. .mid{
  668. display: flex;
  669. margin-right: 160rpx;
  670. .title{
  671. font-size: 23.75rpx;
  672. font-weight: 800;
  673. }
  674. }
  675. .rig{
  676. display: flex;
  677. .title{
  678. font-size: 16rpx;
  679. width: 40rpx;
  680. font-weight: 300;
  681. }
  682. }
  683. }
  684. .patiinfo{
  685. display: flex;
  686. flex-direction:column;
  687. margin-top: 25.2rpx;
  688. padding-bottom: 21.45rpx;
  689. border-bottom: 1px solid #979797;
  690. .r1{
  691. display: flex;
  692. flex-direction:row;
  693. margin-bottom:15rpx;
  694. .row{
  695. font-size: 15rpx;
  696. font-weight: 400;
  697. margin-right: 30rpx;
  698. }
  699. .we{
  700. color:#999999;
  701. }
  702. }
  703. .r2{
  704. display: flex;
  705. flex-direction:row;
  706. margin-bottom:15rpx;
  707. .row{
  708. font-size: 15rpx;
  709. font-weight: 400;
  710. margin-right: 30rpx;
  711. }
  712. .we{
  713. color:#999999;
  714. }
  715. }
  716. .r3{
  717. display: flex;
  718. flex-direction:row;
  719. font-size: 15rpx;
  720. .we{
  721. color:#999999;
  722. }
  723. }
  724. }
  725. }
  726. .rp{
  727. display: flex;
  728. flex-direction:column;
  729. margin:22.39rpx 17.36rpx 0;
  730. border-bottom: 1px solid #979797;
  731. .title{
  732. font-size: 22rpx;
  733. margin-bottom: 10rpx;
  734. }
  735. .lists{
  736. display: flex;
  737. flex-wrap: wrap;
  738. flex-direction: row;
  739. justify-content:flex-start;
  740. align-content:flex-start;
  741. margin-left:20rpx;
  742. height: 545rpx;
  743. .item{
  744. display: flex;
  745. justify-content:center;
  746. align-items: center;
  747. width: 161rpx;
  748. margin: 0 10rpx 20rpx 0;
  749. // position: relative;
  750. .le{
  751. display: flex;
  752. font-size: 12rpx;
  753. width: 100rpx;
  754. word-wrap: break-word;
  755. // z-index: 100;
  756. // position: absolute;
  757. }
  758. .tag-view:deep(.uni-tag){
  759. display: flex;
  760. justify-content:center;
  761. align-items: center;
  762. font-size: 15rpx;
  763. font-weight:500;
  764. width: 80rpx;
  765. padding: 6rpx 6rpx;
  766. }
  767. .rig{
  768. display: flex;
  769. flex-direction:column;
  770. margin-left: 5.31rpx;
  771. width: 200rpx;
  772. // z-index: 200;
  773. // position: absolute;
  774. left:120rpx;
  775. .up{
  776. margin-bottom:8rpx;
  777. font-size: 10rpx;
  778. height: 12.5rpx;
  779. }
  780. .do{
  781. font-size: 12rpx;
  782. height: 12.5rpx;
  783. }
  784. }
  785. }
  786. }
  787. .footer{
  788. margin: 0 10rpx 8rpx;
  789. display: flex;
  790. font-size: 15rpx;
  791. .js{
  792. display: flex;
  793. margin-right: 54.4rpx;
  794. .pies_tips{}
  795. }
  796. .freque{}
  797. }
  798. .rp-tips{
  799. display: flex;
  800. justify-content:flex-end;
  801. font-size: 15rpx;
  802. margin-right: 10rpx;
  803. }
  804. }
  805. .amountarea{
  806. display: flex;
  807. margin: 21.3rpx 19.38px 0;
  808. padding-bottom: 20.94rpx;
  809. border-bottom: 1px solid #979797;
  810. .amount{
  811. display: flex;
  812. flex-direction:column;
  813. .r1{
  814. border: 1px solid #979797;
  815. font-size: 15rpx;
  816. width: 287.5rpx;
  817. display: flex;
  818. justify-content:center;
  819. align-items: center;
  820. height: 33.75rpx;
  821. }
  822. .r2{
  823. display: flex;
  824. justify-content:center;
  825. align-items: center;
  826. font-size: 15rpx;
  827. height: 33.75rpx;
  828. width: 287.5rpx;
  829. border-left: 1px solid #979797;
  830. border-right: 1px solid #979797;
  831. .jyf{
  832. width: 143.93rpx;
  833. display: flex;
  834. justify-content:center;
  835. align-items: center;
  836. }
  837. .psf{
  838. border-left: 1px solid #979797;
  839. width: 143.93rpx;
  840. display: flex;
  841. justify-content:center;
  842. align-items: center;
  843. }
  844. }
  845. .r3{
  846. display: flex;
  847. justify-content:center;
  848. align-items: center;
  849. height: 33.75rpx;
  850. font-size: 15rpx;
  851. border: 1px solid #979797;
  852. }
  853. }
  854. .service{
  855. display: flex;
  856. flex-wrap: wrap;
  857. margin-left: 60rpx;
  858. .kf{
  859. font-size: 15rpx;
  860. margin-right: 60rpx;
  861. width:90rpx;
  862. .we{
  863. font-size: 15rpx;
  864. color:#999999;
  865. }
  866. }
  867. }
  868. }
  869. .comment{
  870. margin: 10rpx 16rpx 10rpx;
  871. font-size: 15rpx;
  872. display: flex;
  873. }
  874. }
  875. .upload{
  876. margin: 0 10rpx 10rpx;
  877. background-color: #fff;
  878. flex-direction:column;
  879. align-items: center;
  880. padding: 20rpx;
  881. .title{
  882. font-size: 15rpx;
  883. margin-bottom:20px;
  884. color: #333333;
  885. }
  886. // :deep(.file-picker__box){
  887. // width: 112.5rpx;
  888. // height: 112.5rpx;
  889. // .file-picker__box-content{
  890. // width: 112.5rpx;
  891. // height: 112.5rpx;
  892. // }
  893. // }
  894. }
  895. .cooment{
  896. margin: 0 10rpx;
  897. background-color: #fff;
  898. flex-direction:column;
  899. align-items: center;
  900. padding: 5rpx 10rpx;
  901. .title{
  902. font-size: 15rpx;
  903. margin-bottom:20rpx;
  904. }
  905. .tex{
  906. display: flex;
  907. justify-content:flex-start;
  908. align-items: center;
  909. margin-bottom:12.7rpx;
  910. border: 1px solid #979797;
  911. // height: 74.38rpx;
  912. border-radius: 5rpx;
  913. .input{
  914. // height: 74.38rpx;
  915. // font-size: 15rpx;
  916. padding: 10rpx;
  917. // border-radius: 5rpx;
  918. :deep(.uni-textarea-placeholder){
  919. font-size: 15rpx;
  920. }
  921. }
  922. }
  923. }
  924. .radio{
  925. display: flex;
  926. margin: 0 10rpx;
  927. background-color: #fff;
  928. // padding: 0 20px 100px;
  929. flex-direction:column;
  930. // align-items: center;
  931. font-size: 15rpx!important;
  932. :deep(.uni-switch-input.uni-switch-input-checked){
  933. border-color: #18C7B0;
  934. background-color: #18C7B0;
  935. }
  936. }
  937. .submit{
  938. display: flex;
  939. margin-top: 33.23rpx;
  940. background-color: #fff;
  941. align-items: center;
  942. width: 750rpx;
  943. height: 62.5rpx;
  944. .bu{
  945. display: flex;
  946. justify-content:center;
  947. align-items: center;
  948. height: 40rpx;
  949. width: 671.25rpx;
  950. font-size: 17.5rpx;
  951. border-radius: 3.75rpx;
  952. background-color: #18c7b0;
  953. color:#fff;
  954. }
  955. }
  956. :deep(.uni-popup-dialog){
  957. width: 500rpx;
  958. // height: 268.75rpx;
  959. display: flex;
  960. flex-direction: column;
  961. background-color: #ffffff;
  962. // justify-content:center;
  963. // align-items: center;
  964. .uni-dialog-title-text{
  965. display: flex;
  966. font-size: 20rpx;
  967. // padding-top: 20px;
  968. }
  969. .uni-dialog-content{
  970. display: flex;
  971. margin: 10rpx 20rpx;
  972. background-color: #fff;
  973. box-shadow: 0 0 20rpx rgba(0, 0, 0, 0.15);
  974. .cotent{
  975. display: flex;
  976. flex-direction: column;
  977. width:400rpx;
  978. height: 112.5rpx;
  979. .title{
  980. font-size: 17.5rpx;
  981. font-weight: 500;
  982. margin-bottom: 10rpx;
  983. display: flex;
  984. align-items: center;
  985. justify-content:center;
  986. }
  987. .body{
  988. display: flex;
  989. // flex-direction: column;
  990. justify-content:center;
  991. .lef{
  992. display: flex;
  993. flex-direction: column;
  994. width: 200rpx;
  995. justify-content:center;
  996. .baracode{
  997. display: flex;
  998. flex-direction:column;
  999. width: 200rpx;
  1000. height: 54.38rpx;
  1001. .cav{
  1002. width:200rpx;
  1003. }
  1004. .barnum{
  1005. width:200rpx;
  1006. font-size: 10rpx;
  1007. display: flex;
  1008. color: #333333;
  1009. justify-content:center;
  1010. align-items: center;
  1011. letter-spacing: 0.7em;
  1012. }
  1013. }
  1014. }
  1015. .rig{
  1016. display: flex;
  1017. flex-direction: column;
  1018. width: 340px;
  1019. margin-left: 13.75rpx;
  1020. .hz{
  1021. display: flex;
  1022. margin-bottom: 10rpx;
  1023. font-size: 15rpx;
  1024. }
  1025. .bold{
  1026. font-weight: 500;
  1027. }
  1028. }
  1029. }
  1030. }
  1031. }
  1032. .uni-dialog-button-group{
  1033. display: flex;
  1034. font-size: 17.5rpx;
  1035. .uni-dialog-button{
  1036. display: flex;
  1037. .uni-dialog-button-text{
  1038. }
  1039. }
  1040. .uni-border-left{
  1041. .uni-dialog-button-text{
  1042. color: #18c7b0;
  1043. }
  1044. }
  1045. }
  1046. }
  1047. }
  1048. </style>