edit.vue 28 KB

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