edit.vue 29 KB

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