Browse Source

对接供应商供货相关接口

master
邓平艺 5 years ago
parent
commit
41e1d9c369
  1. 21
      canteen/pages/purchase/launch.vue
  2. 95
      supplier/pages/gonghuo/detail.vue
  3. 16
      supplier/pages/gonghuo/order.vue
  4. 2
      supplier/pages/index/index.vue

21
canteen/pages/purchase/launch.vue

@ -32,7 +32,7 @@
<!-- 物料table -->
<view class="lf-p-32 lf-p-t-30 lf-p-b-30 lf-w-100 lf-h-maxcontent lf-border-box">
<view class="lf-font-32 lf-font-bold">物资明细</view>
<view v-for="(value, key) in render_material_list" :key="key" class="lf-m-t-20">
<view v-for="(value, key) in render_material_list" :key="key" class="lf-m-t-20" v-if="value.material_list.length">
<view class="lf-m-b-10 lf-row-between">
<text>{{ value.supplier_name }}</text>
<text @click="removeSupplier(key)" class="lf-color-price">删除</text>
@ -146,14 +146,17 @@
if(material_item.purchase_limit <= detailValue){
material_item.purchase_number.value = detailValue; //
}else{
uni.showModal({
title: '温馨提示',
content: '采购数量必须大于起购数量',
showCancel: false,
success: result => {
material_item.purchase_number.value = material_item.purchase_limit;
}
})
this.$msg('采购数量须大于起购数量');
material_item.purchase_number.value = material_item.purchase_limit;
// uni.showModal({
// title: '',
// content: '',
// showCancel: false,
// success: result => {
// material_item.purchase_number.value = material_item.purchase_limit;
// }
// })
}
console.log("render_material_list_change", this.render_material_list);
},

95
supplier/pages/gonghuo/detail.vue

@ -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();
});
}
}

16
supplier/pages/gonghuo/order.vue

@ -15,19 +15,19 @@
<view class="card" v-for="(item, index) in tabItem.list" :key="item.id" @click="$url('/pages/gonghuo/detail?p_sn='+ item.p_sn)">
<view class="lf-row-between item">
<view class="lf-color-gray">采购方</view>
<view class="lf-color-black">{{ item.contact_name }}</view>
<view class="lf-color-black">{{ item.p_name }}</view>
</view>
<view class="lf-row-between item">
<view class="lf-color-gray">发单时间</view>
<view class="lf-color-black">{{ item.receiving_start }}</view>
<view class="lf-color-black">{{ item.deadline_text }}</view>
</view>
<view class="lf-row-between item">
<view class="lf-color-gray">送达时间</view>
<view class="lf-color-black">{{ item.receiving_end }}</view>
<view class="lf-color-black">{{ item.receive_time }}</view>
</view>
<view class="lf-row-between item">
<view class="lf-color-gray">商品种类</view>
<view class="lf-color-black">8</view>
<view class="lf-color-black">{{ item.cate_number }}</view>
</view>
<view class="lf-row-between item">
<view class="lf-color-gray">订单状态</view>
@ -58,27 +58,22 @@
current: 0,
tab_list: [{
name: '全部',
state_name: '',
list: [],
..._public
},{
name: '待接单',
state_name: '待接单',
list: [],
..._public
},{
name: '待发货',
state_name: '待发货',
list: [],
..._public
},{
name: '已完成',
state_name: '已完成',
list: [],
..._public
},{
name: '已退单',
state_name: '已退单',
list: [],
..._public
}],
@ -93,8 +88,9 @@
methods: {
getData(options){
let item = this.tab_list[this.current];
let state = item.name == '全部' ? '' : item.name;
this.$http(this.API.API_SUPPLIER_PURCHASEORDERLIST, {
state: item.state_name,
state: state,
page: item.page,
page_size: this.page_size
}).then(res => {

2
supplier/pages/index/index.vue

@ -18,7 +18,7 @@
</view>
</view>
<view style="height: 170rpx;"></view>
<view class="btn-bottom exit">
<view class="btn-bottom exit" v-if="$isRight(supplier)">
<button class="lf-w-100" @click="loginOut">退出登录</button>
</view>
</view>

Loading…
Cancel
Save