storeOrderDetails.vue 58 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449
  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 == '待推送'"
  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 {
  490. getMsgFollow,
  491. sendMsg,
  492. msgList,
  493. updateMoney,
  494. getGoods,
  495. getEroOrder,
  496. editTuiMoney,
  497. updateDelivery,
  498. createErpOrder,
  499. updateExpress,
  500. updateErp,
  501. afterSales,
  502. sendgoods,
  503. logList,
  504. listOrder,
  505. getExpress,
  506. syncExpress,
  507. listOrderitem,
  508. getOrder,
  509. delOrder,
  510. addOrder,
  511. updateStoreOrder,
  512. exportOrder,
  513. payment,
  514. tuiOrder,
  515. getPrescribe,
  516. getOrderUserPhone,
  517. returnCost,
  518. updateAddressErpFsStoreOrder
  519. } from "@/api/his/storeOrder";
  520. import inquiryOrderDetails from '../his/inquiryOrderDetails.vue';
  521. import packageOrderDetails from '../his/packageOrderDetails2.vue';
  522. import prescribeDetails from '../his/prescribeDetails.vue';
  523. import msgDetails from '../../components/his/followMsgDetails.vue';
  524. import { getTcmScheduleList } from "@/api/company/schedule";
  525. import {getCitys} from "@/api/store/city";
  526. export default {
  527. name: "orderDe",
  528. props:["data"],
  529. components: { inquiryOrderDetails,packageOrderDetails,prescribeDetails ,msgDetails},
  530. data() {
  531. return {
  532. isUpdateRefund:0, //是否支持修改退款金额 默认0不支持
  533. isUpdatePayRemain:0, //是否支持修改物流代收金额 默认0不支持
  534. refundShowProd:[],//原退款明细
  535. refundForm:{
  536. refundAmount:0
  537. },
  538. selectedRows:[],
  539. refundDialog:{
  540. title:"申请退款",
  541. open:false,
  542. },
  543. payRemain: 0, // 物流代收金额,可改
  544. payMoney: 0, // 实收金额,固定
  545. expressDialog:{
  546. title:"物流信息",
  547. open:false,
  548. },
  549. editDy:{
  550. title:"修改物流单号",
  551. open:false,
  552. },
  553. sourceOptions:[],
  554. prescribeDialog:{
  555. title:"处方单",
  556. open:false,
  557. },
  558. followDialogVisible:false,
  559. dialogVisible:false,
  560. total: 0,
  561. msgForm:{
  562. pageNum: 1,
  563. pageSize: 10,
  564. userId:null,
  565. followDoctorId:null,
  566. },
  567. editDyForm:{
  568. orderId:null,
  569. deliveryId:null,
  570. deliveryCode:null,
  571. deliverySn: null
  572. },
  573. showList:true,
  574. edit:{
  575. title:"修改订单",
  576. open:false,
  577. },
  578. erpDialog:{
  579. title:"ERP订单信息",
  580. open:false,
  581. },
  582. show:{
  583. title:"问诊详情",
  584. open:false,
  585. },
  586. pack:{
  587. title:"套餐包",
  588. open:false,
  589. },
  590. followList:[],
  591. counts:null,
  592. recipeType:null,
  593. money:null,
  594. moneyVisible:false,
  595. rules:{},
  596. sendVisible:false,
  597. logs:[],
  598. pay:[],
  599. nickName:null,
  600. storeName:null,
  601. PayOptions:[],
  602. orderOptions:[],
  603. payStatusOptions:[],
  604. express:null,
  605. traces:[],
  606. msg:[],
  607. sexOptions:[],
  608. refundOptions:[],
  609. channelOptions:[],
  610. qwSubjectOptions:[],
  611. tuiOptions:[],
  612. orOptions:[],
  613. storeOPtions:[],
  614. deliveryStatusOptions:[],
  615. deliveryPayStatusOptions:[],
  616. deliveryTypeOptions:[],
  617. orderTypeOptions:[],
  618. orderBuyTypeOptions:[],
  619. scheduleOptions:[],
  620. item:null,
  621. tuiMoneyLogs:[],
  622. erpOrder:null,
  623. prod:null,
  624. showProd:null,
  625. editForm:{
  626. orderId:null,
  627. status:null,
  628. userAddress:null,
  629. deliveryStatus:null,
  630. deliveryType:null,
  631. userPhone:null,
  632. remark:"",
  633. payRemain:null,
  634. payPrice:null
  635. },
  636. editDyRules:{
  637. deliverySn: [
  638. { required: true, message: "物流单号不能为空", trigger: "blur" }
  639. ],
  640. deliveryCode: [
  641. { required: true, message: "物流公司不能为空", trigger: "blur" }
  642. ],
  643. },
  644. editRules:{
  645. userAddress: [
  646. { required: true, message: "收货地址不能为空", trigger: "blur" }
  647. ],
  648. },
  649. mrules:{
  650. },
  651. form: {
  652. deliveryCode: null,
  653. deliveryName:null,
  654. deliverySn:null,
  655. orderId:null,
  656. },
  657. cityIds:[],
  658. citys:[],
  659. userAddress:null,
  660. }
  661. },
  662. created() {
  663. getTcmScheduleList().then(response => {
  664. this.scheduleOptions = response.data;
  665. });
  666. this.getDicts("sys_store_pay_type").then(response => {
  667. this.PayOptions = response.data;
  668. });
  669. this.getDicts("sys_order_status").then(response => {
  670. this.orderOptions = response.data;
  671. });
  672. this.getDicts("sys_order_pay").then(response => {
  673. this.payStatusOptions = response.data;
  674. });
  675. this.getDicts("sys_order_source").then(response => {
  676. this.sourceOptions = response.data;
  677. });
  678. this.getDicts("sys_store_order_type").then(response => {
  679. this.orderTypeOptions = response.data;
  680. });
  681. this.getDicts("sys_store_order_buy_type").then(response => {
  682. this.orderBuyTypeOptions = response.data;
  683. });
  684. this.getDicts("sys_refund_status").then(response => {
  685. this.refundOptions = response.data;
  686. });
  687. this.getDicts("sys_store_channel").then(response => {
  688. this.channelOptions = response.data;
  689. });
  690. this.getDicts("sys_store_qw_subject").then(response => {
  691. this.qwSubjectOptions = response.data;
  692. });
  693. this.getDicts("sys_tui_money_status").then(response => {
  694. this.tuiOptions = response.data;
  695. });
  696. this.getDicts("sys_company_or").then(response => {
  697. this.orOptions = response.data;
  698. });
  699. this.getDicts("sys_patient_sex").then(response => {
  700. this.sexOptions = response.data;
  701. });
  702. this.getDicts("sys_store_delivery_pay_status").then(response => {
  703. this.deliveryPayStatusOptions = response.data;
  704. });
  705. this.getDicts("sys_store_order_delivery_status").then(response => {
  706. this.deliveryStatusOptions = response.data;
  707. });
  708. this.getDicts("sys_delivery_type").then(response => {
  709. this.deliveryTypeOptions = response.data;
  710. });
  711. },
  712. computed: {
  713. // 应收金额 = 实收金额 + 代收金额
  714. payPrice() {
  715. const v = (this.payMoney * 100 + this.payRemain * 100) / 100;
  716. return Number(v.toFixed(2));
  717. }
  718. },
  719. methods: {
  720. updateRefund(row) {
  721. // 默认退款金额 = 数量 × 单价
  722. row.refundAmount = (row.num * row.money).toFixed(2);
  723. },
  724. handleSelectionChange(val) {
  725. this.refundForm.refundAmount = val
  726. .reduce((sum, row) => sum + row.num * row.money, 0)
  727. ;
  728. this.selectedRows = val;
  729. },
  730. getCitys() {
  731. return getCitys().then(res => {
  732. this.citys = res.data || [];
  733. return this.citys;
  734. });
  735. },
  736. // 新增:切换省市区
  737. handleCityChange(val) {
  738. this.cityIds = Array.isArray(val) ? val : [];
  739. },
  740. // 新增:根据已选的 cityIds 从 citys 中获取对应的 label 数组 [省, 市, 区]
  741. getCityLabelsByIds() {
  742. if (!this.cityIds || this.cityIds.length === 0) return [];
  743. const [pVal, cVal, aVal] = this.cityIds;
  744. const p = this.citys.find(p => p.value === pVal);
  745. const c = p?.children?.find(c => c.value === cVal);
  746. const a = c?.children?.find(a => a.value === aVal);
  747. return [p?.label, c?.label, a?.label].filter(Boolean);
  748. },
  749. // 新增:拼装完整地址 = 省 市 区 + 详细地址
  750. buildFullAddress() {
  751. const region = this.getCityLabelsByIds().join(' ');
  752. const detail = (this.editForm.userAddress || '').trim();
  753. console.log(region)
  754. console.log(detail)
  755. return region && detail ? `${region} ${detail}` : (region || detail || '');
  756. },
  757. followMsg(row){
  758. const userId = this.item.userId;
  759. const followDoctorId =this.item.followDoctorId;
  760. const doctorName = this.item.doctorName;
  761. const patientName = this.item.patientName;
  762. setTimeout(() => {
  763. this.$refs.msgDetails.getDetails(userId,followDoctorId,doctorName,patientName);
  764. }, 500);
  765. this.dialogVisible = true;
  766. },
  767. msgDialogClose(){
  768. this.dialogVisible = false;
  769. },
  770. getPrescribeOrder(){
  771. this.prescribeDialog.open=true;
  772. setTimeout(() => {
  773. this.$refs.prescribeDetails.getDetails(this.item.prescribeId);
  774. }, 1);
  775. },
  776. handlePhone(){
  777. const orderId = this.item.orderId;
  778. return getOrderUserPhone(orderId).then(response =>{
  779. this.item.userPhone = response.userPhone;
  780. })
  781. },
  782. editDelivery(){
  783. this.editDy.open = true;
  784. console.log(this.item)
  785. this.editDyForm.orderId = this.item.orderId;
  786. this.editDyForm.deliveryId = this.item.deliveryId;
  787. this.editDyForm.deliveryCode = this.item.deliveryCode;
  788. this.editDyForm.deliverySn = this.item.deliverySn;
  789. },
  790. showListD(){
  791. if(this.showList){
  792. this.showProd=this.prod
  793. }else{
  794. this.showProd=[this.prod[0]]
  795. }
  796. this.showList=this.showList?false:true;
  797. },
  798. showExpress(){
  799. this.expressDialog.open=true;
  800. getExpress(this.item.orderId).then(response => {
  801. this.express = response.data;
  802. if(this.express!=null&&this.express.Traces!=null){
  803. this.traces=this.express.Traces
  804. } else {
  805. this.traces = []
  806. }
  807. });
  808. },
  809. updateErpOrder(){
  810. var that=this;
  811. this.$confirm('确定同步物流单号信息吗', "警告", {
  812. confirmButtonText: "确定",
  813. cancelButtonText: "取消",
  814. type: "warning"
  815. }).then(function() {
  816. var data={orderId:that.item.orderId}
  817. return updateErp(data);
  818. }).then(() => {
  819. this.msgSuccess("操作成功");
  820. getOrder(this.item.orderId).then(response => {
  821. this.item=response.data
  822. that.getlogList(this.item.orderId);
  823. that.$parent.$parent.getList();
  824. });
  825. this.editDy.open = false
  826. }).catch(function() {});
  827. },
  828. sendFollowMsg(){
  829. var that=this;
  830. this.$confirm('是否确认发送消息?', "警告", {
  831. confirmButtonText: "确定",
  832. cancelButtonText: "取消",
  833. type: "warning"
  834. }).then(function() {
  835. return sendMsg(that.item.orderId);
  836. }).then(() => {
  837. this.msgSuccess("操作成功");
  838. }).catch(function() {});
  839. },
  840. handleClose1(){
  841. this.dialogVisible=false;
  842. },
  843. handleClose2(){
  844. this.followDialogVisible=false;
  845. },
  846. follow(row){
  847. getMsgFollow(row).then(response => {
  848. if(response.data.formJson!=null&&response.data.formJson!=''&&response.data.writeStatus==1){
  849. this.messageFollowList=JSON.parse(response.data.formJson );
  850. this.followDialogVisible=true;
  851. }else{
  852. this.$message({
  853. message: '未填写随访单',
  854. type: 'info'
  855. });
  856. return
  857. }
  858. });
  859. },
  860. // 修改订单状态
  861. submitEditForm() {
  862. this.$refs["editForm"].validate(valid => {
  863. if (!valid) return;
  864. // 提交前拼接完整地址
  865. const payload = {
  866. ...this.editForm,
  867. userAddress: this.buildFullAddress(),
  868. payRemain :this.payRemain,
  869. payPrice: this.payPrice,
  870. };
  871. updateAddressErpFsStoreOrder(payload).then(response => {
  872. if (response.code === 200) {
  873. this.msgSuccess("操作成功");
  874. this.edit.open = false;
  875. getOrder(this.item.orderId).then(response => {
  876. this.item = response.data;
  877. this.getlogList(this.item.orderId);
  878. this.$parent.$parent.getList();
  879. });
  880. }
  881. }).finally(()=>{
  882. this.editDyForm.deliveryCode = null;
  883. this.editDyForm.orderId = null;
  884. this.editDyForm.deliveryId = null;
  885. });
  886. });
  887. },
  888. editOrder() {
  889. this.handlePhone().then((res)=>{
  890. this.edit.open = true;
  891. this.editForm.orderId = this.item.orderId;
  892. this.editForm.remark = this.item.remark;
  893. // 先设置其他同步的字段
  894. this.editForm.userPhone = this.item.userPhone != null ? this.item.userPhone.toString() : "";
  895. this.editForm.status = this.item.status != null ? this.item.status.toString() : "";
  896. this.editForm.deliveryType = this.item.deliveryType;
  897. this.editForm.deliveryStatus = this.item.deliveryStatus;
  898. this.payMoney= this.item.payMoney;
  899. this.payRemain = this.item.payRemain;
  900. this.payPrice= this.item.payPrice;
  901. // 等城市数据加载后再解析地址
  902. const currentAddress = (this.item.userAddress || "").toString().trim();
  903. this.getCitys().then(() => {
  904. if (!currentAddress) {
  905. this.cityIds = [];
  906. this.editForm.userAddress = "";
  907. return;
  908. }
  909. // 假设格式为:省 市 区 详细地址(空格分隔)
  910. const parts = currentAddress.split(/\s+/);
  911. const detail = parts.pop() || ""; // 最后一段作为详细地址
  912. const provLabel = parts[0];
  913. const cityLabel = parts[1];
  914. const areaLabel = parts[2];
  915. const province = this.citys.find(p => p.label === provLabel);
  916. const city = province?.children?.find(c => c.label === cityLabel);
  917. const area = city?.children?.find(a => a.label === areaLabel);
  918. if (province && city && area) {
  919. this.cityIds = [province.value, city.value, area.value];
  920. } else {
  921. console.warn("未匹配到完整省市区:", { provLabel, cityLabel, areaLabel });
  922. this.cityIds = [];
  923. }
  924. // 把详细地址写回到输入框(只保留详细地址,不含省市区)
  925. this.editForm.userAddress = detail;
  926. });
  927. })
  928. },
  929. updateExpress(){
  930. var that=this;
  931. this.$confirm('定同步物流信息吗,同步后将自动发货?', "警告", {
  932. confirmButtonText: "确定",
  933. cancelButtonText: "取消",
  934. type: "warning"
  935. }).then(function() {
  936. var data=that.item.orderId
  937. return updateExpress(data);
  938. }).then(() => {
  939. this.msgSuccess("操作成功");
  940. getOrder(this.item.orderId).then(response => {
  941. this.item=response.data
  942. that.getlogList(this.item.orderId);
  943. that.$parent.$parent.getList();
  944. });
  945. }).catch(function() {});
  946. },
  947. addErpOrder(){
  948. var that=this;
  949. this.$confirm('是否确认推送管易?', "警告", {
  950. confirmButtonText: "确定",
  951. cancelButtonText: "取消",
  952. type: "warning"
  953. }).then(function() {
  954. var data=that.item.orderId
  955. return createErpOrder(data);
  956. }).then(() => {
  957. this.msgSuccess("操作成功");
  958. getOrder(this.item.orderId).then(response => {
  959. this.item=response.data
  960. that.getlogList(this.item.orderId);
  961. that.$parent.$parent.getList();
  962. });
  963. }).catch(function() {});
  964. },
  965. showErpOrder(){
  966. this.erpDialog.open=true;
  967. var data=this.item.extendOrderId;
  968. getEroOrder(data).then(response => {
  969. this.erp = response.data;
  970. if(response.data.orders!=null&&response.data.orders.length==1){
  971. this.erpOrder=response.data.orders[0]
  972. }
  973. });
  974. },
  975. editTuiMoney1(){
  976. var that=this;
  977. this.$confirm('是否解冻此订单推广佣金吗?', "警告", {
  978. confirmButtonText: "确定",
  979. cancelButtonText: "取消",
  980. type: "warning"
  981. }).then(function() {
  982. var data=that.item.orderId;
  983. return editTuiMoney(data);
  984. }).then(() => {
  985. this.msgSuccess("操作成功");
  986. getOrder(this.item.orderId).then(response => {
  987. this.item=response.data
  988. that.getlogList(this.item.orderId);
  989. that.$parent.$parent.getList();
  990. });
  991. }).catch(function() {});
  992. },
  993. editTuiMoney2(){
  994. var that=this;
  995. this.$confirm('是否冻结此订单推广佣金吗?', "警告", {
  996. confirmButtonText: "确定",
  997. cancelButtonText: "取消",
  998. type: "warning"
  999. }).then(function() {
  1000. var data=that.item.orderId;
  1001. return editTuiMoney(data);
  1002. }).then(() => {
  1003. this.msgSuccess("操作成功");
  1004. getOrder(this.item.orderId).then(response => {
  1005. this.item=response.data
  1006. that.getlogList(this.item.orderId);
  1007. that.$parent.$parent.getList();
  1008. });
  1009. }).catch(function() {});
  1010. },
  1011. returnCost(){
  1012. var that=this;
  1013. this.$confirm('是否退还此订单成本吗?', "警告", {
  1014. confirmButtonText: "确定",
  1015. cancelButtonText: "取消",
  1016. type: "warning"
  1017. }).then(function() {
  1018. var data=that.item.orderId;
  1019. return returnCost(data);
  1020. }).then(() => {
  1021. this.msgSuccess("操作成功");
  1022. this.getDetails(this.item.orderId,null,null)
  1023. }).catch(function() {});
  1024. },
  1025. moneyCancel(){
  1026. this.money=null;
  1027. this.moneyVisible=false;
  1028. },
  1029. chooseRefund(){
  1030. if(this.isUpdateRefund == 1){
  1031. this.refundShowProd = this.showProd.map(item => {
  1032. const info = JSON.parse(item.jsonInfo);
  1033. return {
  1034. ...item,
  1035. originNum: item.num, // 原始购买数量
  1036. num: item.num, // 可编辑的退款数量
  1037. price: info.price,
  1038. money: 0.00,
  1039. // refundAmount: (item.num * info.price).toFixed(2),
  1040. refundAmount: 0,
  1041. jsonInfo: item.jsonInfo
  1042. }
  1043. })
  1044. this.refundForm.refundAmount = 0
  1045. this.refundDialog.open = true
  1046. // this.$nextTick(() => {
  1047. // // 默认全选表格
  1048. // this.$refs.refundTable.toggleAllSelection();
  1049. // });
  1050. this.$alert('请先设置退款单价和退款数量,再选择商品', '提示');
  1051. } else {
  1052. this.refund(); //正常退款
  1053. }
  1054. },
  1055. submitRefundForm(){
  1056. if(this.refundForm.refundAmount<=0){
  1057. return this.$message("退款金额不能为0");
  1058. }
  1059. if(this.refundForm.refundAmount>this.item.payMoney){
  1060. return this.$message("退款金额不能大于实付金额" + this.item.payMoney + "元");
  1061. }
  1062. if(this.selectedRows.length==0){
  1063. return this.$message("请选择退款商品");
  1064. }
  1065. const refundList = this.selectedRows.map(row => ({
  1066. itemId: row.itemId,
  1067. num: row.num,
  1068. money:row.money
  1069. }))
  1070. const param = {
  1071. orderId:this.item.orderId,
  1072. refundList:refundList,
  1073. refundAmount:this.refundForm.refundAmount
  1074. }
  1075. console.log("申请退款数据", param);
  1076. this.$confirm('是否确认申请退款?', "警告", {
  1077. confirmButtonText: "确定",
  1078. cancelButtonText: "取消",
  1079. type: "warning"
  1080. }).then(function() {
  1081. return afterSales(param);
  1082. }).then(() => {
  1083. this.msgSuccess("操作成功");
  1084. getOrder(this.item.orderId).then(response => {
  1085. this.item = response.data;
  1086. this.getlogList(this.item.orderId);
  1087. this.$parent.$parent.getList();
  1088. this.refundDialog.open = false
  1089. });
  1090. }).catch(function() {});
  1091. },
  1092. refund(){
  1093. var that=this;
  1094. this.$confirm('是否确认申请退款?', "警告", {
  1095. confirmButtonText: "确定",
  1096. cancelButtonText: "取消",
  1097. type: "warning"
  1098. }).then(function() {
  1099. var data={
  1100. orderId:that.item.orderId
  1101. }
  1102. return afterSales(data);
  1103. }).then(() => {
  1104. this.msgSuccess("操作成功");
  1105. getOrder(this.item.orderId).then(response => {
  1106. this.item = response.data;
  1107. this.getlogList(this.item.orderId);
  1108. this.$parent.$parent.getList();
  1109. });
  1110. }).catch(function() {});
  1111. },
  1112. finishOrder(){
  1113. var that=this;
  1114. this.$confirm('是否确认客户已收货?', "警告", {
  1115. confirmButtonText: "确定",
  1116. cancelButtonText: "取消",
  1117. type: "warning"
  1118. }).then(function() {
  1119. var data={
  1120. orderId:that.item.orderId
  1121. }
  1122. return getGoods(data);
  1123. }).then(() => {
  1124. this.msgSuccess("操作成功");
  1125. getOrder(this.item.orderId).then(response => {
  1126. this.item = response.data;
  1127. this.getlistOrderitem(this.item.orderId);
  1128. this.getlogList(this.item.orderId);
  1129. this.$parent.$parent.getList();
  1130. });
  1131. }).catch(function() {});
  1132. },
  1133. syncExpress(){
  1134. var that=this;
  1135. this.$confirm('确定同步物流状态吗', "警告", {
  1136. confirmButtonText: "确定",
  1137. cancelButtonText: "取消",
  1138. type: "warning"
  1139. }).then(function() {
  1140. var data=that.item.orderId
  1141. return syncExpress(data);
  1142. }).then(() => {
  1143. this.msgSuccess("操作成功");
  1144. this.expressDialog.open=false
  1145. getOrder(this.item.orderId).then(response => {
  1146. this.item=response.data
  1147. that.getlogList(this.item.orderId);
  1148. that.$parent.$parent.getList();
  1149. });
  1150. }).catch(function() {});
  1151. },
  1152. getInquiryOrder(){
  1153. this.show.open=true;
  1154. setTimeout(() => {
  1155. this.$refs.Details.getDetails(this.item.inquiryOrderId);
  1156. }, 1);
  1157. },
  1158. getPackageOrder(){
  1159. this.pack.open=true;
  1160. console.log(this.item.packageOrderId)
  1161. setTimeout(() => {
  1162. this.$refs.packDetails.getDetails(this.item.packageOrderId);
  1163. }, 1);
  1164. },
  1165. tuiOrder(){
  1166. var that=this;
  1167. this.$confirm('是否确认推送到智慧药房?', "警告", {
  1168. confirmButtonText: "确定",
  1169. cancelButtonText: "取消",
  1170. type: "warning"
  1171. }).then(function() {
  1172. var data={
  1173. orderId:that.item.orderId
  1174. }
  1175. return tuiOrder(data);
  1176. }).then(() => {
  1177. this.msgSuccess("操作成功");
  1178. getOrder(this.item.orderId).then(response => {
  1179. this.item = response.data;
  1180. this.getlogList(this.item.orderId);
  1181. this.$parent.$parent.getList();
  1182. });
  1183. }).catch(function() {});
  1184. },
  1185. sendCancel(){
  1186. this.sendVisible = false;
  1187. this.form={
  1188. deliveryCode: null,
  1189. deliveryName:null,
  1190. deliverySn:null,
  1191. orderId:null,
  1192. }
  1193. },
  1194. sendGoods(){
  1195. this.form.orderId=this.item.orderId;
  1196. sendgoods(this.form).then(response => {
  1197. this.msgSuccess("修改成功");
  1198. this.sendVisible = false;
  1199. getOrder(this.item.orderId).then(response => {
  1200. this.item = response.data;
  1201. this.getlogList(this.item.orderId);
  1202. this.$parent.$parent.getList();
  1203. });
  1204. this.form={
  1205. deliveryCode: null,
  1206. deliveryName:null,
  1207. deliverySn:null,
  1208. orderId:null,
  1209. }
  1210. });
  1211. },
  1212. getDetails(orderId,nickName,storeName) {
  1213. this.nickName=nickName;
  1214. this.storeName=storeName;
  1215. this.item=null;
  1216. this.tuiMoneyLogs=null;
  1217. getOrder(orderId).then(response => {
  1218. this.item = response.data;
  1219. this.tuiMoneyLogs = response.tuiMoneyLogs;
  1220. this.getlistOrderitem(orderId);
  1221. this.getlogList(orderId);
  1222. this.getPayment(orderId);
  1223. this.msgForm.userId=response.data.userId;
  1224. this.msgForm.followDoctorId=response.data.followDoctorId;
  1225. if(this.item.orderType==2){
  1226. this.getCount(this.item.prescribeId);
  1227. }
  1228. this.isUpdateRefund = response.isUpdateRefund;
  1229. this.isUpdatePayRemain = response.isUpdatePayRemain
  1230. });
  1231. },
  1232. getCount(id){
  1233. getPrescribe(id).then(response => {
  1234. this.recipeType = response.data.recipeType;
  1235. this.counts = JSON.parse(response.data.usageJson).counts
  1236. });
  1237. },
  1238. getOrder(){
  1239. getOrder(this.item.orderId).then(response => {
  1240. this.item = response.data;
  1241. this.getlistOrderitem(this.item.orderId);
  1242. this.getlogList(this.item.orderId);
  1243. this.getPayment(this.item.orderId);
  1244. if(this.item.orderType==2){
  1245. this.getCount(this.item.prescribeId);
  1246. }
  1247. });
  1248. },
  1249. submitEditDyForm(){
  1250. this.$refs["editDyForm"].validate(valid => {
  1251. if (valid) {
  1252. console.log(this.editDyForm)
  1253. updateDelivery(this.editDyForm).then(response => {
  1254. if (response.code === 200) {
  1255. this.msgSuccess("操作成功");
  1256. this.editDy.open = false;
  1257. getOrder(this.item.orderId).then(response => {
  1258. this.item = response.data;
  1259. this.getlogList(this.item.orderId);
  1260. this.$parent.$parent.getList();
  1261. });
  1262. }
  1263. }).finally(()=>{
  1264. this.editDyForm.deliveryCode = null;
  1265. this.editDyForm.orderId = null;
  1266. this.editDyForm.deliveryId = null;
  1267. this.editDyForm.deliverySn = null;
  1268. })
  1269. }
  1270. });
  1271. },
  1272. getlistOrderitem(orderId){
  1273. listOrderitem(orderId).then(response => {
  1274. this.prod = response.rows;
  1275. this.showProd=[this.prod[0]]
  1276. });
  1277. },
  1278. getlogList(orderId){
  1279. logList(orderId).then(response => {
  1280. this.logs = response.rows;
  1281. });
  1282. },
  1283. getPayment(orderId){
  1284. payment(orderId).then(response => {
  1285. console.log(response)
  1286. this.pay = response.data;
  1287. });
  1288. }
  1289. }
  1290. }
  1291. </script>
  1292. <style>
  1293. .content{
  1294. height: 100%;
  1295. background-color: #fff;
  1296. padding: 0px 20px;
  1297. }
  1298. </style>
  1299. <style>
  1300. .contentx{
  1301. height: 100%;
  1302. background-color: #fff;
  1303. padding: 0px 20px 20px;
  1304. margin: 20px;
  1305. }
  1306. .el-descriptions-item__label.is-bordered-label{
  1307. font-weight: normal;
  1308. }
  1309. .el-descriptions-item__content {
  1310. max-width: 150px;
  1311. min-width: 100px;
  1312. }
  1313. .desct{
  1314. padding-top: 20px;
  1315. padding-bottom: 20px;
  1316. color: #524b4a;
  1317. font-weight: bold;
  1318. }
  1319. </style>
  1320. <style scoped>
  1321. .order-content{
  1322. margin: 10px;
  1323. }
  1324. .operate-container {
  1325. background: #F2F6FC;
  1326. height: 60px;
  1327. margin: -20px -20px 0;
  1328. line-height: 60px;
  1329. }
  1330. .operate-button-container {
  1331. float: right;
  1332. margin-right: 20px
  1333. }
  1334. </style>
  1335. <style scoped>
  1336. .chat-records {
  1337. overflow-y: auto;
  1338. }
  1339. .timestamp {
  1340. font-size: 12px;
  1341. color: #A9A9A9;
  1342. }
  1343. .chat-record {
  1344. margin: 10px;
  1345. flex-direction: column;
  1346. align-items: flex-start;
  1347. }
  1348. .sent {
  1349. background-color: #fbfdff;
  1350. color: #000839;
  1351. }
  1352. .sent .timestamp {
  1353. float: right;
  1354. }
  1355. .right{
  1356. float: right;
  1357. }
  1358. .received {
  1359. background-color: #fbfdff;
  1360. color: #000000;
  1361. }
  1362. .el-descriptions-item__content {
  1363. max-width: 150px;
  1364. min-width: 100px;
  1365. }
  1366. .order-content{
  1367. margin: 10px;
  1368. }
  1369. .operate-container {
  1370. background: #F2F6FC;
  1371. height: 60px;
  1372. margin: -20px -20px 0;
  1373. line-height: 60px;
  1374. }
  1375. .operate-button-container {
  1376. float: right;
  1377. margin-right: 20px
  1378. }
  1379. </style>