storeOrderDetails.vue 58 KB

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