packageOrderDetails.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  1. <template>
  2. <div style="background-color: #f0f2f5; padding-bottom: 20px; min-height: 100%; " >
  3. <div style="padding: 20px; background-color: #fff;">
  4. 套餐订单详情
  5. </div>
  6. <div class="content" v-if="item!=null">
  7. <div class="desct"></div>
  8. <div class="order-status" v-if="item!=null" >
  9. <el-steps :active="item.status==3?item.status:item.status-1" align-center finish-status="success">
  10. <el-step title="待支付"></el-step>
  11. <el-step title="服务中"></el-step>
  12. <el-step title="已完成"></el-step>
  13. </el-steps>
  14. </div>
  15. <el-card shadow="never" style="margin-top: 15px">
  16. <div class="operate-container" v-if="item!=null">
  17. <span style="margin-left: 20px" class="color-danger">订单状态:
  18. <el-tag prop="status" v-for="(ite, index) in statusOptions" v-if="item.status==ite.dictValue">{{ite.dictLabel}}</el-tag>
  19. </span>
  20. <!-- <div class="operate-button-container" v-if="item.status==2">
  21. <el-button size="mini" @click="orderRefund()" v-hasPermi="['his:packageOrder:refund']">全部退款 </el-button>
  22. </div> -->
  23. <div class="operate-button-container" v-if="item.status==2 &&item.packageSubType==1 && (item.inquiryRefundStatus==0 || item.inquiryRefundStatus == null)" >
  24. <el-button size="mini" @click="inquiryOrderRefund()" v-hasPermi="['his:packageOrder:inquiryRefund']">问诊退款</el-button>
  25. </div>
  26. <div class="operate-button-container" v-if="item.status==2 &&item.packageSubType!=1 && item.storeRefundStatus==0" >
  27. <el-button size="mini" @click="storeOrderRefund()" v-hasPermi="['his:packageOrder:productRefund']">商品退款</el-button>
  28. </div>
  29. <div class="operate-button-container" v-if="item.storeOrderId!=null&&item.storeOrderId!=''">
  30. <el-button size="mini" @click="showStoreOrder">商品订单</el-button>
  31. </div>
  32. <div class="operate-button-container" v-if="item.inquiryOrderId!=null&&item.inquiryOrderId!=''">
  33. <el-button size="mini" @click="showInquiryOrder">问诊订单</el-button>
  34. </div>
  35. <!-- <div class="operate-button-container" v-if="item.refundStatus==1">
  36. <el-button size="mini" @click="orderRefundAudit()" v-hasPermi="['his:packageOrder:refund']">退款审核</el-button>
  37. </div> -->
  38. </div>
  39. <div class="desct">
  40. 基本信息
  41. </div>
  42. <el-descriptions :column="3" border >
  43. <el-descriptions-item label="订单号"><span v-if="item!=null">{{item.orderSn}}</span></el-descriptions-item>
  44. <el-descriptions-item label="套餐名称"><span v-if="item!=null">{{item.packageName}}</span></el-descriptions-item>
  45. <el-descriptions-item label="套餐别名"><span v-if="item!=null">{{item.secondName}}</span></el-descriptions-item>
  46. <el-descriptions-item label="套餐价格"><span v-if="item!=null">{{item.totalPrice}}</span></el-descriptions-item>
  47. <el-descriptions-item label="订单来源" ><dict-tag :options="sourceOptions" :value="item.source"/></el-descriptions-item>
  48. <el-descriptions-item label="医生名称"><span v-if="item!=null">{{item.doctorName}}</span></el-descriptions-item>
  49. <el-descriptions-item label="用户昵称"><span v-if="item!=null">{{item.nickName}}</span></el-descriptions-item>
  50. <el-descriptions-item label="用户电话"><span v-if="item!=null">{{item.phone}}</span>
  51. <el-button icon="el-icon-search" size="mini" @click="handlePhone()" style="margin-left: 20px;" circle v-hasPermi="['his:packageOrder:queryPhone']"></el-button>
  52. </el-descriptions-item>
  53. <el-descriptions-item label="是否支付"> <dict-tag :options="isPayOptions" :value="item.isPay"/></el-descriptions-item>
  54. <el-descriptions-item label="付款类别"> <dict-tag :options="payTypeOptions" :value="item.payType"/></el-descriptions-item>
  55. <el-descriptions-item label="套餐包类别"> <dict-tag :options="packageSubTypeOptions" :value="item.packageSubType"/></el-descriptions-item>
  56. <el-descriptions-item label="天数"><span v-if="item!=null">{{item.days}}</span></el-descriptions-item>
  57. <el-descriptions-item label="状态"> <dict-tag :options="statusOptions" :value="item.status"/></el-descriptions-item>
  58. <el-descriptions-item label="所属公司"><span v-if="item!=null">{{item.companyName}}</span></el-descriptions-item>
  59. <el-descriptions-item label="公司员工"><span v-if="item!=null">{{item.companyUserName}}</span></el-descriptions-item>
  60. <el-descriptions-item label="退款状态"> <dict-tag :options="refundStatusOptions" :value="item.refundStatus"/></el-descriptions-item>
  61. <el-descriptions-item label="退款用户说明"><span v-if="item!=null">{{item.refundExplain}}</span></el-descriptions-item>
  62. <el-descriptions-item label="不退款的理由"><span v-if="item!=null">{{item.refundReason}}</span></el-descriptions-item>
  63. <el-descriptions-item label="退款时间"><span v-if="item!=null">{{item.refundTime}}</span></el-descriptions-item>
  64. <el-descriptions-item label="退款金额"><span v-if="item!=null">{{item.refundMoney}}</span></el-descriptions-item>
  65. <el-descriptions-item label="备注"><span v-if="item!=null">{{item.remark}}</span></el-descriptions-item>
  66. <el-descriptions-item label="支付时间"><span v-if="item!=null">{{item.startTime}}</span></el-descriptions-item>
  67. <el-descriptions-item label="开始时间"><span v-if="item!=null">{{item.payTime}}</span></el-descriptions-item>
  68. <el-descriptions-item label="结束时间"><span v-if="item!=null">{{item.finishTime}}</span></el-descriptions-item>
  69. <el-descriptions-item label="创建时间"><span v-if="item!=null">{{item.createTime}}</span></el-descriptions-item>
  70. </el-descriptions>
  71. </el-card>
  72. </div>
  73. <div class="contentx" v-if="item!=null">
  74. <div class="desct">
  75. 支付信息
  76. </div>
  77. <el-table
  78. border
  79. :data="pay"
  80. size="small"
  81. style="width: 100%;margin-top: 20px" >
  82. <el-table-column label="支付单号" align="center" prop="payCode" width="120px" />
  83. <el-table-column label="支付金额" align="center" prop="payMoney" />
  84. <el-table-column label="类型" align="center" prop="payTypeCode" />
  85. <el-table-column label="交易单号" align="center" prop="bankTransactionId" />
  86. <el-table-column label="银行流水号" align="center" prop="bankSerialNo" />
  87. <el-table-column label="创建时间" align="center" prop="createTime" />
  88. <el-table-column label="支付时间" align="center" prop="payTime" />
  89. </el-table>
  90. </div>
  91. <div class="contentx" v-if="item!=null " style="padding-bottom: 70px;">
  92. <div class="desct">
  93. 商品信息
  94. </div>
  95. <el-tooltip class="item" effect="dark" :content="showList ? '显示全部' : '隐藏'" placement="top" style="float: right;">
  96. <el-button size="mini" circle icon="el-icon-search" @click="showListD()" />
  97. </el-tooltip>
  98. <el-table border v-if="showProd!=null" :data="showProd" size="small" style="width: 100%;margin-top: 20px" >
  99. <el-table-column label="商品图片" width="150" align="center">
  100. <template slot-scope="scope">
  101. <img :src="JSON.parse(scope.row.jsonInfo).image" style="height: 80px">
  102. </template>
  103. </el-table-column>
  104. <el-table-column label="商品编码" width="300" align="center">
  105. <template slot-scope="scope">
  106. <p>{{JSON.parse(scope.row.jsonInfo).barCode}}</p>
  107. </template>
  108. </el-table-column>
  109. <el-table-column label="商品名称" width="300" align="center">
  110. <template slot-scope="scope">
  111. <p>{{JSON.parse(scope.row.jsonInfo).productName}}</p>
  112. </template>
  113. </el-table-column>
  114. <el-table-column label="单价" width="240" align="center">
  115. <template slot-scope="scope">
  116. <p>¥{{JSON.parse(scope.row.jsonInfo).price.toFixed(2)}}</p>
  117. </template>
  118. </el-table-column>
  119. <el-table-column label="规格" width="240" align="center">
  120. <template slot-scope="scope">
  121. {{JSON.parse(scope.row.jsonInfo).sku}}
  122. </template>
  123. </el-table-column>
  124. <el-table-column label="数量" width="180" align="center">
  125. <template slot-scope="scope">
  126. {{scope.row.num}}
  127. </template>
  128. </el-table-column>
  129. <el-table-column label="处方药" width="240" align="center">
  130. <template slot-scope="scope">
  131. {{scope.row.isPrescribe!=null&&scope.row.isPrescribe==1?'是':'否'}}
  132. </template>
  133. </el-table-column>
  134. <el-table-column label="小计" align="center">
  135. <template slot-scope="scope" >
  136. ¥{{(scope.row.num*JSON.parse(scope.row.jsonInfo).price).toFixed(2)}}
  137. </template>
  138. </el-table-column>
  139. </el-table>
  140. </div>
  141. <div class="contentx" v-if="item!=null">
  142. <div class="desct">
  143. 费用信息
  144. </div>
  145. <el-descriptions :column="3" border >
  146. <el-descriptions-item label="商品合计" ><span v-if="item.totalPrice!=null">¥{{item.totalPrice.toFixed(2)}} </span></el-descriptions-item>
  147. <el-descriptions-item label="处方定价" ><span v-if="item.prescribePrice!=null"> ¥{{item.prescribePrice.toFixed(2)}}</span></el-descriptions-item>
  148. <el-descriptions-item label="处方应付金额" ><span v-if="item.payPrice!=null"> ¥{{item.payPrice.toFixed(2)}}</span></el-descriptions-item>
  149. <el-descriptions-item label="运费" ><span v-if="item.payDelivery!=null">¥{{item.payDelivery.toFixed(2)}}</span></el-descriptions-item>
  150. <el-descriptions-item label="优惠劵" ><span v-if="item.discountMoney!=null">¥{{item.discountMoney.toFixed(2)}}</span></el-descriptions-item>
  151. <el-descriptions-item label="实付金额" ><span v-if="item.payMoney!=null">¥{{item.payMoney.toFixed(2)}}</span></el-descriptions-item>
  152. <el-descriptions-item label="代收金额" ><span v-if="item.payRemain!=null">¥{{item.payRemain.toFixed(2)}}</span></el-descriptions-item>
  153. </el-descriptions>
  154. </div>
  155. <el-drawer
  156. :with-header="false"
  157. :append-to-body="true"
  158. size="75%"
  159. :title="show.title" :visible.sync="show.open"
  160. >
  161. <storeOrderDetails ref="Details" />
  162. </el-drawer>
  163. <el-drawer
  164. :with-header="false"
  165. :append-to-body="true"
  166. size="75%"
  167. :title="inquiryOrderShow.title" :visible.sync="inquiryOrderShow.open">
  168. <inquiryOrderDetails ref="inquiryOrderDetails" />
  169. </el-drawer>
  170. <el-dialog
  171. width="50%"
  172. title="退款审核"
  173. :visible.sync="auditVisible"
  174. append-to-body @close="auditCancel">
  175. <el-form ref="form" :model="refundForm" :rules="rules" label-width="120px">
  176. <el-form-item label="审核" prop="deliveryCode">
  177. <el-radio v-model="refundForm.refundStatus" label="2">同意</el-radio>
  178. <el-radio v-model="refundForm.refundStatus" label="3">拒绝</el-radio>
  179. </el-form-item>
  180. <el-form-item label="拒绝理由" prop="deliveryName">
  181. <el-input v-model="refundForm.refundReason" placeholder="请输入快递名称" type="textarea"/>
  182. </el-form-item>
  183. </el-form>
  184. <div slot="footer" class="dialog-footer">
  185. <el-button type="primary" @click="auditOk">确 定</el-button>
  186. <el-button @click="auditCancel">取 消</el-button>
  187. </div>
  188. </el-dialog>
  189. </div>
  190. </template>
  191. <script>
  192. import { listPackageOrder,storeRefund,inquiryRefund, payment,getPackageOrder, delPackageOrder,refundAudit, addPackageOrder,refund, updatePackageOrder, exportPackageOrder,getPhone } from "@/api/his/packageOrder";
  193. import { listOrderitem} from "@/api/his/storeOrder";
  194. import storeOrderDetails from '../his/storeOrderDetails2.vue';
  195. import inquiryOrderDetails from '../his/inquiryOrderDetails.vue';
  196. export default {
  197. name: "patientdetails",
  198. components: { storeOrderDetails,inquiryOrderDetails },
  199. props:["data"],
  200. data() {
  201. return {
  202. show:{
  203. open:false,
  204. title:"订单详情"
  205. },
  206. auditVisible:false,
  207. rules:{},
  208. inquiryOrderShow:{
  209. open:false,
  210. title:"订单详情"
  211. },
  212. sourceOptions:[],
  213. showList:true,
  214. prod:null,
  215. showProd:null,
  216. // 状态字典
  217. isPayOptions: [],
  218. packageSubTypeOptions: [],
  219. productJson:[],
  220. refundForm:{
  221. orderId:null,
  222. refundReason:null,
  223. refundStatus:null,
  224. },
  225. // 状态字典
  226. statusOptions: [],
  227. refundStatusOptions: [],
  228. item:null,
  229. pay:[],
  230. }
  231. },
  232. created() {
  233. this.getDicts("sys_company_or").then(response => {
  234. this.isPayOptions = response.data;
  235. });
  236. this.getDicts("sys_package_order_status").then(response => {
  237. this.statusOptions = response.data;
  238. });
  239. this.getDicts("sys_refund_status").then(response => {
  240. this.refundStatusOptions = response.data;
  241. });
  242. this.getDicts("sys_package_pay_type").then(response => {
  243. this.payTypeOptions = response.data;
  244. });
  245. this.getDicts("sys_order_source").then(response => {
  246. this.sourceOptions = response.data;
  247. });
  248. this.getDicts("sys_package_sub_type").then(response => {
  249. this.packageSubTypeOptions = response.data;
  250. });
  251. },
  252. methods: {
  253. handlePhone(){
  254. const orderId = this.item.orderId;
  255. getPhone(orderId).then(response =>{
  256. this.item.phone = response.data;
  257. })
  258. },
  259. getDetails(orderId) {
  260. this.item=null;
  261. getPackageOrder(orderId).then(response => {
  262. this.item = response.data;
  263. payment(orderId).then(response => {
  264. this.pay = response.data;
  265. });
  266. if(this.item.storeOrderId!=null){
  267. this.getlistOrderitem(this.item.storeOrderId)
  268. }
  269. });
  270. },
  271. showStoreOrder(){
  272. this.show.open=true;
  273. setTimeout(() => {
  274. this.$refs.Details.getDetails(this.item.storeOrderId,this.item.nickName,null);
  275. }, 1);
  276. },
  277. showListD(){
  278. if(this.showList){
  279. this.showProd=this.prod
  280. }else{
  281. this.showProd=[this.prod[0]]
  282. }
  283. this.showList=this.showList?false:true;
  284. },
  285. orderRefundAudit(){
  286. this.refundForm.orderId=this.item.orderId;
  287. this.refundForm.refundReason=null;
  288. this.refundForm.refundStatus="2";
  289. this.auditVisible=true;
  290. },
  291. showInquiryOrder(){
  292. this.inquiryOrderShow.open=true;
  293. setTimeout(() => {
  294. this.$refs.inquiryOrderDetails.getDetails(this.item.inquiryOrderId);
  295. }, 1);
  296. },
  297. auditCancel(){
  298. this.auditVisible=false;
  299. },
  300. auditOk(){
  301. refundAudit(this.refundForm).then(response => {
  302. this.msgSuccess("操作成功");
  303. getPackageOrder(this.item.orderId).then(response => {
  304. this.item = response.data;
  305. payment(orderId).then(response => {
  306. this.pay = response.data;
  307. });
  308. });
  309. });
  310. this.auditVisible=false;
  311. },
  312. getlistOrderitem(orderId){
  313. listOrderitem(orderId).then(response => {
  314. this.prod = response.rows;
  315. this.showProd=[this.prod[0]]
  316. });
  317. },
  318. orderRefund(){
  319. var that=this;
  320. this.$confirm('是否确认退款?', "警告", {
  321. confirmButtonText: "确定",
  322. cancelButtonText: "取消",
  323. type: "warning"
  324. }).then(function() {
  325. return refund(that.item.orderId);
  326. }).then(() => {
  327. this.msgSuccess("操作成功");
  328. getPackageOrder(that.item.orderId).then(response => {
  329. this.item = response.data;
  330. payment(orderId).then(response => {
  331. this.pay = response.data;
  332. });
  333. });
  334. }).catch(function() {});
  335. },
  336. inquiryOrderRefund(){
  337. var that=this;
  338. this.$confirm('是否确认问诊退款?', "警告", {
  339. confirmButtonText: "确定",
  340. cancelButtonText: "取消",
  341. type: "warning"
  342. }).then(function() {
  343. return inquiryRefund(that.item.orderId);
  344. }).then(() => {
  345. this.msgSuccess("操作成功");
  346. getPackageOrder(that.item.orderId).then(response => {
  347. this.item = response.data;
  348. payment(orderId).then(response => {
  349. this.pay = response.data;
  350. });
  351. });
  352. }).catch(function() {});
  353. },
  354. storeOrderRefund(){
  355. var that=this;
  356. this.$confirm('是否确认退款?', "警告", {
  357. confirmButtonText: "确定",
  358. cancelButtonText: "取消",
  359. type: "warning"
  360. }).then(function() {
  361. return storeRefund(that.item.orderId);
  362. }).then(() => {
  363. this.msgSuccess("操作成功");
  364. getPackageOrder(that.item.orderId).then(response => {
  365. this.item = response.data;
  366. payment(orderId).then(response => {
  367. this.pay = response.data;
  368. });
  369. });
  370. }).catch(function() {});
  371. },
  372. }
  373. }
  374. </script>
  375. <style>
  376. .el-descriptions-item__content {
  377. max-width: 150px;
  378. min-width: 100px;
  379. }
  380. .content{
  381. height: 100%;
  382. background-color: #fff;
  383. padding: 0px 20px 20px;
  384. margin: 20px;
  385. }
  386. .el-descriptions-item__label.is-bordered-label{
  387. font-weight: normal;
  388. }
  389. .desct{
  390. padding-top: 20px;
  391. padding-bottom: 20px;
  392. color: #524b4a;
  393. font-weight: bold;
  394. }
  395. </style>
  396. <style scoped>
  397. .order-content{
  398. margin: 10px;
  399. }
  400. .operate-container {
  401. background: #F2F6FC;
  402. height: 60px;
  403. margin: -20px -20px 0;
  404. line-height: 60px;
  405. }
  406. .operate-button-container {
  407. float: right;
  408. margin-right: 20px
  409. }
  410. </style>