|
|
|
@ -2,25 +2,25 @@ |
|
|
|
<view class="content"> |
|
|
|
<view class="card" v-for="(item, index) in list" :key="index"> |
|
|
|
<view class="lf-row-between"> |
|
|
|
<view class="lf-color-black lf-font-bold">{{ item.title }}</view> |
|
|
|
<view class="lf-color-black lf-font-bold" v-if="item.material.m_name">{{ item.material.m_name }}</view> |
|
|
|
<!-- 修改功能先隐藏 --> |
|
|
|
<!-- <view style="color: #11D189;" @click="showEdit">修改</view> --> |
|
|
|
</view> |
|
|
|
<view class="lf-row-between lf-m-t-30"> |
|
|
|
<view>订购数</view> |
|
|
|
<view class="lf-color-black">{{ item.orderNum }}</view> |
|
|
|
<view class="lf-color-black">{{ item.purchase_number }}</view> |
|
|
|
</view> |
|
|
|
<view class="lf-row-between lf-m-t-30"> |
|
|
|
<view>实到数</view> |
|
|
|
<view class="lf-flex"> |
|
|
|
<input class="input" placeholder="0" type="number" :value="item.realNum" @blur="inputBlur(index, 'realNum', $event)" /> |
|
|
|
<input class="input" placeholder="0" type="number" v-model="item.reachNum" @blur="inputBlur(index, 'real_reach_number', $event)" /> |
|
|
|
<text class="lf-color-black">斤</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="lf-row-between lf-m-t-30"> |
|
|
|
<view>实收数</view> |
|
|
|
<view class="lf-flex"> |
|
|
|
<input class="input" placeholder="0" type="number" :value="item.receiptsNum" @blur="inputBlur(index, 'receiptsNum', $event)" /> |
|
|
|
<input class="input" placeholder="0" type="number" v-model="item.receiveNum" @blur="inputBlur(index, 'real_receive_number', $event)" /> |
|
|
|
<text class="lf-color-black">斤</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -105,7 +105,13 @@ |
|
|
|
},{ |
|
|
|
name: '嘿嘿嘿', |
|
|
|
checked: false |
|
|
|
}] |
|
|
|
}], |
|
|
|
p_sn: '', |
|
|
|
contents: [], |
|
|
|
order: {}, |
|
|
|
type: 4, |
|
|
|
reachNum: 0, |
|
|
|
receiveNum: 0 |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
@ -116,20 +122,48 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(){ |
|
|
|
|
|
|
|
onLoad(options){ |
|
|
|
this.p_sn = options.p_sn || ''; |
|
|
|
this.getData(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
getData(){ |
|
|
|
this.$http(this.API.API_CANTEEN_PURCHASEDETAIL, { |
|
|
|
p_sn: this.p_sn |
|
|
|
// p_sn: '802316269455228606' |
|
|
|
}).then(res => { |
|
|
|
console.log("xxx",res) |
|
|
|
this.order = res.data.order; |
|
|
|
this.list = res.data.order.items || []; |
|
|
|
this.list.forEach(item => { |
|
|
|
item.reachNum = item.purchase_number |
|
|
|
item.receiveNum = item.purchase_number |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
inputBlur(current, key, event){ |
|
|
|
console.log("inputBlur", current, key, event); |
|
|
|
this.list[current][key] = event.detail.value; |
|
|
|
}, |
|
|
|
comfirm(){ |
|
|
|
// 使用延迟器,以防input还没有赋值成功 |
|
|
|
setTimeout(() => { |
|
|
|
console.log("comfirm", this.list); |
|
|
|
this.$msg('确认收货成功!'); |
|
|
|
}, 100); |
|
|
|
|
|
|
|
let real_count_item = [] |
|
|
|
this.list.forEach(item => { |
|
|
|
real_count_item.push({ |
|
|
|
id:item.id, |
|
|
|
real_receive_number: item.receiveNum, |
|
|
|
real_reach_number: item.reachNum |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
this.$http(this.API.API_CONFIRM, { |
|
|
|
p_sn: this.p_sn, |
|
|
|
state: '已入库', |
|
|
|
real_count_item |
|
|
|
}).then(res => { |
|
|
|
this.$msg('确认收货成功').then(()=>{this.$toBack()}); |
|
|
|
}) |
|
|
|
}, |
|
|
|
switchItem(current){ |
|
|
|
let current_show = this.current_show; |
|
|
|
|