Просмотр исходного кода

供货商 466 1 供货商 的 采购单 新增采购 下一步 这个费用需要唤起带小数点的数字键,现在唤起的是文本键 2新增成功后,修改价格时,要全选,或者数值直接自动清掉,这个也要唤起带小数点数字健

yangming 5 лет назад
Родитель
Сommit
8bad67d55f
2 измененных файлов с 20 добавлено и 12 удалено
  1. 15 7
      ghsApp/src/pagesPurchase/components/pageSuccess.vue
  2. 5 5
      ghsApp/src/pagesPurchase/details.vue

+ 15 - 7
ghsApp/src/pagesPurchase/components/pageSuccess.vue

@@ -42,7 +42,7 @@
 				<view class="flex-space flowers-list" v-for="(res,i) in flowersList" :key="i">
 				<view class="flex-space flowers-list" v-for="(res,i) in flowersList" :key="i">
 					<view class="flowers-name">{{res.name}}</view>
 					<view class="flowers-name">{{res.name}}</view>
 					<view class="flex flowers-val">
 					<view class="flex flowers-val">
-						<input type="text" v-model="res.price"> 元
+						<input type="digit" v-model="res.price" @focus="priceFocus(i)"> 元
 					</view>
 					</view>
 					<view class="flex-center 	flowers-btn" @tap="changePriceFun(res.id,res.price)">修改</view>
 					<view class="flex-center 	flowers-btn" @tap="changePriceFun(res.id,res.price)">修改</view>
 				</view>
 				</view>
@@ -77,6 +77,9 @@ export default {
 		uni.navigateBack({delta:2})
 		uni.navigateBack({delta:2})
 	},
 	},
 		methods: {
 		methods: {
+			priceFocus(i){
+               this.flowersList[i].price = ''
+			},
     closeLayer() {
     closeLayer() {
 					uni.navigateBack({delta: 3});
 					uni.navigateBack({delta: 3});
     },
     },
@@ -91,12 +94,17 @@ export default {
 				});
 				});
 			},
 			},
 			changePriceFun(id,price){
 			changePriceFun(id,price){
-				changePriceByIdApi({
-					productId: id,
-					price: price
-				}).then(res => {
-						uni.showToast({title:'修改成功'})
-				})
+				if(price) {
+					changePriceByIdApi({
+						productId: id,
+						price: price
+					}).then(res => {
+							uni.showToast({title:'修改成功'})
+					})
+				} else {
+					this.$msg('金额不能为空')
+				}
+				
 			},
 			},
 
 
   },
   },

+ 5 - 5
ghsApp/src/pagesPurchase/details.vue

@@ -82,23 +82,23 @@
 				<view class="module-com input-line-wrap">
 				<view class="module-com input-line-wrap">
 					<tui-list-cell class="line-cell" :hover="false">
 					<tui-list-cell class="line-cell" :hover="false">
 						<view class="tui-title ">打包费</view>
 						<view class="tui-title ">打包费</view>
-						<input :disabled="!canIEdit" v-model="form.packingCharge" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写,留空没有费用"/>
+						<input type="digit" :disabled="!canIEdit" v-model="form.packingCharge" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写,留空没有费用"/>
 					</tui-list-cell>
 					</tui-list-cell>
 					<tui-list-cell class="line-cell" :hover="false">
 					<tui-list-cell class="line-cell" :hover="false">
 						<view class="tui-title ">短途运费</view>
 						<view class="tui-title ">短途运费</view>
-						<input :disabled="!canIEdit" v-model="form.shortCharge" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写,留空没有费用"/>
+						<input  type="digit" :disabled="!canIEdit" v-model="form.shortCharge" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写,留空没有费用"/>
 					</tui-list-cell>
 					</tui-list-cell>
 					<tui-list-cell class="line-cell" :hover="false">
 					<tui-list-cell class="line-cell" :hover="false">
 						<view class="tui-title ">包机(长途运费)</view>
 						<view class="tui-title ">包机(长途运费)</view>
-						<input :disabled="!canIEdit" v-model="form.longCharge" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写,留空没有费用"/>
+						<input  type="digit" :disabled="!canIEdit" v-model="form.longCharge" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写,留空没有费用"/>
 					</tui-list-cell>
 					</tui-list-cell>
 					<tui-list-cell class="line-cell" :hover="false">
 					<tui-list-cell class="line-cell" :hover="false">
 						<view class="tui-title ">提货费</view>
 						<view class="tui-title ">提货费</view>
-						<input :disabled="!canIEdit" v-model="form.pickCharge" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写,留空没有费用"/>
+						<input  type="digit" :disabled="!canIEdit" v-model="form.pickCharge" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写,留空没有费用"/>
 					</tui-list-cell>
 					</tui-list-cell>
 					<tui-list-cell class="line-cell" :hover="false">
 					<tui-list-cell class="line-cell" :hover="false">
 						<view class="tui-title ">本地运费</view>
 						<view class="tui-title ">本地运费</view>
-						<input :disabled="!canIEdit" v-model="form.localCharge" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写,留空没有费用"/>
+						<input  type="digit" :disabled="!canIEdit" v-model="form.localCharge" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写,留空没有费用"/>
 					</tui-list-cell>
 					</tui-list-cell>
 					<tui-list-cell class="line-cell" :hover="false" :arrow="true">
 					<tui-list-cell class="line-cell" :hover="false" :arrow="true">
 						<view class="tui-title ">入库日期</view>
 						<view class="tui-title ">入库日期</view>