|
@@ -31,7 +31,6 @@
|
|
|
{{productData.ptItemInfo ? productData.ptItemInfo.name : ''}}
|
|
{{productData.ptItemInfo ? productData.ptItemInfo.name : ''}}
|
|
|
<image :src="`${constant.imgUrl}/icon/official8.png`" v-if="productData.auth == 1" mode="widthFix" style="width:38upx;height:38upx;display:inline-block;margin-left:10upx;"></image>
|
|
<image :src="`${constant.imgUrl}/icon/official8.png`" v-if="productData.auth == 1" mode="widthFix" style="width:38upx;height:38upx;display:inline-block;margin-left:10upx;"></image>
|
|
|
</view>
|
|
</view>
|
|
|
- <button v-if="productData.id > 0 && productData.auth == 0" class="admin-button-com blue mini-btn" @click="ptAuth(productData)">申请认证</button>
|
|
|
|
|
</tui-list-cell>
|
|
</tui-list-cell>
|
|
|
|
|
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
@@ -45,22 +44,35 @@
|
|
|
|
|
|
|
|
<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 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>
|
|
|
|
|
|
|
|
<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 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>
|
|
|
|
|
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
@@ -216,21 +228,22 @@
|
|
|
|
|
|
|
|
<view class="module-com input-line-wrap">
|
|
<view class="module-com input-line-wrap">
|
|
|
|
|
|
|
|
- <tui-list-cell class="line-cell" :hover="false">
|
|
|
|
|
- <view class="tui-title">大客价加价</view>
|
|
|
|
|
- <input v-model="form.hjAddPrice" placeholder-class="phcolor" class="tui-input" name="hjAddPrice" @focus="form.hjAddPrice=''" placeholder="在成本价基础上多卖的金额" maxlength="50" type="digit" />
|
|
|
|
|
- </tui-list-cell>
|
|
|
|
|
-
|
|
|
|
|
- <tui-list-cell class="line-cell" :hover="false">
|
|
|
|
|
- <view class="tui-title">批发价加价</view>
|
|
|
|
|
- <input v-model="form.addPrice" placeholder-class="phcolor" class="tui-input" name="addPrice" @focus="form.addPrice=''" placeholder="在成本价基础上多卖的金额" maxlength="50" type="digit" />
|
|
|
|
|
- </tui-list-cell>
|
|
|
|
|
-
|
|
|
|
|
- <tui-list-cell class="line-cell" :hover="false">
|
|
|
|
|
- <view class="tui-title">零售价加价</view>
|
|
|
|
|
- <input v-model="form.skMore" placeholder-class="phcolor" class="tui-input" name="skMore" @focus="form.skMore=''" placeholder="在成本价基础上多卖的金额" type="digit" />
|
|
|
|
|
- </tui-list-cell>
|
|
|
|
|
-
|
|
|
|
|
|
|
+ <block v-if="Number(getMyShopInfo.pfShopId)>0">
|
|
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
|
|
+ <view class="tui-title">大客价加价</view>
|
|
|
|
|
+ <input v-model="form.hjAddPrice" placeholder-class="phcolor" class="tui-input" name="hjAddPrice" @focus="form.hjAddPrice=''" placeholder="在成本价基础上多卖的金额" maxlength="50" type="digit" />
|
|
|
|
|
+ </tui-list-cell>
|
|
|
|
|
+
|
|
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
|
|
+ <view class="tui-title">批发价加价</view>
|
|
|
|
|
+ <input v-model="form.addPrice" placeholder-class="phcolor" class="tui-input" name="addPrice" @focus="form.addPrice=''" placeholder="在成本价基础上多卖的金额" maxlength="50" type="digit" />
|
|
|
|
|
+ </tui-list-cell>
|
|
|
|
|
+
|
|
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
|
|
+ <view class="tui-title">零售价加价</view>
|
|
|
|
|
+ <input v-model="form.skMore" placeholder-class="phcolor" class="tui-input" name="skMore" @focus="form.skMore=''" placeholder="在成本价基础上多卖的金额" type="digit" />
|
|
|
|
|
+ </tui-list-cell>
|
|
|
|
|
+ </block>
|
|
|
<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>
|
|
|
|
|
|
|
@@ -238,7 +251,7 @@
|
|
|
</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>
|
|
|
<view class="switch_bx">
|
|
<view class="switch_bx">
|
|
|
<switch :checked="form.frontHide == 0 ? false : true" @change="frontHideChange" style="transform: scale(0.8,0.8)" />
|
|
<switch :checked="form.frontHide == 0 ? false : true" @change="frontHideChange" style="transform: scale(0.8,0.8)" />
|
|
|
<text v-if="form.frontHide == 0">否</text>
|
|
<text v-if="form.frontHide == 0">否</text>
|
|
@@ -532,7 +545,7 @@ export default {
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
computed:{
|
|
computed:{
|
|
|
- ...mapGetters(["getLoginInfo","getDictionariesInfo"]),
|
|
|
|
|
|
|
+ ...mapGetters(["getLoginInfo","getDictionariesInfo","getMyShopInfo"]),
|
|
|
coverImgData() {
|
|
coverImgData() {
|
|
|
return this.form.images || [];
|
|
return this.form.images || [];
|
|
|
}
|
|
}
|
|
@@ -1222,36 +1235,72 @@ export default {
|
|
|
let requestHost = addProduct
|
|
let requestHost = addProduct
|
|
|
if(this.form.id && this.form.id != 0){
|
|
if(this.form.id && this.form.id != 0){
|
|
|
requestHost = updateProduct;
|
|
requestHost = updateProduct;
|
|
|
|
|
+ }
|
|
|
|
|
+ if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.stock) == 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(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{
|
|
}else{
|
|
|
- if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.stock) == 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.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.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;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ 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.skDiscountPrice) == false){
|
|
|
|
|
+ uni.showToast({title:"请填写特价,没有特价填0",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))
|
|
let form = JSON.parse(JSON.stringify(this.form))
|
|
|
form.images = form.images.join(',')
|
|
form.images = form.images.join(',')
|
|
|
uni.showLoading({mask:true,title:'提交中'})
|
|
uni.showLoading({mask:true,title:'提交中'})
|
|
@@ -1300,46 +1349,11 @@ export default {
|
|
|
rule: ["required"],
|
|
rule: ["required"],
|
|
|
msg: ["请选择小单位"]
|
|
msg: ["请选择小单位"]
|
|
|
},
|
|
},
|
|
|
- {
|
|
|
|
|
- name: "price",
|
|
|
|
|
- rule: ["required"],
|
|
|
|
|
- msg: ["请填写批发价"]
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: "skPrice",
|
|
|
|
|
- rule: ["required"],
|
|
|
|
|
- msg: ["请填写零售价"]
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: "hjPrice",
|
|
|
|
|
- rule: ["required"],
|
|
|
|
|
- msg: ["请填写大客价"]
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: "hjAddPrice",
|
|
|
|
|
- rule: ["required"],
|
|
|
|
|
- msg: ["请填写大客价加价"]
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: "addPrice",
|
|
|
|
|
- rule: ["required"],
|
|
|
|
|
- msg: ["请填写批发价加价"]
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: "discountPrice",
|
|
|
|
|
- rule: ["required"],
|
|
|
|
|
- msg: ["不做特价请填0"]
|
|
|
|
|
- },
|
|
|
|
|
{
|
|
{
|
|
|
name: "cost",
|
|
name: "cost",
|
|
|
rule: ["required"],
|
|
rule: ["required"],
|
|
|
msg: ["请填写成本"]
|
|
msg: ["请填写成本"]
|
|
|
},
|
|
},
|
|
|
- {
|
|
|
|
|
- name: "skMore",
|
|
|
|
|
- rule: ["required"],
|
|
|
|
|
- msg: ["请填写零售价加价"]
|
|
|
|
|
- },
|
|
|
|
|
{
|
|
{
|
|
|
name: "weight",
|
|
name: "weight",
|
|
|
rule: ["required"],
|
|
rule: ["required"],
|