Browse Source

供应商发起报价接口对接

master
邓平艺 5 years ago
parent
commit
0966e6eedb
  1. 3
      common/api.js
  2. 2
      common/mixin.js
  3. 3
      pages.json
  4. 7
      pages/supply/gonghuo/detail.vue
  5. 144
      pages/supply/offer/index.vue
  6. 7
      pages/supply/order/detail.vue

3
common/api.js

@ -14,13 +14,14 @@ export const API_SUPPLIER_QUOTATIONAPPLY = '/api/supplier/quotationApply'; //
export const API_SUPPLIER_QUOTATIONORDERLIST = '/api/supplier/quotationOrderList'; // 申请报价-订单列表
export const API_SUPPLIER_PURCHASEORDERLIST = '/api/supplier/purchaseOrderList'; // 供货订单列表
export const API_SUPPLIER_QUOTATIONDETAIL = '/api/supplier/quotationDetail'; // 报价订单详情
export const API_SUPPLIER_TEMPORARYQUOTATION = '/api/supplier/temporaryQuotation'; // 报价订单 临时保存
export const API_SUPPLIER_QUOTATIONUPDATE = '/api/supplier/quotationUpdate'; // 改变报价订单状态
export const API_SUPPLIER_PURCHASEORDERACCEPT = '/api/supplier/purchaseOrderAccept'; // 供应商接单
export const API_SUPPLIER_PURCHASEDETAIL = '/api/supplier/purchaseDetail'; // 供货订单详情
export const API_SUPPLIER_PURCHASEORDERSENDOUT = '/api/supplier/purchaseOrderSendout'; // 供应商确认发货
export const API_SUPPLIER_PURCHASEUPLOADVOUCHER = '/api/supplier/purchaseUploadVoucher'; // 上传凭证
export const API_SUPPLIER_PURCHASESAVEVOUCHER = '/api/supplier/purchaseSaveVoucher'; // 保存凭证
export const API_SUPPLIER_QUOTATIONREUSEBYORDER = '/api/supplier/quotationReuseByOrder'; // 报价订单复用 根据【订单号】
export const API_SUPPLIER_QUOTATIONREUSEBYBATCH = '/api/supplier/quotationReuseByBatch'; // 报价订单复用 根据【批次号】
/* 食堂相关接口 */
export const API_CANTEEN_LOGIN = '/api/canteen/login'; // 登录

2
common/mixin.js

