index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. <template>
  2. <div class='order-detail' v-if="info">
  3. <van-tabs class="mt10" v-model="active1" >
  4. <van-tab title="订单状态">
  5. </van-tab>
  6. <van-tab title="审方状态">
  7. </van-tab>
  8. </van-tabs>
  9. <div v-show="active1===0" class="lh26 plr15 ptb10 bgc-fff fs-14">
  10. <div class="row">
  11. <div>处方号</div>
  12. <div>{{info.prescribeNum}}</div>
  13. </div>
  14. <div class="row">
  15. <div>订单类型</div>
  16. <div>{{info.orderSource=='厦门i健康'? '线上订单' : "线下订单"}}</div>
  17. </div>
  18. <div class="row">
  19. <div>开方时间</div>
  20. <div>{{info.orderSource=='厦门i健康'? formatDatetime(info.prescribeTime) : formatDate(info.prescribeTime)}}</div>
  21. </div>
  22. <div class="row">
  23. <div>患者姓名</div>
  24. <div>{{info.patientName || "--"}}</div>
  25. </div>
  26. <div class="row">
  27. <div>医保卡号</div>
  28. <div>{{info.socialSecurityCardNum || "--"}}</div>
  29. </div>
  30. <div class="row">
  31. <div>开方医生</div>
  32. <div>{{info.doctorName || "--"}}</div>
  33. </div>
  34. <div class="row">
  35. <div>订单金额</div>
  36. <div v-if="info.amount">¥{{info.amount}}</div>
  37. <div v-else>--</div>
  38. </div>
  39. <div class="row" >
  40. <div>社保扣款</div>
  41. <div v-if="info.socialinsurPayment">¥{{info.socialinsurPayment}}</div>
  42. <div v-else>--</div>
  43. </div>
  44. <div class="row">
  45. <div>订单状态</div>
  46. <div>{{info.sellStateName}}</div>
  47. <div v-if="info.sellState==-5&&$hasAuth('orderManage', 'index','updateOrderToWaitOut')"><van-button @click="updateOrderToWaitOut" class="ml10" block type="primary" size="mini" color="#17b3ec">更正订单状态</van-button></div>
  48. </div>
  49. <div class="row">
  50. <div>取药码</div>
  51. <div>{{info.pickUpNum}}</div>
  52. </div>
  53. </div>
  54. <div v-show="active1===1" class="lh26 plr15 ptb10 bgc-fff fs-14">
  55. <template v-if="info.reviewerState==1||info.reviewerState==-1">
  56. <div class="row">
  57. <div>审方状态</div>
  58. <div>{{info.reviewerState==1? "审核通过" : "审核不通过"}}</div>
  59. </div>
  60. <div class="row">
  61. <div>审方医生</div>
  62. <div>{{info.reviewerDoctorName || '--'}}</div>
  63. </div>
  64. <div class="row">
  65. <div>审方时间</div>
  66. <div>{{info.reviewerTime || '--'}}</div>
  67. </div>
  68. <div class="row" v-if="info.reviewerState==-1">
  69. <div>审方批注</div>
  70. <div>{{info.reviewerContent || "--"}}</div>
  71. </div>
  72. </template>
  73. <NoData v-else/>
  74. </div>
  75. <van-tabs class="mt10" v-model="active" sticky>
  76. <van-tab title="药品详情">
  77. <DrugList :list="info.drugList"/>
  78. </van-tab>
  79. <van-tab v-if="info.outList&&info.outList.length" title="出货日志">
  80. <LogList :list="info.outList"/>
  81. </van-tab>
  82. <van-tab title="设备信息" v-if="info.device">
  83. <DeviceInfo :data="info.device"/>
  84. </van-tab>
  85. <van-tab title="出货拍照" v-if="info.outList&&info.outList.length">
  86. <div class="pl10">
  87. <div class="pic-list" >
  88. <div class="pic-item" v-for="(item, i) in info.outList" :key="i">
  89. <img @click="preview(i)" :src="item.pic" alt="">
  90. </div>
  91. </div>
  92. </div>
  93. </van-tab>
  94. </van-tabs>
  95. <div v-if="info.reviewerState==0" class="bot-button">
  96. <div class="bot-button-inner bot-button-inner-fixed">
  97. <div><van-button @click="show=true" round block type="danger">不通过</van-button></div>
  98. <div><van-button @click="reviewerOrder(1, '')" round block type="primary" color="#17b3ec">审方通过</van-button></div>
  99. </div>
  100. </div>
  101. <van-popup v-model="show" position="bottom" >
  102. <div class="plr20">
  103. <div class="ptb15 fs-14">请填写不通过原因</div>
  104. <div class="text-ipt">
  105. <van-cell-group >
  106. <van-field
  107. v-model="reviewerContent"
  108. rows="5"
  109. label=""
  110. type="textarea"
  111. maxlength="500"
  112. placeholder="请输入.."
  113. show-word-limit
  114. />
  115. </van-cell-group>
  116. </div>
  117. </div>
  118. <div class="ptb15">
  119. <div class="bot-button-inner">
  120. <div><van-button @click="show=false" round block type="danger">返回</van-button></div>
  121. <div><van-button @click="reviewerOrder(-1, reviewerContent)" round block type="primary" color="#17b3ec">确定</van-button></div>
  122. </div>
  123. </div>
  124. </van-popup>
  125. </div>
  126. </template>
  127. <script>
  128. import { ImagePreview } from 'vant';
  129. import medicineAbinetApi from '@/api/api-medicineAbinet'
  130. import dictApi from '@/api/dictApi'
  131. import DeviceInfo from './components/DeviceInfo'
  132. import LogList from './components/LogList'
  133. import DrugList from './components/DrugList'
  134. export default{
  135. name: 'orderDetail',
  136. components:{
  137. DeviceInfo,
  138. DrugList,
  139. LogList
  140. },
  141. data(){
  142. return {
  143. id: this.$route.query.id,
  144. info: '',
  145. show: false,
  146. reviewerContent: '',
  147. active1: 0,
  148. auth: false
  149. }
  150. },
  151. async created() {
  152. this.getOrderDetailById()
  153. dictApi
  154. .findDictNew({
  155. name: 'updateOrderToWaitOut',
  156. code: 'updateOrderToWaitOut'
  157. })
  158. .then(res=>{
  159. if(res.status == 200){
  160. this.auth = !!_.find(res.detailModelList, v=>{
  161. return v.dictValue == this.user.id
  162. })
  163. console.log('findDictNew', res.detailModelList)
  164. }
  165. })
  166. },
  167. methods:{
  168. getOrderDetailById(){
  169. this.$loading('加载中..')
  170. let p = {
  171. orderId: this.id
  172. }
  173. medicineAbinetApi
  174. .getOrderDetailById(p)
  175. .then(res=>{
  176. this.$toast.clear()
  177. console.log('getOrderDetailById', res)
  178. if(res.status == 200){
  179. if(res.obj.outList){
  180. res.obj.outList.forEach(v => {
  181. v.pic = this.setImgUrl(v.pic)
  182. });
  183. }
  184. this.info = res.obj
  185. }
  186. })
  187. .catch(err=>{
  188. console.error(err)
  189. })
  190. },
  191. preview(startPosition){
  192. var images = _.map(this.info.outList, v=>{
  193. return v.pic
  194. })
  195. ImagePreview({
  196. images,
  197. startPosition
  198. });
  199. },
  200. reviewerOrder(reviewerState, reviewerContent){
  201. new Promise((resolve, reject)=>{
  202. if(reviewerState == 1){
  203. this.$dialog.confirm({
  204. title: '提示',
  205. message: '确定审核通过?',
  206. })
  207. .then(() => {
  208. resolve()
  209. })
  210. .catch(() => {
  211. reject()
  212. });
  213. } else {
  214. if(this.reviewerContent === ''){
  215. this.$toast("请填写原因")
  216. return reject()
  217. }
  218. resolve()
  219. }
  220. }).then(res=>{
  221. this.$loading('加载中..')
  222. let p = {
  223. orderId: this.id,
  224. reviewerState,
  225. reviewerContent,
  226. doctor: this.user.id
  227. }
  228. medicineAbinetApi
  229. .reviewerOrder(p)
  230. .then(res=>{
  231. console.log('reviewerOrder', res)
  232. if(res.status == 200){
  233. this.$toast("审方成功")
  234. this.setBackRefresh(true)
  235. this.info.reviewerState = reviewerState
  236. this.show = false
  237. }
  238. })
  239. .catch(err=>{
  240. console.error(err)
  241. })
  242. }).catch(err=>{
  243. console.error(err)
  244. })
  245. },
  246. updateOrderToWaitOut(){
  247. new Promise((resolve, reject)=>{
  248. this.$dialog.confirm({
  249. title: '提示',
  250. message: '确定执行该操作?',
  251. })
  252. .then(() => {
  253. resolve()
  254. })
  255. .catch(() => {
  256. reject()
  257. });
  258. }).then(res=>{
  259. this.$loading('加载中..')
  260. let p = {
  261. orderId: this.id,
  262. }
  263. medicineAbinetApi
  264. .updateOrderToWaitOut(p)
  265. .then(res=>{
  266. console.log('updateOrderToWaitOut', res)
  267. if(res.status == 200){
  268. this.$toast("操作成功")
  269. this.setBackRefresh(true)
  270. this.getOrderDetailById()
  271. }
  272. })
  273. .catch(err=>{
  274. console.error(err)
  275. })
  276. }).catch(err=>{
  277. console.error(err)
  278. })
  279. }
  280. },
  281. }
  282. </script>
  283. <style lang='scss' scoped>
  284. .order-detail{
  285. .row{
  286. display: -webkit-box;
  287. >div{
  288. &:first-child{
  289. width: 60px;
  290. position: relative;
  291. text-align: justify;
  292. text-align-last: justify;
  293. margin-right: 12px;
  294. &::after{
  295. content: ":";
  296. display: inline-block;
  297. position: absolute;
  298. right: -14px;
  299. top: 0;
  300. }
  301. }
  302. }
  303. }
  304. .pic-list{
  305. padding: 10px 0;
  306. display: flex;
  307. flex-wrap: wrap;
  308. .pic-item{
  309. width: calc(100% / 4 - 10px);
  310. margin-right: 10px;
  311. margin-bottom: 10px;
  312. img{
  313. width: 100%;
  314. display: block;
  315. }
  316. }
  317. }
  318. .bot-button{
  319. height: 100px;
  320. }
  321. .bot-button-inner{
  322. display: -webkit-box;
  323. padding:0 10px;
  324. &.bot-button-inner-fixed{
  325. position: fixed;
  326. bottom: 20px;
  327. width: 100%;
  328. }
  329. >div{
  330. width: 50%;
  331. padding:0 10px;
  332. }
  333. }
  334. .text-ipt{
  335. border: 1px solid #e1e1e1;
  336. }
  337. }
  338. </style>