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