main
scout 8 months ago
parent 9e017fd508
commit 5588ae51aa

@ -3,7 +3,7 @@
"configurations" : [ "configurations" : [
{ {
"playground" : "custom", "playground" : "custom",
"type" : "uni-app:app-android" "type" : "uni-app:app-ios"
}, },
{ {
"app-plus" : { "app-plus" : {
@ -13,7 +13,7 @@
}, },
{ {
"playground" : "custom", "playground" : "custom",
"type" : "uni-app:app-ios" "type" : "uni-app:app-android"
} }
] ]
} }

@ -2,8 +2,8 @@
"name" : "艺邑库存", "name" : "艺邑库存",
"appid" : "__UNI__6DE03A4", "appid" : "__UNI__6DE03A4",
"description" : "", "description" : "",
"versionName" : "1.0.0", "versionName" : "1.0.1",
"versionCode" : "100", "versionCode" : 102,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {

@ -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("修改失败");
} }
}, },

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Loading…
Cancel
Save