storeOrderDetails.vue 58 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426
  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="contentx" v-if="item!=null">
  7. <div class="desct"></div>
  8. <div class="order-status" v-if="item!=null" >
  9. <!-- 7为金牛药师待确认状态-->
  10. <el-steps :active="item.status==7?1:(item.status==4?item.status:item.status-1)" align-center finish-status="success">
  11. <el-step title="待支付"></el-step>
  12. <el-step title="待发货"></el-step>
  13. <el-step title="待收货"></el-step>
  14. <el-step title="已完成"></el-step>
  15. </el-steps>
  16. </div>
  17. <el-card shadow="never" style="margin-top: 15px">
  18. <div class="operate-container" v-if="item!=null">
  19. <span style="margin-left: 20px" class="color-danger">订单状态:
  20. <el-tag prop="status" v-for="(ite, index) in orderOptions" v-if="item.status==ite.dictValue">{{ite.dictLabel}}</el-tag>
  21. </span>
  22. <div class="operate-button-container" v-if="item.status==3">
  23. <el-button size="mini" @click="finishOrder()" v-hasPermi="['his:storeOrder:good']">确认收货</el-button>
  24. </div>
  25. <div class="operate-button-container" v-if="item.status==2&&item.orderType==1">
  26. <el-button size="mini" @click="sendVisible=true" v-hasPermi="['his:storeOrder:sendGoods']">发货</el-button>
  27. </div>
  28. <div class="operate-button-container" v-if="item.status==2&&item.orderType==2">
  29. <el-button size="mini" @click="tuiOrder()" v-hasPermi="['his:storeOrder:sendHisGoods']" >推送订单</el-button>
  30. </div>
  31. <div class="operate-button-container" v-if="item.inquiryOrderId!=null&&item.inquiryOrderId!=''" v-hasPermi="['his:storeOrder:inquiry']">
  32. <el-button size="mini" @click="getInquiryOrder()" >问诊订单</el-button>
  33. </div>
  34. <div class="operate-button-container" v-if="item.packageOrderId!=null&&item.packageOrderId!=''" v-hasPermi="['his:storeOrder:package']" >
  35. <el-button size="mini" @click="getPackageOrder()" >套餐包订单</el-button>
  36. </div>
  37. <div class="operate-button-container" v-if="item.deliverySn!=null" v-hasPermi="['his:storeOrder:express']">
  38. <el-button size="mini" @click="showExpress()" >查看物流</el-button>
  39. </div>
  40. <div class="operate-button-container" >
  41. <el-button size="mini" @click="editDelivery()" v-hasPermi="['his:storeOrder:updateDelivery']" >修改物流单号</el-button>
  42. </div>
  43. <div class="operate-button-container" >
  44. <el-button size="mini" @click="editOrder()" v-hasPermi="['his:storeOrder:edit']" >修改订单</el-button>
  45. </div>
  46. <div class="operate-button-container" v-if="item.status ==2 && item.extendOrderId == null && item.deliverySn == null&&item.orderType==1" v-hasPermi="['his:storeOrder:createErpOrder']">
  47. <el-button size="mini" @click="addErpOrder()" >创建ERP订单信息</el-button>
  48. </div>
  49. <div class="operate-button-container" v-if="item.extendOrderId!=null && item.orderType==1" v-hasPermi="['his:storeOrder:getEroOrder']" >
  50. <el-button size="mini" @click="showErpOrder()" >ERP订单信息</el-button>
  51. </div>
  52. <div class="operate-button-container" v-if="item.tuiMoneyStatus==0 && item.status==4" v-hasPermi="['his:storeOrder:editTuiMoney']" >
  53. <el-button size="mini" @click="editTuiMoney1()" >解冻</el-button>
  54. </div>
  55. <div class="operate-button-container" v-if="item.tuiMoneyStatus==1 && item.status==4" v-hasPermi="['his:storeOrder:editTuiMoney']" >
  56. <el-button size="mini" @click="editTuiMoney2()" >冻结</el-button>
  57. </div>
  58. <div class="operate-button-container" v-if="item.followTime!=null&&item.followTime!=''" v-hasPermi="['his:storeOrder:msgList']" >
  59. <el-button size="mini" @click="followMsg()" >随访记录</el-button>
  60. </div>
  61. <div class="operate-button-container" v-if="item.status>1">
  62. <el-button size="mini" @click="chooseRefund()" v-hasPermi="['his:storeOrder:afterSales']">申请退款</el-button>
  63. </div>
  64. <div class="operate-button-container" v-if="item.prescribeId!=null&&item.prescribeId!=''" >
  65. <el-button size="mini" @click="getPrescribeOrder()" >处方单</el-button>
  66. </div>
  67. <div class="operate-button-container" v-if="item.status== -2" >
  68. <el-button size="mini" @click="returnCost()" v-hasPermi="['his:storeOrder:returnCost']" >成本退还</el-button>
  69. </div>
  70. <div class="operate-button-container" >
  71. <el-button size="mini" @click="sendFollowMsg()" v-if="item.status>1" v-hasPermi="['his:storeOrder:sendMsg']">发送随访消息</el-button>
  72. </div>
  73. </div>
  74. <div class="desct">
  75. 基本信息
  76. </div>
  77. <el-descriptions :column="3" border >
  78. <el-descriptions-item label="订单编号" ><span v-if="item!=null">{{item.orderCode}}</span></el-descriptions-item>
  79. <el-descriptions-item label="会员"><span v-if="item.nickName!=null">{{item.nickName}}({{item.phone}})</span></el-descriptions-item>
  80. <el-descriptions-item label="会员ID" ><span v-if="item!=null">{{item.userId}}</span></el-descriptions-item>
  81. <el-descriptions-item label="支付方式" ><dict-tag :options="PayOptions" :value="item.payType"/></el-descriptions-item>
  82. <el-descriptions-item label="药品类型" ><dict-tag :options="orderTypeOptions" :value="item.orderType"/></el-descriptions-item>
  83. <el-descriptions-item label="订单来源" ><dict-tag :options="sourceOptions" :value="item.source"/></el-descriptions-item>
  84. <el-descriptions-item label="医生名称" ><span v-if="item!=null">{{item.doctorName}}</span></el-descriptions-item>
  85. <el-descriptions-item label="店铺名称" ><span v-if="item!=null">{{item.storeName}}</span></el-descriptions-item>
  86. <el-descriptions-item label="患者姓名" > <span v-if="item!=null">{{item.patientName}}</span></el-descriptions-item>
  87. <el-descriptions-item label="患者年龄" ><span v-if="item!=null">{{item.patientAge}}</span></el-descriptions-item>
  88. <el-descriptions-item label="患者性别" > <dict-tag :options="sexOptions" :value="item.patientGender"/> </el-descriptions-item>
  89. <el-descriptions-item label="与本人关系" ><span v-if="item!=null">{{item.relation}}</span> </el-descriptions-item>
  90. <el-descriptions-item label="收货人" > <span v-if="item!=null">{{item.userName}}</span> </el-descriptions-item>
  91. <el-descriptions-item label="收货人电话" > <span v-if="item!=null">{{item.userPhone}}</span>
  92. <el-button icon="el-icon-search" size="mini" @click="handlePhone()" style="margin-left: 20px;" circle v-hasPermi="['his:storeOrder:queryPhone']"></el-button>
  93. </el-descriptions-item>
  94. <el-descriptions-item label="详细地址" > <span>{{item.userAddress}}</span> </el-descriptions-item>
  95. <el-descriptions-item label="所属公司"><span v-if="item!=null">{{item.companyName}}</span></el-descriptions-item>
  96. <el-descriptions-item label="员工"><span v-if="item!=null">{{item.companyUserName}}</span></el-descriptions-item>
  97. <el-descriptions-item label="推广佣金" ><span v-if="item.tuiMoney!=null">{{item.tuiMoney.toFixed(2)}}</span></el-descriptions-item>
  98. <el-descriptions-item label="推广佣金状态" ><span v-if="item!=null"><dict-tag :options="tuiOptions" :value="item.tuiMoneyStatus"/> </span></el-descriptions-item>
  99. <el-descriptions-item label="快递公司编号" > <span v-if="item!=null">{{item.deliveryCode}}</span></el-descriptions-item>
  100. <el-descriptions-item label="快递名称" ><span v-if="item!=null">{{item.deliveryName}}</span></el-descriptions-item>
  101. <el-descriptions-item label="快递单号" ><span v-if="item!=null">{{item.deliverySn}}</span></el-descriptions-item>
  102. <el-descriptions-item label="ERP编号" ><span v-if="item!=null">{{item.extendOrderId}}</span></el-descriptions-item>
  103. <el-descriptions-item label="物流状态" ><dict-tag :options="deliveryStatusOptions" :value="item.deliveryStatus"/></el-descriptions-item>
  104. <el-descriptions-item label="物流结算状态" ><dict-tag :options="deliveryPayStatusOptions" :value="item.deliveryPayStatus"/></el-descriptions-item>
  105. <el-descriptions-item label="物流结算时间" ><span v-if="item!=null">{{item.deliveryPayTime}}</span></el-descriptions-item>
  106. <el-descriptions-item label="物流结算金额" ><span v-if="item!=null">{{item.deliveryPayMoney}}</span></el-descriptions-item>
  107. <el-descriptions-item label="物流跟踪状态" ><span v-if="item!=null"><dict-tag :options="deliveryTypeOptions" :value="item.deliveryType"/> </span></el-descriptions-item>
  108. <el-descriptions-item label="用户备注" ><span v-if="item!=null">{{item.remark}}</span></el-descriptions-item>
  109. <el-descriptions-item label="档期归属" >
  110. <el-tag prop="scheduleId" v-for="(schedule, index) in scheduleOptions" v-if="item!=null&&item.scheduleId==schedule.id">{{schedule.name}}
  111. </el-tag>
  112. </el-descriptions-item>
  113. <el-descriptions-item label="订单购买类型" ><span v-if="item!=null"><dict-tag :options="orderBuyTypeOptions" :value="item.orderBuyType"/></span></el-descriptions-item>
  114. <el-descriptions-item label=" 公众号/渠道" ><span v-if="item!=null">{{item.channel}}</span></el-descriptions-item>
  115. <el-descriptions-item label=" 渠道" ><span v-if="item!=null"><dict-tag :options="channelOptions" :value="item.orderChannel"/></span></el-descriptions-item>
  116. <el-descriptions-item label=" 企微主体" ><span v-if="item!=null"><dict-tag :options="qwSubjectOptions" :value="item.qwSubject"/></span></el-descriptions-item>
  117. </el-descriptions>
  118. </el-card>
  119. </div>
  120. <div class="contentx" v-if="item!=null" style="padding-bottom: 70px;">
  121. <div class="desct">
  122. 商品信息
  123. </div>
  124. <el-tooltip class="item" effect="dark" :content="showList ? '显示全部' : '隐藏'" placement="top" style="float: right;">
  125. <el-button size="mini" circle icon="el-icon-search" @click="showListD()" />
  126. </el-tooltip>
  127. <el-table border v-if="showProd!=null" :data="showProd" size="small" style="width: 100%;margin-top: 20px" >
  128. <el-table-column label="商品图片" width="150" align="center">
  129. <template slot-scope="scope">
  130. <img :src="JSON.parse(scope.row.jsonInfo).image" style="height: 80px">
  131. </template>
  132. </el-table-column>
  133. <el-table-column label="商品编码" width="300" align="center">
  134. <template slot-scope="scope">
  135. <p>{{JSON.parse(scope.row.jsonInfo).barCode}}</p>
  136. </template>
  137. </el-table-column>
  138. <el-table-column label="商品名称" width="300" align="center">
  139. <template slot-scope="scope">
  140. <p>{{JSON.parse(scope.row.jsonInfo).productName}}</p>
  141. </template>
  142. </el-table-column>
  143. <el-table-column label="单价" width="240" align="center">
  144. <template slot-scope="scope">
  145. <p>¥{{JSON.parse(scope.row.jsonInfo).price.toFixed(2)}}</p>
  146. </template>
  147. </el-table-column>
  148. <el-table-column label="规格" width="240" align="center">
  149. <template slot-scope="scope">
  150. {{JSON.parse(scope.row.jsonInfo).sku}}
  151. </template>
  152. </el-table-column>
  153. <el-table-column label="数量" width="180" align="center">
  154. <template slot-scope="scope">
  155. {{scope.row.num}}
  156. </template>
  157. </el-table-column>
  158. <el-table-column label="处方药" width="240" align="center">
  159. <template slot-scope="scope">
  160. {{scope.row.isPrescribe!=null&&scope.row.isPrescribe==1?'是':'否'}}
  161. </template>
  162. </el-table-column>
  163. <el-table-column label="小计" align="center">
  164. <template slot-scope="scope" >
  165. ¥{{(scope.row.num*JSON.parse(scope.row.jsonInfo).price).toFixed(2)}}
  166. </template>
  167. </el-table-column>
  168. </el-table>
  169. <div style="float: right;margin: 20px" v-if="item.totalPrice!=null">
  170. 合计:<span class="color-danger">¥{{item.totalPrice.toFixed(2)}}</span>
  171. </div>
  172. <div style="float: right;margin: 20px" v-if="item.orderType==2">
  173. 剂数:<span class="color-danger">{{counts}}</span>
  174. </div>
  175. <div style="float: right;margin: 20px" v-if="item.orderType==2">
  176. 制作类型:<span class="color-danger">{{ recipeType === 0 ? '颗粒剂' : recipeType === 1 ? '膏方' : '饮片'}}</span>
  177. </div>
  178. </div>
  179. <div class="contentx" v-if="item!=null">
  180. <div class="desct">
  181. 费用信息
  182. </div>
  183. <el-descriptions :column="3" border >
  184. <el-descriptions-item label="商品合计" ><span v-if="item.totalPrice!=null">¥{{item.totalPrice.toFixed(2)}} </span></el-descriptions-item>
  185. <el-descriptions-item label="处方定价" ><span v-if="item.prescribePrice!=null"> ¥{{item.prescribePrice.toFixed(2)}}</span></el-descriptions-item>
  186. <el-descriptions-item label="处方应付金额" ><span v-if="item.payPrice!=null"> ¥{{item.payPrice.toFixed(2)}}</span></el-descriptions-item>
  187. <el-descriptions-item label="运费" ><span v-if="item.payDelivery!=null">¥{{item.payDelivery.toFixed(2)}}</span></el-descriptions-item>
  188. <el-descriptions-item label="优惠劵" ><span v-if="item.discountMoney!=null">¥{{item.discountMoney.toFixed(2)}}</span></el-descriptions-item>
  189. <el-descriptions-item label="实付金额" ><span v-if="item.payMoney!=null">¥{{item.payMoney.toFixed(2)}}</span></el-descriptions-item>
  190. <el-descriptions-item label="代收金额" ><span v-if="item.payRemain!=null">¥{{item.payRemain.toFixed(2)}}</span></el-descriptions-item>
  191. </el-descriptions>
  192. </div>
  193. <div class="contentx" v-if="item!=null">
  194. <div class="desct">
  195. 支付信息
  196. </div>
  197. <el-table
  198. border
  199. :data="pay"
  200. size="small"
  201. style="width: 100%;margin-top: 20px" >
  202. <el-table-column label="支付单号" align="center" prop="payCode" width="120px" />
  203. <el-table-column label="支付金额" align="center" prop="payMoney" />
  204. <el-table-column label="类型" align="center" prop="payTypeCode" />
  205. <el-table-column label="外部订单号 " align="center" prop="tradeNo" />
  206. <el-table-column label="创建时间" align="center" prop="createTime" />
  207. <el-table-column label="支付时间" align="center" prop="payTime" />
  208. </el-table>
  209. </div>
  210. <div class="contentx" v-if="item!=null">
  211. <div class="desct">
  212. 操作信息
  213. </div>
  214. <el-table style="margin-top: 20px;width: 100%"
  215. ref="orderHistoryTable"
  216. :data="logs" border>
  217. <el-table-column label="操作时间" width="160" align="center">
  218. <template slot-scope="scope">
  219. {{scope.row.changeTime}}
  220. </template>
  221. </el-table-column>
  222. <el-table-column label="备注" align="center">
  223. <template slot-scope="scope">
  224. {{scope.row.changeMessage}}
  225. </template>
  226. </el-table-column>
  227. </el-table>
  228. </div>
  229. <div class="contentx" v-if="item!=null">
  230. <div class="desct">
  231. 分佣信息
  232. </div>
  233. <el-table
  234. border
  235. :data="tuiMoneyLogs"
  236. size="small"
  237. style="width: 100%;margin-top: 20px" >
  238. <el-table-column label="公司名称" align="center" prop="companyName" width="120px" />
  239. <el-table-column label="金额" align="center" prop="money" />
  240. <el-table-column label="余额" align="center" prop="balance" />
  241. <el-table-column label="创建时间" align="center" prop="createTime" />
  242. <el-table-column label="备注" align="center" prop="remark" />
  243. </el-table>
  244. </div>
  245. <el-dialog
  246. width="50%"
  247. title="发货"
  248. :visible.sync="sendVisible"
  249. append-to-body @close="sendCancel">
  250. <el-form ref="form" :model="form" :rules="rules" label-width="120px">
  251. <el-form-item label="快递公司编号" prop="deliveryCode">
  252. <el-input v-model="form.deliveryCode" placeholder="请输入快递公司编号" />
  253. </el-form-item>
  254. <el-form-item label="快递名称" prop="deliveryName">
  255. <el-input v-model="form.deliveryName" placeholder="请输入快递名称" />
  256. </el-form-item>
  257. <el-form-item label="快递单号" prop="deliverySn">
  258. <el-input v-model="form.deliverySn" placeholder="请输入快递单号" />
  259. </el-form-item>
  260. </el-form>
  261. <div slot="footer" class="dialog-footer">
  262. <el-button type="primary" @click="sendGoods">确 定</el-button>
  263. <el-button @click="sendCancel">取 消</el-button>
  264. </div>
  265. </el-dialog>
  266. <el-dialog :title="expressDialog.title" :visible.sync="expressDialog.open" width="600px" append-to-body>
  267. <div v-hasPermi="['his:storeOrder:syncExpress']" >
  268. <el-button size="mini" @click="syncExpress()" >同步快递鸟物流状态</el-button>
  269. </div>
  270. <el-table style="margin-top: 20px;width: 100%"
  271. ref="orderHistoryTable"
  272. :data="traces" border>
  273. <el-table-column label="操作时间" width="160" align="center">
  274. <template slot-scope="scope">
  275. {{scope.row.AcceptTime}}
  276. </template>
  277. </el-table-column>
  278. <el-table-column label="位置" align="center">
  279. <template slot-scope="scope">
  280. {{scope.row.Location}}
  281. </template>
  282. </el-table-column>
  283. <el-table-column label="描述" align="center">
  284. <template slot-scope="scope">
  285. {{scope.row.AcceptStation}}
  286. </template>
  287. </el-table-column>
  288. </el-table>
  289. </el-dialog>
  290. <el-dialog :title="editDy.title" :visible.sync="editDy.open" width="600px" append-to-body>
  291. <el-form ref="editDyForm" :model="editDyForm" :rules="editDyRules" label-width="100px">
  292. <div v-hasPermi="['his:storeOrder:updateErpOrder']" style="margin-bottom: 20px;" >
  293. <el-button size="mini" @click="updateErpOrder" >同步物流单号信息</el-button>
  294. </div>
  295. <el-form-item label="物流公司" prop="deliveryCode" >
  296. <el-select style="width:220px" v-model="editDyForm.deliveryCode" placeholder="请选择" clearable size="small">
  297. <el-option key="SF" label="顺丰" value="SF" />
  298. <el-option key="EMS" label="邮政" value="EMS" />
  299. <el-option key="ZTO" label="中通" value="ZTO" />
  300. <el-option key="STO" label="申通" value="STO" />
  301. <el-option key="JD" label="京东" value="JD" />
  302. <el-option key="DBL" label="德邦" value="DBL" />
  303. <el-option key="YD" label="韵达" value="YD" />
  304. </el-select>
  305. </el-form-item>
  306. <el-form-item label="物流单号" prop="deliverySn" >
  307. <el-input v-model="editDyForm.deliverySn" placeholder="请输入物流单号" />
  308. </el-form-item>
  309. </el-form>
  310. <div slot="footer" class="dialog-footer">
  311. <el-button type="primary" @click="submitEditDyForm">确 定</el-button>
  312. <el-button @click="editDy.open = false">取 消</el-button>
  313. </div>
  314. </el-dialog>
  315. <el-dialog :title="erpDialog.title" :visible.sync="erpDialog.open" width="800px" append-to-body>
  316. <div v-if="item!=null&&item.extendOrderId!=null&&item.status==2" style="position: absolute; top: 50px;right: 20px;">
  317. <el-button size="mini" @click="updateExpress()" v-hasPermi="['his:storeOrder:updateExpress']" >同步物流发货</el-button>
  318. </div>
  319. <div class="table-layout" v-if="erpOrder!=null" >
  320. <el-descriptions direction="vertical" :column="3" border >
  321. <el-descriptions-item label="订单编号" > <span v-if="item!=null"> {{erpOrder.code}}</span></el-descriptions-item>
  322. <el-descriptions-item label="是否代收" ><span v-if="item!=null">{{erpOrder.cod?'是':'否'}}</span></el-descriptions-item>
  323. <el-descriptions-item label="快递编号" ><span v-if="item!=null">{{erpOrder.express_code}}</span></el-descriptions-item>
  324. <el-descriptions-item label="快递名称" ><span v-if="item!=null"> {{erpOrder.express_name}}</span></el-descriptions-item>
  325. <el-descriptions-item label="收货人" ><span v-if="item!=null">{{erpOrder.receiver_name}}</span></el-descriptions-item>
  326. <el-descriptions-item label="电话" ><span v-if="item!=null"> {{erpOrder.receiver_mobile}}</span></el-descriptions-item>
  327. <el-descriptions-item label="地址" ><span v-if="item!=null"> {{erpOrder.receiver_address}}</span></el-descriptions-item>
  328. <el-descriptions-item label="运单号" ><span v-if="item!=null"> {{erpOrder.deliverys!=null&&erpOrder.deliverys.length>0?erpOrder.deliverys[0].mail_no:''}}</span></el-descriptions-item>
  329. </el-descriptions>
  330. </div>
  331. </el-dialog>
  332. <el-dialog :title="edit.title" :visible.sync="edit.open" width="600px" append-to-body>
  333. <el-form ref="editForm" :model="editForm" :rules="editRules" label-width="100px">
  334. <el-form-item label="订单状态" prop="status" >
  335. <el-select v-model="editForm.status" placeholder="请选择状态" clearable size="small" filterable>
  336. <el-option
  337. v-for="dict in orderOptions "
  338. :key="dict.dictValue"
  339. :label="dict.dictLabel"
  340. :value="dict.dictValue"
  341. :disabled="dict.dictLabel == '待推送' || dict.dictLabel == '退款中' || dict.dictLabel == '退款成功'"
  342. />
  343. </el-select>
  344. </el-form-item>
  345. <el-form-item label="实付金额" prop="payMoney">
  346. <el-input-number
  347. v-model="payMoney"
  348. :precision="2"
  349. :step="0.1"
  350. disabled
  351. />
  352. </el-form-item>
  353. <el-form-item label="物流代收金额">
  354. <el-input-number v-model="payRemain" :precision="2" :step="0.1" :disabled="isUpdatePayRemain==0"/>
  355. </el-form-item>
  356. <el-form-item label="应付金额">
  357. <el-input-number v-model="payPrice" :precision="2" :step="0.1" disabled/>
  358. </el-form-item>
  359. <el-form-item label="物流状态" prop="deliveryStatus" >
  360. <el-select v-model="editForm.deliveryStatus" placeholder="请选择物流状态" clearable size="small" filterable>
  361. <el-option
  362. v-for="dict in deliveryStatusOptions "
  363. :key="dict.dictValue"
  364. :label="dict.dictLabel"
  365. :value="dict.dictValue"
  366. />
  367. </el-select>
  368. </el-form-item>
  369. <el-form-item label="物流跟踪状态" prop="deliveryType" >
  370. <el-select v-model="editForm.deliveryType" placeholder="请选择状态" clearable size="small" filterable>
  371. <el-option
  372. v-for="dict in deliveryTypeOptions "
  373. :key="dict.dictValue"
  374. :label="dict.dictLabel"
  375. :value="dict.dictValue"
  376. />
  377. </el-select>
  378. </el-form-item>
  379. <el-form-item label="详情地址" prop="userAddress" >
  380. <el-cascader
  381. ref="citySelect"
  382. v-model="cityIds"
  383. :options="citys"
  384. @change="handleCityChange"
  385. clearable>
  386. </el-cascader>
  387. <el-input v-model="editForm.userAddress" placeholder="请输入详细地址(不含省/市/区)" />
  388. </el-form-item>
  389. <el-form-item label="收货人电话" prop="userPhone" >
  390. <el-input v-model="editForm.userPhone" placeholder="请输入" />
  391. </el-form-item>
  392. <el-form-item label="备注" prop="remark" >
  393. <el-input v-model="editForm.remark" placeholder="请输入备注" />
  394. </el-form-item>
  395. </el-form>
  396. <div slot="footer" class="dialog-footer">
  397. <el-button type="primary" @click="submitEditForm">确 定</el-button>
  398. </div>
  399. </el-dialog>
  400. <el-drawer
  401. :with-header="false"
  402. :append-to-body="true"
  403. size="75%"
  404. :title="show.title" :visible.sync="show.open">
  405. <inquiryOrderDetails ref="Details" />
  406. </el-drawer>
  407. <el-drawer
  408. :with-header="false"
  409. :append-to-body="true"
  410. size="75%"
  411. :title="pack.title" :visible.sync="pack.open">
  412. <packageOrderDetails ref="packDetails" />
  413. </el-drawer>
  414. <el-dialog
  415. title="聊天记录"
  416. :visible.sync="dialogVisible"
  417. width="80%"
  418. :before-close="msgDialogClose" append-to-body >
  419. <msgDetails ref="msgDetails" :msgDialogClose="msgDialogClose" /><strong></strong>
  420. <span slot="footer" class="dialog-footer">
  421. <el-button @click="msgDialogClose">取 消</el-button>
  422. <el-button type="primary" @click="msgDialogClose">确 定</el-button>
  423. </span>
  424. </el-dialog>
  425. <el-drawer
  426. :with-header="false"
  427. :append-to-body="true"
  428. size="75%"
  429. :title="prescribeDialog.title" :visible.sync="prescribeDialog.open">
  430. <prescribeDetails ref="prescribeDetails" />
  431. </el-drawer>
  432. <el-dialog
  433. :title="refundDialog.title"
  434. :visible.sync="refundDialog.open"
  435. width="50%"
  436. append-to-body
  437. >
  438. <el-table border v-if="refundShowProd!=null" :data="refundShowProd" ref="refundTable" size="small" @selection-change="handleSelectionChange">
  439. <el-table-column type="selection" width="55" align="center" />
  440. <el-table-column label="商品编码" width="110" align="center">
  441. <template slot-scope="scope">
  442. <p>{{ JSON.parse(scope.row.jsonInfo).barCode }}</p>
  443. </template>
  444. </el-table-column>
  445. <el-table-column label="商品名称" align="center">
  446. <template slot-scope="scope">
  447. <p>{{ JSON.parse(scope.row.jsonInfo).productName }}</p>
  448. </template>
  449. </el-table-column>
  450. <el-table-column label="原单价" width="100" align="center">
  451. <template slot-scope="scope">
  452. <p>¥{{JSON.parse(scope.row.jsonInfo).price.toFixed(2)}}</p>
  453. </template>
  454. </el-table-column>
  455. <el-table-column label="退款单价" width="200" align="center">
  456. <template slot-scope="scope">
  457. <el-input-number
  458. v-model="scope.row.money"
  459. :precision="2"
  460. :step="0.1"
  461. :min="0"
  462. size="mini"
  463. />
  464. </template>
  465. </el-table-column>
  466. <el-table-column label="退款数量" width="200" align="center">
  467. <template slot-scope="scope">
  468. <el-input-number
  469. v-model="scope.row.num"
  470. :min="0"
  471. :max="scope.row.originNum"
  472. size="mini"
  473. />
  474. </template>
  475. </el-table-column>
  476. </el-table>
  477. <div style="margin-top:10px;">
  478. 合计退款金额:
  479. <span style="color:red; font-weight:bold;">
  480. ¥{{ refundForm.refundAmount ? refundForm.refundAmount.toFixed(2) : '0.00' }}
  481. </span>
  482. </div>
  483. <div slot="footer" class="dialog-footer">
  484. <el-button type="primary" @click="submitRefundForm">确 定</el-button>
  485. </div>
  486. </el-dialog>
  487. </div>
  488. </template>
  489. <script>
  490. import {getMsgFollow,sendMsg,msgList,updateMoney,getGoods,getEroOrder,editTuiMoney,updateDelivery,createErpOrder,updateExpress,updateErp, afterSales,sendgoods,logList,listOrder,getExpress,syncExpress, listOrderitem,getOrder, delOrder, addOrder, updateStoreOrder, exportOrder,payment,tuiOrder ,getPrescribe,getOrderUserPhone,returnCost} from "@/api/his/storeOrder";
  491. import inquiryOrderDetails from '../his/inquiryOrderDetails.vue';
  492. import packageOrderDetails from '../his/packageOrderDetails2.vue';
  493. import prescribeDetails from '../his/prescribeDetails.vue';
  494. import msgDetails from '../../components/his/followMsgDetails.vue';
  495. import { getTcmScheduleList } from "@/api/company/schedule";
  496. import {getCitys} from "@/api/store/city";
  497. export default {
  498. name: "orderDe",
  499. props:["data"],
  500. components: { inquiryOrderDetails,packageOrderDetails,prescribeDetails ,msgDetails},
  501. data() {
  502. return {
  503. isUpdateRefund:0, //是否支持修改退款金额 默认0不支持
  504. isUpdatePayRemain:0, //是否支持修改物流代收金额 默认0不支持
  505. refundShowProd:[],//原退款明细
  506. refundForm:{
  507. refundAmount:0
  508. },
  509. selectedRows:[],
  510. refundDialog:{
  511. title:"申请退款",
  512. open:false,
  513. },
  514. payRemain: 0, // 物流代收金额,可改
  515. payMoney: 0, // 实收金额,固定
  516. expressDialog:{
  517. title:"物流信息",
  518. open:false,
  519. },
  520. editDy:{
  521. title:"修改物流单号",
  522. open:false,
  523. },
  524. sourceOptions:[],
  525. prescribeDialog:{
  526. title:"处方单",
  527. open:false,
  528. },
  529. followDialogVisible:false,
  530. dialogVisible:false,
  531. total: 0,
  532. msgForm:{
  533. pageNum: 1,
  534. pageSize: 10,
  535. userId:null,
  536. followDoctorId:null,
  537. },
  538. editDyForm:{
  539. orderId:null,
  540. deliveryId:null,
  541. deliveryCode:null,
  542. deliverySn: null
  543. },
  544. showList:true,
  545. edit:{
  546. title:"修改订单",
  547. open:false,
  548. },
  549. erpDialog:{
  550. title:"ERP订单信息",
  551. open:false,
  552. },
  553. show:{
  554. title:"问诊详情",
  555. open:false,
  556. },
  557. pack:{
  558. title:"套餐包",
  559. open:false,
  560. },
  561. followList:[],
  562. counts:null,
  563. recipeType:null,
  564. money:null,
  565. moneyVisible:false,
  566. rules:{},
  567. sendVisible:false,
  568. logs:[],
  569. pay:[],
  570. nickName:null,
  571. storeName:null,
  572. PayOptions:[],
  573. orderOptions:[],
  574. payStatusOptions:[],
  575. express:null,
  576. traces:[],
  577. msg:[],
  578. sexOptions:[],
  579. refundOptions:[],
  580. channelOptions:[],
  581. qwSubjectOptions:[],
  582. tuiOptions:[],
  583. orOptions:[],
  584. storeOPtions:[],
  585. deliveryStatusOptions:[],
  586. deliveryPayStatusOptions:[],
  587. deliveryTypeOptions:[],
  588. orderTypeOptions:[],
  589. orderBuyTypeOptions:[],
  590. scheduleOptions:[],
  591. item:null,
  592. tuiMoneyLogs:[],
  593. erpOrder:null,
  594. prod:null,
  595. showProd:null,
  596. editForm:{
  597. orderId:null,
  598. status:null,
  599. userAddress:null,
  600. deliveryStatus:null,
  601. deliveryType:null,
  602. userPhone:null,
  603. remark:"",
  604. payRemain:null,
  605. payPrice:null
  606. },
  607. editDyRules:{
  608. deliverySn: [
  609. { required: true, message: "物流单号不能为空", trigger: "blur" }
  610. ],
  611. deliveryCode: [
  612. { required: true, message: "物流公司不能为空", trigger: "blur" }
  613. ],
  614. },
  615. editRules:{
  616. userAddress: [
  617. { required: true, message: "收货地址不能为空", trigger: "blur" }
  618. ],
  619. },
  620. mrules:{
  621. },
  622. form: {
  623. deliveryCode: null,
  624. deliveryName:null,
  625. deliverySn:null,
  626. orderId:null,
  627. },
  628. cityIds:[],
  629. citys:[],
  630. userAddress:null,
  631. }
  632. },
  633. created() {
  634. getTcmScheduleList().then(response => {
  635. this.scheduleOptions = response.data;
  636. });
  637. this.getDicts("sys_store_pay_type").then(response => {
  638. this.PayOptions = response.data;
  639. });
  640. this.getDicts("sys_order_status").then(response => {
  641. this.orderOptions = response.data;
  642. });
  643. this.getDicts("sys_order_pay").then(response => {
  644. this.payStatusOptions = response.data;
  645. });
  646. this.getDicts("sys_order_source").then(response => {
  647. this.sourceOptions = response.data;
  648. });
  649. this.getDicts("sys_store_order_type").then(response => {
  650. this.orderTypeOptions = response.data;
  651. });
  652. this.getDicts("sys_store_order_buy_type").then(response => {
  653. this.orderBuyTypeOptions = response.data;
  654. });
  655. this.getDicts("sys_refund_status").then(response => {
  656. this.refundOptions = response.data;
  657. });
  658. this.getDicts("sys_store_channel").then(response => {
  659. this.channelOptions = response.data;
  660. });
  661. this.getDicts("sys_store_qw_subject").then(response => {
  662. this.qwSubjectOptions = response.data;
  663. });
  664. this.getDicts("sys_tui_money_status").then(response => {
  665. this.tuiOptions = response.data;
  666. });
  667. this.getDicts("sys_company_or").then(response => {
  668. this.orOptions = response.data;
  669. });
  670. this.getDicts("sys_patient_sex").then(response => {
  671. this.sexOptions = response.data;
  672. });
  673. this.getDicts("sys_store_delivery_pay_status").then(response => {
  674. this.deliveryPayStatusOptions = response.data;
  675. });
  676. this.getDicts("sys_store_order_delivery_status").then(response => {
  677. this.deliveryStatusOptions = response.data;
  678. });
  679. this.getDicts("sys_delivery_type").then(response => {
  680. this.deliveryTypeOptions = response.data;
  681. });
  682. },
  683. watch: {
  684. 'editForm.status': function(newVal, oldVal) {
  685. if (newVal == 2) {
  686. // 状态改为待发货时,物流状态设置为"暂无轨迹信息"(值0)
  687. this.editForm.deliveryType = "";
  688. this.editForm.deliveryStatus = "0"; // 对应"暂无轨迹信息"
  689. }
  690. }
  691. },
  692. computed: {
  693. // 应收金额 = 实收金额 + 代收金额
  694. payPrice() {
  695. const v = (this.payMoney * 100 + this.payRemain * 100) / 100;
  696. return Number(v.toFixed(2));
  697. }
  698. },
  699. methods: {
  700. updateRefund(row) {
  701. // 默认退款金额 = 数量 × 单价
  702. row.refundAmount = (row.num * row.money).toFixed(2);
  703. },
  704. handleSelectionChange(val) {
  705. this.refundForm.refundAmount = val
  706. .reduce((sum, row) => sum + row.num * row.money, 0)
  707. ;
  708. this.selectedRows = val;
  709. },
  710. getCitys() {
  711. return getCitys().then(res => {
  712. this.citys = res.data || [];
  713. return this.citys;
  714. });
  715. },
  716. // 新增:切换省市区
  717. handleCityChange(val) {
  718. this.cityIds = Array.isArray(val) ? val : [];
  719. },
  720. // 新增:根据已选的 cityIds 从 citys 中获取对应的 label 数组 [省, 市, 区]
  721. getCityLabelsByIds() {
  722. if (!this.cityIds || this.cityIds.length === 0) return [];
  723. const [pVal, cVal, aVal] = this.cityIds;
  724. const p = this.citys.find(p => p.value === pVal);
  725. const c = p?.children?.find(c => c.value === cVal);
  726. const a = c?.children?.find(a => a.value === aVal);
  727. return [p?.label, c?.label, a?.label].filter(Boolean);
  728. },
  729. // 新增:拼装完整地址 = 省 市 区 + 详细地址
  730. buildFullAddress() {
  731. const region = this.getCityLabelsByIds().join(' ');
  732. const detail = (this.editForm.userAddress || '').trim();
  733. console.log(region)
  734. console.log(detail)
  735. return region && detail ? `${region} ${detail}` : (region || detail || '');
  736. },
  737. followMsg(row){
  738. const userId = this.item.userId;
  739. const followDoctorId =this.item.followDoctorId;
  740. const doctorName = this.item.doctorName;
  741. const patientName = this.item.patientName;
  742. setTimeout(() => {
  743. this.$refs.msgDetails.getDetails(userId,followDoctorId,doctorName,patientName);
  744. }, 500);
  745. this.dialogVisible = true;
  746. },
  747. msgDialogClose(){
  748. this.dialogVisible = false;
  749. },
  750. getPrescribeOrder(){
  751. this.prescribeDialog.open=true;
  752. setTimeout(() => {
  753. this.$refs.prescribeDetails.getDetails(this.item.prescribeId);
  754. }, 1);
  755. },
  756. handlePhone(){
  757. const orderId = this.item.orderId;
  758. getOrderUserPhone(orderId).then(response =>{
  759. this.item.userPhone = response.userPhone;
  760. })
  761. },
  762. editDelivery(){
  763. this.editDy.open = true;
  764. console.log(this.item)
  765. this.editDyForm.orderId = this.item.orderId;
  766. this.editDyForm.deliveryId = this.item.deliveryId;
  767. this.editDyForm.deliveryCode = this.item.deliveryCode;
  768. this.editDyForm.deliverySn = this.item.deliverySn;
  769. },
  770. showListD(){
  771. if(this.showList){
  772. this.showProd=this.prod
  773. }else{
  774. this.showProd=[this.prod[0]]
  775. }
  776. this.showList=this.showList?false:true;
  777. },
  778. showExpress(){
  779. this.expressDialog.open=true;
  780. getExpress(this.item.orderId).then(response => {
  781. this.express = response.data;
  782. if(this.express!=null&&this.express.Traces!=null){
  783. this.traces=this.express.Traces
  784. } else {
  785. this.traces = []
  786. }
  787. });
  788. },
  789. updateErpOrder(){
  790. var that=this;
  791. this.$confirm('确定同步物流单号信息吗', "警告", {
  792. confirmButtonText: "确定",
  793. cancelButtonText: "取消",
  794. type: "warning"
  795. }).then(function() {
  796. var data={orderId:that.item.orderId}
  797. return updateErp(data);
  798. }).then(() => {
  799. this.msgSuccess("操作成功");
  800. getOrder(this.item.orderId).then(response => {
  801. this.item=response.data
  802. that.getlogList(this.item.orderId);
  803. that.$parent.$parent.getList();
  804. });
  805. this.editDy.open = false
  806. }).catch(function() {});
  807. },
  808. sendFollowMsg(){
  809. var that=this;
  810. this.$confirm('是否确认发送消息?', "警告", {
  811. confirmButtonText: "确定",
  812. cancelButtonText: "取消",
  813. type: "warning"
  814. }).then(function() {
  815. return sendMsg(that.item.orderId);
  816. }).then(() => {
  817. this.msgSuccess("操作成功");
  818. }).catch(function() {});
  819. },
  820. handleClose1(){
  821. this.dialogVisible=false;
  822. },
  823. handleClose2(){
  824. this.followDialogVisible=false;
  825. },
  826. follow(row){
  827. getMsgFollow(row).then(response => {
  828. if(response.data.formJson!=null&&response.data.formJson!=''&&response.data.writeStatus==1){
  829. this.messageFollowList=JSON.parse(response.data.formJson );
  830. this.followDialogVisible=true;
  831. }else{
  832. this.$message({
  833. message: '未填写随访单',
  834. type: 'info'
  835. });
  836. return
  837. }
  838. });
  839. },
  840. // 修改订单状态
  841. submitEditForm() {
  842. this.$refs["editForm"].validate(valid => {
  843. if (!valid) return;
  844. // 提交前拼接完整地址
  845. const payload = {
  846. ...this.editForm,
  847. userAddress: this.buildFullAddress(),
  848. payRemain :this.payRemain,
  849. payPrice: this.payPrice,
  850. };
  851. updateStoreOrder(payload).then(response => {
  852. if (response.code === 200) {
  853. this.msgSuccess("操作成功");
  854. this.edit.open = false;
  855. getOrder(this.item.orderId).then(response => {
  856. this.item = response.data;
  857. this.getlogList(this.item.orderId);
  858. this.$parent.$parent.getList();
  859. });
  860. }
  861. }).finally(()=>{
  862. this.editDyForm.deliveryCode = null;
  863. this.editDyForm.orderId = null;
  864. this.editDyForm.deliveryId = null;
  865. });
  866. });
  867. },
  868. editOrder() {
  869. this.edit.open = true;
  870. this.editForm.orderId = this.item.orderId;
  871. this.editForm.remark = this.item.remark;
  872. // 先设置其他同步的字段
  873. this.editForm.userPhone = this.item.userPhone != null ? this.item.userPhone.toString() : "";
  874. this.editForm.status = this.item.status != null ? this.item.status.toString() : "";
  875. this.editForm.deliveryType = this.item.deliveryType;
  876. this.editForm.deliveryStatus = this.item.deliveryStatus;
  877. this.payMoney= this.item.payMoney;
  878. this.payRemain = this.item.payRemain;
  879. this.payPrice= this.item.payPrice;
  880. // 等城市数据加载后再解析地址
  881. const currentAddress = (this.item.userAddress || "").toString().trim();
  882. this.getCitys().then(() => {
  883. if (!currentAddress) {
  884. this.cityIds = [];
  885. this.editForm.userAddress = "";
  886. return;
  887. }
  888. // 假设格式为:省 市 区 详细地址(空格分隔)
  889. const parts = currentAddress.split(/\s+/);
  890. const detail = parts.pop() || ""; // 最后一段作为详细地址
  891. const provLabel = parts[0];
  892. const cityLabel = parts[1];
  893. const areaLabel = parts[2];
  894. const province = this.citys.find(p => p.label === provLabel);
  895. const city = province?.children?.find(c => c.label === cityLabel);
  896. const area = city?.children?.find(a => a.label === areaLabel);
  897. if (province && city && area) {
  898. this.cityIds = [province.value, city.value, area.value];
  899. } else {
  900. console.warn("未匹配到完整省市区:", { provLabel, cityLabel, areaLabel });
  901. this.cityIds = [];
  902. }
  903. // 把详细地址写回到输入框(只保留详细地址,不含省市区)
  904. this.editForm.userAddress = detail;
  905. });
  906. },
  907. updateExpress(){
  908. var that=this;
  909. this.$confirm('定同步物流信息吗,同步后将自动发货?', "警告", {
  910. confirmButtonText: "确定",
  911. cancelButtonText: "取消",
  912. type: "warning"
  913. }).then(function() {
  914. var data=that.item.orderId
  915. return updateExpress(data);
  916. }).then(() => {
  917. this.msgSuccess("操作成功");
  918. getOrder(this.item.orderId).then(response => {
  919. this.item=response.data
  920. that.getlogList(this.item.orderId);
  921. that.$parent.$parent.getList();
  922. });
  923. }).catch(function() {});
  924. },
  925. addErpOrder(){
  926. var that=this;
  927. this.$confirm('是否确认推送管易?', "警告", {
  928. confirmButtonText: "确定",
  929. cancelButtonText: "取消",
  930. type: "warning"
  931. }).then(function() {
  932. var data=that.item.orderId
  933. return createErpOrder(data);
  934. }).then(() => {
  935. this.msgSuccess("操作成功");
  936. getOrder(this.item.orderId).then(response => {
  937. this.item=response.data
  938. that.getlogList(this.item.orderId);
  939. that.$parent.$parent.getList();
  940. });
  941. }).catch(function() {});
  942. },
  943. showErpOrder(){
  944. this.erpDialog.open=true;
  945. var data=this.item.extendOrderId;
  946. getEroOrder(data).then(response => {
  947. this.erp = response.data;
  948. if(response.data.orders!=null&&response.data.orders.length==1){
  949. this.erpOrder=response.data.orders[0]
  950. }
  951. });
  952. },
  953. editTuiMoney1(){
  954. var that=this;
  955. this.$confirm('是否解冻此订单推广佣金吗?', "警告", {
  956. confirmButtonText: "确定",
  957. cancelButtonText: "取消",
  958. type: "warning"
  959. }).then(function() {
  960. var data=that.item.orderId;
  961. return editTuiMoney(data);
  962. }).then(() => {
  963. this.msgSuccess("操作成功");
  964. getOrder(this.item.orderId).then(response => {
  965. this.item=response.data
  966. that.getlogList(this.item.orderId);
  967. that.$parent.$parent.getList();
  968. });
  969. }).catch(function() {});
  970. },
  971. editTuiMoney2(){
  972. var that=this;
  973. this.$confirm('是否冻结此订单推广佣金吗?', "警告", {
  974. confirmButtonText: "确定",
  975. cancelButtonText: "取消",
  976. type: "warning"
  977. }).then(function() {
  978. var data=that.item.orderId;
  979. return editTuiMoney(data);
  980. }).then(() => {
  981. this.msgSuccess("操作成功");
  982. getOrder(this.item.orderId).then(response => {
  983. this.item=response.data
  984. that.getlogList(this.item.orderId);
  985. that.$parent.$parent.getList();
  986. });
  987. }).catch(function() {});
  988. },
  989. returnCost(){
  990. var that=this;
  991. this.$confirm('是否退还此订单成本吗?', "警告", {
  992. confirmButtonText: "确定",
  993. cancelButtonText: "取消",
  994. type: "warning"
  995. }).then(function() {
  996. var data=that.item.orderId;
  997. return returnCost(data);
  998. }).then(() => {
  999. this.msgSuccess("操作成功");
  1000. this.getDetails(this.item.orderId,null,null)
  1001. }).catch(function() {});
  1002. },
  1003. moneyCancel(){
  1004. this.money=null;
  1005. this.moneyVisible=false;
  1006. },
  1007. chooseRefund(){
  1008. if(this.isUpdateRefund == 1){
  1009. this.refundShowProd = this.showProd.map(item => {
  1010. const info = JSON.parse(item.jsonInfo);
  1011. return {
  1012. ...item,
  1013. originNum: item.num, // 原始购买数量
  1014. num: item.num, // 可编辑的退款数量
  1015. price: info.price,
  1016. money: 0.00,
  1017. // refundAmount: (item.num * info.price).toFixed(2),
  1018. refundAmount: 0,
  1019. jsonInfo: item.jsonInfo
  1020. }
  1021. })
  1022. this.refundForm.refundAmount = 0
  1023. this.refundDialog.open = true
  1024. // this.$nextTick(() => {
  1025. // // 默认全选表格
  1026. // this.$refs.refundTable.toggleAllSelection();
  1027. // });
  1028. this.$alert('请先设置退款单价和退款数量,再选择商品', '提示');
  1029. } else {
  1030. this.refund(); //正常退款
  1031. }
  1032. },
  1033. submitRefundForm(){
  1034. if(this.refundForm.refundAmount<=0){
  1035. return this.$message("退款金额不能为0");
  1036. }
  1037. if(this.refundForm.refundAmount>this.item.payMoney){
  1038. return this.$message("退款金额不能大于实付金额" + this.item.payMoney + "元");
  1039. }
  1040. if(this.selectedRows.length==0){
  1041. return this.$message("请选择退款商品");
  1042. }
  1043. const refundList = this.selectedRows.map(row => ({
  1044. itemId: row.itemId,
  1045. num: row.num,
  1046. money:row.money
  1047. }))
  1048. const param = {
  1049. orderId:this.item.orderId,
  1050. refundList:refundList,
  1051. refundAmount:this.refundForm.refundAmount
  1052. }
  1053. console.log("申请退款数据", param);
  1054. this.$confirm('是否确认申请退款?', "警告", {
  1055. confirmButtonText: "确定",
  1056. cancelButtonText: "取消",
  1057. type: "warning"
  1058. }).then(function() {
  1059. return afterSales(param);
  1060. }).then(() => {
  1061. this.msgSuccess("操作成功");
  1062. getOrder(this.item.orderId).then(response => {
  1063. this.item = response.data;
  1064. this.getlogList(this.item.orderId);
  1065. this.$parent.$parent.getList();
  1066. this.refundDialog.open = false
  1067. });
  1068. }).catch(function() {});
  1069. },
  1070. refund(){
  1071. var that=this;
  1072. this.$confirm('是否确认申请退款?', "警告", {
  1073. confirmButtonText: "确定",
  1074. cancelButtonText: "取消",
  1075. type: "warning"
  1076. }).then(function() {
  1077. var data={
  1078. orderId:that.item.orderId
  1079. }
  1080. return afterSales(data);
  1081. }).then(() => {
  1082. this.msgSuccess("操作成功");
  1083. getOrder(this.item.orderId).then(response => {
  1084. this.item = response.data;
  1085. this.getlogList(this.item.orderId);
  1086. this.$parent.$parent.getList();
  1087. });
  1088. }).catch(function() {});
  1089. },
  1090. finishOrder(){
  1091. var that=this;
  1092. this.$confirm('是否确认客户已收货?', "警告", {
  1093. confirmButtonText: "确定",
  1094. cancelButtonText: "取消",
  1095. type: "warning"
  1096. }).then(function() {
  1097. var data={
  1098. orderId:that.item.orderId
  1099. }
  1100. return getGoods(data);
  1101. }).then(() => {
  1102. this.msgSuccess("操作成功");
  1103. getOrder(this.item.orderId).then(response => {
  1104. this.item = response.data;
  1105. this.getlistOrderitem(this.item.orderId);
  1106. this.getlogList(this.item.orderId);
  1107. this.$parent.$parent.getList();
  1108. });
  1109. }).catch(function() {});
  1110. },
  1111. syncExpress(){
  1112. var that=this;
  1113. this.$confirm('确定同步物流状态吗', "警告", {
  1114. confirmButtonText: "确定",
  1115. cancelButtonText: "取消",
  1116. type: "warning"
  1117. }).then(function() {
  1118. var data=that.item.orderId
  1119. return syncExpress(data);
  1120. }).then(() => {
  1121. this.msgSuccess("操作成功");
  1122. this.expressDialog.open=false
  1123. getOrder(this.item.orderId).then(response => {
  1124. this.item=response.data
  1125. that.getlogList(this.item.orderId);
  1126. that.$parent.$parent.getList();
  1127. });
  1128. }).catch(function() {});
  1129. },
  1130. getInquiryOrder(){
  1131. this.show.open=true;
  1132. setTimeout(() => {
  1133. this.$refs.Details.getDetails(this.item.inquiryOrderId);
  1134. }, 1);
  1135. },
  1136. getPackageOrder(){
  1137. this.pack.open=true;
  1138. console.log(this.item.packageOrderId)
  1139. setTimeout(() => {
  1140. this.$refs.packDetails.getDetails(this.item.packageOrderId);
  1141. }, 1);
  1142. },
  1143. tuiOrder(){
  1144. var that=this;
  1145. this.$confirm('是否确认推送到智慧药房?', "警告", {
  1146. confirmButtonText: "确定",
  1147. cancelButtonText: "取消",
  1148. type: "warning"
  1149. }).then(function() {
  1150. var data={
  1151. orderId:that.item.orderId
  1152. }
  1153. return tuiOrder(data);
  1154. }).then(() => {
  1155. this.msgSuccess("操作成功");
  1156. getOrder(this.item.orderId).then(response => {
  1157. this.item = response.data;
  1158. this.getlogList(this.item.orderId);
  1159. this.$parent.$parent.getList();
  1160. });
  1161. }).catch(function() {});
  1162. },
  1163. sendCancel(){
  1164. this.sendVisible = false;
  1165. this.form={
  1166. deliveryCode: null,
  1167. deliveryName:null,
  1168. deliverySn:null,
  1169. orderId:null,
  1170. }
  1171. },
  1172. sendGoods(){
  1173. this.form.orderId=this.item.orderId;
  1174. sendgoods(this.form).then(response => {
  1175. this.msgSuccess("修改成功");
  1176. this.sendVisible = false;
  1177. getOrder(this.item.orderId).then(response => {
  1178. this.item = response.data;
  1179. this.getlogList(this.item.orderId);
  1180. this.$parent.$parent.getList();
  1181. });
  1182. this.form={
  1183. deliveryCode: null,
  1184. deliveryName:null,
  1185. deliverySn:null,
  1186. orderId:null,
  1187. }
  1188. });
  1189. },
  1190. getDetails(orderId,nickName,storeName) {
  1191. this.nickName=nickName;
  1192. this.storeName=storeName;
  1193. this.item=null;
  1194. this.tuiMoneyLogs=null;
  1195. getOrder(orderId).then(response => {
  1196. this.item = response.data;
  1197. this.tuiMoneyLogs = response.tuiMoneyLogs;
  1198. this.getlistOrderitem(orderId);
  1199. this.getlogList(orderId);
  1200. this.getPayment(orderId);
  1201. this.msgForm.userId=response.data.userId;
  1202. this.msgForm.followDoctorId=response.data.followDoctorId;
  1203. if(this.item.orderType==2){
  1204. this.getCount(this.item.prescribeId);
  1205. }
  1206. this.isUpdateRefund = response.isUpdateRefund;
  1207. this.isUpdatePayRemain = response.isUpdatePayRemain
  1208. });
  1209. },
  1210. getCount(id){
  1211. getPrescribe(id).then(response => {
  1212. this.recipeType = response.data.recipeType;
  1213. this.counts = JSON.parse(response.data.usageJson).counts
  1214. });
  1215. },
  1216. getOrder(){
  1217. getOrder(this.item.orderId).then(response => {
  1218. this.item = response.data;
  1219. this.getlistOrderitem(this.item.orderId);
  1220. this.getlogList(this.item.orderId);
  1221. this.getPayment(this.item.orderId);
  1222. if(this.item.orderType==2){
  1223. this.getCount(this.item.prescribeId);
  1224. }
  1225. });
  1226. },
  1227. submitEditDyForm(){
  1228. this.$refs["editDyForm"].validate(valid => {
  1229. if (valid) {
  1230. console.log(this.editDyForm)
  1231. updateDelivery(this.editDyForm).then(response => {
  1232. if (response.code === 200) {
  1233. this.msgSuccess("操作成功");
  1234. this.editDy.open = false;
  1235. getOrder(this.item.orderId).then(response => {
  1236. this.item = response.data;
  1237. this.getlogList(this.item.orderId);
  1238. this.$parent.$parent.getList();
  1239. });
  1240. }
  1241. }).finally(()=>{
  1242. this.editDyForm.deliveryCode = null;
  1243. this.editDyForm.orderId = null;
  1244. this.editDyForm.deliveryId = null;
  1245. this.editDyForm.deliverySn = null;
  1246. })
  1247. }
  1248. });
  1249. },
  1250. getlistOrderitem(orderId){
  1251. listOrderitem(orderId).then(response => {
  1252. this.prod = response.rows;
  1253. this.showProd=[this.prod[0]]
  1254. });
  1255. },
  1256. getlogList(orderId){
  1257. logList(orderId).then(response => {
  1258. this.logs = response.rows;
  1259. });
  1260. },
  1261. getPayment(orderId){
  1262. payment(orderId).then(response => {
  1263. console.log(response)
  1264. this.pay = response.data;
  1265. });
  1266. }
  1267. }
  1268. }
  1269. </script>
  1270. <style>
  1271. .content{
  1272. height: 100%;
  1273. background-color: #fff;
  1274. padding: 0px 20px;
  1275. }
  1276. </style>
  1277. <style>
  1278. .contentx{
  1279. height: 100%;
  1280. background-color: #fff;
  1281. padding: 0px 20px 20px;
  1282. margin: 20px;
  1283. }
  1284. .el-descriptions-item__label.is-bordered-label{
  1285. font-weight: normal;
  1286. }
  1287. .el-descriptions-item__content {
  1288. max-width: 150px;
  1289. min-width: 100px;
  1290. }
  1291. .desct{
  1292. padding-top: 20px;
  1293. padding-bottom: 20px;
  1294. color: #524b4a;
  1295. font-weight: bold;
  1296. }
  1297. </style>
  1298. <style scoped>
  1299. .order-content{
  1300. margin: 10px;
  1301. }
  1302. .operate-container {
  1303. background: #F2F6FC;
  1304. height: 60px;
  1305. margin: -20px -20px 0;
  1306. line-height: 60px;
  1307. }
  1308. .operate-button-container {
  1309. float: right;
  1310. margin-right: 20px
  1311. }
  1312. </style>
  1313. <style scoped>
  1314. .chat-records {
  1315. overflow-y: auto;
  1316. }
  1317. .timestamp {
  1318. font-size: 12px;
  1319. color: #A9A9A9;
  1320. }
  1321. .chat-record {
  1322. margin: 10px;
  1323. flex-direction: column;
  1324. align-items: flex-start;
  1325. }
  1326. .sent {
  1327. background-color: #fbfdff;
  1328. color: #000839;
  1329. }
  1330. .sent .timestamp {
  1331. float: right;
  1332. }
  1333. .right{
  1334. float: right;
  1335. }
  1336. .received {
  1337. background-color: #fbfdff;
  1338. color: #000000;
  1339. }
  1340. .el-descriptions-item__content {
  1341. max-width: 150px;
  1342. min-width: 100px;
  1343. }
  1344. .order-content{
  1345. margin: 10px;
  1346. }
  1347. .operate-container {
  1348. background: #F2F6FC;
  1349. height: 60px;
  1350. margin: -20px -20px 0;
  1351. line-height: 60px;
  1352. }
  1353. .operate-button-container {
  1354. float: right;
  1355. margin-right: 20px
  1356. }
  1357. </style>