index.vue 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971
  1. <template>
  2. <div class="app-container">
  3. <el-tabs v-model="goodsType" @tab-click="onChangeGoodsType">
  4. <template v-for="(dict, i) in dict.type.goods_type">
  5. <el-tab-pane :key="i" :label="dict.label" :name="dict.value" v-if="dict.label !== '材料商品'"></el-tab-pane>
  6. </template>
  7. </el-tabs>
  8. <el-form :model="queryParams" ref="queryForm" @submit.native.prevent :inline="true" v-show="showSearch" label-width="100px">
  9. <el-form-item prop="orderNo">
  10. <el-input v-model="queryParams.orderNo" placeholder="请输入订单编号" clearable @keyup.enter.native="handleQuery" />
  11. </el-form-item>
  12. <el-form-item prop="orderStatus">
  13. <el-select v-model="queryParams.orderStatus" placeholder="请选择支付状态" clearable>
  14. <el-option v-for="dict in dict.type.order_goods_status" :key="dict.code" :label="dict.label" :value="dict.value" />
  15. </el-select>
  16. </el-form-item>
  17. <el-form-item prop="realName">
  18. <el-input v-model="queryParams.realName" placeholder="请输入客户姓名" clearable @keyup.enter.native="handleQuery" />
  19. </el-form-item>
  20. <el-form-item prop="phoneNumber">
  21. <el-input v-model="queryParams.phoneNumber" placeholder="请输入手机号" clearable @keyup.enter.native="handleQuery" />
  22. </el-form-item>
  23. <br />
  24. <el-form-item>
  25. <el-date-picker clearable v-model="queryCreateTime" type="daterange" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="下单时间" end-placeholder="结束日期" @change="getCreateTime"></el-date-picker>
  26. </el-form-item>
  27. <el-form-item>
  28. <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
  29. <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
  30. </el-form-item>
  31. </el-form>
  32. <el-row :gutter="10" class="mb8">
  33. <!-- <el-col :span="1.5">-->
  34. <!-- <el-button type="warning" plain icon="el-icon-download" @click="handleExport" v-hasPermi="['order:goods:export']" v-if="userInfoVO.userType == '00'">导出 </el-button>-->
  35. <!-- </el-col>-->
  36. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  37. </el-row>
  38. <Page uri="/mapi/order/goods/list" :request-params="queryParams" ref="pagination">
  39. <el-table-column label="订单编号" align="center" prop="orderNo" width="200" />
  40. <el-table-column label="客户姓名" align="center" width="130">
  41. <template slot-scope="scope">
  42. <div class="customer-name">
  43. <i class="el-icon-user"></i>
  44. {{ scope.row.realName || '--' }}
  45. </div>
  46. </template>
  47. </el-table-column>
  48. <el-table-column label="手机号" align="center" width="130">
  49. <template slot-scope="scope">
  50. <div class="customer-phone" >
  51. <i class="el-icon-mobile-phone"></i>
  52. {{ scope.row.phoneNumber || '--' }}
  53. </div>
  54. </template>
  55. </el-table-column>
  56. <el-table-column label="订单总价" align="center" prop="totalPrice" width="120" />
  57. <el-table-column label="抵扣金额" align="center" prop="deductAmount" width="120">
  58. <template slot-scope="scope">
  59. {{ scope.row.deductAmount ? scope.row.deductAmount : '--' }}
  60. </template>
  61. </el-table-column>
  62. <el-table-column label="支付金额" align="center" prop="payAmount" width="120" />
  63. <el-table-column label="支付方式" align="center" prop="payType" width="120">
  64. <template slot-scope="scope">
  65. <dict-tag :options="dict.type.recharge_pay_type" :value="scope.row.payType" />
  66. </template>
  67. </el-table-column>
  68. <el-table-column label="订单状态" align="center" prop="orderStatus" width="120">
  69. <template slot-scope="scope">
  70. <dict-tag :options="dict.type.order_goods_status" :value="scope.row.orderStatus" />
  71. </template>
  72. </el-table-column>
  73. <el-table-column label="退单状态" align="center" prop="orderStatus" width="120">
  74. <template slot-scope="scope">
  75. <dict-tag :options="dict.type.goods_order_refund_status" :value="scope.row.refundStatus" />
  76. </template>
  77. </el-table-column>
  78. <el-table-column label="下单时间" align="center" prop="createTime" width="180" />
  79. <el-table-column label="支付时间" align="center" prop="payTime" width="180">
  80. <template slot-scope="scope">
  81. {{ scope.row.payTime ? scope.row.payTime : '--' }}
  82. </template>
  83. </el-table-column>
  84. <!-- <el-table-column label="发货时间" align="center" prop="sendTime" width="200px"/>-->
  85. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" min-width="200">
  86. <template slot-scope="scope">
  87. <el-button type="text" icon="el-icon-chat-dot-square" @click="orderDetail(scope.row)">订单详情</el-button>
  88. <el-button type="text" icon="el-icon-check" @click="rePay(scope.row)" v-if="scope.row.orderStatus == '0' && userInfoVO.userType == '02'">重新支付 </el-button>
  89. <el-button type="text" icon="el-icon-close" @click="cancelOrder(scope.row)" v-if="scope.row.orderStatus == '0'">取消订单 </el-button>
  90. <el-button type="text" icon="el-icon-check" @click="outOrderGoods(scope.row)" v-if="scope.row.orderStatus == '2' && userInfoVO.userType == '00' && scope.row.refundStatus == '0'">出货 </el-button>
  91. <!-- <el-button type="text" icon="el-icon-truck" @click="deliveryInfo(scope.row)" v-if="scope.row.deliveryNo"> 物流信息 </el-button>-->
  92. <el-button type="text" icon="el-icon-chat-dot-square" @click="refundOrder(scope.row)" v-if="userInfoVO.userType == '00' && scope.row.refundStatus == '0' && !scope.row.deliveryNo"> 撤单 </el-button>
  93. <el-button type="text" icon="el-icon-printer" v-if="userInfoVO.userType != '00'" @click="btn_lodop(scope.row)">打印 </el-button>
  94. </template>
  95. </el-table-column>
  96. </Page>
  97. <!-- 详情-->
  98. <el-dialog :title="detailTitle" :visible.sync="openDetail" size="80%" append-to-body>
  99. <el-card class="customer-info-card">
  100. <el-descriptions title="客户信息" v-show="detailView" :column="3" border :label-style="{ 'text-align': 'center' }" :contentStyle="{ 'text-align': 'center' }">
  101. <el-descriptions-item label="客户姓名">{{ detailView.realName }}</el-descriptions-item>
  102. <el-descriptions-item label="客户手机号">{{ detailView.phoneNumber }}</el-descriptions-item>
  103. <el-descriptions-item label="订单状态">
  104. <dict-tag :options="dict.type.order_goods_status" :value="detailView.orderStatus" />
  105. </el-descriptions-item>
  106. <el-descriptions-item label="收货联系人">{{ detailView.contactName ? detailView.contactName : '暂无信息' }} </el-descriptions-item>
  107. <el-descriptions-item label="收货人手机号">{{ detailView.contactPhone ? detailView.contactPhone : '暂无信息' }} </el-descriptions-item>
  108. <el-descriptions-item label="下单时间">{{ detailView.createTime ? detailView.createTime : '暂无信息' }} </el-descriptions-item>
  109. <el-descriptions-item label="支付时间">{{ detailView.payTime ? detailView.payTime : '暂无信息' }} </el-descriptions-item>
  110. <el-descriptions-item label="发货时间">{{ detailView.sendTime ? detailView.sendTime : '暂无信息' }} </el-descriptions-item>
  111. <el-descriptions-item label="确认收货时间">{{ detailView.finishTime ? detailView.finishTime : '暂无信息' }} </el-descriptions-item>
  112. <el-descriptions-item label="订单总价">{{ detailView.totalPrice ? detailView.totalPrice : '暂无信息' }} </el-descriptions-item>
  113. <el-descriptions-item label="物流公司">{{ detailView.deliveryCompany ? detailView.deliveryCompany : '暂无信息' }} </el-descriptions-item>
  114. <el-descriptions-item label="物流单号">{{ detailView.deliveryNo ? detailView.deliveryNo : '暂无信息' }} </el-descriptions-item>
  115. <el-descriptions-item label="收货地址" span="3">{{ detailView.province }}{{ detailView.city }}{{ detailView.area }}{{ detailView.address }}{{ detailView.addressDetail }} </el-descriptions-item>
  116. <el-descriptions-item label="备注信息" span="3">{{ detailView.deliveryNo ? detailView.deliveryNo : '暂无信息' }} </el-descriptions-item>
  117. <el-descriptions-item label="退款备注" span="3" v-if="detailView.refundReason">{{ detailView.refundReason ? detailView.refundReason : '暂无信息' }} </el-descriptions-item>
  118. </el-descriptions>
  119. </el-card>
  120. <div class="product-list-container">
  121. <h3 class="product-list-title">商品信息</h3>
  122. <el-table v-loading="detailLoading" :data="detailView.orderGoodsSkuList" fit highlight-current-row border stripe>
  123. <el-table-column :label="goodsType == 0 ? '商品名称' : '材料名称'" align="center" prop="goodsName" width="250px" />
  124. <el-table-column :label="goodsType == 0 ? '商品规格' : '材料规格'" align="center" width="250px">
  125. <template slot-scope="scope">
  126. <div style="text-align: center">
  127. {{ scope.row.skuName.replace(' ', '/') }}
  128. </div>
  129. </template>
  130. </el-table-column>
  131. <el-table-column label="数量" align="center" prop="buyNum" />
  132. <el-table-column label="价格(元)" align="center" prop="salePrice" />
  133. <el-table-column label="总和(元)" align="center">
  134. <template slot-scope="scope">
  135. <span>{{ scope.row.buyNum * scope.row.salePrice }}</span>
  136. </template>
  137. </el-table-column>
  138. </el-table>
  139. </div>
  140. <el-row :gutter="10" class="order-total">
  141. <el-col :span="21">
  142. <el-form label-width="130px" style="text-align: right" :inline="true" size="small">
  143. <el-form-item label="总金额(元):">
  144. {{ costTotalPrice }}
  145. </el-form-item>
  146. </el-form>
  147. </el-col>
  148. </el-row>
  149. </el-dialog>
  150. <!-- 重新支付页面 -->
  151. <el-dialog title="订单支付" :visible.sync="openRePayPage" size="60%" append-to-body>
  152. <el-descriptions title="核对信息" v-if="appUserInfo" :column="3" border :contentStyle="{ 'text-align': 'center' }" style="margin-left: 15px; margin-right: 15px">
  153. <el-descriptions-item label="总件数(件)" :labelStyle="{ width: '16%' }" :label-style="{ 'text-align': 'center' }">{{ calculateTotalCount }} </el-descriptions-item>
  154. <el-descriptions-item label="抵扣金额(元)" :labelStyle="{ width: '16%' }" :label-style="{ 'text-align': 'center' }">
  155. {{ payFrom.deductAmount ? '¥' + payFrom.deductAmount : '¥' + '0' }}
  156. </el-descriptions-item>
  157. <el-descriptions-item label="卡余额(元)" :labelStyle="{ width: '16%' }" :label-style="{ 'text-align': 'center' }"> ¥{{ appUserInfo ? appUserInfo.rechargeBalance + appUserInfo.giveBalance : '0.00' }} </el-descriptions-item>
  158. <el-descriptions-item label="原价(元)">{{ costTotalPrice }}</el-descriptions-item>
  159. <el-descriptions-item label="折后金额(元)">{{ calculatePayMoney }}</el-descriptions-item>
  160. <!-- <el-descriptions-item label="现有积分">{{appUserInfo.pointBalance}}</el-descriptions-item>-->
  161. </el-descriptions>
  162. <template>
  163. <el-form ref="payFrom" :model="payFrom" label-width="80px" style="margin-top: 20px">
  164. <el-row :gutter="10">
  165. <el-card style="margin-left: 15px; margin-right: 15px">
  166. <el-col :span="24">
  167. <el-descriptions title="优惠信息"></el-descriptions>
  168. </el-col>
  169. <el-col :span="24">
  170. <el-form-item label="抵扣现金券(元)" label-width="130px" prop="deductAmount">
  171. <el-input-number :min="1" :max="9999999" :controls="false" style="width: 200px" v-model.number="payFrom.deductAmount"></el-input-number>
  172. </el-form-item>
  173. </el-col>
  174. </el-card>
  175. </el-row>
  176. <el-row :gutter="10">
  177. <el-card style="margin-top: 15px; margin-left: 15px; margin-right: 15px">
  178. <el-col :span="24">
  179. <el-form-item label="支付方式" prop="payType">
  180. <el-radio-group v-model="payFrom.payType" style="width: 400px" @input="changePayType">
  181. <el-radio-button label="3">余额</el-radio-button>
  182. <el-radio-button label="2">现金</el-radio-button>
  183. <el-radio-button label="0">微信</el-radio-button>
  184. <el-radio-button label="1">支付宝</el-radio-button>
  185. </el-radio-group>
  186. </el-form-item>
  187. </el-col>
  188. <div v-if="payFrom.payType">
  189. <el-col :span="8">
  190. <el-descriptions :column="2" style="width: 400px" v-if="payFrom.payType == '3' && appUserInfo">
  191. <el-descriptions-item label="客户姓名">{{ appUserInfo ? appUserInfo.realName : '- -' }} </el-descriptions-item>
  192. <el-descriptions-item label="余额(元)"> ¥{{ appUserInfo ? appUserInfo.rechargeBalance + appUserInfo.giveBalance : '0.00' }} </el-descriptions-item>
  193. </el-descriptions>
  194. </el-col>
  195. <el-col :span="12" v-if="payFrom.payType == '2'">
  196. <el-form-item label="实收现金(元)" label-width="120px" prop="thisPayMoney">
  197. <el-input-number :min="1" :max="9999999" :controls="false" v-model="payFrom.thisPayMoney"></el-input-number>
  198. </el-form-item>
  199. </el-col>
  200. <el-col :span="12" v-if="payFrom.payType == '2'">
  201. <el-form-item label="找零:" label-width="120px">
  202. <span>{{ payFrom.thisPayMoney && payFrom.thisPayMoney - payMoney >= 0 ? payFrom.thisPayMoney - payMoney : '0' }}</span>
  203. </el-form-item>
  204. </el-col>
  205. <el-col :span="8" v-if="payFrom.payType == '0'">
  206. <el-form-item label="微信付款条形码" label-width="120px" prop="wxBarcode">
  207. <el-input style="width: 200px" v-model="payFrom.wxBarcode"></el-input>
  208. </el-form-item>
  209. </el-col>
  210. <el-col :span="8" v-if="payFrom.payType == '1'">
  211. <el-form-item label="支付宝付款条形码" label-width="130px" prop="aliPayBarcode">
  212. <el-input style="width: 200px" v-model="payFrom.aliPayBarcode"></el-input>
  213. </el-form-item>
  214. </el-col>
  215. </div>
  216. </el-card>
  217. </el-row>
  218. <el-row :gutter="10">
  219. <div>
  220. <el-button type="primary" @click="submitSettlement" style="margin-left: 3%; margin-top: 20px">结算 </el-button>
  221. </div>
  222. </el-row>
  223. </el-form>
  224. </template>
  225. </el-dialog>
  226. <!-- 撤单页面-->
  227. <el-dialog :visible.sync="openRefundPage" width="400px" append-to-body>
  228. <el-form ref="refundVO" :model="refundVO">
  229. <el-form-item label="撤单原因" label-width="80px" prop="refundReason">
  230. <el-input v-model="refundVO.refundReason" type="textarea" placeholder="请输入撤单原因" maxlength="500" :rows="5" show-word-limit></el-input>
  231. </el-form-item>
  232. </el-form>
  233. <el-row :gutter="10">
  234. <div>
  235. <el-button type="primary" @click="submitRefund" style="margin-left: 3%; margin-top: 20px">提交</el-button>
  236. </div>
  237. </el-row>
  238. </el-dialog>
  239. <!-- 订单出货对话框 -->
  240. <el-dialog title="订单出货信息" :visible.sync="openDeliveryPage" size="40%" append-to-body :before-close="deliveryClose">
  241. <el-row :gutter="15">
  242. <el-form ref="deliveryVo" :model="deliveryVo" :rules="deliveryRules" label-width="120px">
  243. <el-col :span="24">
  244. <el-form-item label="快递公司" prop="deliveryCompany">
  245. <el-radio-group v-model="deliveryVo.deliveryCompany" @input="changeDeliveryId">
  246. <el-radio-button v-for="dict in deliveryData" :label="dict.name" :key="dict.name"></el-radio-button>
  247. </el-radio-group>
  248. </el-form-item>
  249. <!-- <el-form-item label="预期揽件时间" prop="expectTime">-->
  250. <!-- <el-date-picker-->
  251. <!-- type="datetime"-->
  252. <!-- placeholder="选择预期揽件时间"-->
  253. <!-- v-model="deliveryVo.expectTime"-->
  254. <!-- style="width: 100%"-->
  255. <!-- value-format="yyyy-MM-dd HH:mm"-->
  256. <!-- format="yyyy-MM-dd HH:mm"-->
  257. <!-- :picker-options="{-->
  258. <!-- disabledDate: (time) => {-->
  259. <!-- return time.getTime() < Date.now() - 3600 * 1000 * 24-->
  260. <!-- },-->
  261. <!-- selectableRange: startTimeRange-->
  262. <!-- }"-->
  263. <!-- :default-time="deliTime"-->
  264. <!-- class="date_picker"-->
  265. <!-- :editable="false"-->
  266. <!-- ></el-date-picker>-->
  267. <!-- </el-form-item>-->
  268. <!-- <el-form-item label="包裹数量" prop="count">
  269. <el-input v-model="deliveryVo.count" type="number" placeholder="请输入包裹数量" clearable></el-input>
  270. </el-form-item> -->
  271. <!-- <el-form-item label="货物高度" prop="spaceHeight">-->
  272. <!-- <el-input v-model="deliveryVo.spaceHeight" placeholder="请输入货物高度" clearable>-->
  273. <!-- <template slot="append">厘米(cm)</template>-->
  274. <!-- </el-input>-->
  275. <!-- </el-form-item>-->
  276. <!-- <el-form-item label="货物长度" prop="spaceLength">-->
  277. <!-- <el-input v-model="deliveryVo.spaceLength" placeholder="请输入货物长度" clearable>-->
  278. <!-- <template slot="append">厘米(cm)</template>-->
  279. <!-- </el-input>-->
  280. <!-- </el-form-item>-->
  281. <!-- <el-form-item label="货物宽度" prop="spaceWidth">-->
  282. <!-- <el-input v-model="deliveryVo.spaceWidth" placeholder="请输入货物宽度" clearable>-->
  283. <!-- <template slot="append">厘米(cm)</template>-->
  284. <!-- </el-input>-->
  285. <!-- </el-form-item>-->
  286. <!-- <el-form-item label="货物总重量" prop="weight">-->
  287. <!-- <el-input v-model="deliveryVo.weight" placeholder="请输入货物总重量" clearable>-->
  288. <!-- <template slot="append">千克 (kg)</template>-->
  289. <!-- </el-input>-->
  290. <!-- </el-form-item>-->
  291. <el-form-item label="快递单号" prop="deliveryNo">
  292. <el-input v-model="deliveryVo.deliveryNo" type="input" placeholder="请输入快递单号" maxlength="100" clearable></el-input>
  293. </el-form-item>
  294. <!-- <el-form-item label="备注信息" prop="customRemark">-->
  295. <!-- <el-input v-model="deliveryVo.customRemark" rows="5" type="textarea" placeholder="请输入备注信息,比如易碎物品……" maxlength="500" show-word-limit clearable></el-input>-->
  296. <!-- </el-form-item>-->
  297. </el-col>
  298. </el-form>
  299. </el-row>
  300. <div slot="footer" class="dialog-footer">
  301. <el-button type="primary" @click="submitDelivery('deliveryVo')" style="margin-left: 5%">提交</el-button>
  302. <el-button @click="cancelDelivery">取 消</el-button>
  303. </div>
  304. </el-dialog>
  305. <!-- 快递信息对话框 -->
  306. <el-dialog title="快递信息" :visible.sync="openDeliveryinfo" size="40%" append-to-body :before-close="deliveryinfoClose">
  307. <div class="deliveryView">
  308. <div class="info">
  309. <span>快递公司:</span>
  310. <span>{{ deliveryView.name }}</span>
  311. </div>
  312. <div class="info">
  313. <span>收货地址:</span>
  314. <span>{{ deliveryView.address }}</span>
  315. </div>
  316. </div>
  317. <el-timeline v-if="deliveryView.pathItemList.length">
  318. <el-timeline-item v-for="(item, index) in deliveryView.pathItemList" :key="index" :timestamp="item.actionTime">
  319. {{ item.actionMsg }}
  320. </el-timeline-item>
  321. </el-timeline>
  322. <el-empty description="暂无快递信息" v-else></el-empty>
  323. <div slot="footer" class="dialog-footer">
  324. <el-button type="primary" style="margin-left: 5%" @click="openDeliveryinfo = false">关闭</el-button>
  325. </div>
  326. </el-dialog>
  327. </div>
  328. </template>
  329. <script>
  330. import { cancelOrder, getGoods, listGoods, outOrderGoods, refundOrderGoods, rePayOrder, getdeliveryAll, getDeliveryPath } from '@/api/order/goods'
  331. import { findUserByPhoneNumber, getUser } from '@/api/app/user'
  332. import { getLodop } from '@/utils/lodopUtils'
  333. import { printGoods } from '@/api/order/clothItem'
  334. export default {
  335. name: 'goodsRetailOrder',
  336. dicts: ['order_goods_status', 'goods_order_refund_status','delivery_company', 'recharge_pay_type'],
  337. data() {
  338. var validateNumberInput = (rule, value, callback) => {
  339. if (!value || isNaN(value)) {
  340. callback(new Error('只能输入数字,不能为空'))
  341. } else {
  342. callback()
  343. }
  344. }
  345. return {
  346. userInfoVO: null,
  347. //
  348. orderLoading: true,
  349. // 遮罩层
  350. loading: false,
  351. detailLoading: true,
  352. // 选中数组
  353. ids: [],
  354. // 非单个禁用
  355. single: true,
  356. // 非多个禁用
  357. multiple: true,
  358. // 显示搜索条件
  359. showSearch: true,
  360. // 总条数
  361. total: 0,
  362. // 弹出层标题
  363. title: '',
  364. detailTitle: '',
  365. // 是否显示弹出层
  366. open: false,
  367. openDetail: false,
  368. openRePayPage: false,
  369. openDeliveryPage: false,
  370. openRefundPage: false,
  371. // 查询参数
  372. queryParams: {
  373. realName: null,
  374. phoneNumber: null,
  375. orderNo: null,
  376. orderStatus: null
  377. },
  378. // 表单参数
  379. payFrom: {},
  380. // 表单校验
  381. rules: {},
  382. goodsType: null,
  383. // 商品订单表格数据
  384. GoodsList: [],
  385. // 可选商品集合
  386. goodsList: null,
  387. // 已选商品集合
  388. addGoodsList: [],
  389. // 自定义一个计算数量的临时对象集合
  390. purchaseCountVOList: [],
  391. // 总金额
  392. totalPrice: 0,
  393. // 总件数
  394. totalCount: 0,
  395. // 详情数据
  396. detailView: {},
  397. // detailList:[],
  398. // 详情总金额
  399. costTotalPrice: null,
  400. appUserInfo: null,
  401. goodsOrderInfo: null,
  402. payMoney: null,
  403. deliveryVo: {
  404. // bizId: '',
  405. // count: 1,
  406. customRemark: '',
  407. deliveryCompany: '',
  408. deliveryId: '',
  409. deliveryNo: ''
  410. // expectTime: '',
  411. // orderId: null,
  412. // serviceName: '',
  413. // serviceType: null,
  414. // spaceHeight: null,
  415. // spaceLength: null,
  416. // spaceWidth: null,
  417. // weight: null
  418. },
  419. deliveryRules: {
  420. deliveryName: [{ required: true, message: '请选择物流公司', trigger: 'change' }],
  421. // serviceType: [{ required: true, message: '请选择服务类型', trigger: 'change' }],
  422. // expectTime: [{ required: true, message: '选择预期揽件时间', trigger: 'blur' }],
  423. // spaceHeight: [
  424. // { required: true, message: '请输入货物高度', trigger: 'blur' },
  425. // { validator: validateNumberInput, trigger: 'blur' }
  426. // ],
  427. // spaceLength: [
  428. // { required: true, message: '请输入货物长度', trigger: 'blur' },
  429. // { validator: validateNumberInput, trigger: 'blur' }
  430. // ],
  431. // spaceWidth: [
  432. // { required: true, message: '请输入货物宽度', trigger: 'blur' },
  433. // { validator: validateNumberInput, trigger: 'blur' }
  434. // ],
  435. // weight: [
  436. // { required: true, message: '请输入货物总重量', trigger: 'blur' },
  437. // { validator: validateNumberInput, trigger: 'blur' }
  438. // ],
  439. // customRemark: [{ required: true, message: '请输入备注信息,比如易碎物品……', trigger: 'blur' }]
  440. },
  441. refundVO: {
  442. orderId: null,
  443. refundReason: null
  444. },
  445. deliveryData: [], //快递公司数据
  446. startTimeRange: null,
  447. deliTime: null,
  448. openDeliveryinfo: false,
  449. deliveryView: {
  450. name: '',
  451. pathItemList: []
  452. },
  453. LODOP: null,
  454. number: 1,
  455. pointerList: [],
  456. queryCreateTime: null,
  457. queryPayTime: null
  458. }
  459. },
  460. created() {
  461. this.handleUser()
  462. this.goodsType = this.getUrlParam('goodsType')
  463. this.getList()
  464. this.getdeliveryAll()
  465. },
  466. mounted() {
  467. this.number = 1
  468. const printerTime = setInterval(() => {
  469. this.LODOP = getLodop()
  470. this.number++
  471. if (this.number == 25) {
  472. clearInterval(printerTime)
  473. }
  474. if (this.LODOP) {
  475. clearInterval(printerTime)
  476. }
  477. }, 200)
  478. this.pointerList = JSON.parse(this.$cache.local.get('printerSeting'))
  479. },
  480. watch: {
  481. 'deliveryVo.expectTime': {
  482. deep: true,
  483. handler(newValue, oldValue) {
  484. if (newValue) {
  485. let nowDate = this.sendTimeDate(new Date().getTime() + 3600000) // 一小时之后的时间(我是因业务要求,这里可以随意调整时间)
  486. let dt = nowDate.split(' ')
  487. let st = ''
  488. if (newValue.split(' ')[0] == dt[0]) {
  489. // 是今天,选择 的时间开始为此刻的时分秒
  490. st = dt[1]
  491. } else {
  492. // 明天及以后从0时开始
  493. st = '00:00:00'
  494. }
  495. this.startTimeRange = st + ' - 23:59:59'
  496. //例如:如果今天此刻时间为10:41:40 则选择时间范围为: 11:41:40 - 23:59:59
  497. //否则为:00:00:00- 23:59:59
  498. }
  499. }
  500. }
  501. },
  502. computed: {
  503. calculateTotalCount() {
  504. this.totalCount = 0
  505. // this.detailList.forEach(vo =>{
  506. this.detailView.forEach((vo) => {
  507. this.totalCount = this.totalCount + vo.buyNum
  508. })
  509. return this.totalCount
  510. },
  511. calculatePayMoney() {
  512. this.payMoney = this.payFrom.deductAmount ? this.costTotalPrice - this.payFrom.deductAmount : this.costTotalPrice
  513. return this.payMoney
  514. }
  515. },
  516. methods: {
  517. onChangeGoodsType() {
  518. this.queryParams.goodsType = this.goodsType
  519. this.handleQuery()
  520. },
  521. handleUser() {
  522. this.userInfoVO = this.getUserInfo()
  523. },
  524. getCreateTime() {
  525. if (this.queryCreateTime != null) {
  526. this.queryParams.createTimeFrom = this.queryCreateTime[0]
  527. this.queryParams.createTimeTo = this.queryCreateTime[1]
  528. }
  529. },
  530. getPayTime() {
  531. if (this.queryPayTime != null) {
  532. this.queryParams.beginPayTime = this.queryPayTime[0]
  533. this.queryParams.endPayTime = this.queryPayTime[1]
  534. }
  535. },
  536. getList() {
  537. this.queryParams.goodsType = this.goodsType
  538. this.$nextTick(() => {
  539. this.$refs.pagination.handleSearch(true)
  540. })
  541. },
  542. /** 搜索按钮操作 */
  543. handleQuery() {
  544. this.queryParams.pageNum = 1
  545. this.getList()
  546. },
  547. /** 重置按钮操作 */
  548. resetQuery() {
  549. this.queryCreateTime = null
  550. this.queryParams.createTimeFrom = null
  551. this.queryParams.createTimeTo = null
  552. this.queryPayTime = null
  553. this.queryParams.beginPayTime = null
  554. this.queryParams.endPayTime = null
  555. this.resetForm('queryForm')
  556. this.handleQuery()
  557. },
  558. rePay(row) {
  559. this.payFrom = {}
  560. this.payFrom.id = row.id
  561. this.openRePayPage = true
  562. getUser(row.appUserId).then((res1) => {
  563. if (res1.data.phoneNumber == null || res1.data.phoneNumber == '') {
  564. return
  565. }
  566. findUserByPhoneNumber({ phoneNumber: res1.data.phoneNumber }).then((res) => {
  567. this.appUserInfo = res.data
  568. })
  569. })
  570. getGoods(row.id).then((response) => {
  571. this.detailView = response.data
  572. this.costTotalPrice = this.detailView.totalPrice
  573. // this.detailList = response.data;
  574. // this.costTotalPrice = this.detailList[0].totalPrice;
  575. })
  576. if (row.deductAmount != null && row.deductAmount != '') {
  577. this.payFrom.deductAmount = row.deductAmount
  578. }
  579. if (row.payType != null && row.payType != '') {
  580. this.payFrom.payType = row.payType
  581. }
  582. if (row.payType != null && row.payType != '') {
  583. this.payFrom.payType = row.payType
  584. }
  585. },
  586. submitSettlement() {
  587. this.$confirm('是否确认结算?').then(() => {
  588. if (this.totalCount == 0) {
  589. this.$message.error('请选择商品')
  590. return
  591. }
  592. if (this.payFrom.payType == null || this.payFrom.payType == '') {
  593. this.$message.error('请选择支付方式')
  594. return
  595. }
  596. if (this.payFrom.deductAmount != null || this.payFrom.deductAmount != '') {
  597. if (this.payFrom.deductAmount > this.payMoney) {
  598. this.$message.error('抵扣金额不能大于支付金额')
  599. return
  600. }
  601. }
  602. if (this.payFrom.payType == '1') {
  603. if (this.appUserInfo.rechargeBalance + this.appUserInfo.giveBalance < this.payMoney) {
  604. this.$message.error('用户余额不足')
  605. return
  606. }
  607. }
  608. if (this.payFrom.payType == '2') {
  609. if (this.payFrom.thisPayMoney < this.payMoney) {
  610. this.$message.error('现金金额不够支付')
  611. return
  612. }
  613. }
  614. this.submitGoodsOrderDTO = {}
  615. // 设置订单基础信息
  616. this.submitGoodsOrderDTO.id = this.payFrom.id
  617. this.submitGoodsOrderDTO.goodsType = this.goodsType
  618. this.submitGoodsOrderDTO.deductAmount = this.payFrom.deductAmount
  619. this.submitGoodsOrderDTO.payAmount = this.payMoney
  620. this.submitGoodsOrderDTO.payType = this.payFrom.payType
  621. rePayOrder(this.submitGoodsOrderDTO).then((response) => {
  622. this.$modal.msgSuccess('结算完成')
  623. this.addGoodsList = []
  624. this.purchaseCountVOList = []
  625. this.submitGoodsOrderDTO = {}
  626. this.openRePayPage = false
  627. this.getList()
  628. })
  629. })
  630. },
  631. // 切换支付方式
  632. changePayType() {
  633. delete this.payFrom.thisPayMoney
  634. this.$forceUpdate()
  635. },
  636. // 取消订单
  637. cancelOrder(row) {
  638. this.$confirm('是否确认取消该订单?')
  639. .then(() => {
  640. const vo = {
  641. orderId: row.id,
  642. remark: '不想要了'
  643. }
  644. cancelOrder(vo).then((response2) => {
  645. this.$modal.msgSuccess('订单取消成功')
  646. this.getList()
  647. })
  648. })
  649. .catch(() => {})
  650. },
  651. // 订单详情
  652. orderDetail(row) {
  653. this.openDetail = true
  654. this.detailTitle = '订单商品详情'
  655. this.detailLoading = true
  656. // this.detailList = [];
  657. this.detailView = {}
  658. const id = row.id
  659. getGoods(id).then((response) => {
  660. this.detailView = response.data
  661. this.costTotalPrice = this.detailView.totalPrice
  662. // this.detailList = response.data;
  663. // this.costTotalPrice = this.detailList[0].totalPrice;
  664. this.detailLoading = false
  665. })
  666. },
  667. // 出货
  668. outOrderGoods(row) {
  669. this.deliveryreset()
  670. this.openDeliveryPage = true
  671. this.deliveryVo.deliveryCompany = this.deliveryData[0].name
  672. this.deliveryVo.deliveryId = this.deliveryData[0].code
  673. this.deliveryVo.orderId = row.id
  674. },
  675. //获取快递公司
  676. getdeliveryAll() {
  677. getdeliveryAll().then((res) => {
  678. this.deliveryData = res.data
  679. })
  680. },
  681. //切换快递获取其他数据
  682. changeDeliveryId(value) {
  683. this.deliveryData.forEach((item, index) => {
  684. if (value == item.deliveryName) {
  685. this.deliveryVo.deliveryId = item.code
  686. }
  687. })
  688. },
  689. // 撤单
  690. refundOrder(row) {
  691. this.refundVO = {}
  692. this.openRefundPage = true
  693. this.refundVO.orderId = row.id
  694. },
  695. submitDelivery(formName) {
  696. this.$confirm('是否确认出货配送?')
  697. .then(() => {
  698. this.$refs[formName].validate((valid) => {
  699. if (valid) {
  700. outOrderGoods(this.deliveryVo).then((response2) => {
  701. this.$message.success('操作成功')
  702. this.getList()
  703. this.openDeliveryPage = false
  704. this.deliveryreset()
  705. })
  706. }
  707. })
  708. })
  709. .catch(() => {})
  710. },
  711. sendTimeDate(date) {
  712. if (!!date) {
  713. var nowDate = new Date(date).getFullYear() + '-' + (new Date(date).getMonth() + 1 < 10 ? '0' + (new Date(date).getMonth() + 1) : new Date(date).getMonth() + 1) + '-' + (new Date(date).getDate(date) < 10 ? '0' + new Date(date).getDate(date) : new Date(date).getDate(date))
  714. var nowTime =
  715. (new Date(date).getHours() < 10 ? '0' + new Date(date).getHours() : new Date(date).getHours()) +
  716. ':' +
  717. (new Date(date).getMinutes() < 10 ? '0' + new Date(date).getMinutes() : new Date(date).getMinutes()) +
  718. ':' +
  719. (new Date(date).getSeconds() < 10 ? '0' + new Date(date).getSeconds() : new Date(date).getSeconds())
  720. return nowDate + ' ' + nowTime
  721. } else {
  722. return ''
  723. }
  724. },
  725. cancelDelivery() {
  726. this.openDeliveryPage = false
  727. this.deliveryreset()
  728. },
  729. // 表单重置
  730. deliveryreset() {
  731. this.deliveryVo = {
  732. bizId: '',
  733. // count: 1,
  734. customRemark: '',
  735. deliveryCompany: '',
  736. deliveryId: '',
  737. expectTime: '',
  738. orderId: 0,
  739. serviceName: '',
  740. serviceType: null,
  741. spaceHeight: null,
  742. spaceLength: null,
  743. spaceWidth: null,
  744. weight: null
  745. }
  746. },
  747. submitRefund() {
  748. this.$confirm('是否确认撤回该订单?')
  749. .then(() => {
  750. refundOrderGoods(this.refundVO).then((response2) => {
  751. this.$message.success('操作成功')
  752. this.getList()
  753. this.openRefundPage = false
  754. this.refundVO.orderId = null
  755. this.refundVO.refundReason = null
  756. })
  757. })
  758. .catch(() => {})
  759. },
  760. checkClose(done) {
  761. this.$confirm('是否关闭支付页面,放弃支付?')
  762. .then(function () {
  763. done()
  764. })
  765. .then(() => {})
  766. .catch(() => {})
  767. },
  768. deliveryClose(done) {
  769. this.$confirm('是否关闭出货信息窗口,确认关闭?')
  770. .then(function () {
  771. done()
  772. })
  773. .then(() => {})
  774. .catch(() => {})
  775. },
  776. deliveryinfoClose(done) {
  777. this.$confirm('是否关闭快递信息窗口,确认关闭?')
  778. .then(function () {
  779. done()
  780. })
  781. .then(() => {})
  782. .catch(() => {})
  783. },
  784. deliveryInfo(row) {
  785. getDeliveryPath({
  786. orderId: row.id
  787. }).then((res) => {
  788. this.deliveryView.name = row.deliveryCompany
  789. this.deliveryView.pathItemList = res.data.pathItemList
  790. this.deliveryView.address = row.province + row.city + row.area + row.address + row.addressDetail
  791. console.log(this.deliveryView)
  792. this.openDeliveryinfo = true
  793. })
  794. },
  795. btn_lodop(row) {
  796. if (!this.LODOP) {
  797. this.$modal.msgError('请安装打印机软件')
  798. return
  799. }
  800. let p_name = ''
  801. this.pointerList.forEach((pointer) => {
  802. if (pointer.printType == 0) {
  803. p_name = pointer.printName
  804. }
  805. })
  806. printGoods(row.id).then((res) => {
  807. if (this.userInfoVO.userType == '02') {
  808. const obj = {
  809. name: this.userInfoVO.storeName,
  810. contactPhone: this.userInfoVO.phonenumber,
  811. user: this.userInfoVO.nickName
  812. }
  813. res.data.sysOrg = obj
  814. }
  815. res.data.newTime = this.formatDates(new Date(), 1)
  816. this.goodsPrinter(this.LODOP, res.data, p_name)
  817. })
  818. },
  819. /** 导出按钮操作 */
  820. handleExport() {
  821. this.download(
  822. 'mapi/order/goods/export',
  823. {
  824. ...this.queryParams,
  825. ...{ goodsType: this.goodsType }
  826. },
  827. `goods_order_${new Date().getTime()}.xlsx`
  828. )
  829. }
  830. }
  831. }
  832. </script>
  833. <style>
  834. .list_title {
  835. text-align: center;
  836. line-height: 40px;
  837. }
  838. .head-container-two {
  839. height: 500px;
  840. display: block;
  841. overflow-y: scroll;
  842. }
  843. .head-column1 {
  844. height: 300px;
  845. display: block;
  846. overflow-y: scroll;
  847. }
  848. .head-column2 {
  849. height: 600px;
  850. display: block;
  851. overflow-y: scroll;
  852. }
  853. .box-shadow .el-button--medium {
  854. font-size: 18px;
  855. }
  856. </style>
  857. <style lang="scss" scoped>
  858. .servicecard {
  859. box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  860. background-color: #fff;
  861. border-radius: 5px;
  862. margin: 0 10px 10px 0;
  863. padding: 10px 20px;
  864. display: inline-block;
  865. cursor: pointer;
  866. position: relative;
  867. &::after {
  868. content: '';
  869. position: absolute;
  870. top: 0;
  871. right: 0px; /* 调整三角形的大小和位置 */
  872. width: 0;
  873. height: 0;
  874. border-left: 35px solid transparent;
  875. border-top: 35px solid #007bff;
  876. z-index: 50;
  877. opacity: 0;
  878. }
  879. .check {
  880. position: absolute;
  881. top: -5px;
  882. right: 3px;
  883. color: #fff;
  884. z-index: 100;
  885. opacity: 0;
  886. }
  887. &.active {
  888. &::after {
  889. opacity: 1;
  890. }
  891. .check {
  892. opacity: 1;
  893. }
  894. }
  895. }
  896. .deliveryView {
  897. margin: 0 20px 20px 20px;
  898. padding: 15px;
  899. border-radius: 5px;
  900. background-color: #f4f4f4;
  901. color: #555;
  902. .info:first-child {
  903. margin-bottom: 10px;
  904. }
  905. }
  906. .customer-info-card {
  907. margin-bottom: 20px;
  908. }
  909. .product-list-container {
  910. margin: 20px 0;
  911. .product-list-title {
  912. margin-bottom: 15px;
  913. font-size: 16px;
  914. font-weight: 500;
  915. color: #303133;
  916. }
  917. }
  918. .order-total {
  919. margin-top: 20px;
  920. padding: 15px;
  921. background-color: #f5f7fa;
  922. border-radius: 4px;
  923. }
  924. </style>