|
|
|
@ -1,96 +1,100 @@ |
|
|
|
<template> |
|
|
|
<view> |
|
|
|
<view class="head" v-if="$isRight(order)"> |
|
|
|
<view class="lf-row-between lf-color-gray list"> |
|
|
|
<view>采购单 {{ order.p_sn }}</view> |
|
|
|
</view> |
|
|
|
<view class="lf-row-between list"> |
|
|
|
<image :src="order.supplier.logo" class="image"></image> |
|
|
|
<view class="info"> |
|
|
|
<view class="lf-font-32 lf-color-black lf-font-bold">{{ order.supplier.supplier_name }}</view> |
|
|
|
<view class="lf-font-24 lf-color-555">{{ order.supplier.address }}</view> |
|
|
|
<block v-if="$isRight(order)"> |
|
|
|
<view class="head"> |
|
|
|
<view class="lf-row-between lf-color-gray list"> |
|
|
|
<view>采购单 {{ order.p_sn }}</view> |
|
|
|
</view> |
|
|
|
<view class="lf-row-between list"> |
|
|
|
<image :src="order.supplier.logo" class="image"></image> |
|
|
|
<view class="info"> |
|
|
|
<view class="lf-font-32 lf-color-black lf-font-bold">{{ order.supplier.supplier_name }}</view> |
|
|
|
<view class="lf-font-24 lf-color-555">{{ order.supplier.address }}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<self-line></self-line> |
|
|
|
<view class="lf-p-l-32 lf-p-r-32 lf-border-box lf-bg-white"> |
|
|
|
<!-- <lf-ysteps :stepList="stepList" color="#11D189"></lf-ysteps> --> |
|
|
|
<lf-stepbar :list="order.state_log" v-if="order.state_log"></lf-stepbar> |
|
|
|
</view> |
|
|
|
<self-line></self-line> |
|
|
|
<view class="head"> |
|
|
|
<view class="lf-row-between list"> |
|
|
|
<view>车辆</view> |
|
|
|
<view class="lf-font-bold">{{order.car_license}}</view> |
|
|
|
</view> |
|
|
|
<view class="lf-row-between list"> |
|
|
|
<view>司机</view> |
|
|
|
<view class="lf-font-bold">{{order.deliver_man}}</view> |
|
|
|
</view> |
|
|
|
<view class="lf-row-between list"> |
|
|
|
<view>联系电话</view> |
|
|
|
<view class="lf-font-bold">{{order.deliver_phone}}</view> |
|
|
|
<self-line></self-line> |
|
|
|
<view class="lf-p-l-32 lf-p-r-32 lf-border-box lf-bg-white"> |
|
|
|
<lf-stepbar :list="order.state_log" v-if="order.state_log"></lf-stepbar> |
|
|
|
</view> |
|
|
|
<view class="list"> |
|
|
|
<view>证明材料-供应端</view> |
|
|
|
<view class="lf-flex-wrap lf-m-t-10"> |
|
|
|
<image :src="item.voucher_pic" @click="lookImage(index)" class="ms-img" v-for="(item, index) in order.voucher" :key="item.id"></image> |
|
|
|
<self-line></self-line> |
|
|
|
<view class="head"> |
|
|
|
<view class="lf-row-between list"> |
|
|
|
<view>车辆</view> |
|
|
|
<view class="lf-font-bold">{{order.car_license || '-'}}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="list" v-if="voucher_list.length"> |
|
|
|
<view>证明材料-食堂端</view> |
|
|
|
<view class="lf-flex-wrap lf-m-t-10"> |
|
|
|
<image :src="item" @click="lookPopupImage(index)" class="ms-img" v-for="(item, index) in voucher_list" :key="index"></image> |
|
|
|
<view class="lf-row-between list"> |
|
|
|
<view>司机</view> |
|
|
|
<view class="lf-font-bold">{{order.deliver_man || '-'}}</view> |
|
|
|
</view> |
|
|
|
<view class="lf-row-between list"> |
|
|
|
<view>联系电话</view> |
|
|
|
<view class="lf-font-bold">{{order.deliver_phone || '-'}}</view> |
|
|
|
</view> |
|
|
|
<view class="list" v-if="order.voucher.length"> |
|
|
|
<view>证明材料-供应端</view> |
|
|
|
<view class="lf-flex-wrap lf-m-t-10"> |
|
|
|
<image :src="item.voucher_pic" @click="lookImage(index)" class="ms-img" v-for="(item, index) in order.voucher" :key="item.id"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="list" v-if="voucher_list.length"> |
|
|
|
<view>证明材料-食堂端</view> |
|
|
|
<view class="lf-flex-wrap lf-m-t-10"> |
|
|
|
<image :src="item" @click="lookPopupImage(index)" class="ms-img" v-for="(item, index) in voucher_list" :key="index"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<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 :first-line-fixed="true" contentBgColor="#ecfaf5" :headers="headers" :contents="contents" width="max-content" height="350rpx"></wyb-table> |
|
|
|
</view> |
|
|
|
<view style="height: 100rpx;"></view> |
|
|
|
<!-- 操作按钮 --> |
|
|
|
<view class="fixed-bottom" v-if="type != '备货中'"> |
|
|
|
<view v-if="type == '待发单'" class="lf-row-flex-end"> |
|
|
|
<button class="btn btn1" @click="$url('/pages/purchase/launch?p_sn='+ order.p_sn+'&enter_type=1')">编辑</button> |
|
|
|
<button class="btn btn2">立即发单</button> |
|
|
|
</view> |
|
|
|
<view v-else-if="type == '待接单'" class="lf-row-flex-end"> |
|
|
|
<button class="btn btn2" style="background-color: #FF0000;" @click="orderStateChange('已撤销')">撤销订单</button> |
|
|
|
</view> |
|
|
|
<view v-else-if="type == '已发货'" class="lf-row-flex-end"> |
|
|
|
<button class="btn btn1">退单</button> |
|
|
|
<button class="btn btn1 lf-m-l-20" @click="is_show_voucher = true">上传凭证</button> |
|
|
|
<button class="btn btn2" @click="$url('/pages/purchase/receipt?p_sn='+ order.p_sn)">确认收货</button> |
|
|
|
<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 :first-line-fixed="true" contentBgColor="#ecfaf5" :headers="headers" :contents="contents" width="max-content" height="80vh"></wyb-table> |
|
|
|
</view> |
|
|
|
<view v-else-if="type == '已收货' || type == '已入库'" class="lf-row-between"> |
|
|
|
<button class="btn btn1" @click="$url('/pages/purchase/launch?p_sn='+ order.p_sn+'&enter_type=2')">复用采购单</button> |
|
|
|
<view class="lf-font-32" style="color: #11D189;">已完成</view> |
|
|
|
<view style="height: 140rpx;"></view> |
|
|
|
<!-- 操作按钮 --> |
|
|
|
<view class="fixed-bottom" v-if="type && type != '备货中'"> |
|
|
|
<view v-if="type == '待发单'" class="lf-row-flex-end"> |
|
|
|
<button class="btn btn1" @click="$url('/pages/purchase/launch?p_sn='+ order.p_sn+'&enter_type=1')">编辑</button> |
|
|
|
<button class="btn btn2" @click="orderStateChange('待接单')">立即发单</button> |
|
|
|
</view> |
|
|
|
<view v-else-if="type == '待接单'" class="lf-row-flex-end"> |
|
|
|
<button class="btn btn2" style="background-color: #FF0000;" @click="orderStateChange('已撤销')">撤销订单</button> |
|
|
|
</view> |
|
|
|
<view v-else-if="type == '已发货'" class="lf-row-flex-end"> |
|
|
|
<button class="btn btn1" @click="orderStateChange('已退单')">退单</button> |
|
|
|
<button class="btn btn1 lf-m-l-20" @click="is_show_voucher = true">上传凭证</button> |
|
|
|
<button class="btn btn2" @click="$url('/pages/purchase/receipt?p_sn='+ order.p_sn)">确认收货</button> |
|
|
|
</view> |
|
|
|
<view v-else-if="type == '已收货' || type == '已入库'" class="lf-row-between"> |
|
|
|
<button class="btn btn1" @click="$url('/pages/purchase/launch?p_sn='+ order.p_sn+'&enter_type=2')">复用采购单</button> |
|
|
|
<view class="lf-font-32" style="color: #11D189;">已完成</view> |
|
|
|
</view> |
|
|
|
<view v-else class="lf-row-flex-end"> |
|
|
|
<view class="lf-font-32">{{ type }}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- 弹出层-上传凭证 --> |
|
|
|
<u-popup v-model="is_show_voucher" mode="center" border-radius="20"> |
|
|
|
<view class="popup-box"> |
|
|
|
<view class="content"> |
|
|
|
<view class="popup-title">上传凭证信息</view> |
|
|
|
<view class="popup-desc">请在此处上传检验检疫凭证、售卖资质等证书</view> |
|
|
|
<view class="popup-images"> |
|
|
|
<view class="popup-image-item" v-for="(item, index) in voucher_list" :key="index" @click="lookPopupImage(index)"> |
|
|
|
<image :src="item" mode="aspectFill"></image> |
|
|
|
<view class="remove-image" @click.stop="removeInage(index)"> |
|
|
|
<u-icon name="close-circle"></u-icon> |
|
|
|
<!-- 弹出层-上传凭证 --> |
|
|
|
<u-popup v-model="is_show_voucher" mode="center" border-radius="20"> |
|
|
|
<view class="popup-box"> |
|
|
|
<view class="content"> |
|
|
|
<view class="popup-title">上传凭证信息</view> |
|
|
|
<view class="popup-desc">请在此处上传检验检疫凭证、售卖资质等证书</view> |
|
|
|
<view class="popup-images"> |
|
|
|
<view class="popup-image-item" v-for="(item, index) in voucher_list" :key="index" @click="lookPopupImage(index)"> |
|
|
|
<image :src="item" mode="aspectFill"></image> |
|
|
|
<view class="remove-image" @click.stop="removeInage(index)"> |
|
|
|
<u-icon name="close-circle"></u-icon> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="popup-image-item popup-image-item-after" @click="uploadImage" v-if="voucher_list.length < 6"></view> |
|
|
|
</view> |
|
|
|
<view class="popup-image-item popup-image-item-after" @click="uploadImage" v-if="voucher_list.length < 6"></view> |
|
|
|
</view> |
|
|
|
<view class="foot-btn"> |
|
|
|
<u-button class="popup-btn" @click="is_show_voucher = false">取消</u-button> |
|
|
|
<u-button class="popup-btn" @click="submitImage">确定</u-button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="foot-btn"> |
|
|
|
<u-button class="popup-btn" @click="is_show_voucher = false">取消</u-button> |
|
|
|
<u-button class="popup-btn" @click="submitImage">确定</u-button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</u-popup> |
|
|
|
</u-popup> |
|
|
|
</block> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
@ -136,20 +140,23 @@ |
|
|
|
contents: [], |
|
|
|
order: {}, |
|
|
|
p_sn: '', |
|
|
|
type: 4, |
|
|
|
type: '', |
|
|
|
is_show_voucher: false, |
|
|
|
voucher_list: [], |
|
|
|
voucher_count: 6 |
|
|
|
voucher_count: 6, |
|
|
|
show_count: 0 |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(options){ |
|
|
|
// TODO 1、凭证上传流程变动:当采购单状态为已发货状态时,食堂可以上传凭证图片; |
|
|
|
// TODO 2、食堂收货时,实到数、实收数默认填充采购数量; |
|
|
|
// todo 上传凭证参考页面:/uniapp-supplychain/supplier/pages/gonghuo/detail |
|
|
|
this.p_sn = options.p_sn || ''; |
|
|
|
// TODO 显示车辆等信息,显示table信息 |
|
|
|
this.getData(); |
|
|
|
}, |
|
|
|
onShow(){ |
|
|
|
this.show_count++; |
|
|
|
if(this.show_count > 1){ |
|
|
|
this.getData(); |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 预览图片 |
|
|
|
lookPopupImage(current){ |
|
|
|
@ -201,10 +208,7 @@ |
|
|
|
}) |
|
|
|
|
|
|
|
Promise.all(http_list).then(res => { |
|
|
|
console.log("上传完毕", res); |
|
|
|
let images = res.map(item => item.path); |
|
|
|
console.log(images) |
|
|
|
// todo 图片上传url给后端 |
|
|
|
that.$http(that.API.API_SUPPLIER_PURCHASEUPLOADVOUCHER, { |
|
|
|
p_sn: that.p_sn, |
|
|
|
images: images, |
|
|
|
@ -228,9 +232,7 @@ |
|
|
|
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; |
|
|
|
let list = res.data.order.items || []; |
|
|
|
let contents = list.map(item => { |
|
|
|
@ -248,9 +250,8 @@ |
|
|
|
} |
|
|
|
}) |
|
|
|
this.contents = contents; |
|
|
|
console.log(this.contents) |
|
|
|
this.type = res.data.order.state |
|
|
|
}) |
|
|
|
}).catch(err => this.$toBack()); |
|
|
|
}, |
|
|
|
// 预览图片 |
|
|
|
lookImage(index){ |
|
|
|
@ -262,14 +263,14 @@ |
|
|
|
}) |
|
|
|
}, 200); |
|
|
|
}, |
|
|
|
// 改变订单状态 TODO |
|
|
|
// 改变订单状态 |
|
|
|
orderStateChange(state){ |
|
|
|
this.$http(this.API.API_CANTEEN_PURCHASEUPDATE, { |
|
|
|
p_sn: this.p_sn, |
|
|
|
state: state |
|
|
|
}).then(res => { |
|
|
|
console.log("orderStateChange", res); |
|
|
|
this.$msg('操作成功').then(()=>{this.$toBack()}); |
|
|
|
this.$msg('操作成功').then(()=> this.getData()); |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|