From fbd20431d9947d6989f6508ae47ccaad96576d68 Mon Sep 17 00:00:00 2001
From: 819527061@qq.com <123456>
Date: 星期一, 05 二月 2024 09:02:16 +0800
Subject: [PATCH] 解决审批历史页面报错问题
---
pages/jihua/jihua.vue | 170 +++++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 117 insertions(+), 53 deletions(-)
diff --git a/pages/jihua/jihua.vue b/pages/jihua/jihua.vue
index 1529468..4c28ca2 100644
--- a/pages/jihua/jihua.vue
+++ b/pages/jihua/jihua.vue
@@ -27,16 +27,24 @@
<view class="main-flex">
<view class="carNum-box">
<view>璁″垝杞︽暟锛�</view>
- <!-- <u--input placeholder="璇疯緭鍏ュ彂杩愯溅鏁�" border="surround" v-model="item.numPlan" @change="inputChange" @focus="faYunPlanCarsFocus(item)"></u--input> -->
- <view class="planCars" :style="{color:item.numPlan ? '#111':'#ccc'}" @click="faYunPlanCarsFocus(item)">
- <text v-model="item.numPlan">{{ item.numPlan || '鐐瑰嚮杈撳叆鏁伴噺' }}</text>
- <view class="cursor" v-if="isCursor && fayunPlanFocusId == item.orderId"><image src="@/static/cursor.gif" mode=""><image></view>
- </view>
+ <u--input
+ placeholder="璇疯緭鍏ュ彂杩愯溅鏁�"
+ border="surround"
+ v-model="item.numPlan"
+ @change="inputChange(item)"
+ @focus="faYunPlanCarsFocus(item)"
+ type="number" pattern="[0-9]*"></u--input>
+
+ <!-- <view class="planCars" :style="{color:item.numPlan ? '#111':'#ccc'}" @click="faYunPlanCarsFocus(item)">
+ <text v-model="item.numPlan">{{ item.numPlan || '鐐瑰嚮杈撳叆鏁伴噺' }}</text>
+ <!– <text v-model="item.numPlan">{{ item.numPlan || '鐐瑰嚮杈撳叆鏁伴噺' }}</text>–>
+ <view class="cursor" v-if="isCursor && fayunPlanFocusId == item.orderId"><image src="@/static/cursor.gif" mode=""><image></view>
+ </view>-->
</view>
<view style="margin-right:10px">瀹為檯鍙戣溅鏁帮細{{ item.numReal || '鏆傛棤' }}</view>
</view>
</view>
- <u-keyboard
+ <u-keyboard
@change="valChange"
@backspace="backspace"
@confirm="keyBoardConfirm"
@@ -48,7 +56,7 @@
:overlay="false"
:closeOnClickOverlay="false"
:dotDisabled="true"
- zIndex="100000"
+ zIndex="100000"
></u-keyboard>
</view>
@@ -70,18 +78,24 @@
<view class="main-flex">
<view class="carNum-box">
<view>璁″垝杞︽暟锛�</view>
- <!-- <u--input placeholder="璇疯緭鍏ュ彂杩愯溅鏁�" border="surround" v-model="item.numPlan" @change="inputTotalChange(item)" @focus="faYunPlanCarsFocus(item)"></u--input> -->
- <view class="planCars" :style="{color:item.numPlan ? '#111':'#ccc'}" @click="faYunPlanCarsFocus(item)">
+ <u--input
+ placeholder="璇疯緭鍏ュ彂杩愯溅鏁�"
+ border="surround"
+ v-model="item.numPlan"
+ @change="inputTotalChange(item)"
+ @focus="faYunPlanCarsFocus(item)"
+ type="number" pattern="[0-9]*"></u--input>
+<!-- <view class="planCars" :style="{color:item.numPlan ? '#111':'#ccc'}" @click="faYunPlanCarsFocus(item)">
<text v-model="item.numPlan">{{ item.numPlan || '鐐瑰嚮杈撳叆鏁伴噺' }}</text>
<view class="cursor" v-if="isCursor && fayunPlanFocusId == item.orderId">
<image src="@/static/cursor.gif" mode="" />
</view>
- </view>
+ </view>-->
</view>
<view style="margin-right:10px">瀹為檯鍙戣溅鏁帮細{{ item.numReal == null ? '鏆傛棤' : item.numReal }}</view>
</view>
</view>
- <u-keyboard
+<!-- <u-keyboard
@change="valChange"
@backspace="backspace"
@confirm="keyBoardConfirm"
@@ -94,17 +108,17 @@
:closeOnClickOverlay="false"
:dotDisabled="true"
zIndex="100000"
- ></u-keyboard>
+ ></u-keyboard>-->
</view>
</view>
</view>
</view>
-
+
<!-- 淇敼寮瑰嚭妗� -->
<u-popup :show="editPopupShow" @close="editPopupClose" @open="editPopupOpen" mode="top" round="10">
<view class="editPopup">
<view class="editPopup__title"><text>璁″垝杞︽暟</text></view>
- <view class="editPopup__input"><u--input v-model="keyBoardValue" @change="change" placeholder="璇疯緭鍏ュ唴瀹�" type="number" border="surround"></u--input></view>
+ <view class="editPopup__input"><u--input v-model="keyBoardValue" placeholder="璇疯緭鍏ュ唴瀹�" type="number" border="surround"></u--input></view>
<!-- <view class="editPopup__btn"><u-button text="纭畾" type="primary" @click="popupDetermineClick"></u-button></view> -->
</view>
</u-popup>
@@ -118,7 +132,8 @@
<script>
import popupMenu from '@/components/common/popup-menu/popup-menu.vue';
import tool from '@/utils/tool.js';
-import { TrackOpTypes } from "vue";
+import { TrackOpTypes } from "vue";
+import row from "../../uni_modules/uview-ui/libs/config/props/row";
export default {
components: {
popupMenu
@@ -127,7 +142,7 @@
return {
radioValue: '鍏ㄩ儴',
tabList: [
- {
+ {
name: '浠婃棩鍙戣繍璁″垝'
},
{
@@ -162,6 +177,7 @@
onPageScroll(e) {
// 浼犲叆scrollTop鍊煎苟瑙﹀彂鎵�鏈塭asy-loadimage缁勪欢涓嬬殑婊氬姩鐩戝惉浜嬩欢
this.scrollTop = e.scrollTop;
+ // console.log('灞忓箷婊氬姩鐩戝惉浜嬩欢',this.scrollTop);
},
// 鐐瑰嚮瀵艰埅鏍忚彍鍗曞悗
onNavigationBarButtonTap(e) {
@@ -194,17 +210,17 @@
},
deep: true,
immediate: true
- },
- scrollTop: {
- handler: function(newV, oldV) {
- if (newV != oldV) {
- this.keyBoardClose();
- // this.keyBoardShow = false;
- }
- }
- },
- deep: true,
- immediate: true
+ }
+ // scrollTop: {
+ // handler: function(newV, oldV) {
+ // if (newV != oldV) {
+ // this.keyBoardClose();
+ // // this.keyBoardShow = false;
+ // }
+ // },
+ // deep: true,
+ // immediate: true
+ // }
},
methods: {
init() {
@@ -217,7 +233,7 @@
fyList() {
this.overlayShow = true;
//鍒楄〃鏌ヨ
- uni.showLoading({
+ uni.showLoading({
title: '姝e湪鍔犺浇...'
});
let compId = uni.getStorageSync('userInfo').compId;
@@ -265,21 +281,25 @@
//鎻愪氦
dataFormSubmit() {
this.overlayShow = true;
+ uni.showLoading({
+ title:'鍔犺浇涓�...'
+ })
this.fyData.forEach(e => {
if(!e.shippingDate && e.numPlan){
e.shippingDate = this.info.shippingDate
}
});
- this.$reqPost('addObj', this.fyData).then(res => {
+ this.$reqPost('xscarshippingdayplanAddObj', this.fyData).then(res => {
+ uni.hideLoading();
if(res.code == 0){
- setTimeout(()=>{
- uni.showToast({
- title:'鏇存柊鎴愬姛锛�',
- icon:'none',
- duration:1000
- })
- },0)
this.fyList();
+ setTimeout(()=>{
+ uni.showToast({
+ title:'鏇存柊鎴愬姛锛�',
+ icon:'none',
+ duration:1000
+ })
+ },0)
}
});
},
@@ -322,13 +342,15 @@
// 淇敼寮瑰嚭妗�
editPopupClose(){
console.log('淇敼寮瑰嚭妗咰lose');
- // this.editPopupShow = false;
+ this.editPopupShow = false;
+ this.keyBoardShow = false;
},
editPopupOpen(){
console.log('淇敼寮瑰嚭妗哋pen');
},
// 鍒囨崲鍏ㄩ儴鍜屽凡璁剧疆
groupChange(n) {
+ this.initVariable();
this.isTomJihua = n;
if (n == '宸茶缃殑璁″垝') {
this.xscarshippingdayplan();
@@ -338,6 +360,7 @@
},
//鍒囨崲浠婃棩鍜屾槑鏃�
tabClick(item) {
+ this.initVariable();
if (item.index == 1) {
this.info.shippingDate = this.tomorrowDate();
if (this.isTomJihua == '宸茶缃殑璁″垝') {
@@ -354,20 +377,43 @@
}
}
},
- inputChange(val) {
- console.log('鍏ㄩ儴璁″垝', val);
+ // 鍒濆鍖栧彉閲�
+ initVariable(){
+ this.keyBoardShow = false;
+ this.keyBoardValue = null;
+ this.fayunPlanFocusId = null;
+ uni.pageScrollTo({
+ scrollTop: 0,
+ duration: 300
+ });
},
+ inputChange(item) {
+ if(item.numPlan) {
+ let total = Math.floor(item.order.executiveSurplus / Number(34));
+ let max = total + (item.numReal ? item.numReal : 0) + 1
+ if(item.numPlan > max) {
+ this.$nextTick(() => {
+ item.numPlan = max
+ this.$set(item,'numPlan',max)
+ })
+ uni.showToast({
+ title:`璇ヨ鍗曟渶澶ц缃溅鏁颁负锛�${max}`,
+ icon:'none',
+ duration:1000
+ })
+ }
+ }
+ },
+ changeIn(val) {
+ console.log(val,'val=====')
+ },
inputTotalChange(val) {
console.log(val, 'val2=======val2,宸茶缃鍒�');
this.editRow = val;
- },
+ },
// input鑾峰彇鐒︾偣
faYunPlanCarsFocus(item) {
- // 鑾峰彇璇ョ劍鐐瑰湪椤甸潰鐨勪綅缃�
- // let boxBottom = document.getElementById('#u-dropdown');
- // console.log('鍏冪礌',boxBottom);
- // let bottom = this.$refs.planViewRef.offsetHeight
- this.keyBoardShow = true;
+ console.log(item,'鍙戣繍杞︽暟璁″垝------------===========')
this.fayunPlanFocusId = item.orderId;
this.keyBoardValue = item.numPlan + '';
if(this.isTomJihua == '宸茶缃殑璁″垝'){
@@ -375,6 +421,17 @@
} else{
this.isCursor = true;
}
+
+ // 鏍规嵁鍒楄〃涓嬫爣锛屼娇灞忓箷婊氬姩鍒扮浉搴斿彲瑙嗕綅缃�
+ // for(let i = 0;i<this.fyData.length;i++){
+ // if(this.fyData[i].orderId == item.orderId){
+ // uni.pageScrollTo({
+ // scrollTop: i*144,
+ // duration: 300
+ // });
+ // }
+ // }
+
},
// 閿洏
valChange(val) {
@@ -447,8 +504,15 @@
}
};
</script>
-
+<style>
+input{-webkit-appearance: none;}
+</style>
<style lang="scss" scoped>
+.ceshi-box{
+ width: 100%;
+ display: flex;
+ flex-direction: column;
+}
::v-deep {
.u-tabs__wrapper__nav {
padding-left: vww(75.5);
@@ -470,7 +534,7 @@
width: vww(100);
z-index: 1;
}
-
+
.u-radio-group--row {
height: 100%;
width: 100%;
@@ -531,14 +595,14 @@
// transform: translateX(-50%);
// border-radius: vww(20);
// }
-
+
}
.jihua-main {
display: flex;
flex-direction: column;
width: 100%;
- padding: vww(44) vww(10) vww(70) vww(10);
+ padding: vww(44) vww(10) vww(270) vww(10);
box-sizing: border-box;
.main-inside {
width: 100%;
@@ -558,7 +622,7 @@
.main-block-box {
box-shadow: 0px 0px 8px 0px rgba(216, 218, 238, 0.8);
- height: vww(120);
+ //height: vww(120);
padding: vww(10);
box-sizing: border-box;
margin-top: vww(12);
@@ -596,8 +660,8 @@
border: 1px solid #dddddd;
border-radius: vww(4);
padding: vww(1) vww(10);
-
-
+
+
// 杈撳叆鐒︾偣鍥剧墖
.cursor {
// float: left;
@@ -650,4 +714,4 @@
// }
// }
}
-</style>
\ No newline at end of file
+</style>
--
Gitblit v1.9.1