|
@@ -69,10 +69,12 @@
|
|
|
<view class="select-cmd_bx">
|
|
<view class="select-cmd_bx">
|
|
|
<view class="num_bx">
|
|
<view class="num_bx">
|
|
|
<view class="kc">总价</view>
|
|
<view class="kc">总价</view>
|
|
|
- <allSelectInput :isActive="isAloneAllActive" :isFocus="isAloneAllFocus" :value="customData.itemPrice" :placeholder="'采购金额'"
|
|
|
|
|
- :width="416" :height="80" :fontSize="40"
|
|
|
|
|
- @deleteInputVal="deleteAloneInputVal" @initAllInput="initAloneAllInput" @moveAllInput="moveAloneAllInput">
|
|
|
|
|
- </allSelectInput> <text style="margin-left: 20rpx">元</text>
|
|
|
|
|
|
|
+ <input v-model="customData.itemPrice" @focus="customData.itemPrice = null" type="number" placeholder="采购金额" />
|
|
|
|
|
+ <!--<allSelectInput :isActive="isAloneAllActive" :isFocus="isAloneAllFocus" :value="customData.itemPrice" :placeholder="'采购金额'"-->
|
|
|
|
|
+ <!--:width="416" :height="80" :fontSize="40"-->
|
|
|
|
|
+ <!--@deleteInputVal="deleteAloneInputVal" @initAllInput="initAloneAllInput" @moveAllInput="moveAloneAllInput">-->
|
|
|
|
|
+ <!--</allSelectInput> -->
|
|
|
|
|
+ <text style="margin-left: 20rpx">元</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="select-cmd_bx">
|
|
<view class="select-cmd_bx">
|
|
@@ -80,23 +82,24 @@
|
|
|
<view class="kc">
|
|
<view class="kc">
|
|
|
数量
|
|
数量
|
|
|
</view>
|
|
</view>
|
|
|
- <allMoreSelectInput
|
|
|
|
|
- :isActive="isActive" :isFocus="isFocus" :value="customData.bigCount"
|
|
|
|
|
- :isActiveOne="isActiveOne" :isFocusOne="isFocusOne" :valueOne="customData.smallCount"
|
|
|
|
|
- @deleteInputVal="deleteInputVal" @initAllInput="initAllInput" @moveAllInput="moveAllInput"
|
|
|
|
|
- @deleteInputValOne="deleteInputValOne" @initAllInputOne="initAllInputOne" @moveAllInputOne="moveAllInputOne">
|
|
|
|
|
- </allMoreSelectInput>
|
|
|
|
|
- <!--<input v-model="customData.bigCount" type="number" focus />扎-->
|
|
|
|
|
- <!--<input v-model="customData.smallCount" type="number" style="margin-left:24upx"/>支-->
|
|
|
|
|
|
|
+ <!--<allMoreSelectInput-->
|
|
|
|
|
+ <!--:isActive="isActive" :isFocus="isFocus" :value="customData.bigCount"-->
|
|
|
|
|
+ <!--:isActiveOne="isActiveOne" :isFocusOne="isFocusOne" :valueOne="customData.smallCount"-->
|
|
|
|
|
+ <!--@deleteInputVal="deleteInputVal" @initAllInput="initAllInput" @moveAllInput="moveAllInput"-->
|
|
|
|
|
+ <!--@deleteInputValOne="deleteInputValOne" @initAllInputOne="initAllInputOne" @moveAllInputOne="moveAllInputOne">-->
|
|
|
|
|
+ <!--</allMoreSelectInput>-->
|
|
|
|
|
+ <input v-model="customData.bigCount" @input="countWeight" @focus="customData.bigCount = null" type="number" />扎
|
|
|
|
|
+ <input v-model="customData.smallCount" @input="countWeight" @focus="customData.smallCount = null" type="number" style="margin-left:24upx"/>支
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="select-cmd_bx">
|
|
<view class="select-cmd_bx">
|
|
|
<view class="num_bx">
|
|
<view class="num_bx">
|
|
|
<view class="kc">重量</view>
|
|
<view class="kc">重量</view>
|
|
|
- <allSelectInput :isActive="isWeightActive" :isFocus="isWeightFocus" :value="customData.realityWeight" :placeholder="'公斤'"
|
|
|
|
|
- :width="416" :height="80" :fontSize="40"
|
|
|
|
|
- @deleteInputVal="deleteWeightInputVal" @initAllInput="initWeightAllInput" @moveAllInput="moveWeightAllInput">
|
|
|
|
|
- </allSelectInput>
|
|
|
|
|
|
|
+ <input v-model="customData.realityWeight" @focus="customData.realityWeight = null" type="number" placeholder="公斤" />
|
|
|
|
|
+ <!--<allSelectInput :isActive="isWeightActive" :isFocus="isWeightFocus" :value="customData.realityWeight" :placeholder="'公斤'"-->
|
|
|
|
|
+ <!--:width="416" :height="80" :fontSize="40"-->
|
|
|
|
|
+ <!--@deleteInputVal="deleteWeightInputVal" @initAllInput="initWeightAllInput" @moveAllInput="moveWeightAllInput">-->
|
|
|
|
|
+ <!--</allSelectInput>-->
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -125,11 +128,11 @@ import ModalModule from "@/components/plugin/modal";
|
|
|
import FooterCart from "@/components/module/app-footer-cart";
|
|
import FooterCart from "@/components/module/app-footer-cart";
|
|
|
import productMins from "@/mixins/product";
|
|
import productMins from "@/mixins/product";
|
|
|
|
|
|
|
|
-import allMoreSelectInput from "@/components/module/allMoreSelectInput";
|
|
|
|
|
-import allMoreSelectInputMins from "@/mixins/allMoreSelectInput";
|
|
|
|
|
|
|
+// import allMoreSelectInput from "@/components/module/allMoreSelectInput";
|
|
|
|
|
+// import allMoreSelectInputMins from "@/mixins/allMoreSelectInput";
|
|
|
|
|
|
|
|
-import allSelectInput from "@/components/module/allSelectInput";
|
|
|
|
|
-import allSelectInputMins from "@/mixins/allSelectInput";
|
|
|
|
|
|
|
+// import allSelectInput from "@/components/module/allSelectInput";
|
|
|
|
|
+// import allSelectInputMins from "@/mixins/allSelectInput";
|
|
|
export default {
|
|
export default {
|
|
|
name: "purchase", // 采购
|
|
name: "purchase", // 采购
|
|
|
components: {
|
|
components: {
|
|
@@ -138,9 +141,9 @@ export default {
|
|
|
AppWrapperEmpty,
|
|
AppWrapperEmpty,
|
|
|
CommodityPurchase,
|
|
CommodityPurchase,
|
|
|
ModalModule,
|
|
ModalModule,
|
|
|
- FooterCart,allMoreSelectInput,allSelectInput
|
|
|
|
|
|
|
+ FooterCart
|
|
|
},
|
|
},
|
|
|
- mixins: [productMins,allMoreSelectInputMins,allSelectInputMins],
|
|
|
|
|
|
|
+ mixins: [productMins],
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
pageType: "purchase",
|
|
pageType: "purchase",
|
|
@@ -154,16 +157,24 @@ export default {
|
|
|
isModel: false,
|
|
isModel: false,
|
|
|
showSubmitModel: false,
|
|
showSubmitModel: false,
|
|
|
customData: {
|
|
customData: {
|
|
|
- bigCount: 0,
|
|
|
|
|
- smallCount: 0,
|
|
|
|
|
- itemPrice: 0,
|
|
|
|
|
- weight:0,
|
|
|
|
|
- realityWeight:0,
|
|
|
|
|
|
|
+ bigCount: null,
|
|
|
|
|
+ smallCount: null,
|
|
|
|
|
+ itemPrice: null,
|
|
|
|
|
+ weight:null,
|
|
|
|
|
+ realityWeight:null,
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
onLoad() {},
|
|
onLoad() {},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ // 计算重量
|
|
|
|
|
+ countWeight(){
|
|
|
|
|
+ let ratio = this.customData.ratio;
|
|
|
|
|
+ let smallCount = this.customData.smallCount;
|
|
|
|
|
+ let bigCount = this.customData.bigCount;
|
|
|
|
|
+ let weight = this.customData.weight;
|
|
|
|
|
+ this.customData.realityWeight = (smallCount * weight / ratio + bigCount * weight).toFixed(2)
|
|
|
|
|
+ },
|
|
|
// 离开全选input alone
|
|
// 离开全选input alone
|
|
|
moveAloneAllInput(e){
|
|
moveAloneAllInput(e){
|
|
|
this.isAloneAllActive=false;
|
|
this.isAloneAllActive=false;
|
|
@@ -193,22 +204,17 @@ export default {
|
|
|
this.isModel = true;
|
|
this.isModel = true;
|
|
|
console.log(info,'customData')
|
|
console.log(info,'customData')
|
|
|
this.customData = info;
|
|
this.customData = info;
|
|
|
- this.$nextTick(()=>{
|
|
|
|
|
- // this.initAllInput();
|
|
|
|
|
- this.initAloneAllInput();
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ // this.$nextTick(()=>{
|
|
|
|
|
+ // // this.initAllInput();
|
|
|
|
|
+ // this.initAloneAllInput();
|
|
|
|
|
+ // })
|
|
|
},
|
|
},
|
|
|
modalCancel() {
|
|
modalCancel() {
|
|
|
this.isModel = false;
|
|
this.isModel = false;
|
|
|
this.customData = {};
|
|
this.customData = {};
|
|
|
}, // 取消 确认
|
|
}, // 取消 确认
|
|
|
affirm(val) {
|
|
affirm(val) {
|
|
|
- // this.moveAllInput();
|
|
|
|
|
- // this.moveAllInputOne();
|
|
|
|
|
- this.isFocus = false;
|
|
|
|
|
- this.isFocusOne = false;
|
|
|
|
|
- this.isAloneAllActive=false;
|
|
|
|
|
- this.isAloneAllFocus=false;
|
|
|
|
|
|
|
+
|
|
|
this.$nextTick(()=>{
|
|
this.$nextTick(()=>{
|
|
|
console.log('customData',this.customData);
|
|
console.log('customData',this.customData);
|
|
|
console.log('val.index',val.index);
|
|
console.log('val.index',val.index);
|
|
@@ -223,11 +229,11 @@ export default {
|
|
|
if (val.index === 0) {
|
|
if (val.index === 0) {
|
|
|
this.modalCancel();
|
|
this.modalCancel();
|
|
|
} else {
|
|
} else {
|
|
|
- if(this.customData.itemPrice==0||this.customData.itemPrice==''){
|
|
|
|
|
|
|
+ if(this.customData.itemPrice==''){
|
|
|
uni.showToast({title:"请输入总价格",icon:"none"})
|
|
uni.showToast({title:"请输入总价格",icon:"none"})
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if(this.customData.bigCount==0&&this.customData.smallCount==0){
|
|
|
|
|
|
|
+ if(this.customData.bigCount==''&&this.customData.smallCount==''){
|
|
|
uni.showToast({title:"请输入花材数量",icon:"none"})
|
|
uni.showToast({title:"请输入花材数量",icon:"none"})
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|