|
|
@@ -29,11 +29,14 @@
|
|
|
<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 class="line-cell" :hover="false">
|
|
|
<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"/>
|
|
|
- <button v-if="productData.id > 0" class="admin-button-com blue small" @click="goStockDetail(productData.id)">库存明细</button>
|
|
|
+ </tui-list-cell>
|
|
|
+
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
+ <div class="tui-title">库存</div>
|
|
|
+ <input v-model="form.cost" style="width:340upx;" placeholder-class="phcolor" @focus="form.cost=''" class="tui-input" name="cost" placeholder="请输入" type="digit"/>
|
|
|
</tui-list-cell>
|
|
|
|
|
|
<tui-list-cell class="line-cell" :arrow="true">
|
|
|
@@ -203,6 +206,7 @@ export default {
|
|
|
skMore:3,
|
|
|
addPrice:3,
|
|
|
discountPrice:0,
|
|
|
+ cost:0,
|
|
|
weight:1.5,
|
|
|
cover:[],
|
|
|
stockWarning:5,
|
|
|
@@ -320,6 +324,7 @@ export default {
|
|
|
this.form.skMore =3
|
|
|
this.form.addPrice =3
|
|
|
this.form.discountPrice = ''
|
|
|
+ this.form.cost = 0
|
|
|
})
|
|
|
},
|
|
|
getDetail() {
|
|
|
@@ -418,6 +423,10 @@ 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.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;
|
|
|
@@ -504,6 +513,11 @@ export default {
|
|
|
rule: ["required"],
|
|
|
msg: ["不做特价请填0"]
|
|
|
},
|
|
|
+ {
|
|
|
+ name: "cost",
|
|
|
+ rule: ["required"],
|
|
|
+ msg: ["请填写成本"]
|
|
|
+ },
|
|
|
{
|
|
|
name: "weight",
|
|
|
rule: ["required"],
|