sel-ship-manage.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <template>
  2. <div class="sel-confirm-module">
  3. <!-- 列表 -->
  4. <time-axis>
  5. <!-- 完成 -->
  6. <timeaxis-item class="axis-list axis-first com-wrap" bgcolor="none">
  7. <template v-slot:node>
  8. <div class="tui-node node-big">
  9. <div class="node-small"></div>
  10. </div>
  11. </template>
  12. <template v-slot:content>
  13. <div class="axis-slot-wrap">
  14. <div class="axis-title">发货</div>
  15. <div class="axis-det btn-wrap">
  16. <button class="admin-button-com big blue confirm-btn" @click="sendSelfFn">自己送</button>
  17. <button class="admin-button-com big blue confirm-btn" @click="sendShipFn">代送</button>
  18. </div>
  19. </div>
  20. </template>
  21. </timeaxis-item>
  22. <!-- 送达 -->
  23. <timeaxis-item class="axis-list com-wrap" bgcolor="none">
  24. <template v-slot:content>
  25. <div class="axis-slot-wrap">
  26. <div class="axis-title">打单</div>
  27. <div class="axis-det">
  28. <div class="app-color-0 app-bold">{{ orderComData[1].addTime | formatTime }}</div>
  29. <block v-if="!$util.isEmpty(orderComData[1].receive)">
  30. <card-name :info="orderComData[1].receive" />
  31. <div class="btn-wrap-com">
  32. <button class="admin-button-com default" @click="printOrderFn">重打</button>
  33. </div>
  34. </block>
  35. </div>
  36. </div>
  37. </template>
  38. </timeaxis-item>
  39. <timeaxis-item class="axis-list com-wrap" bgcolor="none">
  40. <template v-slot:content>
  41. <div class="axis-slot-wrap">
  42. <div class="axis-title">下单</div>
  43. <div class="axis-det">
  44. <div class="app-color-0 app-bold">{{ orderComData[1].addTime | formatTime }}</div>
  45. </div>
  46. </div>
  47. </template>
  48. </timeaxis-item>
  49. </time-axis>
  50. <!-- ship -->
  51. <modal-module :show="shipModal" :maskClosable="false" @cancel="modalCancel" @click="shipModalClick" title="确认发货?" padding="30rpx 30rpx">
  52. <template v-slot:content>
  53. <div class="app-modal-input-wrap ship-modal">
  54. <!-- <div class="inp-list-line switch-wrap">
  55. <div class="line-label">快递代送</div>
  56. <div class="line-input flex-strat">
  57. <switch :checked="form.sendType == '0' ? false : true" @change="switchChangeFn" />
  58. </div>
  59. </div> -->
  60. <!-- <block v-if="form.sendType == 1"> -->
  61. <div class="inp-list-line">
  62. <div class="line-label">送花时间</div>
  63. <div class="line-input">
  64. <picker mode="multiSelector" :range="timeList" :value="timeValue" @change="changeTimeFn" class="inp-select">
  65. <div v-if="form.sendTime">{{ form.sendTime }}</div>
  66. <div class="tui-placeholder" v-else>请选择</div>
  67. </picker>
  68. </div>
  69. </div>
  70. <div class="inp-list-line">
  71. <div class="line-label">配送方</div>
  72. <div class="line-input">
  73. <picker mode="selector" :range="deliveryList" @change="changedeliveryFn" range-key="text" class="inp-select">
  74. <div v-if="form.sendSide">{{ sendSideText }}</div>
  75. <div class="tui-placeholder" v-else>请选择</div>
  76. </picker>
  77. </div>
  78. </div>
  79. <!-- </block> -->
  80. </div>
  81. </template>
  82. </modal-module>
  83. <!-- 删除提示 -->
  84. <modal-module :show="selfShipModal" @cancel="modalCancel" @click="shipModalClick" content="确认已送达?" color="#333" :size="32" padding="30rpx 30rpx"></modal-module>
  85. </div>
  86. </template>
  87. <script>
  88. import TimeAxis from '@/admin/home/components/plugin/time-axis'
  89. import TimeaxisItem from '@/admin/home/components/plugin/timeaxis-item'
  90. import CardName from './card-name'
  91. import ModalModule from '@/components/plugin/modal'
  92. // api
  93. import { orderSend, printOrder } from '@/api/order'
  94. export default {
  95. name: 'sel-confirm-module',
  96. components: {
  97. TimeAxis,
  98. TimeaxisItem,
  99. CardName,
  100. ModalModule
  101. },
  102. props: {
  103. query: {
  104. type: Object,
  105. default: () => {}
  106. },
  107. orderData: {
  108. type: Object,
  109. default: () => {}
  110. },
  111. orderComData: {
  112. type: Array,
  113. default: () => []
  114. }
  115. },
  116. data() {
  117. return {
  118. shipModal: false,
  119. form: {
  120. sendType: 0,
  121. sendTime: '',
  122. sendSide: ''
  123. },
  124. sendSideText: '',
  125. // time
  126. timeList: [
  127. ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24'],
  128. ['00', '10', '20', '30', '40', '50']
  129. ],
  130. timeValue: [0, 0],
  131. // deliveryList
  132. deliveryList: [
  133. {
  134. text: '达达配送',
  135. key: 1
  136. }
  137. ],
  138. // 自己送
  139. selfShipModal: false
  140. }
  141. },
  142. methods: {
  143. sendShipFn() {
  144. this.shipModal = true
  145. this.form = {
  146. sendType: 0,
  147. sendTime: '',
  148. sendSide: ''
  149. }
  150. },
  151. sendSelfFn() {
  152. this.selfShipModal = true
  153. this.form = {
  154. sendType: 2,
  155. sendTime: '',
  156. sendSide: 1
  157. }
  158. },
  159. printOrderFn() {
  160. printOrder({
  161. id: this.orderData.id,
  162. option: 1
  163. }).then(res => {
  164. this.$util.pageTo({
  165. url: '/admin/order/ship',
  166. query: {
  167. id: this.orderData.id,
  168. pageStatus: 7
  169. }
  170. })
  171. })
  172. },
  173. // moadl
  174. switchChangeFn(e) {
  175. this.form.sendType = e.detail.value ? 1 : 0
  176. },
  177. changeTimeFn(e) {
  178. let oneIndex = e.detail.value[0] || 0
  179. let twoIndex = e.detail.value[1] || 0
  180. this.form.sendTime = this.timeList[0][oneIndex] + ':' + this.timeList[1][twoIndex]
  181. },
  182. changedeliveryFn(e) {
  183. this.form.sendSide = this.deliveryList[e.detail.value].key
  184. this.sendSideText = this.deliveryList[e.detail.value].text
  185. },
  186. shipModalClick(e) {
  187. if (e.index === 0) {
  188. this.modalCancel()
  189. } else {
  190. orderSend({
  191. id: this.query.id,
  192. option: 1,
  193. ...this.form
  194. }).then(res => {
  195. this.modalCancel()
  196. this.$util.pageTo({
  197. url: '/admin/order/ship',
  198. query: {
  199. id: this.query.id,
  200. pageStatus: 3
  201. }
  202. })
  203. })
  204. }
  205. },
  206. modalCancel() {
  207. this.shipModal = false
  208. this.selfShipModal = false
  209. }
  210. }
  211. }
  212. </script>
  213. <style lang="scss" scoped>
  214. // 完成
  215. .axis-first {
  216. .axis-det {
  217. margin-top: 40px !important;
  218. }
  219. .confirm-btn {
  220. width: 40%;
  221. }
  222. }
  223. // 打单
  224. .com-wrap {
  225. .axis-det {
  226. margin-top: 14px;
  227. & > div {
  228. margin-top: 20px;
  229. &:first-child {
  230. margin-top: 0;
  231. }
  232. }
  233. }
  234. }
  235. // modal
  236. .ship-modal {
  237. .line-label {
  238. width: 140px;
  239. }
  240. }
  241. .btn-wrap {
  242. display: flex;
  243. align-items: center;
  244. justify-content: space-between;
  245. }
  246. </style>