|
@@ -21,22 +21,41 @@
|
|
|
|
|
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
<div class="tui-title">花店价</div>
|
|
<div class="tui-title">花店价</div>
|
|
|
- <input v-model="form.price" style="width:140upx;" placeholder-class="phcolor" class="tui-input" name="price" @focus="form.price=''" placeholder="请填写" maxlength="50" type="digit" />
|
|
|
|
|
- <text style="color:#666666;margin-right:20upx;">散客比花店贵:</text>
|
|
|
|
|
- <input v-model="form.skMore" style="width:110upx;" placeholder-class="phcolor" class="tui-input" name="skMore" @focus="form.skMore=''" placeholder="请填写" type="digit" />
|
|
|
|
|
|
|
+ <input v-model="form.price" placeholder-class="phcolor" class="tui-input" name="price" @focus="form.price=''" placeholder="请填写" maxlength="50" type="digit" />
|
|
|
</tui-list-cell>
|
|
</tui-list-cell>
|
|
|
|
|
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
- <div class="tui-title">花店今日特价</div>
|
|
|
|
|
|
|
+ <div class="tui-title">今日特价</div>
|
|
|
<input v-model="form.discountPrice" placeholder-class="phcolor" class="tui-input" name="discountPrice" @focus="form.discountPrice=''" placeholder="不做特价填0" maxlength="50" type="digit" />
|
|
<input v-model="form.discountPrice" placeholder-class="phcolor" class="tui-input" name="discountPrice" @focus="form.discountPrice=''" placeholder="不做特价填0" maxlength="50" type="digit" />
|
|
|
</tui-list-cell>
|
|
</tui-list-cell>
|
|
|
|
|
|
|
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
|
|
+ <div class="tui-title">单位比</div>
|
|
|
|
|
+ <input v-model="form.ratio" placeholder-class="phcolor" class="tui-input" name="ratio" placeholder="如:1扎=20支,请填写20" maxlength="50" type="number" />
|
|
|
|
|
+ </tui-list-cell>
|
|
|
|
|
+
|
|
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
|
|
+ <view class="tui-title">单支售价涨幅</view>
|
|
|
|
|
+ <input v-model="form.smallRatio" placeholder-class="phcolor" class="tui-input" name="smallRatio" placeholder="请填写,最小填1" style="width:230upx;" @focus="form.smallRatio=''"
|
|
|
|
|
+ maxlength="50" type="number" /><text style="color:#CCCCCC;">¥<text>{{smallPrice}}</text></text>
|
|
|
|
|
+ </tui-list-cell>
|
|
|
|
|
+
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
<div class="tui-title">库存</div>
|
|
<div class="tui-title">库存</div>
|
|
|
<input v-model="form.stock" style="width:340upx;" placeholder-class="phcolor" @focus="form.stock=''" @input="changeStock($event)" class="tui-input" name="stock" placeholder="请输入" type="digit"/>
|
|
<input v-model="form.stock" style="width:340upx;" placeholder-class="phcolor" @focus="form.stock=''" @input="changeStock($event)" class="tui-input" name="stock" placeholder="请输入" type="digit"/>
|
|
|
<button v-if="productData.id > 0" class="admin-button-com blue small" @click="goStockDetail(productData.id)">库存明细</button>
|
|
<button v-if="productData.id > 0" class="admin-button-com blue small" @click="goStockDetail(productData.id)">库存明细</button>
|
|
|
</tui-list-cell>
|
|
</tui-list-cell>
|
|
|
|
|
|
|
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
|
|
+ <div class="tui-title">花店价比进价贵</div>
|
|
|
|
|
+ <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">
|
|
|
|
|
+ <div class="tui-title">散客价比花店贵</div>
|
|
|
|
|
+ <input v-model="form.skMore" placeholder-class="phcolor" class="tui-input" name="skMore" @focus="form.skMore=''" placeholder="请填写" maxlength="50" type="digit" />
|
|
|
|
|
+ </tui-list-cell>
|
|
|
|
|
+
|
|
|
<tui-list-cell class="line-cell" :arrow="true">
|
|
<tui-list-cell class="line-cell" :arrow="true">
|
|
|
<div class="tui-title">分类</div>
|
|
<div class="tui-title">分类</div>
|
|
|
<picker mode="selector" :value="form.classId" :range="itemClassData" range-key="name" @change="changeItemClassFn" class="tui-input" >
|
|
<picker mode="selector" :value="form.classId" :range="itemClassData" range-key="name" @change="changeItemClassFn" class="tui-input" >
|
|
@@ -64,70 +83,14 @@
|
|
|
</picker>
|
|
</picker>
|
|
|
</tui-list-cell>
|
|
</tui-list-cell>
|
|
|
|
|
|
|
|
- <tui-list-cell class="line-cell" :hover="false">
|
|
|
|
|
- <div class="tui-title">散客加价</div>
|
|
|
|
|
- <input
|
|
|
|
|
- v-model="form.skAddPrice"
|
|
|
|
|
- placeholder-class="phcolor"
|
|
|
|
|
- class="tui-input"
|
|
|
|
|
- name="skAddPrice"
|
|
|
|
|
- @focus="form.skAddPrice=''"
|
|
|
|
|
- placeholder="请填写"
|
|
|
|
|
- maxlength="50"
|
|
|
|
|
- type="digit"
|
|
|
|
|
- />
|
|
|
|
|
- </tui-list-cell>
|
|
|
|
|
- <tui-list-cell class="line-cell" :hover="false">
|
|
|
|
|
- <div class="tui-title">花店加价</div>
|
|
|
|
|
- <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">
|
|
|
|
|
- <div class="tui-title">单位比</div>
|
|
|
|
|
- <input
|
|
|
|
|
- v-model="form.ratio"
|
|
|
|
|
- placeholder-class="phcolor"
|
|
|
|
|
- class="tui-input"
|
|
|
|
|
- name="ratio"
|
|
|
|
|
- placeholder="如:1扎=20支,请填写20"
|
|
|
|
|
- maxlength="50"
|
|
|
|
|
- type="number"
|
|
|
|
|
- />
|
|
|
|
|
- </tui-list-cell>
|
|
|
|
|
-
|
|
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
<div class="tui-title">每扎重量</div>
|
|
<div class="tui-title">每扎重量</div>
|
|
|
- <input
|
|
|
|
|
- v-model="form.weight"
|
|
|
|
|
- placeholder-class="phcolor"
|
|
|
|
|
- class="tui-input"
|
|
|
|
|
- name="weight"
|
|
|
|
|
- placeholder="单位:公斤"
|
|
|
|
|
- maxlength="50"
|
|
|
|
|
- type="digit"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <input v-model="form.weight" placeholder-class="phcolor" class="tui-input" name="weight" placeholder="单位为公斤,参考红玫1扎约1.2公斤" maxlength="50" type="digit" />
|
|
|
</tui-list-cell>
|
|
</tui-list-cell>
|
|
|
|
|
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
<div class="tui-title">库存预警值</div>
|
|
<div class="tui-title">库存预警值</div>
|
|
|
- <input
|
|
|
|
|
- v-model="form.stockWarning"
|
|
|
|
|
- placeholder-class="phcolor"
|
|
|
|
|
- class="tui-input"
|
|
|
|
|
- name="stockWarning"
|
|
|
|
|
- placeholder="请填写"
|
|
|
|
|
- maxlength="50"
|
|
|
|
|
- type="number"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <input v-model="form.stockWarning" placeholder-class="phcolor" class="tui-input" name="stockWarning" placeholder="请填写" maxlength="50" type="number" />
|
|
|
</tui-list-cell>
|
|
</tui-list-cell>
|
|
|
|
|
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
@@ -203,9 +166,9 @@ export default {
|
|
|
classId:'',
|
|
classId:'',
|
|
|
price:'',
|
|
price:'',
|
|
|
skMore:'',
|
|
skMore:'',
|
|
|
- skAddPrice:'',
|
|
|
|
|
addPrice:'',
|
|
addPrice:'',
|
|
|
discountPrice:'',
|
|
discountPrice:'',
|
|
|
|
|
+ smallRatio:'',
|
|
|
weight:'',
|
|
weight:'',
|
|
|
cover:[],
|
|
cover:[],
|
|
|
stockWarning:'',
|
|
stockWarning:'',
|
|
@@ -225,6 +188,15 @@ export default {
|
|
|
},
|
|
},
|
|
|
computed:{
|
|
computed:{
|
|
|
...mapGetters(["getLoginInfo","getDictionariesInfo"]),
|
|
...mapGetters(["getLoginInfo","getDictionariesInfo"]),
|
|
|
|
|
+ smallPrice(){
|
|
|
|
|
+ let price = 0
|
|
|
|
|
+ if(Number(this.form.price) > 0 && Number(this.form.ratio)>0){
|
|
|
|
|
+ let div = Number(this.form.price)/Number(this.form.ratio)
|
|
|
|
|
+ price = div*Number(this.form.smallRatio)
|
|
|
|
|
+ price = parseFloat(price.toFixed(2))
|
|
|
|
|
+ }
|
|
|
|
|
+ return price
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
|
if(option.id){
|
|
if(option.id){
|
|
@@ -306,7 +278,6 @@ export default {
|
|
|
this.form.delStatus = 0
|
|
this.form.delStatus = 0
|
|
|
this.form.id = 0
|
|
this.form.id = 0
|
|
|
this.form.price = ''
|
|
this.form.price = ''
|
|
|
- this.form.skAddPrice =''
|
|
|
|
|
this.form.skMore =''
|
|
this.form.skMore =''
|
|
|
this.form.addPrice =''
|
|
this.form.addPrice =''
|
|
|
this.form.discountPrice = ''
|
|
this.form.discountPrice = ''
|
|
@@ -408,20 +379,20 @@ export default {
|
|
|
uni.showToast({title:"请填写特价,没有特价请填0",icon:"none"})
|
|
uni.showToast({title:"请填写特价,没有特价请填0",icon:"none"})
|
|
|
return;
|
|
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"})
|
|
|
|
|
|
|
+ if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.smallRatio) == false){
|
|
|
|
|
+ uni.showToast({title:"请填写涨幅,最小请填1",icon:"none"})
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.skAddPrice) == 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.price) == false){
|
|
|
|
|
+ uni.showToast({title:"请填写售价",icon:"none"})
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.addPrice) == false){
|
|
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"})
|
|
|
|
|
|
|
+ uni.showToast({title:"请填写花店价比进价贵多少",icon:"none"})
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.form.skMore) == false){
|
|
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"})
|
|
|
|
|
|
|
+ uni.showToast({title:"请填写散客价比花店贵多少",icon:"none"})
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -483,26 +454,26 @@ export default {
|
|
|
rule: ["required"],
|
|
rule: ["required"],
|
|
|
msg: ["请填写售价"]
|
|
msg: ["请填写售价"]
|
|
|
},
|
|
},
|
|
|
- {
|
|
|
|
|
- name: "skAddPrice",
|
|
|
|
|
- rule: ["required"],
|
|
|
|
|
- msg: ["请填写散客加价"]
|
|
|
|
|
- },
|
|
|
|
|
{
|
|
{
|
|
|
name: "skMore",
|
|
name: "skMore",
|
|
|
rule: ["required"],
|
|
rule: ["required"],
|
|
|
- msg: ["请填写散客比花店贵多少"]
|
|
|
|
|
|
|
+ msg: ["请填写散客价比花店贵多少"]
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
name: "addPrice",
|
|
name: "addPrice",
|
|
|
rule: ["required"],
|
|
rule: ["required"],
|
|
|
- msg: ["请填写花店加价"]
|
|
|
|
|
|
|
+ msg: ["请填写花店价比进价贵多少"]
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
name: "discountPrice",
|
|
name: "discountPrice",
|
|
|
rule: ["required"],
|
|
rule: ["required"],
|
|
|
msg: ["不做特价请填0"]
|
|
msg: ["不做特价请填0"]
|
|
|
},
|
|
},
|
|
|
|
|
+ {
|
|
|
|
|
+ name: "smallRatio",
|
|
|
|
|
+ rule: ["required"],
|
|
|
|
|
+ msg: ["请填单支售价涨幅"]
|
|
|
|
|
+ },
|
|
|
{
|
|
{
|
|
|
name: "weight",
|
|
name: "weight",
|
|
|
rule: ["required"],
|
|
rule: ["required"],
|