wangfukang 3 years ago
parent
commit
957fa63e5b
  1. 49
      pages/index/orderDetail.vue
  2. 23
      pages/inventory/addGoods.vue

49
pages/index/orderDetail.vue

@ -810,29 +810,30 @@
this.list[i].stockLogList.push(this.list[i].stockLogList1[m]) this.list[i].stockLogList.push(this.list[i].stockLogList1[m])
} }
} }
} }
console.log(this.list)
for (var i = 0; i < this.list.length; i++) { for (var i = 0; i < this.list.length; i++) {
if(this.list[i].stockLogList.length == 0){ if(this.list[i].stockLogList.length != 0){
this.tui.toast("请选择退货商品") for (var m = 0; m < this.list[i].stockLogList.length; m++) {
return; if(this.list[i].stockLogList[m].returnCount <= 0){
} this.tui.toast("退货数量不能为零")
for (var m = 0; m < this.list[i].stockLogList.length; m++) { return;
if(this.list[i].stockLogList[m].returnCount <= 0){
this.tui.toast("退货数量不能为零")
return;
}
this.list[i].stockLogList[m].productCount = this.list[i].stockLogList[m].returnCount
if(this.list[i].stockLogList.length >0){
if (m == 0) {
this.list[i].productCount = this.list[i].stockLogList[m].productCount
} else {
this.list[i].productCount += this.list[i].stockLogList[m].productCount
} }
} this.list[i].stockLogList[m].productCount = this.list[i].stockLogList[m].returnCount
} if(this.list[i].stockLogList.length >0){
this.list[i].stockLogList1 = this.list[i].stockLogList if (m == 0) {
if(this.list[i].stockLogList1.length <= 0){ this.list[i].productCount = this.list[i].stockLogList[m].productCount
this.list[i].productCount = 0 } else {
this.list[i].productCount += this.list[i].stockLogList[m].productCount
}
}
}
this.list[i].stockLogList1 = this.list[i].stockLogList
if(this.list[i].stockLogList1.length <= 0){
this.list[i].productCount = 0
}
}else{
} }
} }
for (var i = 0; i < this.list.length; i++) { for (var i = 0; i < this.list.length; i++) {
@ -896,11 +897,9 @@
}, },
// 取消订单 // 取消订单
cancelOrder(type) { cancelOrder(type) {
this.tui.modal("提示", "您确定要取消该订单吗?", true, (res) => { this.tui.modal("提示", "您确定要取消吗?", true, (res) => {
if (res) { if (res) {
var data={},url var data={},url
if (type == 'qxdd') { if (type == 'qxdd') {
data = { data = {
status: 2, status: 2,

23
pages/inventory/addGoods.vue

@ -51,12 +51,13 @@
trim="all" /> trim="all" />
</uni-forms-item> </uni-forms-item>
</uni-forms> </uni-forms>
<view> <view v-if="type == 'edit'" style="display: flex;">
<u-button type="primary" @tap.stop="delGoods()">删除商品</u-button> <button @tap.stop="delGoods()" style="width: 49%;">删除商品</button>
<u-button type="primary" @tap.stop="submit()">保存</u-button> <button @tap.stop="submit()" style="width: 49%;">保存</button>
</view>
<view v-else>
<button @tap.stop="submit()">保存</button>
</view> </view>
</view> </view>
<!-- <u-modal v-model="show" :content="content"></u-modal> --> <!-- <u-modal v-model="show" :content="content"></u-modal> -->
</view> </view>
@ -85,7 +86,8 @@
typeItem:{}, typeItem:{},
arrtChange: [], arrtChange: [],
categoryId:'', categoryId:'',
dataList:[], dataList:[],
type:'add',
rules: { rules: {
categoryId: { categoryId: {
rules: [{ rules: [{
@ -141,6 +143,7 @@
}, },
onLoad(option) { onLoad(option) {
if(option.dataList){ if(option.dataList){
this.type = 'edit'
this.dataList = JSON.parse(option.dataList) this.dataList = JSON.parse(option.dataList)
this.formData.productName = this.dataList.productName this.formData.productName = this.dataList.productName
this.formData.barcode = this.dataList.barcode this.formData.barcode = this.dataList.barcode
@ -371,5 +374,13 @@
.content-list { .content-list {
height: 70rpx; height: 70rpx;
border: 1px solid #eee; border: 1px solid #eee;
}
button{
height: 90rpx;
line-height: 90rpx;
font-size: 36rpx;
color: #fff;
background: #5fd9ee;
border-radius: 10px;
} }
</style> </style>
Loading…
Cancel
Save