Commit 89cfa265d54dabe89bbb8d6bc914019a3a3385ee

Authored by lxf
1 parent 73835ce7

fix: 建单超额提醒

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