|
@@ -47,7 +47,7 @@
|
|
|
</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.stock" placeholder-class="phcolor" @input="changeStock($event)" class="tui-input" name="stock" placeholder="请输入" maxlength="50" type="digit"/>
|
|
|
|
|
|
|
+ <input v-model="form.stock" placeholder-class="phcolor" @focus="form.stock=''" @input="changeStock($event)" class="tui-input" name="stock" placeholder="请输入" maxlength="50" type="digit"/>
|
|
|
</tui-list-cell>
|
|
</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>
|
|
@@ -273,7 +273,6 @@ export default {
|
|
|
this.itemClassSelectedData = this.itemClassData[e.detail.value];
|
|
this.itemClassSelectedData = this.itemClassData[e.detail.value];
|
|
|
this.form.classId = this.itemClassSelectedData.id;
|
|
this.form.classId = this.itemClassSelectedData.id;
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
_getDet() {
|
|
_getDet() {
|
|
|
return getProductDetail({ id: this.option.id })
|
|
return getProductDetail({ id: this.option.id })
|
|
|
.then(res => {
|
|
.then(res => {
|
|
@@ -342,24 +341,23 @@ export default {
|
|
|
},
|
|
},
|
|
|
// 确认
|
|
// 确认
|
|
|
confirmFn() {
|
|
confirmFn() {
|
|
|
- console.log('aaaaform',this.form)
|
|
|
|
|
if (this.$util.isEmpty(this.form.cover)) {
|
|
if (this.$util.isEmpty(this.form.cover)) {
|
|
|
- this.$msg("请上传图片");
|
|
|
|
|
- return false;
|
|
|
|
|
|
|
+ this.$msg("请上传图片")
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ if (/^([1-9]\d*|[0]{1,1})$/.test(this.form.stock) == false) {
|
|
|
|
|
+ this.$msg("请填写整数库存")
|
|
|
|
|
+ return false
|
|
|
}
|
|
}
|
|
|
this.form.cover = this.form.cover[0]
|
|
this.form.cover = this.form.cover[0]
|
|
|
let host = this.form.id == 0 ? addProduct : updateProduct;
|
|
let host = this.form.id == 0 ? addProduct : updateProduct;
|
|
|
let form = JSON.parse(JSON.stringify(this.form));
|
|
let form = JSON.parse(JSON.stringify(this.form));
|
|
|
form.cover = this.$util.imgSubstr(form.cover);
|
|
form.cover = this.$util.imgSubstr(form.cover);
|
|
|
- console.log('aaaaform',this.form)
|
|
|
|
|
host({
|
|
host({
|
|
|
...form
|
|
...form
|
|
|
}).then(res => {
|
|
}).then(res => {
|
|
|
-
|
|
|
|
|
this.$msg("操作成功!");
|
|
this.$msg("操作成功!");
|
|
|
-
|
|
|
|
|
uni.navigateBack({});
|
|
uni.navigateBack({});
|
|
|
-
|
|
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
// 表单验证
|
|
// 表单验证
|