zj-dialog-deliver.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <view class="">
  3. <u-modal
  4. :show="isShow"
  5. title="确认发货"
  6. confirmColor="#01C30B"
  7. :showCancelButton="true"
  8. @cancel="cancelDialog"
  9. @confirm="confirmDialog">
  10. <view class="slot-content">
  11. <view class="row">
  12. <view class="label">发货方式</view>
  13. <u-radio-group
  14. v-model="type"
  15. placement="row">
  16. <u-radio label="自送" activeColor="#01C30B" :name="1"></u-radio>
  17. <u-radio label="物流快递" activeColor="#01C30B" :name="2" style="margin-left: 40rpx;"></u-radio>
  18. </u-radio-group>
  19. </view>
  20. <view class="row" v-show="type === 2">
  21. <view class="label">物流公司</view>
  22. <view class="value" @tap="isShowCompanyDialog = true">{{company ? company : '请选择'}}</view>
  23. </view>
  24. <view class="row" v-show="type === 2">
  25. <view class="label">物流单号</view>
  26. <u--input
  27. border="bottom"
  28. placeholder="请填写物流单号"
  29. v-model="orderNo"
  30. ></u--input>
  31. </view>
  32. </view>
  33. </u-modal>
  34. <zjDialogPicker
  35. ref="otherWorkerDialog"
  36. :isShow="isShowCompanyDialog"
  37. :multiple="false"
  38. :styleType="2"
  39. :title="'物流公司'"
  40. :list="companyList"
  41. :keyName="'label'"
  42. :isSearch="true"
  43. @search="searchCompanyDialog"
  44. @cancel="isShowCompanyDialog = false"
  45. @confirm="confirmCompanyDialog">
  46. </zjDialogPicker>
  47. </view>
  48. </template>
  49. <script>
  50. import zjDialogPicker from "@/components/zj-dialog/zj-dialog-picker.vue";
  51. export default {
  52. components: {
  53. zjDialogPicker
  54. },
  55. props: {
  56. isShow: {
  57. type: Boolean,
  58. default: false
  59. },
  60. orderId: {
  61. type: String,
  62. default: ''
  63. },
  64. },
  65. data() {
  66. return {
  67. type: 1, // 发货方式
  68. company: '', // 物流公司
  69. orderNo: '', // 物流单号
  70. companyList: [
  71. {label: '顺丰快递', value: 1},
  72. {label: '申通快递', value: 1},
  73. ],
  74. isShowCompanyDialog: false,
  75. }
  76. },
  77. methods: {
  78. setValue(id) {
  79. },
  80. searchCompanyDialog() {
  81. },
  82. confirmCompanyDialog(e) {
  83. this.company = this.companyList[e[0]].label;
  84. this.isShowCompanyDialog = false;
  85. },
  86. cancelDialog() {
  87. this.$emit('close');
  88. },
  89. confirmDialog() {
  90. if(this.type === 2 && !this.company) return this.$toast('请选择物流公司');
  91. if(this.type === 2 && !this.orderNo) return this.$toast('请填写物流单号');
  92. let url = '';
  93. if(this.detail.dispatchStatus == 'SQGP') {
  94. url = '/order/dispatch/ack';
  95. }else {
  96. url = '/order/rece/ack';
  97. }
  98. this.$axios({
  99. url,
  100. method: 'POST',
  101. params: {
  102. id: this.orderId,
  103. },
  104. isLoading: 1
  105. }).then(res => {
  106. uni.$emit('refreshHome');
  107. uni.$emit('refreshOrderDetail');
  108. this.$successToast('接收成功');
  109. this.cancelDialog();
  110. this.$navPage(`/packageOrder/pages/orderDetail?id=${this.orderId}`);
  111. })
  112. }
  113. }
  114. }
  115. </script>
  116. <style lang="scss" scoped>
  117. .slot-content {
  118. width: 100%;
  119. .row {
  120. display: flex;
  121. align-items: center;
  122. height: 60rpx;
  123. margin-top: 20rpx;
  124. .label {
  125. color: $sec-font;
  126. flex-shrink: 0;
  127. margin-right: 30rpx;
  128. }
  129. .value {
  130. flex: 1;
  131. // color: $theme-color;
  132. }
  133. ::v-deep .u-input {
  134. height: 40rpx !important;
  135. padding: 12rpx 0 !important;
  136. }
  137. }
  138. }
  139. </style>