工单报备按钮加防重复点击,提交报备做必填项的判断
This commit is contained in:
@ -34,6 +34,15 @@ export function orderReporting(data){
|
||||
data
|
||||
})
|
||||
}
|
||||
// 获取订单结算单信息
|
||||
export function getOrderSettlement(data){
|
||||
return request({
|
||||
url:'/supplierAppV2/dispatchApp/order/getOrderSettlement',
|
||||
method:'POST',
|
||||
contentType:'application/json',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 修改结算信息
|
||||
export function updateOrderSettlement(data){
|
||||
return request({
|
||||
|
@ -37,5 +37,25 @@ export const myMixins = {
|
||||
h5GoBack(){
|
||||
this.$router.back();
|
||||
},
|
||||
noMultipleClicks(methods, info) {
|
||||
// methods是需要点击后需要执行的函数, info是点击需要传的参数
|
||||
let that = this;
|
||||
if (that.noClick) {
|
||||
// 第一次点击
|
||||
that.noClick = false;
|
||||
if (info && info !== '') {
|
||||
//info是执行函数需要传的参数
|
||||
methods(info)
|
||||
} else {
|
||||
methods();
|
||||
}
|
||||
setTimeout(() => {
|
||||
console.log("shengxiaoxi")
|
||||
that.noClick = true;
|
||||
}, 3000)
|
||||
} else {
|
||||
// 这里是重复点击的判断
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -127,11 +127,7 @@ export default {
|
||||
}
|
||||
},
|
||||
cancelBtn(){//取消
|
||||
this.driverName='';
|
||||
this.driverPhone='',
|
||||
this.identityCardNumber='',
|
||||
this.drivingModel=''
|
||||
this.states=''
|
||||
this.$router.back()
|
||||
},
|
||||
validatePhoneNumber() {
|
||||
const phoneNumberRegex = /^1[0-9]{10}$/;
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="wrap">
|
||||
<div class="wrap" @scroll="handleScroll">
|
||||
<div class="navBar">
|
||||
<van-nav-bar
|
||||
title="司机管理"
|
||||
@ -76,7 +76,13 @@ export default {
|
||||
});
|
||||
if(res.code == 200){
|
||||
this.total=res.total
|
||||
if(this.pageNum == 1){
|
||||
this.driverList=res.data
|
||||
}else{
|
||||
let preList = this.driverList;
|
||||
let arr = res.data;
|
||||
this.driverList = preList.concat(arr)
|
||||
}
|
||||
}
|
||||
},
|
||||
async handleStatus(item){
|
||||
@ -109,6 +115,16 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
async handleScroll(){
|
||||
let num = Math.ceil( this.total / 10)
|
||||
if(num <= this.pageNum){
|
||||
// console.log("不在加载数据")
|
||||
}else{
|
||||
console.log("111111111111")
|
||||
this.pageNum++;
|
||||
await this.getDriverList()
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -29,11 +29,11 @@
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="title">结算总金额:</span>
|
||||
<span class="content">{{ item.totalMoney }}</span>
|
||||
<span class="content">{{ item.totalMoney + '元' }}</span>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="title">扣款金额:</span>
|
||||
<span class="content">{{ item.cutMoney }}</span>
|
||||
<span class="content">{{ item.cutMoney + '元'}}</span>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="title">扣款原因:</span>
|
||||
@ -41,7 +41,7 @@
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="title">最终开票金额:</span>
|
||||
<span class="content">{{ item.invoiceMoney }}</span>
|
||||
<span class="content">{{ item.invoiceMoney+ '元' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-show="show" class="bgShow">
|
||||
|
@ -37,15 +37,17 @@
|
||||
</van-radio>
|
||||
</van-radio-group>
|
||||
<textarea class="multiple" id="text-input" rows="4" cols="50" placeholder="报备描述" v-model="decscripTxt"></textarea><br>
|
||||
<common-btn @submitClick="submit" />
|
||||
<common-btn @submitClick="noMultipleClicks(submit)" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {orderReporting} from "@/api/order"
|
||||
import {myMixins} from "@/utils/myMixins"
|
||||
import CommonBtn from "@/components/commonBtn.vue"
|
||||
export default {
|
||||
name: "reportingView",
|
||||
mixins:[myMixins],
|
||||
data(){
|
||||
return{
|
||||
decscripTxt:'',
|
||||
@ -54,26 +56,33 @@ export default {
|
||||
inactiveIcon: require('@/assets/uncheck.png'),
|
||||
queryType:'',
|
||||
userOrderId:'',
|
||||
orderCode:''
|
||||
orderCode:'',
|
||||
noClick:true,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
console.log(this.radio)
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
this.queryType = urlParams.get('queryType');
|
||||
this.userOrderId = urlParams.get('userOrderId');
|
||||
this.orderCode = urlParams.get('orderCode')
|
||||
},
|
||||
computed:{
|
||||
isRadio(){
|
||||
return this.radio ? true : false
|
||||
},
|
||||
isTxt(){
|
||||
return this.decscripTxt ? true : false
|
||||
},
|
||||
},
|
||||
methods:{
|
||||
submit(){
|
||||
console.log("提交1111111111")
|
||||
this.goReporting();
|
||||
},
|
||||
change(e){
|
||||
this.radio=e
|
||||
console.log("可以拿到选中的是哪个值",this.radio)
|
||||
},
|
||||
async goReporting(){
|
||||
if(this.isRadio || this.isTxt){
|
||||
let result = await orderReporting({
|
||||
queryType:this.queryType,
|
||||
userOrderId:this.userOrderId,
|
||||
@ -87,6 +96,9 @@ export default {
|
||||
window.android.sendMessage("goBack");
|
||||
},2000)
|
||||
}
|
||||
}else{
|
||||
this.$toast("报备事项和报备描述必填一项")
|
||||
}
|
||||
}
|
||||
},
|
||||
components:{
|
||||
|
@ -51,12 +51,14 @@
|
||||
</div>
|
||||
</div>
|
||||
<common-btn class="btn" @submitClick="submit" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CommonBtn from "@/components/commonBtn.vue"
|
||||
import {updateOrderSettlement} from "@/api/order"
|
||||
import {leftCopy} from "@/utils/common"
|
||||
import {getOrderSettlement, updateOrderSettlement} from "@/api/order"
|
||||
export default {
|
||||
name: "supplySettlement",
|
||||
data(){
|
||||
@ -78,23 +80,32 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
async mounted() {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
this.taskOrderId = urlParams.get('taskOrderId');
|
||||
this.userOrderId = urlParams.get('userOrderId');
|
||||
this.orderCode = urlParams.get('orderCode')
|
||||
await this.getDetail()
|
||||
|
||||
},
|
||||
methods:{
|
||||
submit() {
|
||||
console.log("提交")
|
||||
this.updatSettlement()
|
||||
},
|
||||
async getDetail(){
|
||||
let res = await getOrderSettlement({
|
||||
userOrderId: this.userOrderId,
|
||||
orderCode: this.orderCode,
|
||||
taskOrderId: this.taskOrderId
|
||||
})
|
||||
leftCopy(this.form,{...res.data})
|
||||
},
|
||||
async updatSettlement(){
|
||||
let result =await updateOrderSettlement({
|
||||
...this.form,
|
||||
userOrderId:this.userOrderId,
|
||||
orderCode:this.orderCode,
|
||||
taskOrderId:this.taskOrderId
|
||||
userOrderId: this.userOrderId,
|
||||
orderCode: this.orderCode,
|
||||
taskOrderId: this.taskOrderId
|
||||
})
|
||||
if(result.code !== 200){
|
||||
this.$toast(result.msg)
|
||||
@ -104,7 +115,6 @@ export default {
|
||||
window.android.sendMessage("goBack");
|
||||
},2000)
|
||||
}
|
||||
console.log("result",result)
|
||||
}
|
||||
},
|
||||
components:{
|
||||
|
@ -200,10 +200,7 @@ export default {
|
||||
this.isJoin=e
|
||||
},
|
||||
cancelBtn(){//取消车辆
|
||||
this.isJoin='';
|
||||
this.trailerService='';
|
||||
this.smallRepairService='';
|
||||
this.carNum=''
|
||||
this.$router.back()
|
||||
},
|
||||
async submitBtn(){
|
||||
console.log("提交车辆");
|
||||
|
@ -67,7 +67,6 @@ export default {
|
||||
})
|
||||
if(result.code === 200){
|
||||
this.total=result.total
|
||||
//
|
||||
if(this.pageNum == 1){// 第一页直接赋值
|
||||
this.vehicleList=result.data;
|
||||
}else{// 第二页数据拼接
|
||||
@ -93,14 +92,13 @@ export default {
|
||||
}
|
||||
},
|
||||
async handleScroll(){
|
||||
// console.log("滑动")
|
||||
let num = Math.ceil( this.total / 10)
|
||||
if(num <= this.pageNum){
|
||||
console.log("不在加载数据")
|
||||
// console.log("不在加载数据")
|
||||
}else{
|
||||
this.pageNum++;
|
||||
await this.getVehicleList()
|
||||
console.log("111111111111")
|
||||
// console.log("111111111111")
|
||||
}
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user