storeOrderDetails.vue 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233
  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="refund()" 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="ZTO" />
  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-option key="STO" label="申通" value="STO" />
  304. </el-select>
  305. </el-form-item>
  306. <el-form-item label="物流单号" prop="deliverySn" >
  307. <el-input v-model="editDyForm.deliverySn" placeholder="请输入物流单号" />
  308. </el-form-item>
  309. </el-form>
  310. <div slot="footer" class="dialog-footer">
  311. <el-button type="primary" @click="submitEditDyForm">确 定</el-button>
  312. <el-button @click="editDy.open = false">取 消</el-button>
  313. </div>
  314. </el-dialog>
  315. <el-dialog :title="erpDialog.title" :visible.sync="erpDialog.open" width="800px" append-to-body>
  316. <div v-if="item!=null&&item.extendOrderId!=null&&item.status==2" style="position: absolute; top: 50px;right: 20px;">
  317. <el-button size="mini" @click="updateExpress()" v-hasPermi="['his:storeOrder:updateExpress']" >同步物流发货</el-button>
  318. </div>
  319. <div class="table-layout" v-if="erpOrder!=null" >
  320. <el-descriptions direction="vertical" :column="3" border >
  321. <el-descriptions-item label="订单编号" > <span v-if="item!=null"> {{erpOrder.code}}</span></el-descriptions-item>
  322. <el-descriptions-item label="是否代收" ><span v-if="item!=null">{{erpOrder.cod?'是':'否'}}</span></el-descriptions-item>
  323. <el-descriptions-item label="快递编号" ><span v-if="item!=null">{{erpOrder.express_code}}</span></el-descriptions-item>
  324. <el-descriptions-item label="快递名称" ><span v-if="item!=null"> {{erpOrder.express_name}}</span></el-descriptions-item>
  325. <el-descriptions-item label="收货人" ><span v-if="item!=null">{{erpOrder.receiver_name}}</span></el-descriptions-item>
  326. <el-descriptions-item label="电话" ><span v-if="item!=null"> {{erpOrder.receiver_mobile}}</span></el-descriptions-item>
  327. <el-descriptions-item label="地址" ><span v-if="item!=null"> {{erpOrder.receiver_address}}</span></el-descriptions-item>
  328. <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>
  329. </el-descriptions>
  330. </div>
  331. </el-dialog>
  332. <el-dialog :title="edit.title" :visible.sync="edit.open" width="600px" append-to-body>
  333. <el-form ref="editForm" :model="editForm" :rules="editRules" label-width="100px">
  334. <el-form-item label="订单状态" prop="status" >
  335. <el-select v-model="editForm.status" placeholder="请选择状态" clearable size="small" filterable>
  336. <el-option
  337. v-for="dict in orderOptions "
  338. :key="dict.dictValue"
  339. :label="dict.dictLabel"
  340. :value="dict.dictValue"
  341. :disabled="dict.dictLabel == '待推送'"
  342. />
  343. </el-select>
  344. </el-form-item>
  345. <el-form-item label="物流状态" prop="deliveryStatus" >
  346. <el-select v-model="editForm.deliveryStatus" placeholder="请选择物流状态" clearable size="small" filterable>
  347. <el-option
  348. v-for="dict in deliveryStatusOptions "
  349. :key="dict.dictValue"
  350. :label="dict.dictLabel"
  351. :value="dict.dictValue"
  352. />
  353. </el-select>
  354. </el-form-item>
  355. <el-form-item label="物流跟踪状态" prop="deliveryType" >
  356. <el-select v-model="editForm.deliveryType" placeholder="请选择状态" clearable size="small" filterable>
  357. <el-option
  358. v-for="dict in deliveryTypeOptions "
  359. :key="dict.dictValue"
  360. :label="dict.dictLabel"
  361. :value="dict.dictValue"
  362. />
  363. </el-select>
  364. </el-form-item>
  365. <el-form-item label="详情地址" prop="userAddress" >
  366. <el-cascader
  367. ref="citySelect"
  368. v-model="cityIds"
  369. :options="citys"
  370. @change="handleCityChange"
  371. clearable>
  372. </el-cascader>
  373. <el-input v-model="editForm.userAddress" placeholder="请输入详细地址(不含省/市/区)" />
  374. </el-form-item>
  375. <el-form-item label="收货人电话" prop="userPhone" >
  376. <el-input v-model="editForm.userPhone" placeholder="请输入" />
  377. </el-form-item>
  378. <el-form-item label="备注" prop="remark" >
  379. <el-input v-model="editForm.remark" placeholder="请输入备注" />
  380. </el-form-item>
  381. </el-form>
  382. <div slot="footer" class="dialog-footer">
  383. <el-button type="primary" @click="submitEditForm">确 定</el-button>
  384. </div>
  385. </el-dialog>
  386. <el-drawer
  387. :with-header="false"
  388. :append-to-body="true"
  389. size="75%"
  390. :title="show.title" :visible.sync="show.open">
  391. <inquiryOrderDetails ref="Details" />
  392. </el-drawer>
  393. <el-drawer
  394. :with-header="false"
  395. :append-to-body="true"
  396. size="75%"
  397. :title="pack.title" :visible.sync="pack.open">
  398. <packageOrderDetails ref="packDetails" />
  399. </el-drawer>
  400. <el-dialog
  401. title="聊天记录"
  402. :visible.sync="dialogVisible"
  403. width="80%"
  404. :before-close="msgDialogClose" append-to-body >
  405. <msgDetails ref="msgDetails" :msgDialogClose="msgDialogClose" /><strong></strong>
  406. <span slot="footer" class="dialog-footer">
  407. <el-button @click="msgDialogClose">取 消</el-button>
  408. <el-button type="primary" @click="msgDialogClose">确 定</el-button>
  409. </span>
  410. </el-dialog>
  411. <el-drawer
  412. :with-header="false"
  413. :append-to-body="true"
  414. size="75%"
  415. :title="prescribeDialog.title" :visible.sync="prescribeDialog.open">
  416. <prescribeDetails ref="prescribeDetails" />
  417. </el-drawer>
  418. </div>
  419. </template>
  420. <script>
  421. 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";
  422. import inquiryOrderDetails from '../his/inquiryOrderDetails.vue';
  423. import packageOrderDetails from '../his/packageOrderDetails2.vue';
  424. import prescribeDetails from '../his/prescribeDetails.vue';
  425. import msgDetails from '../../components/his/followMsgDetails.vue';
  426. import { getTcmScheduleList } from "@/api/company/schedule";
  427. import {getCitys} from "@/api/store/city";
  428. export default {
  429. name: "orderDe",
  430. props:["data"],
  431. components: { inquiryOrderDetails,packageOrderDetails,prescribeDetails ,msgDetails},
  432. data() {
  433. return {
  434. expressDialog:{
  435. title:"物流信息",
  436. open:false,
  437. },
  438. editDy:{
  439. title:"修改物流单号",
  440. open:false,
  441. },
  442. sourceOptions:[],
  443. prescribeDialog:{
  444. title:"处方单",
  445. open:false,
  446. },
  447. followDialogVisible:false,
  448. dialogVisible:false,
  449. total: 0,
  450. msgForm:{
  451. pageNum: 1,
  452. pageSize: 10,
  453. userId:null,
  454. followDoctorId:null,
  455. },
  456. editDyForm:{
  457. orderId:null,
  458. deliveryId:null,
  459. deliveryCode:null,
  460. },
  461. showList:true,
  462. edit:{
  463. title:"修改订单",
  464. open:false,
  465. },
  466. erpDialog:{
  467. title:"ERP订单信息",
  468. open:false,
  469. },
  470. show:{
  471. title:"问诊详情",
  472. open:false,
  473. },
  474. pack:{
  475. title:"套餐包",
  476. open:false,
  477. },
  478. followList:[],
  479. counts:null,
  480. recipeType:null,
  481. money:null,
  482. moneyVisible:false,
  483. rules:{},
  484. sendVisible:false,
  485. logs:[],
  486. pay:[],
  487. nickName:null,
  488. storeName:null,
  489. PayOptions:[],
  490. orderOptions:[],
  491. payStatusOptions:[],
  492. express:null,
  493. traces:[],
  494. msg:[],
  495. sexOptions:[],
  496. refundOptions:[],
  497. channelOptions:[],
  498. qwSubjectOptions:[],
  499. tuiOptions:[],
  500. orOptions:[],
  501. storeOPtions:[],
  502. deliveryStatusOptions:[],
  503. deliveryPayStatusOptions:[],
  504. deliveryTypeOptions:[],
  505. orderTypeOptions:[],
  506. orderBuyTypeOptions:[],
  507. scheduleOptions:[],
  508. item:null,
  509. tuiMoneyLogs:[],
  510. erpOrder:null,
  511. prod:null,
  512. showProd:null,
  513. editForm:{
  514. orderId:null,
  515. status:null,
  516. userAddress:null,
  517. deliveryStatus:null,
  518. deliveryType:null,
  519. userPhone:null,
  520. remark:"",
  521. },
  522. editDyRules:{
  523. deliverySn: [
  524. { required: true, message: "物流单号不能为空", trigger: "blur" }
  525. ],
  526. deliveryCode: [
  527. { required: true, message: "物流公司不能为空", trigger: "blur" }
  528. ],
  529. },
  530. editRules:{
  531. userAddress: [
  532. { required: true, message: "收货地址不能为空", trigger: "blur" }
  533. ],
  534. },
  535. mrules:{
  536. },
  537. form: {
  538. deliveryCode: null,
  539. deliveryName:null,
  540. deliverySn:null,
  541. orderId:null,
  542. },
  543. cityIds:[],
  544. citys:[],
  545. userAddress:null,
  546. }
  547. },
  548. created() {
  549. getTcmScheduleList().then(response => {
  550. this.scheduleOptions = response.data;
  551. });
  552. this.getDicts("sys_store_pay_type").then(response => {
  553. this.PayOptions = response.data;
  554. });
  555. this.getDicts("sys_order_status").then(response => {
  556. this.orderOptions = response.data;
  557. });
  558. this.getDicts("sys_order_pay").then(response => {
  559. this.payStatusOptions = response.data;
  560. });
  561. this.getDicts("sys_order_source").then(response => {
  562. this.sourceOptions = response.data;
  563. });
  564. this.getDicts("sys_store_order_type").then(response => {
  565. this.orderTypeOptions = response.data;
  566. });
  567. this.getDicts("sys_store_order_buy_type").then(response => {
  568. this.orderBuyTypeOptions = response.data;
  569. });
  570. this.getDicts("sys_refund_status").then(response => {
  571. this.refundOptions = response.data;
  572. });
  573. this.getDicts("sys_store_channel").then(response => {
  574. this.channelOptions = response.data;
  575. });
  576. this.getDicts("sys_store_qw_subject").then(response => {
  577. this.qwSubjectOptions = response.data;
  578. });
  579. this.getDicts("sys_tui_money_status").then(response => {
  580. this.tuiOptions = response.data;
  581. });
  582. this.getDicts("sys_company_or").then(response => {
  583. this.orOptions = response.data;
  584. });
  585. this.getDicts("sys_patient_sex").then(response => {
  586. this.sexOptions = response.data;
  587. });
  588. this.getDicts("sys_store_delivery_pay_status").then(response => {
  589. this.deliveryPayStatusOptions = response.data;
  590. });
  591. this.getDicts("sys_store_order_delivery_status").then(response => {
  592. this.deliveryStatusOptions = response.data;
  593. });
  594. this.getDicts("sys_delivery_type").then(response => {
  595. this.deliveryTypeOptions = response.data;
  596. });
  597. },
  598. methods: {
  599. getCitys() {
  600. return getCitys().then(res => {
  601. this.citys = res.data || [];
  602. return this.citys;
  603. });
  604. },
  605. // 新增:切换省市区
  606. handleCityChange(val) {
  607. this.cityIds = Array.isArray(val) ? val : [];
  608. },
  609. // 新增:根据已选的 cityIds 从 citys 中获取对应的 label 数组 [省, 市, 区]
  610. getCityLabelsByIds() {
  611. if (!this.cityIds || this.cityIds.length === 0) return [];
  612. const [pVal, cVal, aVal] = this.cityIds;
  613. const p = this.citys.find(p => p.value === pVal);
  614. const c = p?.children?.find(c => c.value === cVal);
  615. const a = c?.children?.find(a => a.value === aVal);
  616. return [p?.label, c?.label, a?.label].filter(Boolean);
  617. },
  618. // 新增:拼装完整地址 = 省 市 区 + 详细地址
  619. buildFullAddress() {
  620. const region = this.getCityLabelsByIds().join(' ');
  621. const detail = (this.editForm.userAddress || '').trim();
  622. console.log(region)
  623. console.log(detail)
  624. return region && detail ? `${region} ${detail}` : (region || detail || '');
  625. },
  626. followMsg(row){
  627. const userId = this.item.userId;
  628. const followDoctorId =this.item.followDoctorId;
  629. const doctorName = this.item.doctorName;
  630. const patientName = this.item.patientName;
  631. setTimeout(() => {
  632. this.$refs.msgDetails.getDetails(userId,followDoctorId,doctorName,patientName);
  633. }, 500);
  634. this.dialogVisible = true;
  635. },
  636. msgDialogClose(){
  637. this.dialogVisible = false;
  638. },
  639. getPrescribeOrder(){
  640. this.prescribeDialog.open=true;
  641. setTimeout(() => {
  642. this.$refs.prescribeDetails.getDetails(this.item.prescribeId);
  643. }, 1);
  644. },
  645. handlePhone(){
  646. const orderId = this.item.orderId;
  647. getOrderUserPhone(orderId).then(response =>{
  648. this.item.userPhone = response.userPhone;
  649. })
  650. },
  651. editDelivery(){
  652. this.editDy.open = true;
  653. console.log(this.item)
  654. this.editDyForm.orderId = this.item.orderId;
  655. this.editDyForm.deliveryId = this.item.deliveryId;
  656. this.editDyForm.deliveryCode = this.item.deliveryCode;
  657. this.editDyForm.deliverySn = this.item.deliverySn;
  658. },
  659. showListD(){
  660. if(this.showList){
  661. this.showProd=this.prod
  662. }else{
  663. this.showProd=[this.prod[0]]
  664. }
  665. this.showList=this.showList?false:true;
  666. },
  667. showExpress(){
  668. this.expressDialog.open=true;
  669. getExpress(this.item.orderId).then(response => {
  670. this.express = response.data;
  671. if(this.express!=null&&this.express.Traces!=null){
  672. this.traces=this.express.Traces
  673. }
  674. });
  675. },
  676. updateErpOrder(){
  677. var that=this;
  678. this.$confirm('确定同步物流单号信息吗', "警告", {
  679. confirmButtonText: "确定",
  680. cancelButtonText: "取消",
  681. type: "warning"
  682. }).then(function() {
  683. var data={orderId:that.item.orderId}
  684. return updateErp(data);
  685. }).then(() => {
  686. this.msgSuccess("操作成功");
  687. getOrder(this.item.orderId).then(response => {
  688. this.item=response.data
  689. that.getlogList(this.item.orderId);
  690. that.$parent.$parent.getList();
  691. });
  692. this.editDy.open = false
  693. }).catch(function() {});
  694. },
  695. sendFollowMsg(){
  696. var that=this;
  697. this.$confirm('是否确认发送消息?', "警告", {
  698. confirmButtonText: "确定",
  699. cancelButtonText: "取消",
  700. type: "warning"
  701. }).then(function() {
  702. return sendMsg(that.item.orderId);
  703. }).then(() => {
  704. this.msgSuccess("操作成功");
  705. }).catch(function() {});
  706. },
  707. handleClose1(){
  708. this.dialogVisible=false;
  709. },
  710. handleClose2(){
  711. this.followDialogVisible=false;
  712. },
  713. follow(row){
  714. getMsgFollow(row).then(response => {
  715. if(response.data.formJson!=null&&response.data.formJson!=''&&response.data.writeStatus==1){
  716. this.messageFollowList=JSON.parse(response.data.formJson );
  717. this.followDialogVisible=true;
  718. }else{
  719. this.$message({
  720. message: '未填写随访单',
  721. type: 'info'
  722. });
  723. return
  724. }
  725. });
  726. },
  727. // 修改订单状态
  728. submitEditForm() {
  729. this.$refs["editForm"].validate(valid => {
  730. if (!valid) return;
  731. // 提交前拼接完整地址
  732. const payload = {
  733. ...this.editForm,
  734. userAddress: this.buildFullAddress(),
  735. };
  736. updateStoreOrder(payload).then(response => {
  737. if (response.code === 200) {
  738. this.msgSuccess("操作成功");
  739. this.edit.open = false;
  740. getOrder(this.item.orderId).then(response => {
  741. this.item = response.data;
  742. this.getlogList(this.item.orderId);
  743. this.$parent.$parent.getList();
  744. });
  745. }
  746. }).finally(()=>{
  747. this.editDyForm.deliveryCode = null;
  748. this.editDyForm.orderId = null;
  749. this.editDyForm.deliveryId = null;
  750. });
  751. });
  752. },
  753. editOrder() {
  754. this.edit.open = true;
  755. this.editForm.orderId = this.item.orderId;
  756. this.editForm.remark = this.item.remark;
  757. // 先设置其他同步的字段
  758. this.editForm.userPhone = this.item.userPhone != null ? this.item.userPhone.toString() : "";
  759. this.editForm.status = this.item.status != null ? this.item.status.toString() : "";
  760. this.editForm.deliveryType = this.item.deliveryType;
  761. this.editForm.deliveryStatus = this.item.deliveryStatus;
  762. // 等城市数据加载后再解析地址
  763. const currentAddress = (this.item.userAddress || "").toString().trim();
  764. this.getCitys().then(() => {
  765. if (!currentAddress) {
  766. this.cityIds = [];
  767. this.editForm.userAddress = "";
  768. return;
  769. }
  770. // 假设格式为:省 市 区 详细地址(空格分隔)
  771. const parts = currentAddress.split(/\s+/);
  772. const detail = parts.pop() || ""; // 最后一段作为详细地址
  773. const provLabel = parts[0];
  774. const cityLabel = parts[1];
  775. const areaLabel = parts[2];
  776. const province = this.citys.find(p => p.label === provLabel);
  777. const city = province?.children?.find(c => c.label === cityLabel);
  778. const area = city?.children?.find(a => a.label === areaLabel);
  779. if (province && city && area) {
  780. this.cityIds = [province.value, city.value, area.value];
  781. } else {
  782. console.warn("未匹配到完整省市区:", { provLabel, cityLabel, areaLabel });
  783. this.cityIds = [];
  784. }
  785. // 把详细地址写回到输入框(只保留详细地址,不含省市区)
  786. this.editForm.userAddress = detail;
  787. });
  788. },
  789. updateExpress(){
  790. var that=this;
  791. this.$confirm('定同步物流信息吗,同步后将自动发货?', "警告", {
  792. confirmButtonText: "确定",
  793. cancelButtonText: "取消",
  794. type: "warning"
  795. }).then(function() {
  796. var data=that.item.orderId
  797. return updateExpress(data);
  798. }).then(() => {
  799. this.msgSuccess("操作成功");
  800. getOrder(this.item.orderId).then(response => {
  801. this.item=response.data
  802. that.getlogList(this.item.orderId);
  803. that.$parent.$parent.getList();
  804. });
  805. }).catch(function() {});
  806. },
  807. addErpOrder(){
  808. var that=this;
  809. this.$confirm('是否确认推送管易?', "警告", {
  810. confirmButtonText: "确定",
  811. cancelButtonText: "取消",
  812. type: "warning"
  813. }).then(function() {
  814. var data=that.item.orderId
  815. return createErpOrder(data);
  816. }).then(() => {
  817. this.msgSuccess("操作成功");
  818. getOrder(this.item.orderId).then(response => {
  819. this.item=response.data
  820. that.getlogList(this.item.orderId);
  821. that.$parent.$parent.getList();
  822. });
  823. }).catch(function() {});
  824. },
  825. showErpOrder(){
  826. this.erpDialog.open=true;
  827. var data=this.item.extendOrderId;
  828. getEroOrder(data).then(response => {
  829. this.erp = response.data;
  830. if(response.data.orders!=null&&response.data.orders.length==1){
  831. this.erpOrder=response.data.orders[0]
  832. }
  833. });
  834. },
  835. editTuiMoney1(){
  836. var that=this;
  837. this.$confirm('是否解冻此订单推广佣金吗?', "警告", {
  838. confirmButtonText: "确定",
  839. cancelButtonText: "取消",
  840. type: "warning"
  841. }).then(function() {
  842. var data=that.item.orderId;
  843. return editTuiMoney(data);
  844. }).then(() => {
  845. this.msgSuccess("操作成功");
  846. getOrder(this.item.orderId).then(response => {
  847. this.item=response.data
  848. that.getlogList(this.item.orderId);
  849. that.$parent.$parent.getList();
  850. });
  851. }).catch(function() {});
  852. },
  853. editTuiMoney2(){
  854. var that=this;
  855. this.$confirm('是否冻结此订单推广佣金吗?', "警告", {
  856. confirmButtonText: "确定",
  857. cancelButtonText: "取消",
  858. type: "warning"
  859. }).then(function() {
  860. var data=that.item.orderId;
  861. return editTuiMoney(data);
  862. }).then(() => {
  863. this.msgSuccess("操作成功");
  864. getOrder(this.item.orderId).then(response => {
  865. this.item=response.data
  866. that.getlogList(this.item.orderId);
  867. that.$parent.$parent.getList();
  868. });
  869. }).catch(function() {});
  870. },
  871. returnCost(){
  872. var that=this;
  873. this.$confirm('是否退还此订单成本吗?', "警告", {
  874. confirmButtonText: "确定",
  875. cancelButtonText: "取消",
  876. type: "warning"
  877. }).then(function() {
  878. var data=that.item.orderId;
  879. return returnCost(data);
  880. }).then(() => {
  881. this.msgSuccess("操作成功");
  882. this.getDetails(this.item.orderId,null,null)
  883. }).catch(function() {});
  884. },
  885. moneyCancel(){
  886. this.money=null;
  887. this.moneyVisible=false;
  888. },
  889. refund(){
  890. var that=this;
  891. this.$confirm('是否确认申请退款?', "警告", {
  892. confirmButtonText: "确定",
  893. cancelButtonText: "取消",
  894. type: "warning"
  895. }).then(function() {
  896. var data={
  897. orderId:that.item.orderId
  898. }
  899. return afterSales(data);
  900. }).then(() => {
  901. this.msgSuccess("操作成功");
  902. getOrder(this.item.orderId).then(response => {
  903. this.item = response.data;
  904. this.getlogList(this.item.orderId);
  905. this.$parent.$parent.getList();
  906. });
  907. }).catch(function() {});
  908. },
  909. finishOrder(){
  910. var that=this;
  911. this.$confirm('是否确认客户已收货?', "警告", {
  912. confirmButtonText: "确定",
  913. cancelButtonText: "取消",
  914. type: "warning"
  915. }).then(function() {
  916. var data={
  917. orderId:that.item.orderId
  918. }
  919. return getGoods(data);
  920. }).then(() => {
  921. this.msgSuccess("操作成功");
  922. getOrder(this.item.orderId).then(response => {
  923. this.item = response.data;
  924. this.getlistOrderitem(this.item.orderId);
  925. this.getlogList(this.item.orderId);
  926. this.$parent.$parent.getList();
  927. });
  928. }).catch(function() {});
  929. },
  930. syncExpress(){
  931. var that=this;
  932. this.$confirm('确定同步物流状态吗', "警告", {
  933. confirmButtonText: "确定",
  934. cancelButtonText: "取消",
  935. type: "warning"
  936. }).then(function() {
  937. var data=that.item.orderId
  938. return syncExpress(data);
  939. }).then(() => {
  940. this.msgSuccess("操作成功");
  941. this.expressDialog.open=false
  942. getOrder(this.item.orderId).then(response => {
  943. this.item=response.data
  944. that.getlogList(this.item.orderId);
  945. that.$parent.$parent.getList();
  946. });
  947. }).catch(function() {});
  948. },
  949. getInquiryOrder(){
  950. this.show.open=true;
  951. setTimeout(() => {
  952. this.$refs.Details.getDetails(this.item.inquiryOrderId);
  953. }, 1);
  954. },
  955. getPackageOrder(){
  956. this.pack.open=true;
  957. console.log(this.item.packageOrderId)
  958. setTimeout(() => {
  959. this.$refs.packDetails.getDetails(this.item.packageOrderId);
  960. }, 1);
  961. },
  962. tuiOrder(){
  963. var that=this;
  964. this.$confirm('是否确认推送到智慧药房?', "警告", {
  965. confirmButtonText: "确定",
  966. cancelButtonText: "取消",
  967. type: "warning"
  968. }).then(function() {
  969. var data={
  970. orderId:that.item.orderId
  971. }
  972. return tuiOrder(data);
  973. }).then(() => {
  974. this.msgSuccess("操作成功");
  975. getOrder(this.item.orderId).then(response => {
  976. this.item = response.data;
  977. this.getlogList(this.item.orderId);
  978. this.$parent.$parent.getList();
  979. });
  980. }).catch(function() {});
  981. },
  982. sendCancel(){
  983. this.sendVisible = false;
  984. this.form={
  985. deliveryCode: null,
  986. deliveryName:null,
  987. deliverySn:null,
  988. orderId:null,
  989. }
  990. },
  991. sendGoods(){
  992. this.form.orderId=this.item.orderId;
  993. sendgoods(this.form).then(response => {
  994. this.msgSuccess("修改成功");
  995. this.sendVisible = false;
  996. getOrder(this.item.orderId).then(response => {
  997. this.item = response.data;
  998. this.getlogList(this.item.orderId);
  999. this.$parent.$parent.getList();
  1000. });
  1001. this.form={
  1002. deliveryCode: null,
  1003. deliveryName:null,
  1004. deliverySn:null,
  1005. orderId:null,
  1006. }
  1007. });
  1008. },
  1009. getDetails(orderId,nickName,storeName) {
  1010. this.nickName=nickName;
  1011. this.storeName=storeName;
  1012. this.item=null;
  1013. this.tuiMoneyLogs=null;
  1014. getOrder(orderId).then(response => {
  1015. this.item = response.data;
  1016. this.tuiMoneyLogs = response.tuiMoneyLogs;
  1017. this.getlistOrderitem(orderId);
  1018. this.getlogList(orderId);
  1019. this.getPayment(orderId);
  1020. this.msgForm.userId=response.data.userId;
  1021. this.msgForm.followDoctorId=response.data.followDoctorId;
  1022. if(this.item.orderType==2){
  1023. this.getCount(this.item.prescribeId);
  1024. }
  1025. });
  1026. },
  1027. getCount(id){
  1028. getPrescribe(id).then(response => {
  1029. this.recipeType = response.data.recipeType;
  1030. this.counts = JSON.parse(response.data.usageJson).counts
  1031. });
  1032. },
  1033. getOrder(){
  1034. getOrder(this.item.orderId).then(response => {
  1035. this.item = response.data;
  1036. this.getlistOrderitem(this.item.orderId);
  1037. this.getlogList(this.item.orderId);
  1038. this.getPayment(this.item.orderId);
  1039. if(this.item.orderType==2){
  1040. this.getCount(this.item.prescribeId);
  1041. }
  1042. });
  1043. },
  1044. submitEditDyForm(){
  1045. this.$refs["editDyForm"].validate(valid => {
  1046. if (valid) {
  1047. console.log(this.editDyForm)
  1048. updateDelivery(this.editDyForm).then(response => {
  1049. if (response.code === 200) {
  1050. this.msgSuccess("操作成功");
  1051. this.editDy.open = false;
  1052. getOrder(this.item.orderId).then(response => {
  1053. this.item = response.data;
  1054. this.getlogList(this.item.orderId);
  1055. this.$parent.$parent.getList();
  1056. });
  1057. }
  1058. }).finally(()=>{
  1059. this.editDyForm.deliveryCode = null;
  1060. this.editDyForm.orderId = null;
  1061. this.editDyForm.deliveryId = null;
  1062. this.editDyForm.deliverySn = null;
  1063. })
  1064. }
  1065. });
  1066. },
  1067. getlistOrderitem(orderId){
  1068. listOrderitem(orderId).then(response => {
  1069. this.prod = response.rows;
  1070. this.showProd=[this.prod[0]]
  1071. });
  1072. },
  1073. getlogList(orderId){
  1074. logList(orderId).then(response => {
  1075. this.logs = response.rows;
  1076. });
  1077. },
  1078. getPayment(orderId){
  1079. payment(orderId).then(response => {
  1080. console.log(response)
  1081. this.pay = response.data;
  1082. });
  1083. }
  1084. }
  1085. }
  1086. </script>
  1087. <style>
  1088. .content{
  1089. height: 100%;
  1090. background-color: #fff;
  1091. padding: 0px 20px;
  1092. }
  1093. </style>
  1094. <style>
  1095. .contentx{
  1096. height: 100%;
  1097. background-color: #fff;
  1098. padding: 0px 20px 20px;
  1099. margin: 20px;
  1100. }
  1101. .el-descriptions-item__label.is-bordered-label{
  1102. font-weight: normal;
  1103. }
  1104. .el-descriptions-item__content {
  1105. max-width: 150px;
  1106. min-width: 100px;
  1107. }
  1108. .desct{
  1109. padding-top: 20px;
  1110. padding-bottom: 20px;
  1111. color: #524b4a;
  1112. font-weight: bold;
  1113. }
  1114. </style>
  1115. <style scoped>
  1116. .order-content{
  1117. margin: 10px;
  1118. }
  1119. .operate-container {
  1120. background: #F2F6FC;
  1121. height: 60px;
  1122. margin: -20px -20px 0;
  1123. line-height: 60px;
  1124. }
  1125. .operate-button-container {
  1126. float: right;
  1127. margin-right: 20px
  1128. }
  1129. </style>
  1130. <style scoped>
  1131. .chat-records {
  1132. overflow-y: auto;
  1133. }
  1134. .timestamp {
  1135. font-size: 12px;
  1136. color: #A9A9A9;
  1137. }
  1138. .chat-record {
  1139. margin: 10px;
  1140. flex-direction: column;
  1141. align-items: flex-start;
  1142. }
  1143. .sent {
  1144. background-color: #fbfdff;
  1145. color: #000839;
  1146. }
  1147. .sent .timestamp {
  1148. float: right;
  1149. }
  1150. .right{
  1151. float: right;
  1152. }
  1153. .received {
  1154. background-color: #fbfdff;
  1155. color: #000000;
  1156. }
  1157. .el-descriptions-item__content {
  1158. max-width: 150px;
  1159. min-width: 100px;
  1160. }
  1161. .order-content{
  1162. margin: 10px;
  1163. }
  1164. .operate-container {
  1165. background: #F2F6FC;
  1166. height: 60px;
  1167. margin: -20px -20px 0;
  1168. line-height: 60px;
  1169. }
  1170. .operate-button-container {
  1171. float: right;
  1172. margin-right: 20px
  1173. }
  1174. </style>