edit.vue 31 KB

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