12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223 |
- <template>
- <view class="main">
- <uni-nav-bar dark :fixed="true" background-color="#18C7B0" status-bar left-icon="left" height="62.5rpx" width="750rpx"
- title="调配详情" @clickLeft="handleBack"
- />
-
- <view class="content">
- <view class="header">
- <view class="ti">
- <view class="left">
- <view class="baracode">
- <w-barcode :options="preseObj"></w-barcode>
- <view class="barnum">{{v.preNo}}</view>
- </view>
- </view>
- <view class="mid">
- <text class="title">中药处方笺</text>
- </view>
- <view class="rig"><text class="title">{{v.type=='1'?"中药处方":v.type=='1'?"中药制剂":""}}</text></view>
- </view>
- <view class="patiinfo">
- <view class="r1">
- <view class="row"><span class="we">姓名:</span>{{v.name}}</view>
- <view class="row"><span class="we">性别:</span>{{v.sex}}</view>
- <view class="row"><span class="we">年龄:</span>{{v.age}}岁</view>
- <view class="row"><span class="we">电话:</span>{{v.contactNumber}}</view>
- <view class="row"><span class="we">当前处方状态:</span>{{v.state=="1"?"配药":v.state=="2"?"煎药":v.state=="3"?"发药":v.state=="4"?"配送":""}}</view>
- </view>
- <view class="r2">
- <view class="row"><span class="we">就诊科室:</span>{{v.department}}</view>
- <view class="row"><span class="we">临床诊断:</span>{{v.disName}}—{{v.symName}}</view>
- <view class="row"><span class="we">开方时间:</span>{{v.prescriptionTime}}</view>
- </view>
- <view class="r3"><span class="we">联系地址:</span>{{v.address}}</view>
- </view>
- </view>
- <view class="rp">
- <view class="title">
- <text class="text">Rp:</text>
- </view>
- <view class="lists">
- <view class="item" v-for="(x, i) in v.rp" :key="i">
- <view class="le tag-view" @click="handleGetRps(x)">
- <uni-tag :inverted="!selectRps.includes(x)" :text="x.matName+x.matDose+x.matUnitName" />
- </view>
- <view class="rig">
- <view class="up"> {{x.matUsageName}}</view>
- <view class="do"> {{x.sign}}</view>
- </view>
- </view>
- </view>
- <view class="footer">
- <view class="js">
- 剂数:{{v.number}}
- <view v-if="v.daijianCost!==''" class="pies_tips">
- (代煎)
- </view>
- </view>
- <view class="js">{{v.dosageForm}}</view>
- <view class="js">{{v.prescriptionUsage}}</view>
- <view class="js">每次{{v.concentration}}</view>
- <view class="js">{{v.frequency}}</view>
- <view class="freque">{{v.medicationTime}}</view>
- </view>
- <view class="rp-tips">{{v.entrust}}</view>
- </view>
- <view class="amountarea">
- <view class="amount">
- <view class="r1">
- <view class="pijw">药品金额:{{v.prescriptionSum}}</view>
- </view>
- <view class="r2">
- <view class="jyf">煎药费:{{v.daijianCost}}</view>
- <view class="psf">配送费:{{v.distributionCost}}</view>
- </view>
- <view class="r3">
- 总金额:{{v.prescriptionTotalSum}}
- <!-- <view class="zjw"></view> -->
- </view>
- </view>
- <view class="service">
- <view class="kf"><span class="we">开方:</span>{{v.operateList[0].operater || ''}}</view>
- <view class="kf"><span class="we">审核:</span>{{v.operateList[1].operater || ''}}</view>
- <view class="kf"><span class="we">调配:</span>{{v.operateList[2].operater || ''}}</view>
- <view class="kf"><span class="we">复核:</span>{{v.operateList[3].operater || ''}}</view>
- <view class="kf"><span class="we">浸泡:</span>{{v.operateList[4].operater || ''}}</view>
- <view class="kf"><span class="we">煎煮:</span>{{v.operateList[5].operater || ''}}</view>
- <view class="kf"><span class="we">打包:</span>{{v.operateList[6].operater || ''}}</view>
- <view class="kf"><span class="we">发药:</span>{{v.operateList[7].operater || ''}}</view>
- </view>
- </view>
- <view class="comment">
- <view class="z">注:</view>
- <text>{{v.entrust1111}}</text>
- </view>
- </view>
- <view class="upload">
- <view class="title">上传照片</view>
- <uni-file-picker
- :image-styles = "imageStyles"
- fileMediatype="image"
- mode="grid"
- :limit="3"
- :del-icon="false"
- :auto-upload="false"
- @select="selectUpload"
- />
- </view>
-
- <view class="cooment">
- <view class="title">备注内容</view>
- <view class="tex">
- <textarea placeholder="请输入备注内容" v-model="editForm.comments" placeholder-style="font-size: 15rpx;" height="60rpx" @input="bindTextInput" class="input" ></textarea>
- </view>
- </view>
- <view class="radio">
- <label for="">
- <switch :checked="isPrint" style="transform:scale(0.7)" @change="handleChange" /> 上传时直接打印标签
- </label>
- </view>
- <view class="submit">
- <button type="primary" class="bu" @click="handleSubmit">上传</button>
- </view>
- <view class="popup">
- <uni-popup ref="alertDialog" type="dialog">
- <uni-popup-dialog type="center" cancelText="不打印" confirmText="打印" title="打印标签" @confirm="dialogConfirm" @close="dialogClose">
- <view class="cotent" id="printMe">
- <view class="title">{{v.yljgName || '默默事中医院取药标签打印(门诊)'}}</view>
- <view class="body">
- <view class="lef">
- <view class="baracode">
- <w-barcode class="cav" :options="preseObj"></w-barcode>
- <view class="barnum">{{v.preNo}}</view>
- </view>
- </view>
- <view class="rig">
- <view class="hz">患者:<view class="bold">{{v.name}},{{v.sex}},{{v.age}}岁</view></view>
- <view class="hz">出生日期:<view class="bold">{{v.birth}}</view></view>
- </view>
- </view>
- </view>
- </uni-popup-dialog>
- </uni-popup>
- </view>
- <view class="popup">
- <uni-popup ref="printerDialog" type="dialog">
- <uni-popup-dialog type="center" cancelText="取消" confirmText="确认" title="设置打印机" @confirm="connectThenPrint" @close="cancelConfig">
- <view class="printconfig">
- <view style="font-size: 20rpx;">使用须知</view>
- <view style="font-size: 16rpx;color:brown;margin-bottom: 20rpx;">*使用前先连接wifi打印机</view>
- <uni-easyinput class="input" confirm-type="done" v-model="printInfo.ip" placeholder="请输入打印机ip地址" @confirm="connectThenPrint"></uni-easyinput>
- </view>
- </uni-popup-dialog>
- </uni-popup>
- </view>
- </view>
- </template>
- <script>
- export default {
- name: ''
- }
- </script>
- <script setup>
- import { onMounted, ref, getCurrentInstance } from 'vue'
- import { selectOrderDetail, upload, sendToUser, updateOrderStatus } from "@/static/js/request.js"
- import { saveDepoly, setIp } from '@/static/js/api.js'
- import debounce from 'lodash.debounce'
- import { onLoad } from '@dcloudio/uni-app'
- const printInfo = ref({
- ip: '',
- port: '9100',
- })
- const urlConfig = ref('http://zhongyao.fscuc.cn')
- // #ifdef APP-PLUS
- const plug= uni.requireNativePlugin('Html5app-Gprinter');
- // #endif
- const connectThenPrint = ()=>{
- const ipReg = /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/
- if(ipReg.test(printInfo.value.ip)){
- if(RegExp.$1<256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256){
- uni.$showMsg('打印机连接成功!', 500)
- plug.connectIP({"ip":printInfo.value.ip,"port":printInfo.value.port},ret=>{
- console.log('connectPrint>>ret',ret)
- const res = JSON.parse(JSON.stringify(ret))
- console.log('connectPrint>>res',res.code)
- if(res.code==3){
- // initPrint.value = true
- console.log('printInfo>>>', printInfo.value)
- uni.setStorageSync('hasPrinter', '1')
-
- uni.setStorageSync('printerIp', printInfo.value.ip)
- // _this.tip=JSON.stringify(ret);
- // console.log(_this.tip);
- // 关闭配置弹窗
- proxy.$refs.printerDialog.close()
- printerTsc()
-
- if(uni.getStorageSync('hasPrinter') == '1'){
- deploy()
- }
-
-
- } else{
- uni.$showMsg('打印机连接失败,请重试!', 500)
- }
- });
- } else{
- uni.$showMsg('ip地址有误,请重试!', 2000)
- }
- }
- }
- // const preseId = ref(11220822134401)
- const preseObj = ref({
- code: '',
- color:['#000'], // 条形码的颜色
- bgColor: '#FFFFFF', // 背景色
- width: 200, // 宽度
- height: 50 // 高度
- })
- const statusArr = ref([
- {name:'配药',id:'1'},
- {name:'煎药',id:'2'},
- {name:'发药',id:'3'},
- {name:'配送',id:'4'}
- ])
- const typeArr = ref([
- {name:'中药处方',id:'1'},
- {name:'中药制剂',id:'2'}
- ])
- const {proxy} = getCurrentInstance()
- const imageStyles =ref({
- width:112.5,
- height:112.5,
- border:{
- color:"#DDDDDD",
- width:1,
- style:'solid',
- radius:'4px'
- }
- })
- const depolyImage = ref([])
- const barOpations = ref({
- height: 80,
- displayValue: false
- })
- const selectRps = ref([])
- const isPrint = ref(true)
- const initPrint =ref(uni.getStorageSync('initPrint'))
- const photos = ref([])
- const v=ref({
- preNo:'11220822134401',
- presType:'普通处方',
- name:'李某',
- sex:'男',
- age:35,
- contactNumber:'13888888888',
- state: '发药',
- department:'中医内科',
- disName:'胃脘痛病',
- symName:'脾胃虚寒证',
- prescriptionTime:'2023-06-01 15:58',
- address:'浙江省某某事某某去某某事中医院门诊楼三楼302是',
- birth:'',
- rp:[
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'先煎',sign:'医生签名'},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'先煎',sign:'医生签名'},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'',sign:''},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'',sign:''},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'',sign:''},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'先煎',sign:''},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'先煎',sign:'医生签名'},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'先煎',sign:'医生签名'},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'',sign:''},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'',sign:''},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'',sign:''},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'先煎',sign:''},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'先煎',sign:'医生签名'},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'先煎',sign:'医生签名'},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'',sign:''},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'',sign:''},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'',sign:''},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'先煎',sign:''},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'先煎',sign:'医生签名'},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'先煎',sign:'医生签名'},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'包煎',sign:'医生签名'},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'',sign:''},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'',sign:''},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'',sign:''},
- {matName:'车前子',matDose:'6',matUnitName:'g',tips:'先煎',sign:''}
- ],
- number:3,
- pies_tips:'待见',
- dosageForm:'汤剂',
- prescriptionUsage:'煎服',
- concentration:'200ml',
- frequency:'一日三次',
- medicationTime:'饭后服',
- entrust:'注意多休息,饮食清单。',
-
- prescriptionSum: '187.00',
- daijianCost:'30.00',
- distributionCost:'10.00',
- prescriptionTotleSum: '227.00',
-
- yljgName:'杭州某某高级中医院',
- operateList:[
- {py:'kf',title:'开方',operater:''},
- {py:'sh',title:'审核',operater:''},
- {py:'tp',title:'调配',operater:''},
- {py:'fh',title:'复核',operater:''},
- {py:'jp',title:'浸泡',operater:''},
- {py:'jz',title:'煎煮',operater:''},
- {py:'db',title:'打包',operater:''},
- {py:'fy',title:'发药',operater:''},
- ],
-
- // extra_doc:'A医生',
- // check_doc:'B医生',
- // depoly:'调陪人',
- // review:'复核人',
- // steep:'浸泡',
- // cook:'煎煮人',
- // pack:'大宝人',
- // dispen:'发药人',
- // },
- entrust1111:'1、本处方当日有效\n 2、取药时请您当面核对药品名称、规格、数量 \n 3、延长处方用量时间原因:慢性病 其他老年病 外地 其他'
- })
- const editForm =ref({
- urls:[],
- userId:uni.getStorageSync('userId'),
- comments:'',
- weight:'',
- coreId: ''
- })
- onMounted(() => {
- printInfo.value.ip = uni.getStorageSync('printerIp')
- })
- const handleRemove = (file, uploadFiles) => {
- console.log(file, uploadFiles)
- }
- const handlePreview = (uploadFile) => {
- console.log(uploadFile)
- }
- const bindTextInput = (e)=>{
- console.log(e.detail.value)
- }
- onLoad(async(options) => {
- console.log('options', options)
- const userId = uni.getStorageSync('userId')
-
- const params = {
- token: uni.getStorageSync('token'),
- data: {
- id: options.id || '',
- preNo: options.preId || '',
- depolyStatus: options.depolyStatus || ''
- }
- }
- console.log("params",params)
- const {data:res} = await selectOrderDetail(params)
-
- if (res.code === 200) {
- v.prescriptionTime = res.data.prescriptionTime,
- v.value.name = res.data.name,
- v.value.sex = res.data.sex,
- v.value.age = res.data.age,
- v.value.contactNumber = res.data.contactNumber
- v.value.address = res.data.address
- v.value.concentration = res.data.concentration
- v.value.frequency = res.data.frequency
- v.value.medicationTime = res.data.medicationTime
- editForm.value.coreId = v.value.id = res.data.id
- console.log('onLoad v.value.v.value.id', v.value.id)
- v.value.disName = res.data.disName,
- v.value.symName = res.data.symName,
- v.value.preNo = res.data.preNo,
- console.log('onLoad v.value.preNo', v.value.preNo)
- preseObj.value.code = v.value.preNo
- v.value.department = res.data.department,
- v.value.dosageForm = res.data.dosageForm,
- v.value.prescriptionUsage = res.data.prescriptionUsage,
-
- v.value.number = res.data.number,
- v.value.prescriptionSum = res.data.prescriptionSum,
- v.value.prescriptionTotalSum = res.data.prescriptionTotalSum,
- v.value.daijianCost = res.data.daijianCost,
- v.value.distributionCost = res.data.distributionCost,
- v.value.prescriptionTotleSum = res.data.prescriptionTotleSum,
-
- v.value.entrust = res.data.entrust
- v.value.rp = res.data.detailList
- v.value.yljgName = res.data.yljgName || ''
- v.value.birth = res.data.patientBirthday.substring(0,10) || ''
- v.value.state = res.data.state
- console.log('res.data.state',res.data.state)
- switch (res.data.state) {
- case '1':
- v.value.state = '配药'
- break
- case '2':
- v.value.state = '煎药'
- break
- case '3':
- v.value.state = '发药'
- break
- case '4':
- v.value.state = '配送'
- break
- case '5':
- v.value.state = '已分配'
- break
- case '6':
- v.value.state = '已传送'
- break
- default:
- v.value.state = '配药'
- }
-
- v.value.operateList[0].operater = res.data.doctor || ''
- v.value.operateList[1].operater = res.data.checkBy || ''
- v.value.operateList[2].operater = res.data.tiaopeiName || ''
- // 循环operateList
- const length = res.data.operateList
- if(length > 0){
- res.data.operateList.forEach((item)=>{
- switch(item.type){
- case '2':
- v.value.operateList[3].operater = item.createBy
- break
- case '3':
- v.value.operateList[4].operater = item.createBy
- break
- case '4':
- v.value.operateList[5].operater = item.createBy
- break
- case '5':
- v.value.operateList[6].operater = item.createBy
- break
- case '6':
- v.value.operateList[7].operater = item.createBy
- break
- defalut:console.log('处方签res.data.operateList数据异常',item.type)
- }
- })
- }
- }
- })
- const handleGetRps = (v)=>{
- console.log('handleGetRps', v)
- if(!selectRps.value.includes(v)) {
- selectRps.value.push(v)
- } else {
- selectRps.value.splice(selectRps.value.indexOf(v), 1)
- }
- }
- const handleChange = ()=>{
- isPrint.value = !isPrint.value
- console.log('handleChange', isPrint.value)
- }
- const handleBack =()=>{
- uni.navigateBack({
- delta: 1
- })
- }
- const cancelConfig = () => {
- console.log('不配置打印ip')
- proxy.$refs.printerDialog.close()
- }
- const handleSubmit = debounce(async()=>{
- console.log('handleSubmit>>>',editForm.value)
- console.log('isPrint.value>>', isPrint.value)
-
- if(isPrint.value){
- // 直接调用接口,然后打印
- // print("#printMe")
- // 打印成功后调用/userPrescription/sendToUser
-
- // if(uni.getStorageSync('initPrint')==true){
- // // APP-PLUS
- // const ret = printerTsc()
- // console.log('ret',ret)
- // // APP-PLUS
- // } else {
- // uni.$showMsg('打印失败,打印机未连接,请先连接打印机', 2000)
- // return
- // }
-
- // todo 判断打印机是否连接成功,hasPrinter=='1'连接成功则开始打印,否则弹窗配置打印机,配置成功打印机后关闭弹窗直接打印
- if(uni.getStorageSync('hasPrinter') == '1'){
- printerTsc()
-
- const tmp = await deploy()
- uni.redirectTo({
- url:"/pages/index/index"
- })
- } else {
- // todo 判断打印机是否连接成功,hasPrinter空值则连接不成功,弹窗配置打印机,配置成功打印机后关闭弹窗直接打印
- proxy.$refs.printerDialog.open('center')
-
- }
-
-
- } else {
- // todo 打印预览弹窗显示
- console.log("cancelConfig proxy.$refs.alertDialog",proxy.$refs.alertDialog)
- proxy.$refs.alertDialog.open('center')
- }
-
- },500)
- const dialogConfirm = debounce(async()=>{
- console.log('dialogConfirm直接调用接口,然后打印')
- // if(uni.getStorageSync('initPrint')==true){
- // // #ifdef APP-PLUS
- // const ret = printerTsc()
- // console.log('ret',ret)
- // // #endif
- // } else {
- // uni.$showMsg('打印失败,打印机未连接,请先连接打印机', 2000)
- // }
- if(uni.getStorageSync('hasPrinter') == '1'){
- printerTsc()
- console.log("uni.getStorageSync('token')",uni.getStorageSync('token'))
- const ret1 = await deploy()
- uni.redirectTo({
- url:"/pages/index/index"
- })
- } else {
- // todo 判断打印机是否连接成功,hasPrinter空值则连接不成功,弹窗配置打印机,配置成功打印机后关闭弹窗直接打印
- proxy.$refs.alertDialog.close()
- proxy.$refs.printerDialog.open('center')
-
- }
- },500)
- const dialogClose = debounce(async()=>{
- console.log('dialogClose直接调用接口,不打印')
- const {data:res} = await saveDepoly({
- token: uni.getStorageSync('token'),
- data: JSON.stringify(editForm.value)
- })
- if(res.code===200){
- console.log('depoly success>>>')
- }
- const res1 = await sendToUser({
- token: uni.getStorageSync('token'),
- data: JSON.stringify({id:uni.getStorageSync('userId')})
- })
- const ret = await updateOrderStatus({
- token: uni.getStorageSync('token'),
- data: {
- id:v.value.id,
- status:'1',
- }
- })
- uni.redirectTo({
- url:"/pages/index/index"
- })
- },500)
- const deploy = async() => {
- const {data:res} = await saveDepoly({
- token: uni.getStorageSync('token'),
- data: JSON.stringify(editForm.value)
- })
- if(res.code===200){
- console.log('depoly success>>>')
- }
- const res1 = await sendToUser({
- token: uni.getStorageSync('token'),
- data: JSON.stringify({id:uni.getStorageSync('userId')})
- })
- const ret2 = await updateOrderStatus({
- token: uni.getStorageSync('token'),
- data: {
- id:v.value.id,
- status:'1',
- }
- })
- console.log('updateOrderStatus >>ret2',ret2)
- // 保存ip和端口
- console.log("保存ip和端口", uni.getStorageSync('userId'),printInfo.value.ip, printInfo.value.port)
- const res2 = await setIp({
- token: uni.getStorageSync('token'),
- data: JSON.stringify({userId:uni.getStorageSync('userId'),ip:printInfo.value.ip,port:printInfo.value.port})
- })
-
- if (res2.data.code !== 200){
- // uni.$showMsg('保存ip和端口数据异常', 2000)
- console.log("保存ip和端口数据异常", res2)
- }
- uni.redirectTo({
- url:"/pages/index/index"
- })
- }
- const selectUpload = debounce((e)=>{
- uni.showLoading({
- title: "上传中"
- });
- const tempFilePaths = e.tempFilePaths;
- for (var i = 0; i < tempFilePaths.length; i++) {
- const tempFile = e.tempFiles[i];
- uni.uploadFile({
- url: urlConfig.value + '/common/upload',
- header: {
- 'Authorization': 'Bearer '+uni.getStorageSync('token')
- },
- formData: {
- secretFlag: 'N',
- fileLocation: 5
- },
- filePath: tempFilePaths[i],
- name: 'file',
- success: (uploadFileRes) => {
- uni.hideLoading();
- console.log('upload success>>',uploadFileRes)
- const back = JSON.parse(uploadFileRes.data);
- console.log('upload success back >>',back)
- if (back.code == 200) {
- editForm.value.urls.push(back.url)
- }
- },
- fail: () => {
- uni.hideLoading();
- uni.showToast("上传失败,请联系开发!")
- },
- complete: function() {
- uni.hideLoading();
- }
- });
- }
- },500)
- const printerTsc = ()=>{
-
- //制作标签格式,
- let data=[]; //定义一个数组
- let line={}; //每添加一个,代表一行字
-
- //设置标签纸大小
- line={};
- line.width=80; //mm
- line.height=50; //mm
- line.gap=2; //标签纸之间,间隙长度 mm
- line.page=1; //打印几份
- line.direction=0, //上下反面打印,0=>正方向,1=> 反方向
- data.push(line); //每添加一个,代表一行字
-
- let filePath=plus.io.convertLocalFileSystemURL("static/OpenSans-Bold.ttf")
- //添加文字
- line={};
- line.customText=v.value.yljgName;
- line.x=100;
- line.y=40;
- line.fontSize=20;
- line.fontPath='';
- data.push(line); //每添加一个,代表一行字
-
- //添加图片
- // var imgage=plus.io.convertLocalFileSystemURL("static/gprinter.png");
- // line={};
- // line.image=imgage;
- // line.x=20;
- // line.y=65;
- // line.width=80;
- // data.push(line);
-
-
- // //添加黑块
- // line={};
- // line.addBar={x:10,y:10,width:200,height:4};
- // data.push(line);
-
- // //添加方框
- // line={};
- // line.addBox={x:10,y:25,xend:180,yend:50,thickness:2};
- // data.push(line);
-
- // //添加二维码
- // line={};
- // line.qrcode="https://www.baidu.com/";
- // line.x=205; //横坐标
- // line.y=25; //纵坐标
- // line.width=3; //二维码大小,1-10 之间
- // line.rotation=0; // 角度:有四个值:0,90,180,270
- // data.push(line);
- //添加条型码
- line={};
- line.barcode=v.value.preNo;
- line.x=50; //横坐标
- line.y=150; //纵坐标
- line.type="CODE128"; //条型码类型
- line.height=80; //条型码高度
- line.readable=true; //是否显示文字在条型下方
- line.rotation=0; // 角度:有四个值:0,90,180,270
- data.push(line)
-
- //患者
- line={};
- line.text='患者:'+v.value.name+', '+v.value.sex+', '+v.value.age+'岁';
- line.x=300;
- line.y=180;
- line.fontSize=14;
- line.fontPath='';
- data.push(line); //每添加一个,代表一行字
-
- //出生
- line={};
- line.customText='出生日期:'+v.value.birth;
- line.x=300;
- line.y=240;
- line.fontSize=13;
- line.fontPath='';
- data.push(line); //每添加一个,代表一行字
-
- // let _this=this;
-
- // #ifdef APP-PLUS
- plug.printer({TSC:data}, (ret) => {
- const tip = JSON.stringify(ret);
- })
- // #endif
- }
- </script>
- <style lang="scss">
- .main {
- display: flex;
- flex-direction:column;
- justify-content:flex-start;
- width: 750rpx;
- :deep(.uni-nav-bar-text){
- font-size: 20px;
- }
- :deep(.uni-navbar-btn-text){
- font-size: 16px;
- }
- .content{
- margin: 5rpx;
- background-color: #fff;
- flex-direction:column;
- align-items: center;
- .header{
- display: flex;
- flex-direction:column;
- margin:16rpx 16rpx 0;
- .ti{
- display: flex;
- flex-direction:row;
- justify-content: space-between;
- margin-top: 15.22rpx;
- .left{
- align-items: flex-start;
- .baracode{
- display: flex;
- flex-direction:column;
- .barnum{
- font-size: 15rpx;
- display: flex;
- justify-content:center;
- align-items: center;
- letter-spacing: 0.3em;
- }
- }
- }
- .mid{
- display: flex;
- margin-right: 160rpx;
- .title{
- font-size: 23.75rpx;
- font-weight: 800;
- }
- }
- .rig{
- display: flex;
- .title{
- font-size: 16rpx;
- width: 40rpx;
- font-weight: 300;
- }
- }
- }
- .patiinfo{
- display: flex;
- flex-direction:column;
- margin-top: 25.2rpx;
- padding-bottom: 21.45rpx;
- border-bottom: 1px solid #979797;
- .r1{
- display: flex;
- flex-direction:row;
- margin-bottom:15rpx;
- .row{
- font-size: 15rpx;
- font-weight: 400;
- margin-right: 30rpx;
- }
- .we{
- color:#999999;
- }
- }
- .r2{
- display: flex;
- flex-direction:row;
- margin-bottom:15rpx;
- .row{
- font-size: 15rpx;
- font-weight: 400;
- margin-right: 30rpx;
- }
- .we{
- color:#999999;
- }
- }
- .r3{
- display: flex;
- flex-direction:row;
- font-size: 15rpx;
- .we{
- color:#999999;
- }
- }
- }
- }
- .rp{
- display: flex;
- flex-direction:column;
- margin:22.39rpx 17.36rpx 0;
- border-bottom: 1px solid #979797;
- .title{
- font-size: 22rpx;
- margin-bottom: 10rpx;
- }
- .lists{
- display: flex;
- flex-wrap: wrap;
- flex-direction: row;
- justify-content:flex-start;
- align-content:flex-start;
- margin-left:20rpx;
- height: 545rpx;
- .item{
- display: flex;
- justify-content:center;
- align-items: center;
- width: 161rpx;
- margin: 0 10rpx 20rpx 0;
- // position: relative;
- .le{
- display: flex;
- font-size: 12rpx;
- width: 100rpx;
- word-wrap: break-word;
- // z-index: 100;
- // position: absolute;
-
- }
- .tag-view:deep(.uni-tag){
- display: flex;
- justify-content:center;
- align-items: center;
- font-size: 15rpx;
- font-weight:500;
- width: 80rpx;
- padding: 6rpx 6rpx;
- }
- .rig{
- display: flex;
- flex-direction:column;
- margin-left: 5.31rpx;
- width: 200rpx;
- // z-index: 200;
- // position: absolute;
- left:120rpx;
- .up{
- margin-bottom:8rpx;
- font-size: 10rpx;
- height: 12.5rpx;
- }
- .do{
-
- font-size: 12rpx;
- height: 12.5rpx;
- }
- }
- }
- }
- .footer{
- margin: 0 10rpx 8rpx;
- display: flex;
- font-size: 15rpx;
- .js{
- display: flex;
- margin-right: 54.4rpx;
- .pies_tips{}
- }
- .freque{}
- }
- .rp-tips{
- display: flex;
- justify-content:flex-end;
- font-size: 15rpx;
- margin-right: 10rpx;
- }
- }
- .amountarea{
- display: flex;
- margin: 21.3rpx 19.38px 0;
- padding-bottom: 20.94rpx;
- border-bottom: 1px solid #979797;
- .amount{
- display: flex;
- flex-direction:column;
- .r1{
- border: 1px solid #979797;
- font-size: 15rpx;
- width: 287.5rpx;
- display: flex;
- justify-content:center;
- align-items: center;
- height: 33.75rpx;
- }
- .r2{
- display: flex;
- justify-content:center;
- align-items: center;
- font-size: 15rpx;
- height: 33.75rpx;
- width: 287.5rpx;
- border-left: 1px solid #979797;
- border-right: 1px solid #979797;
- .jyf{
-
- width: 143.93rpx;
- display: flex;
- justify-content:center;
- align-items: center;
- }
- .psf{
- border-left: 1px solid #979797;
- width: 143.93rpx;
- display: flex;
- justify-content:center;
- align-items: center;
- }
- }
- .r3{
- display: flex;
- justify-content:center;
- align-items: center;
- height: 33.75rpx;
- font-size: 15rpx;
- border: 1px solid #979797;
- }
- }
- .service{
- display: flex;
- flex-wrap: wrap;
- margin-left: 60rpx;
- .kf{
- font-size: 15rpx;
- margin-right: 60rpx;
- width:90rpx;
- .we{
- font-size: 15rpx;
- color:#999999;
- }
- }
- }
- }
-
- .comment{
- margin: 10rpx 16rpx 10rpx;
- font-size: 15rpx;
- display: flex;
- }
- }
- .upload{
- margin: 0 10rpx 10rpx;
- background-color: #fff;
- flex-direction:column;
- align-items: center;
- padding: 20rpx;
-
- .title{
- font-size: 15rpx;
- margin-bottom:20px;
- color: #333333;
- }
- // :deep(.file-picker__box){
- // width: 112.5rpx;
- // height: 112.5rpx;
- // .file-picker__box-content{
- // width: 112.5rpx;
- // height: 112.5rpx;
- // }
- // }
- }
- .cooment{
- margin: 0 10rpx;
- background-color: #fff;
- flex-direction:column;
- align-items: center;
- padding: 5rpx 10rpx;
- .title{
- font-size: 15rpx;
- margin-bottom:20rpx;
- }
- .tex{
- display: flex;
- justify-content:flex-start;
- align-items: center;
- margin-bottom:12.7rpx;
- border: 1px solid #979797;
- // height: 74.38rpx;
- border-radius: 5rpx;
- .input{
- // height: 74.38rpx;
- // font-size: 15rpx;
- padding: 10rpx;
- // border-radius: 5rpx;
- :deep(.uni-textarea-placeholder){
- font-size: 15rpx;
- }
- }
- }
- }
- .radio{
- display: flex;
- margin: 0 10rpx;
- background-color: #fff;
- // padding: 0 20px 100px;
- flex-direction:column;
- // align-items: center;
- font-size: 15rpx!important;
- :deep(.uni-switch-input.uni-switch-input-checked){
- border-color: #18C7B0;
- background-color: #18C7B0;
- }
- }
- .submit{
- display: flex;
- margin-top: 33.23rpx;
- background-color: #fff;
- align-items: center;
- width: 750rpx;
- height: 62.5rpx;
- .bu{
- display: flex;
- justify-content:center;
- align-items: center;
- height: 40rpx;
- width: 671.25rpx;
- font-size: 17.5rpx;
- border-radius: 3.75rpx;
- background-color: #18c7b0;
- color:#fff;
- }
- }
-
- :deep(.uni-popup-dialog){
- width: 500rpx;
- // height: 268.75rpx;
- display: flex;
- flex-direction: column;
- background-color: #ffffff;
-
- // justify-content:center;
- // align-items: center;
- .uni-dialog-title-text{
- display: flex;
- font-size: 20rpx;
- // padding-top: 20px;
- }
- .uni-dialog-content{
- display: flex;
- margin: 10rpx 20rpx;
- background-color: #fff;
- box-shadow: 0 0 20rpx rgba(0, 0, 0, 0.15);
- .cotent{
- display: flex;
- flex-direction: column;
- width:400rpx;
- height: 112.5rpx;
- .title{
- font-size: 17.5rpx;
- font-weight: 500;
- margin-bottom: 10rpx;
- display: flex;
- align-items: center;
- justify-content:center;
- }
- .body{
- display: flex;
- // flex-direction: column;
- justify-content:center;
- .lef{
- display: flex;
- flex-direction: column;
- width: 200rpx;
- justify-content:center;
- .baracode{
- display: flex;
- flex-direction:column;
- width: 200rpx;
- height: 54.38rpx;
- .cav{
- width:200rpx;
-
- }
- .barnum{
- width:200rpx;
- font-size: 10rpx;
- display: flex;
- color: #333333;
- justify-content:center;
- align-items: center;
- letter-spacing: 0.7em;
- }
- }
- }
- .rig{
- display: flex;
- flex-direction: column;
- width: 340px;
- margin-left: 13.75rpx;
- .hz{
- display: flex;
- margin-bottom: 10rpx;
- font-size: 15rpx;
- }
- .bold{
- font-weight: 500;
- }
- }
- }
- }
- }
- .uni-dialog-button-group{
- display: flex;
- font-size: 17.5rpx;
- .uni-dialog-button{
- display: flex;
- .uni-dialog-button-text{
- }
- }
- .uni-border-left{
- .uni-dialog-button-text{
- color: #18c7b0;
- }
- }
- }
- }
- }
- .printconfig{
- background-color: #fff;
- width: 500rpx;
- height: 100rpx;
- padding: 20rpx;
- .initPrint{
- .title{
- font-size: 20rpx;
- }
- .tips{
- font-size: 16rpx;
- }
- .input{
- width: 300rpx;
- }
- }
- }
- </style>
|