sel-ship-manage.vue 5.5 KB

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