liveOrderDetails.vue 34 KB

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