liveOrderDetails.vue 36 KB

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