|
@@ -193,7 +193,8 @@
|
|
|
商品售价<span>*</span>
|
|
商品售价<span>*</span>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="picker">
|
|
<view class="picker">
|
|
|
- <u-input type="number" v-model.number="form.price" placeholder="请输入" />
|
|
|
|
|
|
|
+ <u-input type="number" v-model.number="form.price" placeholder="请输入"
|
|
|
|
|
+ @blur="checkPriceAndSoldPrice('price')" />
|
|
|
</view>
|
|
</view>
|
|
|
<view class="unit">
|
|
<view class="unit">
|
|
|
元
|
|
元
|
|
@@ -204,7 +205,8 @@
|
|
|
商品市场价<span v-if="tabIndex == '1'">*</span>
|
|
商品市场价<span v-if="tabIndex == '1'">*</span>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="picker">
|
|
<view class="picker">
|
|
|
- <u-input type="number" v-model.number="form.soldPrice" placeholder="请输入" />
|
|
|
|
|
|
|
+ <u-input type="number" v-model.number="form.soldPrice" placeholder="请输入"
|
|
|
|
|
+ @blur="checkPriceAndSoldPrice('soldPrice')" />
|
|
|
</view>
|
|
</view>
|
|
|
<view class="unit">
|
|
<view class="unit">
|
|
|
元
|
|
元
|
|
@@ -737,6 +739,21 @@ export default {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ // 校验商品市场价必须大于商品售价
|
|
|
|
|
+ checkPriceAndSoldPrice(field) {
|
|
|
|
|
+ if ((field == 'price' && this.form.soldPrice) || (field == 'soldPrice' && this.form.price)) {
|
|
|
|
|
+ if (this.form.soldPrice <= this.form.price) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '商品市场价必须大于商品售价',
|
|
|
|
|
+ icon: 'none',
|
|
|
|
|
+ duration: 2000
|
|
|
|
|
+ });
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.form[field] = '';
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
// 保存退款规则
|
|
// 保存退款规则
|
|
|
saveFound(rules) {
|
|
saveFound(rules) {
|
|
|
this.form.refundConfirm = rules.refundConfirm.refundConfirm
|
|
this.form.refundConfirm = rules.refundConfirm.refundConfirm
|
|
@@ -845,7 +862,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
//获取商品分组列表
|
|
//获取商品分组列表
|
|
|
getProductGroup() {
|
|
getProductGroup() {
|
|
|
- this.$http.get("/localProductGrouping/localProductGrouping/getList").then(res => {
|
|
|
|
|
|
|
+ this.$http.get("/localProductGrouping/localProductGrouping/getAppList").then(res => {
|
|
|
if (res.data.success) {
|
|
if (res.data.success) {
|
|
|
this.groupOptions = res.data.result || []
|
|
this.groupOptions = res.data.result || []
|
|
|
}
|
|
}
|
|
@@ -885,6 +902,7 @@ export default {
|
|
|
submit() {
|
|
submit() {
|
|
|
console.log(this.form)
|
|
console.log(this.form)
|
|
|
this.form.specItems = this.selectProductSunItem
|
|
this.form.specItems = this.selectProductSunItem
|
|
|
|
|
+ this.form.isApp = '1'
|
|
|
this.makeChecked ? this.form.preBook = 1 : this.form.preBook = 0
|
|
this.makeChecked ? this.form.preBook = 1 : this.form.preBook = 0
|
|
|
// if (!this.form.saleStartDate) {
|
|
// if (!this.form.saleStartDate) {
|
|
|
// uni.showToast({
|
|
// uni.showToast({
|
|
@@ -1000,7 +1018,10 @@ export default {
|
|
|
},
|
|
},
|
|
|
//回显数据
|
|
//回显数据
|
|
|
getForm() {
|
|
getForm() {
|
|
|
- this.$http.get("/app/product/queryById?id=" + this.productId, {}).then(res => {
|
|
|
|
|
|
|
+ this.$http.post("/app/product/queryByIdNew", {
|
|
|
|
|
+ id: this.productId,
|
|
|
|
|
+ isApp: '1'
|
|
|
|
|
+ }).then(res => {
|
|
|
if (res.data.code == 200) {
|
|
if (res.data.code == 200) {
|
|
|
this.form = res.data.result
|
|
this.form = res.data.result
|
|
|
|
|
|