edit.vue 27 KB

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