|
|
|
@ -21,23 +21,24 @@ |
|
|
|
<self-line></self-line> |
|
|
|
<view class="lf-m-t-30 lf-m-l-32"> |
|
|
|
<view class="lf-font-32 lf-color-black lf-font-bold lf-m-b-20">物资明细</view> |
|
|
|
<wyb-table v-if="contents.length" :first-line-fixed="true" contentBgColor="#eef6fe" :headers="headers" :contents="contents" @onButtonClick="onButtonClick" width="max-content" height="350rpx"></wyb-table> |
|
|
|
<wyb-table v-if="contents.length" :first-line-fixed="true" contentBgColor="#eef6fe" :headers="headers" :contents="contents" width="max-content" height="350rpx"></wyb-table> |
|
|
|
</view> |
|
|
|
<view style="height: 100rpx;"></view> |
|
|
|
<!-- 操作按钮 --> |
|
|
|
<view class="fixed-bottom"> |
|
|
|
<view v-if="type == 1" class="lf-row-flex-end"> |
|
|
|
<view v-if="type == '待接单'" class="lf-row-flex-end"> |
|
|
|
<button class="btn btn2" style="background-color: #1833F2;" @click="orderTaking">立即接单</button> |
|
|
|
</view> |
|
|
|
<view v-if="type == 2" class="lf-row-flex-end"> |
|
|
|
<view v-else-if="type == '备货中'" class="lf-row-flex-end"> |
|
|
|
<button class="btn btn1" @click="is_show_voucher = true">上传凭证</button> |
|
|
|
<button class="btn btn2" @click="is_show_receiving = true">确认发货</button> |
|
|
|
</view> |
|
|
|
<view v-if="type == 3" class="lf-row-flex-end"> |
|
|
|
<view class="lf-font-32" style="color: #11D189;">已完成</view> |
|
|
|
<view v-else-if="type == '已发货'" class="lf-row-between"> |
|
|
|
<button class="btn btn1" @click="is_show_voucher = true">上传凭证</button> |
|
|
|
<view class="lf-font-32" style="color: #11D189;">{{ type }}</view> |
|
|
|
</view> |
|
|
|
<view v-if="type == 4" class="lf-row-flex-end"> |
|
|
|
<view class="lf-font-32" style="color: #222222;">已退单</view> |
|
|
|
<view v-else class="lf-row-flex-end"> |
|
|
|
<view class="lf-font-32">{{ type }}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- 弹出层-上传凭证 --> |
|
|
|
@ -101,24 +102,39 @@ |
|
|
|
return { |
|
|
|
stepList: [], |
|
|
|
headers: [{ |
|
|
|
label: '菜品名称', |
|
|
|
key: 'name' |
|
|
|
key: 'm_name', |
|
|
|
label: '物资名称' |
|
|
|
},{ |
|
|
|
key: 'spec', |
|
|
|
label: '规格' |
|
|
|
},{ |
|
|
|
key: 'brand', |
|
|
|
label: '品牌' |
|
|
|
},{ |
|
|
|
key: 'quality_level', |
|
|
|
label: '品级' |
|
|
|
},{ |
|
|
|
label: '编号', |
|
|
|
key: 'm_sn' |
|
|
|
},{ |
|
|
|
key: 'tax_price', |
|
|
|
label: '含税价' |
|
|
|
},{ |
|
|
|
label: '规格', |
|
|
|
key: 'spec' |
|
|
|
key: 'non_tax_price', |
|
|
|
label: '不含税价' |
|
|
|
},{ |
|
|
|
label: '税前价', |
|
|
|
key: 'pre_tax_price' |
|
|
|
key: 'purchase_limit', |
|
|
|
label: '起购数' |
|
|
|
},{ |
|
|
|
label: '税后价', |
|
|
|
key: 'after_tax_price' |
|
|
|
key: 'purchase_number', |
|
|
|
label: '采购数量' |
|
|
|
}], |
|
|
|
contents: [], |
|
|
|
is_show_voucher: false, // 是否显示凭证上传弹出层 |
|
|
|
is_show_receiving: false, |
|
|
|
voucher_list: [], // 已上传的凭证列表 |
|
|
|
voucher_count: 6, // 最多可以上传多少张凭证 |
|
|
|
type: 2, // 订单状态 |
|
|
|
type: '', // 订单状态 |
|
|
|
p_sn: '', |
|
|
|
order: {}, |
|
|
|
l_p_num: '', |
|
|
|
@ -127,8 +143,6 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(options){ |
|
|
|
// todo 缺少待收货状态 |
|
|
|
// todo 供货确认发货后,待收货状态加一个按钮,上传凭证(如果他前面还没有上传) |
|
|
|
this.p_sn = options.p_sn; |
|
|
|
this.getData(); |
|
|
|
}, |
|
|
|
@ -139,6 +153,7 @@ |
|
|
|
}).then(res => { |
|
|
|
console.log("getData", res); |
|
|
|
let order = res.data.order || {}; |
|
|
|
this.type = order.state; |
|
|
|
this.order = order; |
|
|
|
this.stepList = order.state_log.map((item, index) => { |
|
|
|
item.isFinished = false; |
|
|
|
@ -150,23 +165,25 @@ |
|
|
|
return item; |
|
|
|
}) |
|
|
|
|
|
|
|
// todo contents换成接口返回的值 |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
// 监听table删除操作 |
|
|
|
onButtonClick(event){ |
|
|
|
uni.showModal({ |
|
|
|
title: '温馨提示', |
|
|
|
content: '您确定移除该项吗?', |
|
|
|
success: result => { |
|
|
|
if(result.confirm){ |
|
|
|
console.log("移除某一项", event); |
|
|
|
let { contentIndex } = event; |
|
|
|
this.contents.splice(contentIndex, 1); |
|
|
|
let list = order.items || []; |
|
|
|
let contents = list.map(item => { |
|
|
|
let obj = { |
|
|
|
m_name: item.material?.m_name || '', |
|
|
|
material_id: item.material?.id, |
|
|
|
spec: item.spec?.name || '', |
|
|
|
spec_id: item.spec?.id, |
|
|
|
brand: item?.material?.brand || '', |
|
|
|
quality_level: item?.material?.quality_level || '', |
|
|
|
m_sn: item?.material?.m_sn || '', |
|
|
|
tax_price: item.tax_price, |
|
|
|
non_tax_price: item.non_tax_price, |
|
|
|
purchase_limit: item?.p_order_item?.purchase_limit || '', |
|
|
|
purchase_number: item.purchase_number |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
return obj; |
|
|
|
}); |
|
|
|
this.contents = contents; |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 上传凭证图片 |
|
|
|
uploadImage(){ |
|
|
|
@ -218,7 +235,7 @@ |
|
|
|
|
|
|
|
Promise.all(http_list).then(res => { |
|
|
|
console.log("上传完毕", res); |
|
|
|
let images = res.map(item => item.url); |
|
|
|
let images = res.map(item => item.path); |
|
|
|
that.$http(that.API.API_SUPPLIER_PURCHASESAVEVOUCHER, { |
|
|
|
p_sn: that.p_sn, |
|
|
|
images: images, |
|
|
|
@ -243,8 +260,8 @@ |
|
|
|
this.$http(this.API.API_SUPPLIER_PURCHASEORDERACCEPT, { |
|
|
|
p_sn: this.p_sn |
|
|
|
}).then(res => { |
|
|
|
console.log("orderTaking", res); |
|
|
|
this.$msg('接单成功') |
|
|
|
this.$msg('接单成功'); |
|
|
|
this.getData(); |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 确认发货 |
|
|
|
@ -266,8 +283,8 @@ |
|
|
|
deliver_man: driver_name, |
|
|
|
car_license: l_p_num |
|
|
|
}).then(res => { |
|
|
|
console.log("confirmDeliver", res); |
|
|
|
this.$msg('确认收货成功') |
|
|
|
this.$msg('确认收货成功'); |
|
|
|
this.getData(); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|