|
|
|
@ -51,8 +51,11 @@ |
|
|
|
trim="all" /> |
|
|
|
</uni-forms-item> |
|
|
|
</uni-forms> |
|
|
|
|
|
|
|
<u-button type="primary" @tap.stop="submit()">保存</u-button> |
|
|
|
<view> |
|
|
|
<u-button type="primary" @tap.stop="delGoods()">删除商品</u-button> |
|
|
|
<u-button type="primary" @tap.stop="submit()">保存</u-button> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
<!-- <u-modal v-model="show" :content="content"></u-modal> --> |
|
|
|
@ -220,6 +223,36 @@ |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
delGoods(){ |
|
|
|
let that = this; |
|
|
|
if(that.dataList.stockCount == 0 || that.dataList.purchasePrice==null){ |
|
|
|
uni.showModal({ |
|
|
|
title: "提示", |
|
|
|
content: "确定删除此条商品吗?", |
|
|
|
success: function(res) { |
|
|
|
if(res.confirm){ |
|
|
|
that.tui.request('/app/product/edit', "post", { |
|
|
|
id:that.dataList.id, |
|
|
|
delFlag:0 |
|
|
|
}, false, false).then((res1) => { |
|
|
|
if (res1.code == 200) { |
|
|
|
uni.navigateBack({ |
|
|
|
delta: 2 |
|
|
|
}) |
|
|
|
} else { |
|
|
|
uni.showToast({ |
|
|
|
title: "删除失败", |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
this.tui.toast("您的商品下有库存,不能执行删除操作!") |
|
|
|
} |
|
|
|
}, |
|
|
|
// 触发提交表单 |
|
|
|
submit() { |
|
|
|
|