|
|
@@ -12,6 +12,7 @@
|
|
|
name="name"
|
|
|
placeholder="请填写名称"
|
|
|
@input="fillName($event)"
|
|
|
+ @focus="form.name=''"
|
|
|
maxlength="50"
|
|
|
type="text"
|
|
|
/>
|
|
|
@@ -96,13 +97,28 @@
|
|
|
</tui-list-cell>
|
|
|
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
- <div class="tui-title">每扎成本</div>
|
|
|
+ <div class="tui-title">售价</div>
|
|
|
<input
|
|
|
- v-model="form.cost"
|
|
|
+ v-model="form.price"
|
|
|
placeholder-class="phcolor"
|
|
|
class="tui-input"
|
|
|
- name="cost"
|
|
|
- placeholder="请填写成本价"
|
|
|
+ name="price"
|
|
|
+ @focus="form.price=''"
|
|
|
+ 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.discountPrice"
|
|
|
+ placeholder-class="phcolor"
|
|
|
+ class="tui-input"
|
|
|
+ name="discountPrice"
|
|
|
+ @focus="form.discountPrice=''"
|
|
|
+ placeholder="填0表示特价"
|
|
|
maxlength="50"
|
|
|
type="digit"
|
|
|
/>
|
|
|
@@ -116,6 +132,7 @@
|
|
|
class="tui-input"
|
|
|
name="addPrice"
|
|
|
placeholder="请填写加价"
|
|
|
+ @focus="form.addPrice=''"
|
|
|
maxlength="50"
|
|
|
type="digit"
|
|
|
/>
|
|
|
@@ -129,6 +146,7 @@
|
|
|
class="tui-input"
|
|
|
name="weight"
|
|
|
placeholder="单位:公斤"
|
|
|
+ @focus="form.weight=''"
|
|
|
maxlength="50"
|
|
|
type="digit"
|
|
|
/>
|
|
|
@@ -142,6 +160,7 @@
|
|
|
class="tui-input"
|
|
|
name="stockWarning"
|
|
|
placeholder="请填写"
|
|
|
+ @focus="form.stockWarning=''"
|
|
|
maxlength="50"
|
|
|
type="number"
|
|
|
/>
|
|
|
@@ -213,8 +232,9 @@ export default {
|
|
|
bigUnitId:1,
|
|
|
smallUnitId:2,
|
|
|
classId:'',
|
|
|
- cost:'',
|
|
|
+ price:'',
|
|
|
addPrice:'',
|
|
|
+ discountPrice:'',
|
|
|
weight:'',
|
|
|
cover:'',
|
|
|
stockWarning:'',
|
|
|
@@ -308,9 +328,9 @@ export default {
|
|
|
this.form.status = 1
|
|
|
this.form.delStatus = 0
|
|
|
this.form.id = 0
|
|
|
- this.form.cost = ''
|
|
|
+ this.form.price = ''
|
|
|
this.form.addPrice =''
|
|
|
-
|
|
|
+ this.form.discountPrice = ''
|
|
|
})
|
|
|
},
|
|
|
getDetail() {
|
|
|
@@ -322,6 +342,7 @@ export default {
|
|
|
this.form[i] = res.data[i];
|
|
|
});
|
|
|
|
|
|
+ this.form.price = res.data.prePrice
|
|
|
this.form.cover = [res.data.shortCover]
|
|
|
|
|
|
this.itemClassSelectedData = this.itemClassData.filter(
|
|
|
@@ -397,8 +418,12 @@ 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"})
|
|
|
+ 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.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.addPrice) == false){
|
|
|
@@ -458,14 +483,19 @@ export default {
|
|
|
msg: ["请填写单位比"]
|
|
|
},
|
|
|
{
|
|
|
- name: "cost",
|
|
|
+ name: "price",
|
|
|
rule: ["required"],
|
|
|
- msg: ["请填写成本价"]
|
|
|
+ msg: ["请填写售价"]
|
|
|
},
|
|
|
{
|
|
|
name: "addPrice",
|
|
|
rule: ["required"],
|
|
|
- msg: ["请填写加价"]
|
|
|
+ msg: ["请填写每扎加价"]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "discountPrice",
|
|
|
+ rule: ["required"],
|
|
|
+ msg: ["不做特价请填0"]
|
|
|
},
|
|
|
{
|
|
|
name: "weight",
|