order-card.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. <template>
  2. <view class="container" v-if="(props.s=='1' || props.c=='1')" @click="handleDetail">
  3. <view class="t">
  4. <view class="d1"></view>
  5. <view class="d2">
  6. <view class="dtim">时间:{{props.v.prescriptionTime}}</view>
  7. </view>
  8. <view class="d3"><view class="presno">处方号:{{props.v.preNo}}</view></view>
  9. <view class="d4"><view class="source" :class="{'zy':props.v.preMzZy==='1'}">{{props.v.preMzZy==='1'?'门诊':'住院'}}</view></view>
  10. </view>
  11. <view class="m">
  12. <image class="faceu" aspectFill :src="props.v.sex==='男'?'/static/hz.png':'/static/hy.png'" />
  13. <view class="patie">
  14. <view class="name">{{props.v.name}}</view>
  15. <view class="seage">
  16. <image class="img" aspectFill :src="props.v.sex==='男'?'/static/male.png':'/static/female.png'" />
  17. <view class="sex">{{props.v.sex}}</view>
  18. <view class="sep">|</view>
  19. <view class="age">{{v.age}}岁</view>
  20. </view>
  21. <view class="case">{{props.v.disName}} - {{props.v.symName}}</view>
  22. </view>
  23. <view class="pres">
  24. <view class="department">就诊科室:{{props.v.department}}</view>
  25. <view class="presInfo">
  26. 处方信息:
  27. <text class="tips">
  28. {{props.v.dosageForm}},{{props.v.number}}剂
  29. </text>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="b">
  34. <view class="zt">当前处方状态: {{deployStateName}}</view>
  35. <view class="je">处方金额:{{props.v.prescriptionSum}}元</view>
  36. </view>
  37. </view>
  38. <view class="container" v-if="props.workStatus=='1' && props.s=='0' &&props.c=='0'" > <!-- @click="handleSelect" -->
  39. <view class="t">
  40. <view class="d1"></view>
  41. <view class="d2">
  42. <view class="dtim">时间:{{props.v.prescriptionTime}}</view>
  43. </view>
  44. <view class="d3"><view class="presno">处方号:{{props.v.preNo}}</view></view>
  45. <view class="d4"><view class="source" :class="{'zy':props.v.preMzZy==='1'}">{{props.v.preMzZy==='1'?'门诊':'住院'}}</view></view>
  46. </view>
  47. <view class="m">
  48. <view class="radio">
  49. <label><radio @click="handleSelect" color="#18C7B0" :checked="selected"/></label>
  50. <!-- <label><uni-data-checkbox v-model="selected" @change="handleSelect" /></label> -->
  51. <!-- <label><uni-data-checkbox v-model="selected"></uni-data-checkbox></label> -->
  52. <!-- <label> -->
  53. <!-- <uni-icons v-if="selected==false" :type="filled" color="#18C7B0" size="30" style="margin-right: 10rpx;"></uni-icons>
  54. <uni-icons v-else type="checkbox-filled" color="#18C7B0" size="30" style="margin-right: 10rpx;"></uni-icons> -->
  55. <!-- <uni-icons :type="filled" color="#18C7B0" size="30" style="margin-right: 10rpx;"></uni-icons> -->
  56. <!-- </label> -->
  57. </view>
  58. <image class="faceu" aspectFill :src="props.v.sex==='男'?'/static/hz.png':'/static/hy.png'" />
  59. <view class="patie">
  60. <view class="name">{{props.v.name}}</view>
  61. <view class="seage">
  62. <image class="img" aspectFill :src="props.v.sex==='男'?'/static/male.png':'/static/female.png'" />
  63. <view class="sex">{{props.v.sex}}</view>
  64. <view class="sep">|</view>
  65. <view class="age">{{v.age}}岁</view>
  66. </view>
  67. <view class="case">{{props.v.disName}} - {{props.v.symName}}</view>
  68. </view>
  69. <view class="pres">
  70. <view class="department">就诊科室:{{props.v.department}}</view>
  71. <view class="presInfo">
  72. 处方信息:
  73. <text class="tips">
  74. {{props.v.dosageForm}},{{props.v.number}}剂
  75. </text>
  76. </view>
  77. </view>
  78. </view>
  79. <view class="b">
  80. <view class="zt">当前处方状态: {{deployStateName}}</view>
  81. <view class="je">处方金额:{{props.v.prescriptionSum}}元</view>
  82. </view>
  83. </view>
  84. </template>
  85. <script>
  86. export default {
  87. name: 'OrderCard'
  88. }
  89. </script>
  90. <script setup>
  91. import { onMounted, onBeforeUpdate, ref,computed } from 'vue'
  92. const props = defineProps({
  93. s:{
  94. default:'1',
  95. type: String
  96. },
  97. v: {
  98. default: function() {
  99. return {
  100. name: '',
  101. deployState:0,
  102. preNo:'',
  103. selected: false
  104. }
  105. },
  106. type: Object
  107. },
  108. workStatus: {
  109. default:'0',
  110. type: String
  111. },
  112. // 当前tab
  113. c: {
  114. default: 0,
  115. type: Number
  116. }
  117. })
  118. const selected = ref(false)
  119. // const filled = ref('circle')
  120. console.log('in order-card selected:', selected.value)
  121. const emit = defineEmits(['emitSelect'])
  122. console.log('props.workStatus',props.workStatus)
  123. onBeforeUpdate(()=>{
  124. selected.value = props.v.selected
  125. // filled.value = 'circle'
  126. console.log('selected.value', props.v.preNo,selected.value)
  127. })
  128. const deployStateName = computed(()=>{
  129. switch(props.v.state) {
  130. case '1':
  131. return '抓药';
  132. case '2':
  133. return '复核';
  134. case '3':
  135. return '浸泡';
  136. case '4':
  137. return '煎煮';
  138. case '5':
  139. return '打包';
  140. default:
  141. return '异常状态';
  142. }
  143. })
  144. const handleDetail = ()=>{
  145. console.log("handleDetail", props.v, props.c)
  146. const initPrint = uni.getStorageSync('hasPrinter')
  147. if(props.c===0){
  148. if(initPrint !== '1'){
  149. uni.$showMsg('请先连接打印机!然后进行调配', 2000)
  150. } else {
  151. uni.navigateTo({
  152. url:`/pages/edit/edit?id=${props.v.id}`
  153. // url:`/pages/review/review?id=&preNo=${props.v.preNo}&deployState=${props.v.deployState}`
  154. })
  155. }
  156. } else {
  157. uni.navigateTo({
  158. url:`/pages/detail/detail?id=${props.v.id}`
  159. })
  160. }
  161. }
  162. const handleSelect = ()=>{
  163. console.log('handleSelect>>',props.v.id)
  164. selected.value = !selected.value
  165. emit('emitSelect',{
  166. id:props.v.id,
  167. selected:selected.value
  168. })
  169. console.log('handleSelect>>selected.value',selected.value)
  170. // if(selected.value){
  171. // filled.value = 'checkbox-filled'
  172. // } else {
  173. // filled.value = 'circle'
  174. // }
  175. // uni.$showMsg('选中了'+filled.value, 2000)
  176. // console.log('选中了>>>',filled.value)
  177. }
  178. </script>
  179. <style lang="scss">
  180. .container{
  181. display: flex;
  182. width: 100%;
  183. display: flex;
  184. flex-direction:column;
  185. width: 100%;
  186. margin-top: 10rpx;
  187. .t{
  188. display: flex;
  189. background-color: #EBF8F7;
  190. height: 33.75rpx;
  191. width: 709.38rpx;
  192. font-size: 13.75rpx;
  193. color: #999999;
  194. justify-content:flex-start;
  195. align-items:center;
  196. .d1::before{
  197. content: '';
  198. display: inline-block;
  199. width: 20px;
  200. height: 20px;
  201. background: "#18C7B0";
  202. }
  203. .d2{
  204. margin-left: 16rpx;
  205. }
  206. .d3{
  207. margin-left: 200rpx;
  208. }
  209. .d4{
  210. margin-left: auto;
  211. .source{
  212. display: flex;
  213. align-items: center;
  214. justify-content: center;
  215. border-radius: 25rpx 0 0 25rpx;
  216. font-size: 13.75rpx;
  217. width: 50rpx;
  218. height: 21.25rpx;
  219. background-color: #18C7B0;
  220. color: #fff;
  221. }
  222. .zy{
  223. background-color: #82ABE1!important;
  224. }
  225. }
  226. }
  227. .m{
  228. display: flex;
  229. align-items: center;
  230. justify-content: flex-start;
  231. margin: 11.88rpx 25rpx 15.75rpx;
  232. .radio{
  233. }
  234. .faceu{
  235. width: 73.13rpx;
  236. height: 73.13rpx;
  237. margin-right: 10rpx;
  238. }
  239. .patie{
  240. display: flex;
  241. flex-direction:column;
  242. justify-content: flex-start;
  243. align-items: flex-start;
  244. height: 73.13rpx;
  245. width: 270rpx;
  246. .name{
  247. font-size: 17.5rpx;
  248. color: #333333;
  249. display: flex;
  250. align-items: center;
  251. justify-content: flex-start;
  252. }
  253. .seage{
  254. display: flex;
  255. margin-top: 8rpx;
  256. .img{
  257. height: 15rpx;
  258. width: 15rpx;
  259. }
  260. .sex{
  261. font-size: 12rpx;
  262. color: #999999;
  263. padding-right: 8.75rpx;
  264. }
  265. .sep{
  266. font-size: 10rpx;
  267. color: #999999;
  268. }
  269. .age{
  270. font-size: 12rpx;
  271. color: #999999;
  272. padding-left: 8.75rpx;
  273. }
  274. }
  275. .case{
  276. margin-top: 3rpx;
  277. font-size: 15rpx;
  278. color: #333333;
  279. }
  280. }
  281. .pres{
  282. display: flex;
  283. flex-direction:column;
  284. justify-content: flex-start;
  285. align-items: flex-start;
  286. margin-left: 4rpx;
  287. height: 73.13rpx;
  288. .department{
  289. margin-top: 5rpx;
  290. font-size: 15rpx;
  291. color: #999999;
  292. }
  293. .presInfo{
  294. margin-top: 10rpx;
  295. font-size: 15rpx;
  296. color: #333333;
  297. .tips{}
  298. }
  299. }
  300. }
  301. .b{
  302. display: flex;
  303. flex-direction:row;
  304. justify-content: space-between;
  305. align-items: center;
  306. height: 33.75rpx;
  307. width: 709.38rpx;
  308. color: #999999;
  309. padding: 4rpx 48.78rpx;
  310. margin-bottom: 2rpx;
  311. .zt{
  312. display: flex;
  313. width: 200rpx;
  314. font-size: 13.75rpx;
  315. }
  316. .je{
  317. display: flex;
  318. width: 200rpx;
  319. font-size: 15rpx;
  320. }
  321. }
  322. }
  323. </style>