|
@@ -1,6 +1,5 @@
|
|
|
<template>
|
|
<template>
|
|
|
<view class="app-content">
|
|
<view class="app-content">
|
|
|
- <!-- 花材基本信息 -->
|
|
|
|
|
<form @submit="formSubmit">
|
|
<form @submit="formSubmit">
|
|
|
<view class="module-com input-line-wrap">
|
|
<view class="module-com input-line-wrap">
|
|
|
|
|
|
|
@@ -16,43 +15,23 @@
|
|
|
|
|
|
|
|
<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.py"
|
|
|
|
|
- placeholder-class="phcolor"
|
|
|
|
|
- class="tui-input"
|
|
|
|
|
- name="py"
|
|
|
|
|
- placeholder="请填写拼音首字母缩写"
|
|
|
|
|
- maxlength="50"
|
|
|
|
|
- type="text"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <input v-model="form.py" placeholder-class="phcolor" class="tui-input" name="py" placeholder="请填写字母" maxlength="50" type="text" />
|
|
|
</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.price"
|
|
|
|
|
- placeholder-class="phcolor"
|
|
|
|
|
- class="tui-input"
|
|
|
|
|
- name="price"
|
|
|
|
|
- @focus="form.price=''"
|
|
|
|
|
- placeholder="请填写售价"
|
|
|
|
|
- maxlength="50"
|
|
|
|
|
- type="digit"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <input v-model="form.skPrice" placeholder-class="phcolor" class="tui-input" name="skPrice" @focus="form.skPrice=''" 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">
|
|
|
- <view class="tui-title">今日特价</view>
|
|
|
|
|
- <input
|
|
|
|
|
- v-model="form.discountPrice"
|
|
|
|
|
- placeholder-class="phcolor"
|
|
|
|
|
- class="tui-input"
|
|
|
|
|
- name="discountPrice"
|
|
|
|
|
- @focus="form.discountPrice=''"
|
|
|
|
|
- placeholder="没有特价填0"
|
|
|
|
|
- maxlength="50"
|
|
|
|
|
- type="digit"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <view class="tui-title">单支价格倍数</view>
|
|
|
|
|
+ <input v-model="form.smallRatio" placeholder-class="phcolor" class="tui-input" name="smallRatio" style="width:330upx;" @focus="form.smallRatio=''"
|
|
|
|
|
+ placeholder="请填写" maxlength="30" type="number" /><text style="color:#666666;">¥<text>{{smallPrice}}</text></text>
|
|
|
|
|
+ </tui-list-cell>
|
|
|
|
|
+
|
|
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
|
|
+ <view class="tui-title">加价</view>
|
|
|
|
|
+ <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>
|
|
|
|
|
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
@@ -63,14 +42,7 @@
|
|
|
|
|
|
|
|
<tui-list-cell class="line-cell" :arrow="true">
|
|
<tui-list-cell class="line-cell" :arrow="true">
|
|
|
<view class="tui-title">分类</view>
|
|
<view class="tui-title">分类</view>
|
|
|
- <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" >
|
|
|
<input v-model="form.classId" name="classId" type="text" hidden />
|
|
<input v-model="form.classId" name="classId" type="text" hidden />
|
|
|
<view v-if="form.classId" style="height:45upx;" >{{ itemClassSelectedData.name }}</view>
|
|
<view v-if="form.classId" style="height:45upx;" >{{ itemClassSelectedData.name }}</view>
|
|
|
<view class="tui-placeholder" style="height:45upx;" v-else>请选择</view>
|
|
<view class="tui-placeholder" style="height:45upx;" v-else>请选择</view>
|
|
@@ -79,14 +51,7 @@
|
|
|
|
|
|
|
|
<tui-list-cell class="line-cell" :arrow="true">
|
|
<tui-list-cell class="line-cell" :arrow="true">
|
|
|
<view class="tui-title">大单位</view>
|
|
<view class="tui-title">大单位</view>
|
|
|
- <picker
|
|
|
|
|
- mode="selector"
|
|
|
|
|
- :value="form.bigUnitId"
|
|
|
|
|
- :range="unitData"
|
|
|
|
|
- range-key="name"
|
|
|
|
|
- @change="changeBigUnitFn"
|
|
|
|
|
- class="tui-input"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <picker mode="selector" :value="form.bigUnitId" :range="unitData" range-key="name" @change="changeBigUnitFn" class="tui-input" >
|
|
|
<input v-model="form.bigUnitId" name="bigUnitId" type="text" hidden />
|
|
<input v-model="form.bigUnitId" name="bigUnitId" type="text" hidden />
|
|
|
<view v-if="form.bigUnitId">{{ bigUnitSelectedData.name }}</view>
|
|
<view v-if="form.bigUnitId">{{ bigUnitSelectedData.name }}</view>
|
|
|
<view class="tui-placeholder" style="height:45upx;" v-else>请选择</view>
|
|
<view class="tui-placeholder" style="height:45upx;" v-else>请选择</view>
|
|
@@ -95,123 +60,26 @@
|
|
|
|
|
|
|
|
<tui-list-cell class="line-cell" :arrow="true">
|
|
<tui-list-cell class="line-cell" :arrow="true">
|
|
|
<view class="tui-title">小单位</view>
|
|
<view class="tui-title">小单位</view>
|
|
|
- <picker
|
|
|
|
|
- mode="selector"
|
|
|
|
|
- :value="form.smallUnitId"
|
|
|
|
|
- :range="unitData"
|
|
|
|
|
- range-key="name"
|
|
|
|
|
- @change="changeSmallUnitFn"
|
|
|
|
|
- class="tui-input"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <picker mode="selector" :value="form.smallUnitId" :range="unitData" range-key="name" @change="changeSmallUnitFn" class="tui-input" >
|
|
|
<input v-model="form.smallUnitId" name="smallUnitId" type="text" hidden />
|
|
<input v-model="form.smallUnitId" name="smallUnitId" type="text" hidden />
|
|
|
<view v-if="form.smallUnitId">{{ smallUnitSelectedData.name }}</view>
|
|
<view v-if="form.smallUnitId">{{ smallUnitSelectedData.name }}</view>
|
|
|
<view class="tui-placeholder" v-else>请选择</view>
|
|
<view class="tui-placeholder" v-else>请选择</view>
|
|
|
</picker>
|
|
</picker>
|
|
|
</tui-list-cell>
|
|
</tui-list-cell>
|
|
|
|
|
|
|
|
- <tui-list-cell class="line-cell" :hover="false">
|
|
|
|
|
- <view class="tui-title">散客加价</view>
|
|
|
|
|
- <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">
|
|
|
|
|
- <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.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.zsAddPrice"
|
|
|
|
|
- placeholder-class="phcolor"
|
|
|
|
|
- class="tui-input"
|
|
|
|
|
- name="zsAddPrice"
|
|
|
|
|
- @focus="form.zsAddPrice=''"
|
|
|
|
|
- placeholder="请填写金店加价"
|
|
|
|
|
- maxlength="50"
|
|
|
|
|
- type="digit"
|
|
|
|
|
- />
|
|
|
|
|
- </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.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=""
|
|
|
|
|
- maxlength="50"
|
|
|
|
|
- type="number"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <input v-model="form.ratio" disabled="true" placeholder-class="phcolor" class="tui-input" name="ratio" placeholder="如:1扎=20支,请填写20" 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">
|
|
|
<view class="tui-title">每扎重量</view>
|
|
<view class="tui-title">每扎重量</view>
|
|
|
- <input
|
|
|
|
|
- v-model="form.weight"
|
|
|
|
|
- placeholder-class="phcolor"
|
|
|
|
|
- class="tui-input"
|
|
|
|
|
- name="weight"
|
|
|
|
|
- placeholder="单位:公斤"
|
|
|
|
|
- maxlength="50"
|
|
|
|
|
- type="digit"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <input v-model="form.weight" disabled="true" placeholder-class="phcolor" class="tui-input" name="weight" 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">
|
|
|
<view class="tui-title">库存预警值</view>
|
|
<view class="tui-title">库存预警值</view>
|
|
|
- <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">
|
|
@@ -286,18 +154,14 @@ export default {
|
|
|
bigUnitId:1,
|
|
bigUnitId:1,
|
|
|
smallUnitId:2,
|
|
smallUnitId:2,
|
|
|
classId:'',
|
|
classId:'',
|
|
|
- price:'',
|
|
|
|
|
skAddPrice:'',
|
|
skAddPrice:'',
|
|
|
- addPrice:'',
|
|
|
|
|
- hjAddPrice:'',
|
|
|
|
|
- zsAddPrice:'',
|
|
|
|
|
- discountPrice:'',
|
|
|
|
|
weight:'',
|
|
weight:'',
|
|
|
cover:[],
|
|
cover:[],
|
|
|
stockWarning:'',
|
|
stockWarning:'',
|
|
|
status:2,
|
|
status:2,
|
|
|
delStatus:0,
|
|
delStatus:0,
|
|
|
itemId:0,
|
|
itemId:0,
|
|
|
|
|
+ skPrice:0
|
|
|
},
|
|
},
|
|
|
itemClassSelectedData:{},
|
|
itemClassSelectedData:{},
|
|
|
itemClassData:[],
|
|
itemClassData:[],
|
|
@@ -311,6 +175,15 @@ export default {
|
|
|
},
|
|
},
|
|
|
computed:{
|
|
computed:{
|
|
|
...mapGetters(["getLoginInfo","getDictionariesInfo"]),
|
|
...mapGetters(["getLoginInfo","getDictionariesInfo"]),
|
|
|
|
|
+ smallPrice(){
|
|
|
|
|
+ let price = 0
|
|
|
|
|
+ if(this.form.skPrice){
|
|
|
|
|
+ let div = this.$util.div(this.form.skPrice,this.form.ratio)
|
|
|
|
|
+ price = this.$util.mul(div,this.form.smallRatio)
|
|
|
|
|
+ price = parseFloat(price.toFixed(2))
|
|
|
|
|
+ }
|
|
|
|
|
+ return price
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
|
if(option.id){
|
|
if(option.id){
|
|
@@ -391,12 +264,7 @@ export default {
|
|
|
this.form.status = 1
|
|
this.form.status = 1
|
|
|
this.form.delStatus = 0
|
|
this.form.delStatus = 0
|
|
|
this.form.id = 0
|
|
this.form.id = 0
|
|
|
- this.form.price = ''
|
|
|
|
|
this.form.skAddPrice =''
|
|
this.form.skAddPrice =''
|
|
|
- this.form.addPrice =''
|
|
|
|
|
- this.form.hjAddPrice =''
|
|
|
|
|
- this.form.zsAddPrice =''
|
|
|
|
|
- this.form.discountPrice = ''
|
|
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
getDetail() {
|
|
getDetail() {
|
|
@@ -407,21 +275,12 @@ export default {
|
|
|
Object.keys(this.form).forEach((i, index) => {
|
|
Object.keys(this.form).forEach((i, index) => {
|
|
|
this.form[i] = res.data[i];
|
|
this.form[i] = res.data[i];
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
this.currentImgData.push(res.data.cover)
|
|
this.currentImgData.push(res.data.cover)
|
|
|
this.form.cover = [res.data.shortCover]
|
|
this.form.cover = [res.data.shortCover]
|
|
|
|
|
|
|
|
- this.form.price = res.data.prePrice
|
|
|
|
|
-
|
|
|
|
|
- this.itemClassSelectedData = this.itemClassData.filter(
|
|
|
|
|
- e => this.form.classId == e.id
|
|
|
|
|
- )[0];
|
|
|
|
|
- this.smallUnitSelectedData = this.unitData.filter(
|
|
|
|
|
- e => this.form.smallUnitId == e.id
|
|
|
|
|
- )[0];
|
|
|
|
|
- this.bigUnitSelectedData = this.unitData.filter(
|
|
|
|
|
- e => this.form.bigUnitId == e.id
|
|
|
|
|
- )[0];
|
|
|
|
|
|
|
+ this.itemClassSelectedData = this.itemClassData.filter( e => this.form.classId == e.id )[0];
|
|
|
|
|
+ this.smallUnitSelectedData = this.unitData.filter( e => this.form.smallUnitId == e.id )[0];
|
|
|
|
|
+ this.bigUnitSelectedData = this.unitData.filter( e => this.form.bigUnitId == e.id )[0];
|
|
|
this.productData = res.data
|
|
this.productData = res.data
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
@@ -495,11 +354,7 @@ 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.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){
|
|
|
|
|
|
|
+ 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"})
|
|
uni.showToast({title:"请填写售价",icon:"none"})
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -507,18 +362,6 @@ export default {
|
|
|
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.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.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.zsAddPrice) == false){
|
|
|
|
|
- uni.showToast({title:"请填写金店加价",icon:"none"})
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
let form = JSON.parse(JSON.stringify(this.form))
|
|
let form = JSON.parse(JSON.stringify(this.form))
|
|
|
uni.showLoading({mask:true})
|
|
uni.showLoading({mask:true})
|
|
@@ -574,38 +417,13 @@ export default {
|
|
|
{
|
|
{
|
|
|
name: "smallRatio",
|
|
name: "smallRatio",
|
|
|
rule: ["required"],
|
|
rule: ["required"],
|
|
|
- msg: ["请填写零售价系数"]
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: "price",
|
|
|
|
|
- rule: ["required"],
|
|
|
|
|
- msg: ["请填写售价"]
|
|
|
|
|
|
|
+ msg: ["请填写单支价格倍数"]
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
name: "skAddPrice",
|
|
name: "skAddPrice",
|
|
|
rule: ["required"],
|
|
rule: ["required"],
|
|
|
msg: ["请填写散客加价"]
|
|
msg: ["请填写散客加价"]
|
|
|
},
|
|
},
|
|
|
- {
|
|
|
|
|
- name: "addPrice",
|
|
|
|
|
- rule: ["required"],
|
|
|
|
|
- msg: ["请填写普店加价"]
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: "hjAddPrice",
|
|
|
|
|
- rule: ["required"],
|
|
|
|
|
- msg: ["请填写银店加价"]
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: "zsAddPrice",
|
|
|
|
|
- rule: ["required"],
|
|
|
|
|
- msg: ["请填写金店加价"]
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: "discountPrice",
|
|
|
|
|
- rule: ["required"],
|
|
|
|
|
- msg: ["不做特价请填0"]
|
|
|
|
|
- },
|
|
|
|
|
{
|
|
{
|
|
|
name: "weight",
|
|
name: "weight",
|
|
|
rule: ["required"],
|
|
rule: ["required"],
|