|
|
@ -124,6 +124,7 @@
|
|
|
|
@click="addNum"></u-button>
|
|
|
|
@click="addNum"></u-button>
|
|
|
|
<u-button
|
|
|
|
<u-button
|
|
|
|
class="bottom-btn"
|
|
|
|
class="bottom-btn"
|
|
|
|
|
|
|
|
:disabled="loading"
|
|
|
|
style="background-color: #fff; color: #1936c9"
|
|
|
|
style="background-color: #fff; color: #1936c9"
|
|
|
|
text="修改"
|
|
|
|
text="修改"
|
|
|
|
@click="goEdit"></u-button>
|
|
|
|
@click="goEdit"></u-button>
|
|
|
@ -133,6 +134,7 @@
|
|
|
|
v-else>
|
|
|
|
v-else>
|
|
|
|
<u-button
|
|
|
|
<u-button
|
|
|
|
class="bottom-btn"
|
|
|
|
class="bottom-btn"
|
|
|
|
|
|
|
|
:disabled="loading"
|
|
|
|
style="background-color: #fff; color: #1936c9"
|
|
|
|
style="background-color: #fff; color: #1936c9"
|
|
|
|
text="保存"
|
|
|
|
text="保存"
|
|
|
|
@click="goSave"></u-button>
|
|
|
|
@click="goSave"></u-button>
|
|
|
@ -199,6 +201,7 @@ import moment from "moment";
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
|
|
|
|
loading: false,
|
|
|
|
actionType: "add",
|
|
|
|
actionType: "add",
|
|
|
|
title: "商品录入",
|
|
|
|
title: "商品录入",
|
|
|
|
codeVal: "",
|
|
|
|
codeVal: "",
|
|
|
@ -345,9 +348,11 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 保存接口
|
|
|
|
// 保存接口
|
|
|
|
async save() {
|
|
|
|
async save() {
|
|
|
|
|
|
|
|
this.loading = true;
|
|
|
|
this.model.goodsInfo.stockSize = parseInt(this.model.goodsInfo.stockSize);
|
|
|
|
this.model.goodsInfo.stockSize = parseInt(this.model.goodsInfo.stockSize);
|
|
|
|
let res = await this.$api.management.save(this.model.goodsInfo);
|
|
|
|
let res = await this.$api.management.save(this.model.goodsInfo);
|
|
|
|
if (res.status == 0) {
|
|
|
|
if (res.status == 0) {
|
|
|
|
|
|
|
|
this.loading = false;
|
|
|
|
uni.$u.toast("添加成功");
|
|
|
|
uni.$u.toast("添加成功");
|
|
|
|
setTimeout(() => {
|
|
|
|
setTimeout(() => {
|
|
|
|
uni.navigateTo({
|
|
|
|
uni.navigateTo({
|
|
|
@ -355,14 +360,17 @@ export default {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}, 1000);
|
|
|
|
}, 1000);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.loading = false;
|
|
|
|
uni.$u.toast("添加失败");
|
|
|
|
uni.$u.toast("添加失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 修改接口
|
|
|
|
// 修改接口
|
|
|
|
async edit() {
|
|
|
|
async edit() {
|
|
|
|
|
|
|
|
this.loading = true;
|
|
|
|
this.model.goodsInfo.stockSize = parseInt(this.model.goodsInfo.stockSize);
|
|
|
|
this.model.goodsInfo.stockSize = parseInt(this.model.goodsInfo.stockSize);
|
|
|
|
let res = await this.$api.management.update(this.model.goodsInfo);
|
|
|
|
let res = await this.$api.management.update(this.model.goodsInfo);
|
|
|
|
if (res.status == 0) {
|
|
|
|
if (res.status == 0) {
|
|
|
|
|
|
|
|
this.loading = false;
|
|
|
|
uni.$u.toast("修改成功");
|
|
|
|
uni.$u.toast("修改成功");
|
|
|
|
setTimeout(() => {
|
|
|
|
setTimeout(() => {
|
|
|
|
uni.navigateTo({
|
|
|
|
uni.navigateTo({
|
|
|
@ -370,6 +378,7 @@ export default {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}, 1000);
|
|
|
|
}, 1000);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.loading = false;
|
|
|
|
uni.$u.toast("修改失败");
|
|
|
|
uni.$u.toast("修改失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|