|
|
@@ -23,22 +23,34 @@
|
|
|
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
<view class="tui-title">价格</view>
|
|
|
- <input v-model="form.hjPrice" style="width:130upx;border:1upx solid #CCCCCC;text-align:center;height:50upx;" placeholder-class="phcolor"
|
|
|
- class="tui-input" name="hjPrice" @focus="form.hjPrice=''" placeholder="大客价" type="digit" />
|
|
|
- <input v-model="form.price" style="width:130upx;border:1upx solid #3385FF;text-align:center;height:50upx;color:#3385FF;margin-left:30upx;" placeholder-class="phcolor"
|
|
|
- class="tui-input" name="price" @focus="form.price=''" placeholder="批发价" type="digit" @input="priceLinkage()" />
|
|
|
- <input v-model="form.skPrice" style="width:130upx;border:1upx solid #CCCCCC;text-align:center;height:50upx;margin-left:30upx;" placeholder-class="phcolor"
|
|
|
- class="tui-input" name="skPrice" @focus="form.skPrice=''" placeholder="零售价" type="digit" />
|
|
|
+ <block v-if="Number(getMyShopInfo.pfShopId)==0">
|
|
|
+ <input v-model="form.skPrice" style="width:300upx;border:1upx solid #3385FF;text-align:center;height:50upx;color:#3385FF;" placeholder-class="phcolor"
|
|
|
+ class="tui-input" name="skPrice" @focus="form.skPrice=''" placeholder="价格" type="digit" />
|
|
|
+ </block>
|
|
|
+ <block v-else>
|
|
|
+ <input v-model="form.hjPrice" style="width:130upx;border:1upx solid #CCCCCC;text-align:center;height:50upx;" placeholder-class="phcolor"
|
|
|
+ class="tui-input" name="hjPrice" @focus="form.hjPrice=''" placeholder="大客价" type="digit" />
|
|
|
+ <input v-model="form.price" style="width:130upx;border:1upx solid #3385FF;text-align:center;height:50upx;color:#3385FF;margin-left:30upx;" placeholder-class="phcolor"
|
|
|
+ class="tui-input" name="price" @focus="form.price=''" placeholder="批发价" type="digit" @input="priceLinkage()" />
|
|
|
+ <input v-model="form.skPrice" style="width:130upx;border:1upx solid #CCCCCC;text-align:center;height:50upx;margin-left:30upx;" placeholder-class="phcolor"
|
|
|
+ class="tui-input" name="skPrice" @focus="form.skPrice=''" placeholder="零售价" type="digit" />
|
|
|
+ </block>
|
|
|
</tui-list-cell>
|
|
|
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
<view class="tui-title">特价</view>
|
|
|
- <input v-model="form.hjDiscountPrice" style="width:130upx;border:1upx solid #CCCCCC;text-align:center;height:50upx;" placeholder-class="phcolor"
|
|
|
- class="tui-input" name="hjDiscountPrice" @focus="form.hjDiscountPrice=''" placeholder="会员特价" type="digit" />
|
|
|
- <input v-model="form.discountPrice" style="width:130upx;border:1upx solid #3385FF;margin-left:30upx;color:#3385FF;text-align:center;height:50upx;" placeholder-class="phcolor" @input="tjLinkage()"
|
|
|
- class="tui-input" name="discountPrice" @focus="form.discountPrice=''" placeholder="无特价填0" maxlength="50" type="digit" />
|
|
|
- <input v-model="form.skDiscountPrice" style="width:130upx;border:1upx solid #CCCCCC;text-align:center;height:50upx;margin-left:30upx;" placeholder-class="phcolor"
|
|
|
- class="tui-input" name="skDiscountPrice" @focus="form.skDiscountPrice=''" placeholder="零售特价" type="digit" />
|
|
|
+ <block v-if="Number(getMyShopInfo.pfShopId)==0">
|
|
|
+ <input v-model="form.skDiscountPrice" style="width:300upx;border:1upx solid #3385FF;color:#3385FF;text-align:center;height:50upx;" placeholder-class="phcolor"
|
|
|
+ class="tui-input" name="skDiscountPrice" @focus="form.skDiscountPrice=''" placeholder="金额" type="digit" />
|
|
|
+ </block>
|
|
|
+ <block v-else>
|
|
|
+ <input v-model="form.hjDiscountPrice" style="width:130upx;border:1upx solid #CCCCCC;text-align:center;height:50upx;" placeholder-class="phcolor"
|
|
|
+ class="tui-input" name="hjDiscountPrice" @focus="form.hjDiscountPrice=''" placeholder="会员特价" type="digit" />
|
|
|
+ <input v-model="form.discountPrice" style="width:130upx;border:1upx solid #3385FF;margin-left:30upx;color:#3385FF;text-align:center;height:50upx;" placeholder-class="phcolor" @input="tjLinkage()"
|
|
|
+ class="tui-input" name="discountPrice" @focus="form.discountPrice=''" placeholder="无特价填0" maxlength="50" type="digit" />
|
|
|
+ <input v-model="form.skDiscountPrice" style="width:130upx;border:1upx solid #CCCCCC;text-align:center;height:50upx;margin-left:30upx;" placeholder-class="phcolor"
|
|
|
+ class="tui-input" name="skDiscountPrice" @focus="form.skDiscountPrice=''" placeholder="零售特价" type="digit" />
|
|
|
+ </block>
|
|
|
</tui-list-cell>
|
|
|
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
@@ -271,7 +283,7 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
computed:{
|
|
|
- ...mapGetters(["getLoginInfo","getDictionariesInfo"]),
|
|
|
+ ...mapGetters(["getLoginInfo","getDictionariesInfo","getMyShopInfo"]),
|
|
|
coverImgData() {
|
|
|
return this.form.images || [];
|
|
|
}
|
|
|
@@ -583,42 +595,70 @@ export default {
|
|
|
uni.showToast({title:"请填写库存,没库存填0",icon:"none"})
|
|
|
return;
|
|
|
}
|
|
|
- if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.discountPrice) == false){
|
|
|
- uni.showToast({title:"请填写特价,没特价填0",icon:"none"})
|
|
|
- return;
|
|
|
- }
|
|
|
if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.cost) == false){
|
|
|
uni.showToast({title:"请填写成本",icon:"none"})
|
|
|
return;
|
|
|
}
|
|
|
- if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.price) == false){
|
|
|
- uni.showToast({title:"请填写批发价",icon:"none"})
|
|
|
- return;
|
|
|
- }
|
|
|
- if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.skPrice) == false){
|
|
|
- uni.showToast({title:"请填写零售价",icon:"none"})
|
|
|
- return;
|
|
|
- }
|
|
|
- if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.hjPrice) == false){
|
|
|
- uni.showToast({title:"请填写大客价",icon:"none"})
|
|
|
- return;
|
|
|
- }
|
|
|
- if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.addPrice) == false){
|
|
|
- uni.showToast({title:"请填写批发加价",icon:"none"})
|
|
|
- return;
|
|
|
+ if(Number(this.getMyShopInfo.pfShopId)>0){
|
|
|
+ //批发店下面价格都要传
|
|
|
+ if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.price) == false){
|
|
|
+ uni.showToast({title:"请填写批发价",icon:"none"})
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.hjPrice) == false){
|
|
|
+ uni.showToast({title:"请填写大客价",icon:"none"})
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.skPrice) == false){
|
|
|
+ uni.showToast({title:"请填写零售价",icon:"none"})
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.hjAddPrice) == false){
|
|
|
+ uni.showToast({title:"请填写大客加价",icon:"none"})
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.addPrice) == false){
|
|
|
+ uni.showToast({title:"请填写批发加价",icon:"none"})
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.skMore) == false){
|
|
|
+ uni.showToast({title:"请填写零售加价",icon:"none"})
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.skPrice) == false){
|
|
|
+ uni.showToast({title:"请填写销售价格",icon:"none"})
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //纯零售店,批发价和大客价等于零售价
|
|
|
+ this.form.hjPrice = this.form.skPrice
|
|
|
+ this.form.price = this.form.skPrice
|
|
|
+ //纯零售店,加价全部为0
|
|
|
+ this.form.skMore = 0
|
|
|
+ this.form.hjAddPrice = 0
|
|
|
+ this.form.addPrice = 0
|
|
|
+ //特价
|
|
|
+ this.form.hjDiscountPrice = this.form.skDiscountPrice
|
|
|
+ this.form.discountPrice = this.form.skDiscountPrice
|
|
|
}
|
|
|
- if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.skMore) == false){
|
|
|
- uni.showToast({title:"请填写零售加价",icon:"none"})
|
|
|
+
|
|
|
+ if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.skDiscountPrice) == false){
|
|
|
+ uni.showToast({title:"请填写特价,没有特价填0",icon:"none"})
|
|
|
return;
|
|
|
}
|
|
|
- if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.hjAddPrice) == false){
|
|
|
- uni.showToast({title:"请填写大客加价",icon:"none"})
|
|
|
- return;
|
|
|
+ if(Number(this.form.skDiscountPrice)>0 && Number(this.form.hjDiscountPrice)>0 && Number(this.form.discountPrice)>0){
|
|
|
+
|
|
|
+ }else{
|
|
|
+ if(Number(this.form.skDiscountPrice)==0 && Number(this.form.hjDiscountPrice)==0 && Number(this.form.discountPrice)==0){
|
|
|
+ }else{
|
|
|
+ uni.showToast({title:"特价栏要等于0,或全部大于0",icon:"none"})
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
let form = JSON.parse(JSON.stringify(this.form))
|
|
|
form.images = form.images.join(',')
|
|
|
- uni.showLoading({mask:true})
|
|
|
+ uni.showLoading({mask:true,title:'提交中'})
|
|
|
requestHost({...form,appVersion:1}).then(res => {
|
|
|
uni.hideLoading()
|
|
|
if(res.code == 1){
|