Commit 89cfa265d54dabe89bbb8d6bc914019a3a3385ee
1 parent
73835ce7
Exists in
master
and in
1 other branch
fix: 建单超额提醒
Showing
3 changed files
with
47 additions
and
15 deletions
Show diff stats
pages/order/add.vue
| ... | ... | @@ -181,7 +181,7 @@ |
| 181 | 181 | </u-form> |
| 182 | 182 | </template> |
| 183 | 183 | <template #footer> |
| 184 | - <u-button :loading="loading" type="primary" @tap="submitAddFun">下单并指派</u-button> | |
| 184 | + <u-button :loading="loading" type="primary" @click="submitAddFun(false)">下单并指派</u-button> | |
| 185 | 185 | </template> |
| 186 | 186 | <u-toast ref="uToast"></u-toast> |
| 187 | 187 | <u-modal :show="showModal" title="粘贴识别司机车辆信息" :showCancelButton="true" @cancel="showModal = false" @confirm="cliSubmit" confirmText="确定"> |
| ... | ... | @@ -198,6 +198,9 @@ |
| 198 | 198 | > |
| 199 | 199 | <u-textarea disabled v-model="content2"></u-textarea> |
| 200 | 200 | </u-modal> |
| 201 | + <u-modal title="建单超额提醒" :show="exceed" :showCancelButton="true" @cancel="submitAddFun(true)" @confirm="exceed = false" cancelText="继续下单" confirmText="放弃下单"> | |
| 202 | + <rich-text :nodes="exceedStr"> </rich-text> | |
| 203 | + </u-modal> | |
| 201 | 204 | <popup-platenumber :visible="showCar" @update:visible="e => (showCar = e)" @confirm="carConfirm" v-model="carNumber"></popup-platenumber> |
| 202 | 205 | </Page> |
| 203 | 206 | </template> |
| ... | ... | @@ -212,6 +215,8 @@ export default { |
| 212 | 215 | components: { UTextarea, PopupPlatenumber, payee }, |
| 213 | 216 | data() { |
| 214 | 217 | return { |
| 218 | + exceed: false, | |
| 219 | + exceedStr: '', | |
| 215 | 220 | openExternalInsuranceFlag: true, |
| 216 | 221 | eventCode: '', |
| 217 | 222 | loading: false, |
| ... | ... | @@ -661,20 +666,22 @@ export default { |
| 661 | 666 | } |
| 662 | 667 | }); |
| 663 | 668 | }, |
| 664 | - submitAddFun() { | |
| 669 | + submitAddFun(confirmAddFlag = false) { | |
| 670 | + this.exceed = false; | |
| 665 | 671 | if (this.loading) return; |
| 666 | 672 | this.loading = true; |
| 667 | 673 | let totalAmount = Number(this.form.paidAmount || 0) + Number(this.form.serviceAmount || 0) + Number(this.form.securityServiceAmount || 0); |
| 668 | 674 | let addFun = this.eventCode ? uni.$u.api.freightGoodsSourceV2.addOrder : uni.$u.api.freightOrder.add; |
| 669 | - addFun({ ...this.form, totalAmount, payeeId: this.payeeModel.driverId }) | |
| 675 | + addFun({ ...this.form, totalAmount, payeeId: this.payeeModel.driverId, confirmAddFlag }) | |
| 670 | 676 | .then(res => { |
| 671 | - if (res.success) { | |
| 672 | - // this.form = {}; | |
| 677 | + if (res.result) { | |
| 678 | + this.loading = false; | |
| 679 | + this.exceedStr = res.result; | |
| 680 | + this.exceed = true; | |
| 681 | + } else { | |
| 673 | 682 | uni.showToast({ title: '下单成功', icon: 'none' }); |
| 674 | 683 | this.getOpenerEventChannel().emit('refreshData'); |
| 675 | 684 | setTimeout(() => uni.navigateBack(), 1500); |
| 676 | - } else { | |
| 677 | - this.loading = false; | |
| 678 | 685 | } |
| 679 | 686 | }) |
| 680 | 687 | .catch(e => { | ... | ... |
pages/order/again-assign.vue
| ... | ... | @@ -65,8 +65,11 @@ |
| 65 | 65 | </view> |
| 66 | 66 | </template> |
| 67 | 67 | <template #footer> |
| 68 | - <u-button type="primary" @tap="submit">确认更改</u-button> | |
| 68 | + <u-button type="primary" @click="submit(false)">确认更改</u-button> | |
| 69 | 69 | </template> |
| 70 | + <u-modal title="建单超额提醒" :show="exceed" :showCancelButton="true" @cancel="submit(true)" @confirm="exceed = false" cancelText="继续下单" confirmText="放弃下单"> | |
| 71 | + <rich-text :nodes="exceedStr"> </rich-text> | |
| 72 | + </u-modal> | |
| 70 | 73 | <popup-platenumber :visible="showCar" @update:visible="e => (showCar = e)" @confirm="carConfirm" v-model="carNumber"></popup-platenumber> |
| 71 | 74 | </Page> |
| 72 | 75 | </template> |
| ... | ... | @@ -80,6 +83,8 @@ export default { |
| 80 | 83 | components: { PopupPlatenumber, Payee }, |
| 81 | 84 | data() { |
| 82 | 85 | return { |
| 86 | + exceed: false, | |
| 87 | + exceedStr: '', | |
| 83 | 88 | typeCar: '', |
| 84 | 89 | carNumber: '', |
| 85 | 90 | showCar: false, |
| ... | ... | @@ -201,9 +206,13 @@ export default { |
| 201 | 206 | this.showCar = false; |
| 202 | 207 | this.vehicleChange(v); |
| 203 | 208 | }, |
| 204 | - submit() { | |
| 205 | - uni.$u.api.freightOrder.assignVehicle({ ...this.form, code: this.item.code, payeeId: this.payeeModel.driverId }).then(res => { | |
| 206 | - if (res.success) { | |
| 209 | + submit(confirmAssignFlag = false) { | |
| 210 | + this.exceed = false; | |
| 211 | + uni.$u.api.freightOrder.assignVehicle({ ...this.form, code: this.item.code, payeeId: this.payeeModel.driverId, confirmAssignFlag }).then(res => { | |
| 212 | + if (res.result) { | |
| 213 | + this.exceedStr = res.result; | |
| 214 | + this.exceed = true; | |
| 215 | + } else { | |
| 207 | 216 | uni.showToast({ title: '操作成功', icon: 'none' }); |
| 208 | 217 | this.getOpenerEventChannel().emit('refreshData'); |
| 209 | 218 | setTimeout(() => uni.navigateBack(), 500); | ... | ... |
pages/order/change-fee.vue
| ... | ... | @@ -132,8 +132,11 @@ |
| 132 | 132 | </view> |
| 133 | 133 | </template> |
| 134 | 134 | <template #footer> |
| 135 | - <u-button type="primary" @tap="submit">确定更改</u-button> | |
| 135 | + <u-button type="primary" @click="submit(false)">确定更改</u-button> | |
| 136 | 136 | </template> |
| 137 | + <u-modal title="建单超额提醒" :show="exceed" :showCancelButton="true" @cancel="submit(true)" @confirm="exceed = false" cancelText="继续更改" confirmText="放弃更改"> | |
| 138 | + <rich-text :nodes="exceedStr"> </rich-text> | |
| 139 | + </u-modal> | |
| 137 | 140 | </Page> |
| 138 | 141 | </template> |
| 139 | 142 | <script> |
| ... | ... | @@ -141,6 +144,8 @@ export default { |
| 141 | 144 | name: 'change-fee', |
| 142 | 145 | data() { |
| 143 | 146 | return { |
| 147 | + exceed: false, | |
| 148 | + exceedStr: '', | |
| 144 | 149 | currentFreight: {}, |
| 145 | 150 | item: { |
| 146 | 151 | orderFeePayPlanList: [], |
| ... | ... | @@ -273,7 +278,8 @@ export default { |
| 273 | 278 | } |
| 274 | 279 | }); |
| 275 | 280 | }, |
| 276 | - submit() { | |
| 281 | + submit(confirmAdjustAmountFlag = false) { | |
| 282 | + this.exceed = false; | |
| 277 | 283 | let params = [ |
| 278 | 284 | { ...this.oilAmount, afterAmount: this.form.oilAmount === '' ? '0' : this.form.oilAmount }, |
| 279 | 285 | { ...this.prePay, afterAmount: this.form.prepaidAmount === '' ? '0' : this.form.prepaidAmount }, |
| ... | ... | @@ -281,9 +287,19 @@ export default { |
| 281 | 287 | { ...this.final, afterAmount: this.form.balancePaymentAmount === '' ? '0' : this.form.balancePaymentAmount }, |
| 282 | 288 | ]; |
| 283 | 289 | uni.$u.api.freightOrder |
| 284 | - .adjustAmount({ feeList: params, code: this.item.code, paidAmount: this.form.paidAmount, freightAdjustRemark: this.form.freightAdjustRemark, goodsWeight: this.form.goodsWeight }) | |
| 290 | + .adjustAmount({ | |
| 291 | + feeList: params, | |
| 292 | + code: this.item.code, | |
| 293 | + paidAmount: this.form.paidAmount, | |
| 294 | + freightAdjustRemark: this.form.freightAdjustRemark, | |
| 295 | + goodsWeight: this.form.goodsWeight, | |
| 296 | + confirmAdjustAmountFlag, | |
| 297 | + }) | |
| 285 | 298 | .then(res => { |
| 286 | - if (res.success) { | |
| 299 | + if (res.result) { | |
| 300 | + this.exceedStr = res.result; | |
| 301 | + this.exceed = true; | |
| 302 | + } else { | |
| 287 | 303 | uni.showToast({ title: '操作成功', icon: 'none' }); |
| 288 | 304 | this.getOpenerEventChannel().emit('refreshData'); |
| 289 | 305 | setTimeout(() => uni.navigateBack(), 500); | ... | ... |