edit.vue 29 KB

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