edit.vue 28 KB

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