liveOrderDetails.vue 35 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031
  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. <el-steps :active="item.status==4?item.status:item.status" 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-step title="已完成"></el-step>
  14. </el-steps>
  15. </div>
  16. <el-card shadow="never" style="margin-top: 15px">
  17. <div class="operate-container" v-if="item!=null">
  18. <span style="margin-left: 20px" class="color-danger">订单状态:
  19. <el-tag prop="status" v-for="(ite, index) in orderOptions" v-if="item.status==ite.dictValue">{{ite.dictLabel}}</el-tag>
  20. </span>
  21. <div class="operate-button-container" v-if="item.status==3">
  22. <el-button size="mini" @click="finishOrder()" v-hasPermi="['his:liveOrder:good']">确认收货</el-button>
  23. </div>
  24. <div class="operate-button-container" v-if="item.status==2&&item.orderType==1">
  25. <el-button size="mini" @click="sendVisible=true" v-hasPermi="['his:liveOrder:sendGoods']">发货</el-button>
  26. </div>
  27. <div class="operate-button-container" v-if="item.status==2&&item.orderType==2">
  28. <el-button size="mini" @click="tuiOrder()" v-hasPermi="['his:liveOrder:sendHisGoods']" >推送订单</el-button>
  29. </div>
  30. <div class="operate-button-container" v-if="item.deliverySn!=null" v-hasPermi="['his:liveOrder:express']">
  31. <el-button size="mini" @click="showExpress()" >查看物流</el-button>
  32. </div>
  33. <div class="operate-button-container" >
  34. <el-button size="mini" @click="editDelivery()" v-hasPermi="['his:liveOrder:updateDelivery']" >修改物流单号</el-button>
  35. </div>
  36. <div class="operate-button-container" >
  37. <el-button size="mini" @click="editOrder()" v-hasPermi="['his:liveOrder:edit']" >修改订单</el-button>
  38. </div>
  39. <div class="operate-button-container" v-if="item.status ==2 && item.extendOrderId == null && item.deliverySn == null&&item.orderType==1" v-hasPermi="['his:liveOrder:createErpOrder']">
  40. <el-button size="mini" @click="addErpOrder()" >创建ERP订单信息</el-button>
  41. </div>
  42. <div class="operate-button-container" v-if="item.extendOrderId!=null && item.orderType==1" v-hasPermi="['his:liveOrder:getEroOrder']" >
  43. <el-button size="mini" @click="showErpOrder()" >ERP订单信息</el-button>
  44. </div>
  45. <div class="operate-button-container" v-if="item.status>1">
  46. <el-button size="mini" @click="refund()" v-hasPermi="['his:liveOrder:refundOrderMoney']">退款</el-button>
  47. </div>
  48. </div>
  49. <div class="desct">
  50. 基本信息
  51. </div>
  52. <el-descriptions :column="3" border >
  53. <el-descriptions-item label="订单编号" ><span v-if="item!=null">{{item.orderCode}}</span></el-descriptions-item>
  54. <el-descriptions-item label="会员"><span v-if="item.nickName!=null">{{item.nickName}}({{item.phone}})</span></el-descriptions-item>
  55. <el-descriptions-item label="支付方式" ><dict-tag :options="PayOptions" :value="item.payType"/></el-descriptions-item>
  56. <el-descriptions-item label="收货人" > <span v-if="item!=null">{{item.userName}}</span> </el-descriptions-item>
  57. <el-descriptions-item label="手机号码" > <span v-if="item!=null">{{item.userPhone}}</span>
  58. <el-button icon="el-icon-search" size="mini" @click="handlePhone()" style="margin-left: 20px;" circle v-hasPermi="['his:liveOrder:queryPhone']"></el-button>
  59. </el-descriptions-item>
  60. <el-descriptions-item label="收货地址" > <span>{{item.userAddress}}</span> </el-descriptions-item>
  61. <el-descriptions-item label="所属公司"><span v-if="item!=null">{{item.companyName}}</span></el-descriptions-item>
  62. <el-descriptions-item label="员工"><span v-if="item!=null">{{item.companyUserName}}</span></el-descriptions-item>
  63. <el-descriptions-item label="推广佣金" ><span v-if="item.tuiMoney!=null">{{item.tuiMoney.toFixed(2)}}</span></el-descriptions-item>
  64. <el-descriptions-item label="推广佣金状态" ><span v-if="item!=null"><dict-tag :options="tuiOptions" :value="item.tuiMoneyStatus"/> </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="档期归属" >
  67. <el-tag prop="scheduleId" v-for="(schedule, index) in scheduleOptions" v-if="item!=null&&item.scheduleId==schedule.id">{{schedule.name}}
  68. </el-tag>
  69. </el-descriptions-item>
  70. <el-descriptions-item label="订单购买类型" ><span v-if="item!=null"><dict-tag :options="orderBuyTypeOptions" :value="item.orderBuyType"/></span></el-descriptions-item>
  71. <el-descriptions-item label=" 公众号/渠道" ><span v-if="item!=null">{{item.channel}}</span></el-descriptions-item>
  72. <el-descriptions-item label=" 渠道" ><span v-if="item!=null"><dict-tag :options="channelOptions" :value="item.orderChannel"/></span></el-descriptions-item>
  73. <el-descriptions-item label=" 企微主体" ><span v-if="item!=null"><dict-tag :options="qwSubjectOptions" :value="item.qwSubject"/></span></el-descriptions-item>
  74. </el-descriptions>
  75. </el-card>
  76. </div>
  77. <div class="contentx" v-if="item!=null" style="padding-bottom: 70px;">
  78. <div style="margin-top: 20px">
  79. <div class="desct">
  80. 物流信息
  81. </div>
  82. &nbsp;
  83. <el-link type="primary" @click="editDelivery(null)">添加物流信息</el-link>
  84. </div>
  85. <el-table
  86. border
  87. :data="deliverList"
  88. size="small"
  89. style="width: 100%;margin-top: 20px" >
  90. <el-table-column label="物流公司编码" width="150" align="center">
  91. <template slot-scope="scope">
  92. <p>{{scope.row.deliverSn}}</p>
  93. </template>
  94. </el-table-column>
  95. <el-table-column label="物流公司名称" width="300" align="center">
  96. <template slot-scope="scope">
  97. <p>{{scope.row.deliverName}}</p>
  98. </template>
  99. </el-table-column>
  100. <el-table-column label="物流单号" width="300" align="center">
  101. <template slot-scope="scope">
  102. <p>{{scope.row.deliverId}}</p>
  103. </template>
  104. </el-table-column>
  105. <el-table-column label="物流状态" width="300" align="center">
  106. <template slot-scope="scope">
  107. <span>
  108. <el-tag v-for="(item, index) in deliveryStatusOptions" v-if="scope.row!=null&&scope.row.status==item.dictValue">
  109. {{item.dictLabel}}
  110. </el-tag>
  111. </span>
  112. </template>
  113. </el-table-column>
  114. <el-table-column label="发货时间" width="240" align="center">
  115. <template slot-scope="scope">
  116. {{scope.row.deliverySendTime}}
  117. </template>
  118. </el-table-column>
  119. <el-table-column label="操作" width="240" align="center">
  120. <template slot-scope="scope">
  121. <el-link type="primary" @click="showExpress(scope)">查看物流跟踪</el-link>
  122. &nbsp;&nbsp;
  123. <el-link type="primary" @click="editDelivery(scope)">修改物流</el-link>
  124. </template>
  125. </el-table-column>
  126. </el-table>
  127. </div>
  128. <div class="contentx" v-if="item!=null" style="padding-bottom: 70px;">
  129. <div class="desct">
  130. 商品信息
  131. </div>
  132. <el-tooltip class="item" effect="dark" :content="showList ? '显示全部' : '隐藏'" placement="top" style="float: right;">
  133. <el-button size="mini" circle icon="el-icon-search" @click="showListD()" />
  134. </el-tooltip>
  135. <el-table border v-if="showProd!=null" :data="showProd" size="small" style="width: 100%;margin-top: 20px" >
  136. <el-table-column label="商品图片" width="150" align="center">
  137. <template slot-scope="scope">
  138. <img :src="scope.row.imgUrl" style="height: 80px">
  139. </template>
  140. </el-table-column>
  141. <el-table-column label="商品编码" width="300" align="center">
  142. <template slot-scope="scope">
  143. <p>{{scope.row.barCode}}</p>
  144. </template>
  145. </el-table-column>
  146. <el-table-column label="商品名称" width="300" align="center">
  147. <template slot-scope="scope">
  148. <p>{{scope.row.productName}}</p>
  149. </template>
  150. </el-table-column>
  151. <el-table-column label="单价" width="240" align="center">
  152. <template slot-scope="scope">
  153. <p>¥{{scope.row.price.toFixed(2)}}</p>
  154. </template>
  155. </el-table-column>
  156. <el-table-column label="市场价" width="240" align="center">
  157. <template slot-scope="scope">
  158. {{scope.row.otPrice}}
  159. </template>
  160. </el-table-column>
  161. </el-table>
  162. <div style="float: right;margin: 20px" v-if="item.totalPrice!=null">
  163. 合计:<span class="color-danger">¥{{item.totalPrice.toFixed(2)}}</span>
  164. </div>
  165. </div>
  166. <div class="contentx" v-if="item!=null" style="padding-bottom: 70px;">
  167. <div class="desct">
  168. 费用信息
  169. </div>
  170. <el-tooltip class="item" effect="dark" :content="showList ? '显示全部' : '隐藏'" placement="top" style="float: right;">
  171. <el-button size="mini" circle icon="el-icon-search" @click="showListD()" />
  172. </el-tooltip>
  173. <el-descriptions :column="3" border >
  174. <el-descriptions-item label="商品合计" ><span v-if="item!=null">{{item.totalPrice}}</span></el-descriptions-item>
  175. <el-descriptions-item label="应付金额"><span v-if="item.totalPrice!=null">{{item.totalPrice}}({{item.totalPrice}})</span></el-descriptions-item>
  176. <el-descriptions-item label="运费"><span v-if="item.payDelivery!=null">{{item.payDelivery}}({{item.payDelivery}})</span></el-descriptions-item>
  177. <el-descriptions-item label="优惠券" ><span v-if="item.discountMoney!=null"/>{{item.discountMoney}}</el-descriptions-item>
  178. <el-descriptions-item label="积分抵扣" > <span v-if="item!=null">{{item.payIntegral}}</span> </el-descriptions-item>
  179. <el-descriptions-item label="实付金额" > <span v-if="item!=null">{{item.payMoney}}</span> </el-descriptions-item>
  180. <el-descriptions-item label="代收金额" > <span v-if="item!=null">{{item.payRemain}}</span> </el-descriptions-item>
  181. <el-descriptions-item label="服务费" > <span v-if="item!=null">{{0.00}}</span> </el-descriptions-item>
  182. </el-descriptions>
  183. <div style="float: right;margin: 20px" v-if="item.totalPrice!=null">
  184. 合计:<span class="color-danger">¥{{item.totalPrice.toFixed(2)}}</span>
  185. </div>
  186. </div>
  187. <div class="contentx" v-if="payments!=null" style="padding-bottom: 70px;">
  188. <div class="desct">
  189. 支付信息
  190. </div>
  191. <el-table
  192. border
  193. :data="payments"
  194. size="small"
  195. style="width: 100%;margin-top: 20px" >
  196. <el-table-column label="支付单号" align="center" prop="payCode" width="120px" />
  197. <el-table-column label="支付金额" align="center" prop="payMoney" />
  198. <el-table-column label="类型" align="center" prop="payTypeCode" />
  199. <el-table-column label="交易单号" align="center" prop="bankTransactionId" />
  200. <el-table-column label="银行单号" align="center" prop="bankSerialNo" />
  201. <el-table-column label="创建时间" align="center" prop="createTime" />
  202. <el-table-column label="支付时间" align="center" prop="payTime" />
  203. </el-table>
  204. </div>
  205. <div class="contentx" v-if="logs!=null" style="padding-bottom: 70px;">
  206. <div class="desct">
  207. 操作信息
  208. </div>
  209. <el-table style="margin-top: 20px;width: 100%"
  210. ref="orderHistoryTable"
  211. :data="logs" border>
  212. <el-table-column label="操作时间" width="160" align="center">
  213. <template slot-scope="scope">
  214. {{scope.row.changeTime}}
  215. </template>
  216. </el-table-column>
  217. <el-table-column label="备注" align="center">
  218. <template slot-scope="scope">
  219. {{scope.row.changeMessage}}
  220. </template>
  221. </el-table-column>
  222. </el-table>
  223. </div>
  224. <div class="contentx" v-if="tuiMoneyLogs!=null" style="padding-bottom: 70px;">
  225. <div class="desct">
  226. 分佣信息
  227. </div>
  228. <el-table
  229. border
  230. :data="tuiMoneyLogs"
  231. size="small"
  232. style="width: 100%;margin-top: 20px" >
  233. <el-table-column label="公司名称" align="center" prop="companyName" width="120px" />
  234. <el-table-column label="金额" align="center" prop="money" />
  235. <el-table-column label="余额" align="center" prop="balance" />
  236. <el-table-column label="创建时间" align="center" prop="createTime" />
  237. <el-table-column label="备注" align="center" prop="remark" />
  238. </el-table>
  239. </div>
  240. <el-dialog :title="edit.title" :visible.sync="edit.open" width="600px" append-to-body>
  241. <el-form ref="editForm" :model="editForm" :rules="editRules" label-width="100px">
  242. <el-form-item label="订单状态" prop="status" >
  243. <el-select v-model="editForm.status" placeholder="请选择状态" clearable size="small" filterable>
  244. <el-option
  245. v-for="dict in orderOptions "
  246. :key="dict.dictValue"
  247. :label="dict.dictLabel"
  248. :value="dict.dictValue"
  249. />
  250. </el-select>
  251. </el-form-item>
  252. <el-form-item label="物流状态" prop="deliveryStatus" >
  253. <el-select v-model="editForm.deliveryStatus" placeholder="请选择物流状态" clearable size="small" filterable>
  254. <el-option
  255. v-for="dict in deliveryStatusOptions "
  256. :key="dict.dictValue"
  257. :label="dict.dictLabel"
  258. :value="dict.dictValue"
  259. />
  260. </el-select>
  261. </el-form-item>
  262. <el-form-item label="物流跟踪状态" prop="deliveryType" >
  263. <el-select v-model="editForm.deliveryType" placeholder="请选择状态" clearable size="small" filterable>
  264. <el-option
  265. v-for="dict in deliveryTypeOptions "
  266. :key="dict.dictValue"
  267. :label="dict.dictLabel"
  268. :value="dict.dictValue"
  269. />
  270. </el-select>
  271. </el-form-item>
  272. <el-form-item label="详情地址" prop="userAddress" >
  273. <el-input v-model="editForm.userAddress" placeholder="请输入" />
  274. </el-form-item>
  275. <el-form-item label="备注" prop="remark" >
  276. <el-input v-model="editForm.remark" placeholder="请输入备注" />
  277. </el-form-item>
  278. </el-form>
  279. <div slot="footer" class="dialog-footer">
  280. <el-button type="primary" @click="submitEditForm">确 定</el-button>
  281. </div>
  282. </el-dialog>
  283. <el-dialog :title="editDy.title" :visible.sync="editDy.open" width="600px" append-to-body>
  284. <el-form ref="editDyForm" :model="editDyForm" :rules="editDyRules" label-width="100px">
  285. <div v-hasPermi="['his:liveOrder:updateErpOrder']" style="margin-bottom: 20px;" >
  286. <el-button size="mini" @click="updateErpOrder" >同步物流单号信息</el-button>
  287. </div>
  288. <el-form-item label="物流公司" prop="deliveryCode" >
  289. <el-select style="width:220px" v-model="editDyForm.deliveryCode" placeholder="请选择" clearable size="small">
  290. <el-option key="SF" label="顺丰" value="SF" />
  291. <el-option key="EMS" label="邮政" value="EMS" />
  292. <el-option key="ZTO" label="中通" value="ZTO" />
  293. <el-option key="JD" label="京东" value="JD" />
  294. <el-option key="DBL" label="德邦" value="DBL" />
  295. <el-option key="YD" label="韵达" value="YD" />
  296. </el-select>
  297. </el-form-item>
  298. <el-form-item label="物流单号" prop="deliverySn" >
  299. <el-input v-model="editDyForm.deliverySn" placeholder="请输入物流单号" />
  300. </el-form-item>
  301. </el-form>
  302. <div slot="footer" class="dialog-footer">
  303. <el-button type="primary" @click="submitEditDyForm">确 定</el-button>
  304. <el-button @click="editDy.open = false">取 消</el-button>
  305. </div>
  306. </el-dialog>
  307. <el-dialog :title="expressDialog.title" :visible.sync="expressDialog.open" width="600px" append-to-body>
  308. <div v-hasPermi="['his:storeOrder:syncExpress']" >
  309. <el-button size="mini" @click="syncExpress()" >同步快递鸟物流状态</el-button>
  310. </div>
  311. <el-table style="margin-top: 20px;width: 100%"
  312. ref="orderHistoryTable"
  313. :data="traces" border>
  314. <el-table-column label="操作时间" width="160" align="center">
  315. <template slot-scope="scope">
  316. {{scope.row.AcceptTime}}
  317. </template>
  318. </el-table-column>
  319. <el-table-column label="位置" align="center">
  320. <template slot-scope="scope">
  321. {{scope.row.Location}}
  322. </template>
  323. </el-table-column>
  324. <el-table-column label="描述" align="center">
  325. <template slot-scope="scope">
  326. {{scope.row.AcceptStation}}
  327. </template>
  328. </el-table-column>
  329. </el-table>
  330. </el-dialog>
  331. </div>
  332. </template>
  333. <script>
  334. import {
  335. getLiveOrder,
  336. syncExpress,
  337. updateLiveOrder,
  338. updateErp,
  339. getExpress,
  340. listOrderitem,
  341. tuiOrder,
  342. refundOrderMoney,
  343. editDeliveryId, finishOrder, getOrderExpress, getOrderPayments, getOrderLog
  344. } from "@/api/live/liveOrder";
  345. import {getStoreOrderLive} from "@/api/store/storeOrder";
  346. export default {
  347. props:["data"],
  348. data() {
  349. return {
  350. expressDialog:{
  351. title:"物流信息",
  352. open:false,
  353. },
  354. editDy:{
  355. title:"修改物流单号",
  356. open:false,
  357. },
  358. sourceOptions:[],
  359. payments: [],
  360. followDialogVisible:false,
  361. dialogVisible:false,
  362. total: 0,
  363. msgForm:{
  364. pageNum: 1,
  365. pageSize: 10,
  366. userId:null,
  367. followDoctorId:null,
  368. },
  369. editDyForm:{
  370. orderId:null,
  371. deliveryId:null,
  372. deliveryCode:null,
  373. },
  374. showList:true,
  375. edit:{
  376. title:"修改订单",
  377. open:false,
  378. },
  379. erpDialog:{
  380. title:"ERP订单信息",
  381. open:false,
  382. },
  383. show:{
  384. title:"问诊详情",
  385. open:false,
  386. },
  387. pack:{
  388. title:"套餐包",
  389. open:false,
  390. },
  391. followList:[],
  392. money:null,
  393. moneyVisible:false,
  394. rules:{},
  395. sendVisible:false,
  396. logs:[],
  397. pay:[],
  398. nickName:null,
  399. storeName:null,
  400. PayOptions:[],
  401. orderOptions:[],
  402. payStatusOptions:[],
  403. express:null,
  404. traces:[],
  405. msg:[],
  406. deliverList: [],
  407. sexOptions:[],
  408. refundOptions:[],
  409. channelOptions:[],
  410. qwSubjectOptions:[],
  411. tuiOptions:[],
  412. orOptions:[],
  413. storeOPtions:[],
  414. deliveryStatusOptions:[],
  415. deliveryPayStatusOptions:[],
  416. deliveryTypeOptions:[],
  417. orderTypeOptions:[],
  418. orderBuyTypeOptions:[],
  419. scheduleOptions:[],
  420. item:null,
  421. tuiMoneyLogs:[],
  422. erpOrder:null,
  423. prod:null,
  424. showProd:null,
  425. editForm:{
  426. orderId:null,
  427. status:null,
  428. userAddress:null,
  429. deliveryStatus:null,
  430. deliveryType:null,
  431. remark:"",
  432. },
  433. editDyRules:{
  434. deliverySn: [
  435. { required: true, message: "物流单号不能为空", trigger: "blur" }
  436. ],
  437. deliveryCode: [
  438. { required: true, message: "物流公司不能为空", trigger: "blur" }
  439. ],
  440. },
  441. editRules:{
  442. userAddress: [
  443. { required: true, message: "收货地址不能为空", trigger: "blur" }
  444. ],
  445. },
  446. mrules:{
  447. },
  448. form: {
  449. deliveryCode: null,
  450. deliveryName:null,
  451. deliverySn:null,
  452. orderId:null,
  453. }
  454. }
  455. },
  456. created() {
  457. this.getDicts("sys_store_pay_type").then(response => {
  458. this.PayOptions = response.data;
  459. });
  460. this.getDicts("sys_order_status").then(response => {
  461. this.orderOptions = response.data;
  462. });
  463. this.getDicts("sys_order_pay").then(response => {
  464. this.payStatusOptions = response.data;
  465. });
  466. this.getDicts("sys_order_source").then(response => {
  467. this.sourceOptions = response.data;
  468. });
  469. this.getDicts("sys_store_order_type").then(response => {
  470. this.orderTypeOptions = response.data;
  471. });
  472. this.getDicts("sys_store_order_buy_type").then(response => {
  473. this.orderBuyTypeOptions = response.data;
  474. });
  475. this.getDicts("sys_refund_status").then(response => {
  476. this.refundOptions = response.data;
  477. });
  478. this.getDicts("sys_store_channel").then(response => {
  479. this.channelOptions = response.data;
  480. });
  481. this.getDicts("sys_store_qw_subject").then(response => {
  482. this.qwSubjectOptions = response.data;
  483. });
  484. this.getDicts("sys_tui_money_status").then(response => {
  485. this.tuiOptions = response.data;
  486. });
  487. this.getDicts("sys_company_or").then(response => {
  488. this.orOptions = response.data;
  489. });
  490. this.getDicts("sys_patient_sex").then(response => {
  491. this.sexOptions = response.data;
  492. });
  493. this.getDicts("sys_store_delivery_pay_status").then(response => {
  494. this.deliveryPayStatusOptions = response.data;
  495. });
  496. this.getDicts("store_order_delivery_status").then(response => {
  497. this.deliveryStatusOptions = response.data;
  498. });
  499. this.getDicts("logistics_status").then(response => {
  500. this.deliveryTypeOptions = response.data;
  501. });
  502. },
  503. methods: {
  504. getOrderLive(orderId){
  505. getLiveOrder(orderId).then(response => {
  506. this.item=response.data
  507. });
  508. this.getlistOrderitem(orderId);
  509. },
  510. followMsg(row){
  511. const userId = this.item.userId;
  512. const followDoctorId =this.item.followDoctorId;
  513. const doctorName = this.item.doctorName;
  514. const patientName = this.item.patientName;
  515. setTimeout(() => {
  516. this.$refs.msgDetails.getDetails(userId,followDoctorId,doctorName,patientName);
  517. }, 500);
  518. this.dialogVisible = true;
  519. },
  520. msgDialogClose(){
  521. this.dialogVisible = false;
  522. },
  523. handlePhone(){
  524. const orderId = this.item.orderId;
  525. getOrderUserPhone(orderId).then(response =>{
  526. this.item.userPhone = response.userPhone;
  527. })
  528. },
  529. editDelivery(){
  530. this.editDy.open = true;
  531. this.editDyForm.orderId = this.item.orderId;
  532. },
  533. showListD(){
  534. if(this.showList){
  535. this.showProd=this.prod
  536. }else{
  537. this.showProd=[this.prod[0]]
  538. }
  539. this.showList=this.showList?false:true;
  540. },
  541. showExpress(){
  542. this.expressDialog.open=true;
  543. getExpress({
  544. orderId: this.item.orderId,
  545. deliverId: this.item.deliverySn,
  546. deliverSn: this.item.deliveryCode,
  547. }).then(response => {
  548. this.express = response.data;
  549. if(this.express!=null&&this.express.Traces!=null){
  550. this.traces=this.express.Traces
  551. }
  552. });
  553. },
  554. updateErpOrder(){
  555. var that=this;
  556. this.$confirm('确定同步物流单号信息吗', "警告", {
  557. confirmButtonText: "确定",
  558. cancelButtonText: "取消",
  559. type: "warning"
  560. }).then(function() {
  561. var data={orderId:that.item.orderId}
  562. return updateErp(data);
  563. }).then(() => {
  564. this.msgSuccess("操作成功");
  565. getLiveOrder(this.item.orderId).then(response => {
  566. this.item=response.data
  567. that.getlogList(this.item.orderId);
  568. that.$parent.$parent.getList();
  569. });
  570. this.editDy.open = false
  571. }).catch(function() {});
  572. },
  573. sendFollowMsg(){
  574. var that=this;
  575. this.$confirm('是否确认发送消息?', "警告", {
  576. confirmButtonText: "确定",
  577. cancelButtonText: "取消",
  578. type: "warning"
  579. }).then(function() {
  580. return sendMsg(that.item.orderId);
  581. }).then(() => {
  582. this.msgSuccess("操作成功");
  583. }).catch(function() {});
  584. },
  585. handleClose1(){
  586. this.dialogVisible=false;
  587. },
  588. handleClose2(){
  589. this.followDialogVisible=false;
  590. },
  591. follow(row){
  592. getMsgFollow(row).then(response => {
  593. if(response.data.formJson!=null&&response.data.formJson!=''&&response.data.writeStatus==1){
  594. this.messageFollowList=JSON.parse(response.data.formJson );
  595. this.followDialogVisible=true;
  596. }else{
  597. this.$message({
  598. message: '未填写随访单',
  599. type: 'info'
  600. });
  601. return
  602. }
  603. });
  604. },
  605. //修改订单状态
  606. submitEditForm(){
  607. this.$refs["editForm"].validate(valid => {
  608. if (valid) {
  609. updateLiveOrder(this.editForm).then(response => {
  610. if (response.code === 200) {
  611. this.msgSuccess("操作成功");
  612. this.edit.open = false;
  613. getLiveOrder(this.item.orderId).then(response => {
  614. this.item=response.data
  615. that.getlogList(this.item.orderId);
  616. that.$parent.$parent.getList();
  617. });
  618. }
  619. });
  620. }
  621. });
  622. },
  623. editOrder(){
  624. this.edit.open=true;
  625. this.editForm.orderId=this.item.orderId;
  626. this.editForm.remark=this.item.remark;
  627. this.editForm.userAddress = this.item.userAddress == null ? '' : this.item.userAddress.toString();
  628. this.editForm.status = this.item.status == null ? '' : this.item.status.toString();
  629. this.editForm.deliveryType = this.item.deliveryType == null ? '' : this.item.deliveryType.toString();
  630. this.editForm.deliveryStatus = this.item.deliveryStatus == null ? '' : this.item.deliveryStatus.toString();
  631. },
  632. updateExpress(){
  633. var that=this;
  634. this.$confirm('定同步物流信息吗,同步后将自动发货?', "警告", {
  635. confirmButtonText: "确定",
  636. cancelButtonText: "取消",
  637. type: "warning"
  638. }).then(function() {
  639. var data=that.item.orderId
  640. return updateExpress(data);
  641. }).then(() => {
  642. this.msgSuccess("操作成功");
  643. getLiveOrder(this.item.orderId).then(response => {
  644. this.item=response.data
  645. that.getlogList(this.item.orderId);
  646. that.$parent.$parent.getList();
  647. });
  648. }).catch(function() {});
  649. },
  650. addErpOrder(){
  651. var that=this;
  652. this.$confirm('是否确认推送管易?', "警告", {
  653. confirmButtonText: "确定",
  654. cancelButtonText: "取消",
  655. type: "warning"
  656. }).then(function() {
  657. var data=that.item.orderId
  658. return createErpOrder(data);
  659. }).then(() => {
  660. this.msgSuccess("操作成功");
  661. getLiveOrder(this.item.orderId).then(response => {
  662. this.item=response.data
  663. that.getlogList(this.item.orderId);
  664. that.$parent.$parent.getList();
  665. });
  666. }).catch(function() {});
  667. },
  668. showErpOrder(){
  669. this.erpDialog.open=true;
  670. var data=this.item.extendOrderId;
  671. getEroOrder(data).then(response => {
  672. this.erp = response.data;
  673. if(response.data.orders!=null&&response.data.orders.length==1){
  674. this.erpOrder=response.data.orders[0]
  675. }
  676. });
  677. },
  678. editTuiMoney1(){
  679. var that=this;
  680. this.$confirm('是否解冻此订单推广佣金吗?', "警告", {
  681. confirmButtonText: "确定",
  682. cancelButtonText: "取消",
  683. type: "warning"
  684. }).then(function() {
  685. var data=that.item.orderId;
  686. return editTuiMoney(data);
  687. }).then(() => {
  688. this.msgSuccess("操作成功");
  689. getLiveOrder(this.item.orderId).then(response => {
  690. this.item=response.data
  691. that.getlogList(this.item.orderId);
  692. that.$parent.$parent.getList();
  693. });
  694. }).catch(function() {});
  695. },
  696. editTuiMoney2(){
  697. var that=this;
  698. this.$confirm('是否冻结此订单推广佣金吗?', "警告", {
  699. confirmButtonText: "确定",
  700. cancelButtonText: "取消",
  701. type: "warning"
  702. }).then(function() {
  703. var data=that.item.orderId;
  704. return editTuiMoney(data);
  705. }).then(() => {
  706. this.msgSuccess("操作成功");
  707. getLiveOrder(this.item.orderId).then(response => {
  708. this.item=response.data
  709. that.getlogList(this.item.orderId);
  710. that.$parent.$parent.getList();
  711. });
  712. }).catch(function() {});
  713. },
  714. returnCost(){
  715. var that=this;
  716. this.$confirm('是否退还此订单成本吗?', "警告", {
  717. confirmButtonText: "确定",
  718. cancelButtonText: "取消",
  719. type: "warning"
  720. }).then(function() {
  721. var data=that.item.orderId;
  722. return returnCost(data);
  723. }).then(() => {
  724. this.msgSuccess("操作成功");
  725. this.getDetails(this.item.orderId,null,null)
  726. }).catch(function() {});
  727. },
  728. moneyCancel(){
  729. this.money=null;
  730. this.moneyVisible=false;
  731. },
  732. refund(){
  733. var that=this;
  734. this.$confirm('是否确认申请退款?', "警告", {
  735. confirmButtonText: "确定",
  736. cancelButtonText: "取消",
  737. type: "warning"
  738. }).then(function() {
  739. var data={
  740. orderId:that.item.orderId
  741. }
  742. return refundOrderMoney(data);
  743. }).then(() => {
  744. this.msgSuccess("操作成功");
  745. getLiveOrder(this.item.orderId).then(response => {
  746. this.item = response.data;
  747. // this.getlogList(this.item.orderId);
  748. this.$parent.$parent.getList();
  749. });
  750. }).catch(function() {});
  751. },
  752. finishOrder(){
  753. var that=this;
  754. this.$confirm('是否确认客户已收货?', "警告", {
  755. confirmButtonText: "确定",
  756. cancelButtonText: "取消",
  757. type: "warning"
  758. }).then(function() {
  759. var data={
  760. orderId:that.item.orderId
  761. }
  762. return finishOrder(data);
  763. }).then(() => {
  764. this.msgSuccess("操作成功");
  765. getLiveOrder(this.item.orderId).then(response => {
  766. this.item = response.data;
  767. this.getlistOrderitem(this.item.orderId);
  768. this.$parent.$parent.getList();
  769. });
  770. }).catch(function() {});
  771. },
  772. syncExpress(){
  773. var that=this;
  774. this.$confirm('确定同步物流状态吗', "警告", {
  775. confirmButtonText: "确定",
  776. cancelButtonText: "取消",
  777. type: "warning"
  778. }).then(function() {
  779. var data=that.item.orderId
  780. return syncExpress(data);
  781. }).then(() => {
  782. this.msgSuccess("操作成功");
  783. this.expressDialog.open=false
  784. getLiveOrder(this.item.orderId).then(response => {
  785. this.item=response.data
  786. that.getlogList(this.item.orderId);
  787. that.$parent.$parent.getList();
  788. });
  789. }).catch(function() {});
  790. },
  791. getInquiryOrder(){
  792. this.show.open=true;
  793. setTimeout(() => {
  794. this.$refs.Details.getDetails(this.item.inquiryOrderId);
  795. }, 1);
  796. },
  797. getPackageOrder(){
  798. this.pack.open=true;
  799. console.log(this.item.packageOrderId)
  800. setTimeout(() => {
  801. this.$refs.packDetails.getDetails(this.item.packageOrderId);
  802. }, 1);
  803. },
  804. tuiOrder(){
  805. var that=this;
  806. this.$confirm('是否确认推送订单?', "警告", {
  807. confirmButtonText: "确定",
  808. cancelButtonText: "取消",
  809. type: "warning"
  810. }).then(function() {
  811. var data={
  812. orderId:that.item.orderId
  813. }
  814. return tuiOrder(data);
  815. }).then(() => {
  816. this.msgSuccess("操作成功");
  817. getLiveOrder(this.item.orderId).then(response => {
  818. this.item = response.data;
  819. this.getlogList(this.item.orderId);
  820. this.$parent.$parent.getList();
  821. });
  822. }).catch(function() {});
  823. },
  824. getDetails(orderId,nickName,storeName) {
  825. this.nickName=nickName;
  826. this.storeName=storeName;
  827. this.item=null;
  828. this.tuiMoneyLogs=null;
  829. getLiveOrder(orderId).then(response => {
  830. this.item = response.data;
  831. this.tuiMoneyLogs = response.tuiMoneyLogs;
  832. // this.getlogList(orderId);
  833. // this.getPayment(orderId);
  834. this.msgForm.userId=response.data.userId;
  835. this.msgForm.followDoctorId=response.data.followDoctorId;
  836. this.getlistOrderitem(this.item.orderId);
  837. getOrderExpress(orderId).then(response => {
  838. this.deliverList = response.data;
  839. console.log(this.deliverList)
  840. });
  841. getOrderPayments(this.item.orderId).then(response => {
  842. this.payments = response.payments;
  843. });
  844. getOrderLog(this.item.orderId).then(response => {
  845. this.logs = response.logs
  846. });
  847. });
  848. },
  849. getOrder(){
  850. getLiveOrder(this.item.orderId).then(response => {
  851. this.item = response.data;
  852. this.getlistOrderitem(this.item.orderId);
  853. });
  854. },
  855. submitEditDyForm(){
  856. this.$refs["editDyForm"].validate(valid => {
  857. if (valid) {
  858. editDeliveryId({orderId: this.editDyForm.orderId,
  859. deliverSn: this.editDyForm.deliveryCode,
  860. deliverId: this.editDyForm.deliverySn,type: 1}).then(response => {
  861. if (response.code === 200) {
  862. this.msgSuccess("操作成功");
  863. this.editDy.open = false;
  864. getLiveOrder(this.item.orderId).then(response => {
  865. this.item = response.data;
  866. this.$parent.$parent.getList();
  867. });
  868. }
  869. })
  870. }
  871. });
  872. },
  873. getlistOrderitem(orderId){
  874. this.prod = null
  875. this.showProd=[]
  876. this.showList = true
  877. listOrderitem(orderId).then(response => {
  878. this.prod = response.rows;
  879. if (this.prod.length > 0) {
  880. this.showProd=[this.prod[0]];
  881. }
  882. });
  883. },
  884. // getlogList(orderId){
  885. // logList(orderId).then(response => {
  886. // this.logs = response.rows;
  887. // });
  888. // },
  889. // getPayment(orderId){
  890. // payment(orderId).then(response => {
  891. // console.log(response)
  892. // this.pay = response.data;
  893. // });
  894. // }
  895. }
  896. }
  897. </script>
  898. <style scoped>
  899. .content{
  900. height: 100%;
  901. background-color: #fff;
  902. padding: 0px 20px;
  903. }
  904. .contentx{
  905. height: 100%;
  906. background-color: #fff;
  907. padding: 0px 20px 20px;
  908. margin: 20px;
  909. }
  910. .el-descriptions-item__label.is-bordered-label{
  911. font-weight: normal;
  912. }
  913. .el-descriptions-item__content {
  914. max-width: 150px;
  915. min-width: 100px;
  916. }
  917. .desct{
  918. padding-top: 20px;
  919. padding-bottom: 20px;
  920. color: #524b4a;
  921. font-weight: bold;
  922. }
  923. .order-content{
  924. margin: 10px;
  925. }
  926. .operate-container {
  927. background: #F2F6FC;
  928. height: 60px;
  929. margin: -20px -20px 0;
  930. line-height: 60px;
  931. }
  932. .operate-button-container {
  933. float: right;
  934. margin-right: 20px
  935. }
  936. </style>
  937. <style scoped>
  938. .chat-records {
  939. overflow-y: auto;
  940. }
  941. .timestamp {
  942. font-size: 12px;
  943. color: #A9A9A9;
  944. }
  945. .chat-record {
  946. margin: 10px;
  947. flex-direction: column;
  948. align-items: flex-start;
  949. }
  950. .sent {
  951. background-color: #fbfdff;
  952. color: #000839;
  953. }
  954. .sent .timestamp {
  955. float: right;
  956. }
  957. .right{
  958. float: right;
  959. }
  960. .received {
  961. background-color: #fbfdff;
  962. color: #000000;
  963. }
  964. .el-descriptions-item__content {
  965. max-width: 150px;
  966. min-width: 100px;
  967. }
  968. .order-content{
  969. margin: 10px;
  970. }
  971. .operate-container {
  972. background: #F2F6FC;
  973. height: 60px;
  974. margin: -20px -20px 0;
  975. line-height: 60px;
  976. }
  977. .operate-button-container {
  978. float: right;
  979. margin-right: 20px
  980. }
  981. </style>