@ -126,7 +126,7 @@ export default{
'pages/empty/index',
'/preview-image'
];
if(intercept_route.includes(this.$getPageType())){
if(intercept_route.includes(this.currentPage)){
return; // 忽略提示跳转的路由
}
let path_url = '/pages/'+ this.$getPageType() +'/login/index';

3
pages.json

@ -22,8 +22,7 @@
{
"path": "pages/supply/offer/index",
"style": {
"navigationBarTitleText": "发起报价",
"disableScroll": true
"navigationBarTitleText": "发起报价"
}
},
{

7
pages/supply/gonghuo/detail.vue

@ -128,7 +128,7 @@
},
onLoad(options){
this.p_sn = options.p_sn;
// this.getData();
this.getData();
},
methods: {
getData(){
@ -259,7 +259,10 @@
}
this.is_show_receiving = false;
this.$http(this.API.API_SUPPLIER_PURCHASEORDERSENDOUT, {
p_sn: this.p_sn
p_sn: this.p_sn,
deliver_phone: driver_phone,
deliver_man: driver_name,
car_license: l_p_num
}).then(res => {
console.log("confirmDeliver", res);
this.$msg('确认收货成功')

144
pages/supply/offer/index.vue

@ -27,7 +27,12 @@
<self-line></self-line>
<!-- 物料table -->
<view class="box">
<wyb-table :first-line-fixed="true" contentBgColor="#eef6fe" :headers="headers" :contents="contents" @onInputChange="onInputChange" width="max-content" height="800rpx"></wyb-table>
<wyb-table :first-line-fixed="true"
contentBgColor="#eef6fe"
:headers="headers"
:contents="contents"
@onInputChange="onInputChange"
width="100%" height="800rpx"></wyb-table>
</view>
<!-- 操作按钮 -->
<view class="fixed-bottom">
@ -54,17 +59,24 @@
label: '规格',
key: 'spec'
},{
label: '税前价',
key: 'pre_tax_price'
label: '单位',
key: 'unit'
},{
label: '税后价',
key: 'after_tax_price'
label: '品牌',
key: 'brand'
},{
label: '品质',
key: 'quality_level'
},{
label: '报价',
key: 'offer'
}],
contents: [],
is_show: false,
relation_list: [],
relation_list: [], //
node_top: 0,
q_sn: '' //
code: '', //
type: 0
}
},
computed: {
@ -83,10 +95,21 @@
}
},
onLoad(options){
this.q_sn = options.q_sn || '';
// todo
this.code = options.code || '';
this.type = options.type || 0;
if(options.type == 1){
//
this.editMaterialList();
}else if(options.type == 2){
//
this.materialListByOrder();
}else if(options.type == 3){
//
this.materialListByBatch();
}else{
//
this.getMaterialList();
// this.getCanteenList();
}
},
onReady(){
let that = this;
@ -101,45 +124,80 @@
methods: {
//
getMaterialList(){
this.$http(this.API.API_SUPPLIER_TEMPORARYQUOTATION, {
supplier_id: getApp().globalData.supplier_id,
// q_sn: this.q_sn //
this.$http(this.API.API_SUPPLIER_MATERIALLIST).then(res => {
let list = res.data.spec || [];
let contents = list.map(item => {
return {
name: item?.material?.m_name || '',
material_id: item?.material?.id || 0,
spec: item.name,
spec_id: item.id,
unit: item?.material?.unit?.unit_name || '',
brand: item?.material?.brand || '',
quality_level: item?.material?.quality_level || '',
offer: {edit: true, value: ''}
}
})
this.contents = contents;
this.getCanteenList();
})
},
//
editMaterialList(){
// this.$http(this.API.).then(res => {
// console.log("editMaterialList", res);
// })
},
//
materialListByOrder(){
this.$http(this.API.API_SUPPLIER_QUOTATIONREUSEBYORDER, {
q_sn: this.code
}).then(res => {
console.log("materialListByOrder", res);
let list = res.data.order || [];
let canteen = res.data.canteen || [];
let contents = list.map(item => {
let obj = {
name: item.material?.m_name,
material_id: item.material?.id,
return {
name: item?.material?.m_name || '',
material_id: item?.material?.id || 0,
spec: item.name,
spec_id: item.id,
pre_tax_price: {edit: true, value: ''},
after_tax_price: {edit: true, value: ''}
unit: item?.material?.unit?.unit_name || '',
brand: item?.material?.brand || '',
quality_level: item?.material?.quality_level || '',
offer: {edit: true, value: ''}
}
if(item.quotation && Object.keys(item.quotation).length){
obj.pre_tax_price.value = item.quotation.tax_price;
obj.after_tax_price.value = item.quotation.non_tax_price;
})
this.contents = contents;
this.getCanteenList(canteen);
})
},
//
materialListByBatch(){
this.$http(this.API.API_SUPPLIER_QUOTATIONREUSEBYBATCH, {
batch_sn: this.code
}).then(res => {
console.log("materialListByBatch", res);
let list = res.data.order || [];
let canteen = res.data.canteen || [];
let contents = list.map(item => {
return {
name: item?.material?.m_name || '',
material_id: item?.material?.id || 0,
spec: item.name,
spec_id: item.id,
unit: item?.material?.unit?.unit_name || '',
brand: item?.material?.brand || '',
quality_level: item?.material?.quality_level || '',
offer: {edit: true, value: ''}
}
return obj;
});
})
this.contents = contents;
this.getCanteenList(res.data.canteen || []);
// let list = res.data.material || [];
// let contents = list.map(item => {
// console.log("item", item)
// return {
// name: item.material?.m_name,
// spec: item.name,
// pre_tax_price: {edit: true, value: item.tax_standard_price},
// after_tax_price: {edit: true, value: item.non_tax_standard_price},
// spec_id: item.id,
// material_id: item.material?.id
// }
// })
// this.contents = contents;
this.getCanteenList(canteen);
})
},
//
getCanteenList(canteen){
getCanteenList(canteen = []){
this.$http(this.API.API_SUPPLIER_CANTEENLIST).then(res => {
let list = res.data.list.map(item => {
item.checked = false;
@ -170,12 +228,11 @@
//
let list = [];
this.contents.map(item => {
if(item.pre_tax_price.value || item.after_tax_price.value){
if(item.offer.value){
list.push({
m_id: item.material_id,
m_spec_id: item.spec_id,
tax_price: item.pre_tax_price.value,
non_tax_price: item.after_tax_price.value
offer: item.offer.value
})
}
});
@ -189,8 +246,11 @@
if(canteen_ids.length <= 0){
return this.$msg('您未选择关联食堂哦')
}
if(list.length <= 0){
return this.$msg('没有需要报价的物资')
}
//
let state = ['待发单', '待审核'][_t];
let state = ['待发', '待审核'][_t];
this.$http(this.API.API_SUPPLIER_QUOTATIONAPPLY, {
data: list,
state: state,

7
pages/supply/order/detail.vue

@ -26,11 +26,12 @@
<button class="btn btn2" style="background-color: #FF0000;" @click="revokeOrder">撤销订单</button>
</view>
<view v-if="type == 2" class="lf-row-flex-end">
<button class="btn btn1" @click="$url('/pages/supply/offer/index?q_sn='+ order.q_sn)">编辑</button>
<button class="btn btn1" @click="$url('/pages/supply/offer/index?type=1&code='+ order.q_sn)">编辑</button>
<button class="btn btn2" @click="initiateQuotation">发起报价</button>
</view>
<view v-if="type == 3 || type == 4" class="lf-row-between">
<button class="btn btn1" @click="$url('/pages/supply/offer/index?q_sn='+ order.q_sn)">复用报价单</button>
<button class="btn btn1" @click="$url('/pages/supply/offer/index?type=2&code='+ order.q_sn)">复用报价单</button>
<button class="btn btn1" @click="$url('/pages/supply/offer/index?type=3&code='+ order.batch_sn)">复用批次号</button>
<view class="lf-font-32" style="color: #11D189;" v-if="type == 3">报价已通过</view>
<view class="lf-font-32" style="color: #FF0000;" v-if="type == 4">报价已被拒绝</view>
</view>
@ -44,7 +45,7 @@
components: { wybTable },
data(){
return {
type: 1,
type: 3,
order: {},
headers: [{
label: '菜品名称',

Loading…
Cancel
Save