order-card.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  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. uni.navigateTo({
  157. url:`/pages/edit/edit?id=${props.v.id}`
  158. // url:`/pages/review/review?id=&preNo=${props.v.preNo}&deployState=${props.v.deployState}`
  159. })
  160. } else {
  161. uni.navigateTo({
  162. url:`/pages/detail/detail?id=${props.v.id}`
  163. })
  164. }
  165. }
  166. const handleSelect = ()=>{
  167. console.log('handleSelect>>',props.v.id)
  168. selected.value = !selected.value
  169. emit('emitSelect',{
  170. id:props.v.id,
  171. selected:selected.value
  172. })
  173. console.log('handleSelect>>selected.value',selected.value)
  174. // if(selected.value){
  175. // filled.value = 'checkbox-filled'
  176. // } else {
  177. // filled.value = 'circle'
  178. // }
  179. // uni.$showMsg('选中了'+filled.value, 2000)
  180. // console.log('选中了>>>',filled.value)
  181. }
  182. </script>
  183. <style lang="scss">
  184. .container{
  185. display: flex;
  186. width: 100%;
  187. display: flex;
  188. flex-direction:column;
  189. width: 100%;
  190. margin-top: 10rpx;
  191. .t{
  192. display: flex;
  193. background-color: #EBF8F7;
  194. height: 33.75rpx;
  195. width: 709.38rpx;
  196. font-size: 13.75rpx;
  197. color: #999999;
  198. justify-content:flex-start;
  199. align-items:center;
  200. .d1::before{
  201. content: '';
  202. display: inline-block;
  203. width: 20px;
  204. height: 20px;
  205. background: "#18C7B0";
  206. }
  207. .d2{
  208. margin-left: 16rpx;
  209. }
  210. .d3{
  211. margin-left: 200rpx;
  212. }
  213. .d4{
  214. margin-left: auto;
  215. .source{
  216. display: flex;
  217. align-items: center;
  218. justify-content: center;
  219. border-radius: 25rpx 0 0 25rpx;
  220. font-size: 13.75rpx;
  221. width: 50rpx;
  222. height: 21.25rpx;
  223. background-color: #18C7B0;
  224. color: #fff;
  225. }
  226. .zy{
  227. background-color: #82ABE1!important;
  228. }
  229. }
  230. }
  231. .m{
  232. display: flex;
  233. align-items: center;
  234. justify-content: flex-start;
  235. margin: 11.88rpx 25rpx 15.75rpx;
  236. .radio{
  237. }
  238. .faceu{
  239. width: 73.13rpx;
  240. height: 73.13rpx;
  241. margin-right: 10rpx;
  242. }
  243. .patie{
  244. display: flex;
  245. flex-direction:column;
  246. justify-content: flex-start;
  247. align-items: flex-start;
  248. height: 73.13rpx;
  249. width: 270rpx;
  250. .name{
  251. font-size: 17.5rpx;
  252. color: #333333;
  253. display: flex;
  254. align-items: center;
  255. justify-content: flex-start;
  256. }
  257. .seage{
  258. display: flex;
  259. margin-top: 8rpx;
  260. .img{
  261. height: 15rpx;
  262. width: 15rpx;
  263. }
  264. .sex{
  265. font-size: 12rpx;
  266. color: #999999;
  267. padding-right: 8.75rpx;
  268. }
  269. .sep{
  270. font-size: 10rpx;
  271. color: #999999;
  272. }
  273. .age{
  274. font-size: 12rpx;
  275. color: #999999;
  276. padding-left: 8.75rpx;
  277. }
  278. }
  279. .case{
  280. margin-top: 3rpx;
  281. font-size: 15rpx;
  282. color: #333333;
  283. }
  284. }
  285. .pres{
  286. display: flex;
  287. flex-direction:column;
  288. justify-content: flex-start;
  289. align-items: flex-start;
  290. margin-left: 4rpx;
  291. height: 73.13rpx;
  292. .department{
  293. margin-top: 5rpx;
  294. font-size: 15rpx;
  295. color: #999999;
  296. }
  297. .presInfo{
  298. margin-top: 10rpx;
  299. font-size: 15rpx;
  300. color: #333333;
  301. .tips{}
  302. }
  303. }
  304. }
  305. .b{
  306. display: flex;
  307. flex-direction:row;
  308. justify-content: space-between;
  309. align-items: center;
  310. height: 33.75rpx;
  311. width: 709.38rpx;
  312. color: #999999;
  313. padding: 4rpx 48.78rpx;
  314. margin-bottom: 2rpx;
  315. .zt{
  316. display: flex;
  317. width: 200rpx;
  318. font-size: 13.75rpx;
  319. }
  320. .je{
  321. display: flex;
  322. width: 200rpx;
  323. font-size: 15rpx;
  324. }
  325. }
  326. }
  327. </style>