index.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item prop="orderNo">
  5. <el-input v-model="queryParams.orderNo" placeholder="请输入订单编号" clearable
  6. @keyup.enter.native="handleQuery" />
  7. </el-form-item>
  8. <el-form-item prop="appointmentTime">
  9. <el-date-picker clearable v-model="queryParams.appointmentTime" type="date" value-format="yyyy-MM-dd"
  10. placeholder="请选择创建时间"></el-date-picker>
  11. </el-form-item>
  12. <el-form-item prop="contactName">
  13. <el-input v-model="queryParams.contactName" placeholder="请输入客户名称" clearable
  14. @keyup.enter.native="handleQuery" />
  15. </el-form-item>
  16. <el-form-item prop="contactPhone" label-width="90px">
  17. <el-input v-model="queryParams.contactPhone" placeholder="请输入客户手机号" clearable
  18. @keyup.enter.native="handleQuery" />
  19. </el-form-item>
  20. <el-form-item>
  21. <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
  22. <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
  23. </el-form-item>
  24. </el-form>
  25. <el-row :gutter="10" class="mb8">
  26. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  27. </el-row>
  28. <el-tabs type="border-card" v-model="virtualListStatus" @tab-click="changeOrderStatus">
  29. <el-tab-pane label="待接单" :name="'0'" ></el-tab-pane>
  30. <el-tab-pane label="取衣中" :name="'1'"></el-tab-pane>
  31. <el-tab-pane label="待支付" :name="'4'"></el-tab-pane>
  32. <el-tab-pane label="待入厂" :name="'5'"></el-tab-pane>
  33. <el-tab-pane label="清洗中" :name="'6'"></el-tab-pane>
  34. <el-tab-pane label="待上挂" :name="'8'"></el-tab-pane>
  35. <el-tab-pane label="待送衣" :name="'9'"></el-tab-pane>
  36. <el-tab-pane label="送衣中" :name="'10'"></el-tab-pane>
  37. <el-tab-pane label="已完成" :name="'12'"></el-tab-pane>
  38. <el-table v-loading="loading" fit highlight-current-row border stripe :data="clothList">
  39. <el-table-column label="预约单号" align="center" prop="orderNo" width="200px" />
  40. <el-table-column label="预约时间" align="center" prop="appointmentTime" width="160px" />
  41. <el-table-column label="是否大件" align="center" width="100px">
  42. <template slot-scope="scope">
  43. <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.isLargeItem" />
  44. </template>
  45. </el-table-column>
  46. <el-table-column label="是否拆装" align="center" width="100px">
  47. <template slot-scope="scope">
  48. <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.isDisassemblyAndAssembly" />
  49. </template>
  50. </el-table-column>
  51. <el-table-column label="件数" align="center" prop="appointmentCount" width="80px" />
  52. <el-table-column label="客户姓名" align="center" prop="contactName" width="120px">
  53. <template slot-scope="scope">
  54. <div>{{ scope.row.contactName }}</div>
  55. </template>
  56. </el-table-column>
  57. <el-table-column label="客户电话" align="center" prop="contactName" width="120px">
  58. <template slot-scope="scope">
  59. <div>{{ scope.row.contactPhone }}</div>
  60. </template>
  61. </el-table-column>
  62. <el-table-column label="订单金额" align="center" width="120">
  63. <template slot-scope="scope">
  64. <span class="value">{{ scope.row.payAmount > 0 ? scope.row.payAmount : '未定价' }}</span>
  65. </template>
  66. </el-table-column>
  67. <el-table-column label="订单状态" align="center" width="150">
  68. <template slot-scope="scope">
  69. <div class="status-group">
  70. <dict-tag :options="dict.type.cloth_order_status" :value="scope.row.orderStatus" />
  71. </div>
  72. </template>
  73. </el-table-column>
  74. <el-table-column label="取衣方式" align="center" width="120px">
  75. <template slot-scope="scope">
  76. <dict-tag :options="dict.type.cloth_take_type" :value="scope.row.takeClothWay" />
  77. </template>
  78. </el-table-column>
  79. <el-table-column label="配送方式" align="center" width="120px">
  80. <template slot-scope="scope">
  81. <dict-tag :options="dict.type.order_cloth_delivery_way" :value="scope.row.deliveryWay" />
  82. </template>
  83. </el-table-column>
  84. <el-table-column label="派送员" align="center" width="100px">
  85. <template slot-scope="scope">
  86. <span v-if="scope.row.takeClothAppUserId == null || scope.row.takeClothAppUserId == ''">- -</span>
  87. <span v-if="scope.row.takeClothAppUserId != null || scope.row.takeClothAppUserId != ''">
  88. {{ scope.row.takeClothAppUserName }}
  89. </span>
  90. </template>
  91. </el-table-column>
  92. <el-table-column label="派送员手机号" align="center" width="120px">
  93. <template slot-scope="scope">
  94. <span v-if="scope.row.takeClothAppUserId == null || scope.row.takeClothAppUserId == ''">- -</span>
  95. <span v-if="scope.row.takeClothAppUserId != null || scope.row.takeClothAppUserId != ''">
  96. {{ scope.row.takeClothAppUserPhone }}
  97. </span>
  98. </template>
  99. </el-table-column>
  100. <el-table-column label="地址明细" align="center" prop="address" min-width="220px" show-overflow-tooltip></el-table-column>
  101. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="180">
  102. <template slot-scope="scope">
  103. <el-button type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
  104. v-if="scope.row.orderStatus == '0' || scope.row.orderStatus == '9'">派单
  105. </el-button>
  106. <el-button type="text" icon="el-icon-delete" @click="handleCancel(scope.row)"
  107. v-if="scope.row.deliveryStatus == '10000'">取消订单
  108. </el-button>
  109. </template>
  110. </el-table-column>
  111. </el-table>
  112. <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
  113. @pagination="getList" />
  114. <!-- 添加或修改洗衣订单对话框 -->
  115. <el-dialog :title="title" :visible.sync="open" width="40%" append-to-body>
  116. <el-row :gutter="15">
  117. <el-form ref="form" :model="form" :rules="rules" label-width="100px">
  118. <el-col :span="24">
  119. <el-form-item label="配送方式" prop="service_trans_id">
  120. <el-radio-group v-model="form.service_trans_id">
  121. <el-radio-button v-if="virtualListStatus !== 1" key="0" label="0">第三方配送</el-radio-button>
  122. <el-radio-button key="1" label="1">门店配送</el-radio-button>
  123. </el-radio-group>
  124. </el-form-item>
  125. </el-col>
  126. <el-col :span="24" v-if="form.service_trans_id == 1">
  127. <el-form-item label="配送员" prop="takeClothAppUserId">
  128. <el-select v-model="form.takeClothAppUserId" placeholder="请选择配送员" clearable>
  129. <el-option v-for="man in deliveryManList" :key="man.appUserId" :label="man.realName"
  130. :value="man.appUserId" />
  131. </el-select>
  132. </el-form-item>
  133. </el-col>
  134. </el-form>
  135. </el-row>
  136. <div>
  137. <el-button type="primary" @click="submitForm" style="margin-left: 40%">提交</el-button>
  138. </div>
  139. </el-dialog>
  140. </el-tabs>
  141. <!-- 添加或修改商品品牌管理对话框 -->
  142. <el-dialog title="同城配送信息" :visible.sync="intracityExpressOpen" size="50%" append-to-body>
  143. <el-row :gutter="15" style="margin-bottom: 80px; margin-left: 20px; width: calc(100% - 20px)">
  144. <el-col :span="24">
  145. <el-descriptions class="margin-top" :column="2" border>
  146. <el-descriptions-item>
  147. <template slot="label"> 配送公司</template>
  148. <dict-tag :options="dict.type.express_service_type" :value="intracityExpressOrderInfo.service_trans_id" />
  149. </el-descriptions-item>
  150. <el-descriptions-item>
  151. <template slot="label"> 配送订单状态</template>
  152. <dict-tag :options="dict.type.intracity_express_order_status"
  153. :value="intracityExpressOrderInfo.order_status" />
  154. </el-descriptions-item>
  155. <el-descriptions-item>
  156. <template slot="label"> 配送距离</template>
  157. <span v-if="intracityExpressOrderInfo.distance < 1000">{{ intracityExpressOrderInfo.distance }}米</span>
  158. <span v-else>{{ intracityExpressOrderInfo.distance / 1000 }}千米</span>
  159. </el-descriptions-item>
  160. <el-descriptions-item>
  161. <template slot="label"> 支付费用</template>
  162. {{ intracityExpressOrderInfo.actualfee / 100 }}元
  163. </el-descriptions-item>
  164. <el-descriptions-item>
  165. <template slot="label"> 违约金</template>
  166. {{ intracityExpressOrderInfo.deductfee / 100 }}元
  167. </el-descriptions-item>
  168. <el-descriptions-item>
  169. <template slot="label"></template>
  170. </el-descriptions-item>
  171. <el-descriptions-item>
  172. <template slot="label"> 发单时间</template>
  173. {{ transDate(intracityExpressOrderInfo.create_time) }}
  174. </el-descriptions-item>
  175. <el-descriptions-item>
  176. <template slot="label"> 配送员接单时间</template>
  177. {{ transDate(intracityExpressOrderInfo.accept_time) }}
  178. </el-descriptions-item>
  179. <el-descriptions-item>
  180. <template slot="label"> 配送员取货时间</template>
  181. {{ transDate(intracityExpressOrderInfo.fetch_time) }}
  182. </el-descriptions-item>
  183. <el-descriptions-item>
  184. <template slot="label"> 配送员送达时间</template>
  185. {{ transDate(intracityExpressOrderInfo.finish_time) }}
  186. </el-descriptions-item>
  187. <el-descriptions-item>
  188. <template slot="label"> 取消时间</template>
  189. {{ transDate(intracityExpressOrderInfo.cancel_time) }}
  190. </el-descriptions-item>
  191. <el-descriptions-item>
  192. <template slot="label"> 预期送达时间</template>
  193. {{ transDate(intracityExpressOrderInfo.expected_finish_time) }}
  194. </el-descriptions-item>
  195. <el-descriptions-item>
  196. <template slot="label"> 配送员姓名</template>
  197. {{ intracityExpressOrderInfo.transporter_info ? intracityExpressOrderInfo.transporter_info.transporter_name : ''
  198. }}
  199. </el-descriptions-item>
  200. <el-descriptions-item>
  201. <template slot="label"> 配送员手机</template>
  202. {{ intracityExpressOrderInfo.transporter_info ? intracityExpressOrderInfo.transporter_info.transporter_phone : ''
  203. }}
  204. </el-descriptions-item>
  205. <el-descriptions-item>
  206. <template slot="label"> 取件人姓名</template>
  207. {{ intracityExpressOrderInfo.store_info ? intracityExpressOrderInfo.store_info.store_name : '' }}
  208. </el-descriptions-item>
  209. <el-descriptions-item>
  210. <template slot="label"> 取件人电话</template>
  211. {{ intracityExpressOrderInfo.store_info ? intracityExpressOrderInfo.store_info.phone_num : '' }}
  212. </el-descriptions-item>
  213. <el-descriptions-item :span="2">
  214. <template slot="label"> 取件地址</template>
  215. {{ intracityExpressOrderInfo.store_info ? intracityExpressOrderInfo.store_info.address : '' }}
  216. </el-descriptions-item>
  217. <el-descriptions-item>
  218. <template slot="label"> 收件人姓名</template>
  219. {{ intracityExpressOrderInfo.receiver_info ? intracityExpressOrderInfo.receiver_info.receiver_name : '' }}
  220. </el-descriptions-item>
  221. <el-descriptions-item>
  222. <template slot="label"> 收件人电话</template>
  223. {{ intracityExpressOrderInfo.receiver_info ? intracityExpressOrderInfo.receiver_info.phone_num : '' }}
  224. </el-descriptions-item>
  225. <el-descriptions-item :span="2">
  226. <template slot="label"> 收件地址</template>
  227. {{ intracityExpressOrderInfo.receiver_info ? intracityExpressOrderInfo.receiver_info.address : '' }}
  228. </el-descriptions-item>
  229. </el-descriptions>
  230. </el-col>
  231. </el-row>
  232. <div slot="footer" class="dialog-footer">
  233. <el-button @click="cancel" style="margin-left: 5%">取 消</el-button>
  234. </div>
  235. </el-dialog>
  236. <!-- 订单出货对话框 -->
  237. <el-dialog title="订单出货信息" :visible.sync="openDeliveryPage" size="40%" append-to-body
  238. :before-close="deliveryClose">
  239. <el-row :gutter="15">
  240. <el-form ref="deliveryVo" :model="deliveryVo" :rules="deliveryRules" label-width="120px">
  241. <el-col :span="24">
  242. <el-form-item label="快递公司" prop="deliveryCompany">
  243. <el-radio-group v-model="deliveryVo.deliveryCompany" @input="changeDeliveryId">
  244. <el-radio-button v-for="dict in deliveryData" :label="dict.deliveryName"
  245. :key="dict.deliveryName"></el-radio-button>
  246. </el-radio-group>
  247. </el-form-item>
  248. <el-form-item label="服务类型" prop="serviceType">
  249. <div class="servicecard" v-for="del in serviceData" :key="del.serviceType" @click="checkserviceId(del)"
  250. :class="{ active: deliveryVo.serviceType == del.serviceType }">
  251. <div class="check"><i class="el-icon-check"></i></div>
  252. {{ del.serviceName }}
  253. </div>
  254. </el-form-item>
  255. <el-form-item label="预期揽件时间" prop="expectTime">
  256. <el-date-picker
  257. type="datetime"
  258. placeholder="选择预期揽件时间"
  259. v-model="deliveryVo.expectTime"
  260. style="width: 100%"
  261. value-format="yyyy-MM-dd HH:mm"
  262. format="yyyy-MM-dd HH:mm"
  263. :picker-options="{
  264. disabledDate: (time) => {
  265. return time.getTime() < Date.now() - 3600 * 1000 * 24
  266. },
  267. selectableRange: startTimeRange
  268. }"
  269. :default-time="deliTime"
  270. class="date_picker"
  271. :editable="false"
  272. ></el-date-picker>
  273. </el-form-item>
  274. <!-- <el-form-item label="包裹数量" prop="count">
  275. <el-input v-model="deliveryVo.count" type="number" placeholder="请输入包裹数量" clearable></el-input>
  276. </el-form-item> -->
  277. <el-form-item label="货物高度" prop="spaceHeight">
  278. <el-input v-model="deliveryVo.spaceHeight" placeholder="请输入货物高度" clearable>
  279. <template slot="append">厘米(cm)</template>
  280. </el-input>
  281. </el-form-item>
  282. <el-form-item label="货物长度" prop="spaceLength">
  283. <el-input v-model="deliveryVo.spaceLength" placeholder="请输入货物长度" clearable>
  284. <template slot="append">厘米(cm)</template>
  285. </el-input>
  286. </el-form-item>
  287. <el-form-item label="货物宽度" prop="spaceWidth">
  288. <el-input v-model="deliveryVo.spaceWidth" placeholder="请输入货物宽度" clearable>
  289. <template slot="append">厘米(cm)</template>
  290. </el-input>
  291. </el-form-item>
  292. <el-form-item label="货物总重量" prop="weight">
  293. <el-input v-model="deliveryVo.weight" placeholder="请输入货物总重量" clearable>
  294. <template slot="append">千克 (kg)</template>
  295. </el-input>
  296. </el-form-item>
  297. <el-form-item label="备注信息" prop="customRemark">
  298. <el-input v-model="deliveryVo.customRemark" rows="5" type="textarea"
  299. placeholder="请输入备注信息,比如易碎物品……" maxlength="500" show-word-limit
  300. clearable></el-input>
  301. </el-form-item>
  302. </el-col>
  303. </el-form>
  304. </el-row>
  305. <div slot="footer" class="dialog-footer">
  306. <el-button type="primary" @click="submitDelivery('deliveryVo')" style="margin-left: 5%">提交</el-button>
  307. <el-button @click="cancelDelivery">取 消</el-button>
  308. </div>
  309. </el-dialog>
  310. <!-- 快递信息对话框 -->
  311. <el-dialog title="快递信息" :visible.sync="openDeliveryinfo" size="40%" append-to-body
  312. :before-close="deliveryinfoClose">
  313. <div class="deliveryView">
  314. <div class="info">
  315. <span>快递公司:</span>
  316. <span>{{ deliveryView.name }}</span>
  317. </div>
  318. <div class="info">
  319. <span>收货地址:</span>
  320. <span>{{ deliveryView.address }}</span>
  321. </div>
  322. </div>
  323. <el-timeline v-if="deliveryView.pathItemList.length">
  324. <el-timeline-item v-for="(item, index) in deliveryView.pathItemList" :key="index" :timestamp="item.actionTime">
  325. {{ item.actionMsg }}
  326. </el-timeline-item>
  327. </el-timeline>
  328. <el-empty description="暂无快递信息" v-else></el-empty>
  329. <div slot="footer" class="dialog-footer">
  330. <el-button type="primary" style="margin-left: 5%" @click="openDeliveryinfo = false">关闭</el-button>
  331. </div>
  332. </el-dialog>
  333. </div>
  334. </template>
  335. <script>
  336. import {
  337. getAppointmentClothOrderList,
  338. setDeliveryManByAppointment,
  339. cancelAppointmentOrderByAppointment,
  340. setIntracityExpress,
  341. orderClothSetThirdDelivery,
  342. setSendDelivery
  343. } from '@/api/order/cloth'
  344. import { getDeliveryManListByOrg } from '../../../api/app/delivery'
  345. import { intracityExpressGetOrderInfo } from '../../../api/express/intracity'
  346. import { formatDate } from '../../../utils'
  347. import { getdeliveryAll, getDeliveryPath } from '../../../api/order/goods'
  348. import { getDeliveryPathByClothOrderNo } from '../../../api/express/delivery'
  349. export default {
  350. name: 'WorkAppointmentOrder',
  351. dicts: ['cloth_order_status', 'sys_normal_disable', 'sys_yes_no', 'cloth_take_type', 'cloth_send_type', 'order_cloth_delivery_way', 'express_service_type', 'intracity_express_order_status'],
  352. data() {
  353. var validateNumberInput = (rule, value, callback) => {
  354. if (!value || isNaN(value)) {
  355. callback(new Error('只能输入数字,不能为空'))
  356. } else {
  357. callback()
  358. }
  359. }
  360. return {
  361. orderStatus: '1',
  362. virtualListStatus: '0',
  363. // 遮罩层
  364. loading: true,
  365. // 选中数组
  366. ids: [],
  367. // 非单个禁用
  368. single: true,
  369. // 非多个禁用
  370. multiple: true,
  371. // 显示搜索条件
  372. showSearch: true,
  373. // 总条数
  374. total: 0,
  375. // 预约订单表格数据
  376. clothList: [],
  377. // 弹出层标题
  378. title: '',
  379. // 是否显示弹出层
  380. open: false,
  381. intracityExpressOpen: false,
  382. intracityExpressOrderInfo: {},
  383. openDeliveryPage: false,
  384. deliveryVo: {
  385. bizId: '',
  386. // count: 1,
  387. customRemark: '',
  388. deliveryCompany: '',
  389. deliveryId: '',
  390. expectTime: '',
  391. orderId: null,
  392. serviceName: '',
  393. serviceType: null,
  394. spaceHeight: null,
  395. spaceLength: null,
  396. spaceWidth: null,
  397. weight: null
  398. },
  399. deliveryData: [], //快递公司数据
  400. serviceData: [], //快递公司服务类型数据
  401. openDeliveryinfo: false,
  402. deliveryView: {
  403. name: '',
  404. pathItemList: []
  405. },
  406. startTimeRange: null,
  407. deliTime: null,
  408. // 查询参数
  409. queryParams: {
  410. pageNum: 1,
  411. pageSize: 10,
  412. orderNo: null,
  413. contactName: null,
  414. contactPhone: null,
  415. orderStatus: null,
  416. virtualListStatus: '0'
  417. },
  418. // 表单参数
  419. form: {},
  420. // 表单校验
  421. rules: {
  422. service_trans_id: [
  423. {
  424. required: true,
  425. message: '配送方式不能为空',
  426. trigger: 'blur'
  427. }
  428. ],
  429. takeClothAppUserId: [
  430. {
  431. required: true,
  432. message: '派送员不能为空',
  433. trigger: 'blur'
  434. }
  435. ]
  436. },
  437. deliveryRules: {
  438. deliveryName: [{ required: true, message: '请选择物流公司', trigger: 'change' }],
  439. serviceType: [{ required: true, message: '请选择服务类型', trigger: 'change' }],
  440. expectTime: [{ required: true, message: '选择预期揽件时间', trigger: 'blur' }],
  441. // count: [
  442. // { required: true, message: '请输入包裹数量', trigger: 'blur' },
  443. // ],
  444. spaceHeight: [
  445. { required: true, message: '请输入货物高度', trigger: 'blur' },
  446. { validator: validateNumberInput, trigger: 'blur' }
  447. ],
  448. spaceLength: [
  449. { required: true, message: '请输入货物长度', trigger: 'blur' },
  450. { validator: validateNumberInput, trigger: 'blur' }
  451. ],
  452. spaceWidth: [
  453. { required: true, message: '请输入货物宽度', trigger: 'blur' },
  454. { validator: validateNumberInput, trigger: 'blur' }
  455. ],
  456. weight: [
  457. { required: true, message: '请输入货物总重量', trigger: 'blur' },
  458. { validator: validateNumberInput, trigger: 'blur' }
  459. ],
  460. customRemark: [{ required: true, message: '请输入备注信息,比如易碎物品……', trigger: 'blur' }]
  461. },
  462. deliveryManList: []
  463. }
  464. },
  465. created() {
  466. var userInfoVO = this.getUserInfo()
  467. console.log(userInfoVO)
  468. if (userInfoVO.userType == '02') {
  469. this.getDeliveryList()
  470. } else {
  471. this.getdeliveryAll()
  472. }
  473. this.getList()
  474. },
  475. methods: {
  476. getDeliveryList() {
  477. getDeliveryManListByOrg().then((response) => {
  478. this.deliveryManList = response.data
  479. })
  480. },
  481. changeOrderStatus() {
  482. this.queryParams.virtualListStatus = this.virtualListStatus
  483. this.handleQuery()
  484. },
  485. /** 查询洗衣订单列表 */
  486. getList() {
  487. this.loading = true
  488. this.queryParams.virtualListStatus = this.virtualListStatus
  489. getAppointmentClothOrderList(this.queryParams).then((response) => {
  490. this.clothList = response.rows
  491. this.total = response.total
  492. this.loading = false
  493. this.$forceUpdate()
  494. })
  495. },
  496. // 取消按钮
  497. cancel() {
  498. this.intracityExpressOpen = false
  499. this.open = false
  500. this.reset()
  501. },
  502. // 表单重置
  503. reset() {
  504. this.form = {
  505. id: null,
  506. orderNo: null,
  507. orgId: null,
  508. sourceType: null,
  509. factoryId: null,
  510. appUserId: null,
  511. province: null,
  512. city: null,
  513. area: null,
  514. address: null,
  515. addressDetail: null,
  516. longitude: null,
  517. latitude: null,
  518. contactName: null,
  519. contactPhone: null,
  520. orderAmount: null,
  521. payAmount: null,
  522. payType: null,
  523. payTime: null,
  524. outTradeOrderNo: null,
  525. orderSource: null,
  526. refundAmount: null,
  527. refundContent: null,
  528. appointmentTime: null,
  529. appointmentCount: null,
  530. orderStatus: '0',
  531. virtualListStatus: 1,
  532. takeClothTime: null,
  533. takeClothAppUserId: null,
  534. setPriceTime: null,
  535. pickUpTime: null,
  536. washClothStartTime: null,
  537. washClothEndTime: null,
  538. sendToStoreTime: null,
  539. sendToUserTime: null,
  540. refundApplyTime: null,
  541. refundTime: null,
  542. refundStatus: '0',
  543. refundReason: null,
  544. sendClothAppUserId: null,
  545. takeClothWay: null,
  546. sendClothWay: null,
  547. couponAmount: null,
  548. finishTime: null,
  549. employeeId: null,
  550. delFlag: null,
  551. createById: null,
  552. createBy: null,
  553. createTime: null,
  554. updateById: null,
  555. updateBy: null,
  556. updateTime: null,
  557. remark: null,
  558. isDisassemblyAndAssembly: null,
  559. isLargeItem: null,
  560. clothSpeedId: null,
  561. clothSpeedName: null,
  562. isSpecial: null,
  563. deductAmount: null
  564. }
  565. this.resetForm('form')
  566. },
  567. /** 搜索按钮操作 */
  568. handleQuery() {
  569. this.getList()
  570. },
  571. /** 重置按钮操作 */
  572. resetQuery() {
  573. this.resetForm('queryForm')
  574. this.handleQuery()
  575. },
  576. /** 派单按钮操作 */
  577. handleUpdate(row) {
  578. this.reset()
  579. var userInfoVO = this.getUserInfo()
  580. if (userInfoVO.userType == '01') {
  581. this.openDeliveryPage = true
  582. this.deliveryVo.deliveryCompany = this.deliveryData[0].deliveryName
  583. this.serviceData = this.deliveryData[0].serviceType
  584. // 获取当前时间
  585. const now = new Date()
  586. // 增加一个小时
  587. now.setHours(now.getHours() + 1)
  588. // 提取时分秒并格式化
  589. const hours = ('0' + now.getHours()).slice(-2)
  590. const minutes = ('0' + now.getMinutes()).slice(-2)
  591. const seconds = ('0' + now.getSeconds()).slice(-2)
  592. // 结果字符串
  593. this.deliTime = `${hours}:${minutes}:${seconds}`
  594. this.deliveryVo.orderNo = row.orderNo
  595. } else {
  596. if (this.virtualListStatus === 1) {
  597. this.form.service_trans_id = '1'
  598. }
  599. this.open = true
  600. this.form.orderNo = row.orderNo
  601. this.form.orderStatus = row.orderStatus
  602. }
  603. },
  604. /** 提交按钮 */
  605. submitForm() {
  606. this.$refs['form'].validate((valid) => {
  607. if (valid) {
  608. if (this.form.service_trans_id == 0) {
  609. setIntracityExpress({ orderNo: this.form.orderNo }).then((res) => {
  610. this.$modal.msgSuccess('派单成功')
  611. this.open = false
  612. this.getList()
  613. })
  614. } else {
  615. if (this.form.orderStatus == '0') {
  616. setDeliveryManByAppointment({
  617. deliveryId: this.form.takeClothAppUserId,
  618. orderNo: this.form.orderNo
  619. }).then((response) => {
  620. this.$modal.msgSuccess('派单成功')
  621. this.open = false
  622. this.getList()
  623. })
  624. } else {
  625. setSendDelivery({
  626. deliveryManId: this.form.takeClothAppUserId,
  627. orderNo: this.form.orderNo
  628. }).then((response) => {
  629. this.$modal.msgSuccess('派单成功')
  630. this.open = false
  631. this.getList()
  632. })
  633. }
  634. }
  635. }
  636. })
  637. },
  638. handleCancel(row) {
  639. this.$confirm('是否确认取消该预约订单?')
  640. .then(() => {
  641. cancelAppointmentOrderByAppointment({ orderNo: row.orderNo }).then((response) => {
  642. this.$modal.msgSuccess('取消完成')
  643. this.getList()
  644. })
  645. })
  646. .catch(() => {
  647. })
  648. },
  649. checkClose(done) {
  650. this.$confirm('是否关闭表单,关闭后数据将丢失?')
  651. .then(function() {
  652. done()
  653. })
  654. .then(() => {
  655. })
  656. .catch(() => {
  657. })
  658. },
  659. handleLogistics(row, deliveryType) {
  660. getDeliveryPathByClothOrderNo({ orderNo: row.orderNo, deliveryType: deliveryType }).then((res) => {
  661. this.deliveryView.name = row.deliveryName
  662. this.deliveryView.pathItemList = res.data.pathItemList
  663. this.deliveryView.address = row.province + row.city + row.area + row.address + row.addressDetail
  664. this.openDeliveryinfo = true
  665. })
  666. },
  667. handleGetExpressInfo(row, deliveryType) {
  668. intracityExpressGetOrderInfo({ orderNo: row.orderNo, deliveryType: deliveryType }).then((res) => {
  669. this.intracityExpressOpen = true
  670. this.intracityExpressOrderInfo = res.data
  671. })
  672. },
  673. transDate(pay_time) {
  674. return formatDate(pay_time * 1000, 1)
  675. },
  676. //获取快递公司
  677. getdeliveryAll() {
  678. getdeliveryAll().then((res) => {
  679. this.deliveryData = res.data
  680. })
  681. },
  682. //切换快递获取其他数据
  683. changeDeliveryId(value) {
  684. this.deliveryData.forEach((item, index) => {
  685. if (value == item.deliveryName) {
  686. this.deliveryVo.deliveryId = item.deliveryId
  687. this.deliveryVo.bizId = item.bizId
  688. this.serviceData = item.serviceType
  689. }
  690. })
  691. },
  692. checkserviceId(del) {
  693. this.deliveryVo.serviceType = del.serviceType
  694. this.deliveryVo.serviceName = del.serviceName
  695. },
  696. cancelDelivery() {
  697. this.openDeliveryPage = false
  698. this.deliveryreset()
  699. },
  700. // 表单重置
  701. deliveryreset() {
  702. this.deliveryVo = {
  703. bizId: '',
  704. // count: 1,
  705. customRemark: '',
  706. deliveryCompany: '',
  707. deliveryId: '',
  708. expectTime: '',
  709. orderId: 0,
  710. serviceName: '',
  711. serviceType: null,
  712. spaceHeight: null,
  713. spaceLength: null,
  714. spaceWidth: null,
  715. weight: null
  716. }
  717. },
  718. deliveryClose(done) {
  719. this.$confirm('是否关闭出货信息窗口,确认关闭?')
  720. .then(function() {
  721. done()
  722. })
  723. .then(() => {
  724. })
  725. .catch(() => {
  726. })
  727. },
  728. deliveryinfoClose(done) {
  729. this.$confirm('是否关闭快递信息窗口,确认关闭?')
  730. .then(function() {
  731. done()
  732. })
  733. .then(() => {
  734. })
  735. .catch(() => {
  736. })
  737. },
  738. submitDelivery(formName) {
  739. this.$confirm('是否确认出货配送?')
  740. .then(() => {
  741. this.$refs[formName].validate((valid) => {
  742. if (valid) {
  743. orderClothSetThirdDelivery(this.deliveryVo).then((res) => {
  744. this.$message.success('操作成功')
  745. this.getList()
  746. this.openDeliveryPage = false
  747. this.deliveryreset()
  748. })
  749. }
  750. })
  751. })
  752. .catch(() => {
  753. })
  754. }
  755. }
  756. }
  757. </script>
  758. <style lang="scss" scoped>
  759. .servicecard {
  760. box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  761. background-color: #fff;
  762. border-radius: 5px;
  763. margin: 0 10px 10px 0;
  764. padding: 10px 20px;
  765. display: inline-block;
  766. cursor: pointer;
  767. position: relative;
  768. &::after {
  769. content: '';
  770. position: absolute;
  771. top: 0;
  772. right: 0px; /* 调整三角形的大小和位置 */
  773. width: 0;
  774. height: 0;
  775. border-left: 35px solid transparent;
  776. border-top: 35px solid #007bff;
  777. z-index: 50;
  778. opacity: 0;
  779. }
  780. .check {
  781. position: absolute;
  782. top: -5px;
  783. right: 3px;
  784. color: #fff;
  785. z-index: 100;
  786. opacity: 0;
  787. }
  788. &.active {
  789. &::after {
  790. opacity: 1;
  791. }
  792. .check {
  793. opacity: 1;
  794. }
  795. }
  796. }
  797. .deliveryView {
  798. margin: 0 20px 20px 20px;
  799. padding: 15px;
  800. border-radius: 5px;
  801. background-color: #f4f4f4;
  802. color: #555;
  803. .info:first-child {
  804. margin-bottom: 10px;
  805. }
  806. }
  807. </style>
  808. s