Browse Source

对接报价订单

master
邓平艺 5 years ago
parent
commit
941e377504
  1. 2
      canteen/components/wyb-table/wyb-table.vue
  2. 3
      canteen/pages/purchase/detail.vue
  3. 28
      canteen/pages/purchase/launch.vue
  4. 1
      supplier/common/api.js
  5. 2
      supplier/components/wyb-table/wyb-table.vue
  6. 2
      supplier/pages/gonghuo/detail.vue
  7. 49
      supplier/pages/gonghuo/order.vue
  8. 65
      supplier/pages/offer/index.vue
  9. 75
      supplier/pages/order/detail.vue
  10. 46
      supplier/pages/order/index.vue

2
canteen/components/wyb-table/wyb-table.vue

@ -149,7 +149,7 @@
position: hIndex === 0 && firstLineFixed ? 'sticky' : 'static'}">
<input class="lf-w-100" :disabled="false" placeholder="请输入.." v-if="isObject(autoContentItem(cIndex, hIndex), 'edit')" :style="{minHeight: (minHeight[1] || minHeight[0]) + 'rpx'}" @blur="inputBlur(cIndex, hIndex, $event)" :value="autoContentItem(cIndex, hIndex).value" />
<button class="diy-btn" v-else-if="isObject(autoContentItem(cIndex, hIndex), 'button')" @click="buttonClick(cIndex, hIndex)">{{ autoContentItem(cIndex, hIndex).value }}</button>
<view class="lf-w-100 lf-h-100 lf-row-center" v-else :style="{minHeight: (minHeight[1] || minHeight[0]) + 'rpx'}">{{ autoContentItem(cIndex, hIndex) }}</view>
<view class="lf-w-100 lf-h-100 lf-row-center" v-else :style="{minHeight: (minHeight[1] || minHeight[0]) + 'rpx', 'word-break': 'break-all'}">{{ autoContentItem(cIndex, hIndex) }}</view>
</view>
</view>
<view v-if="computedCol.length !== 0" class="wyb-table-content-line" :style="{

3
canteen/pages/purchase/detail.vue

@ -55,6 +55,7 @@
</view>
<view v-else-if="type == 4" class="lf-row-flex-end">
<button class="btn btn1">退单</button>
<button class="btn btn1 lf-m-l-20">上传凭证</button>
<button class="btn btn2" @click="$url('/pages/purchase/receipt?p_sn='+ order.p_sn)">确认收货</button>
</view>
<view v-else-if="type == 5" class="lf-row-between">
@ -92,6 +93,8 @@
}
},
onLoad(options){
// TODO 1
// TODO 2
this.p_sn = options.p_sn || '';
// TODO table
this.getData();

28
canteen/pages/purchase/launch.vue

@ -35,7 +35,7 @@
<view v-for="(value, key) in render_material_list" :key="key" class="lf-m-t-20">
<view class="lf-m-b-10 lf-row-between">
<text>{{ value.supplier_name }}</text>
<text @click="removeSupplier(key)">删除</text>
<text @click="removeSupplier(key)" class="lf-color-price">删除</text>
</view>
<wyb-table :headers="value.headers"
:contents="value.material_list"
@ -149,14 +149,24 @@
},
//
removeSupplier(key){
// render_material_list
let render_material_list = {...this.render_material_list};
delete render_material_list[key];
this.render_material_list = render_material_list;
// material_list
delete this.material_list[key];
//
this.show_material = Object.keys(this.material_list).length > 0;
uni.showModal({
title: '温馨提示',
content: '删除供应商后所添加的物资将随之移除,确定继续吗?',
confirmColor: '#FF0000',
cancelColor: '#11D189',
success: result => {
if(result.confirm){
// render_material_list
let render_material_list = {...this.render_material_list};
delete render_material_list[key];
this.render_material_list = render_material_list;
// material_list
delete this.material_list[key];
//
this.show_material = Object.keys(this.material_list).length > 0;
}
}
})
},
//
save(_t){

1
supplier/common/api.js

@ -21,3 +21,4 @@ export const API_SUPPLIER_PURCHASEUPLOADVOUCHER = '/api/supplier/purchaseUploadV
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_SUPPLIER_QUOTATIONSAVE = '/api/supplier/quotationSave'; // 报价订单编辑时保存

2
supplier/components/wyb-table/wyb-table.vue

@ -149,7 +149,7 @@
position: hIndex === 0 && firstLineFixed ? 'sticky' : 'static'}">
<input class="lf-w-100" :disabled="false" placeholder="请输入.." v-if="isObject(autoContentItem(cIndex, hIndex), 'edit')" :style="{minHeight: (minHeight[1] || minHeight[0]) + 'rpx'}" @blur="inputBlur(cIndex, hIndex, $event)" :value="autoContentItem(cIndex, hIndex).value" />
<button class="diy-btn" v-else-if="isObject(autoContentItem(cIndex, hIndex), 'button')" @click="buttonClick(cIndex, hIndex)">{{ autoContentItem(cIndex, hIndex).value }}</button>
<view class="lf-w-100 lf-h-100 lf-row-center" v-else :style="{minHeight: (minHeight[1] || minHeight[0]) + 'rpx'}">{{ autoContentItem(cIndex, hIndex) }}</view>
<view class="lf-w-100 lf-h-100 lf-row-center" v-else :style="{minHeight: (minHeight[1] || minHeight[0]) + 'rpx', 'word-break': 'break-all'}">{{ autoContentItem(cIndex, hIndex) }}</view>
</view>
</view>
<view v-if="computedCol.length !== 0" class="wyb-table-content-line" :style="{

2
supplier/pages/gonghuo/detail.vue

@ -127,6 +127,8 @@
}
},
onLoad(options){
// todo
// todo ()
this.p_sn = options.p_sn;
this.getData();
},

49
supplier/pages/gonghuo/order.vue

@ -47,48 +47,40 @@
<script>
export default {
data(){
let _public = {
loading_class: true,
loading_text: '正在加载中...',
page: 1,
isPage: true,
isRefresher: false, // scroll-view
}
return {
current: 0,
tab_list: [{
name: '全部',
loading_class: true,
loading_text: '正在加载中...',
page: 1,
isPage: true,
state_name: '',
list: []
list: [],
..._public
},{
name: '待接单',
loading_class: true,
loading_text: '正在加载中...',
page: 1,
isPage: true,
state_name: '待接单',
list: []
list: [],
..._public
},{
name: '待发货',
loading_class: true,
loading_text: '正在加载中...',
page: 1,
isPage: true,
state_name: '待发货',
list: []
list: [],
..._public
},{
name: '已完成',
loading_class: true,
loading_text: '正在加载中...',
page: 1,
isPage: true,
state_name: '已完成',
list: []
list: [],
..._public
},{
name: '已退单',
loading_class: true,
loading_text: '正在加载中...',
page: 1,
isPage: true,
state_name: '已退单',
list: []
list: [],
..._public
}],
page_size: 10,
windowHeight: 0
@ -107,18 +99,19 @@
page_size: this.page_size
}).then(res => {
console.log("res", res);
let list = res.data.list || {};
if(options && options.refresh){
item.isRefresher = false;
}
// item.isPage = res.isPage; //
item.isPage = this.$isRight(list.next_page_url); //
if(!item.isPage){
item.loading_class = false;
item.loading_text = '已加载全部数据~'
}
if(item.page == 1){
item.list = res.data.list;
item.list = list.data;
}else{
item.list.push(...res.data.list);
item.list.push(...list.data);
}
})
},

65
supplier/pages/offer/index.vue

@ -72,7 +72,7 @@
key: 'tax_price'
},{
label: '非含税价',
key: 'no_tax_price'
key: 'non_tax_price'
}],
contents: [],
is_show: false,
@ -98,11 +98,12 @@
}
},
onLoad(options){
// todo
this.code = options.code || '';
this.type = options.type || 0;
if(options.type == 1){
//
this.editMaterialList();
this.materialListByOrder();
}else if(options.type == 2){
//
this.materialListByOrder();
@ -128,7 +129,6 @@
//
getMaterialList(){
this.$http(this.API.API_SUPPLIER_MATERIALLIST).then(res => {
let list = res.data.spec || [];
let contents = list.map(item => {
return {
@ -140,20 +140,14 @@
quality_level: item?.material?.quality_level || '',
number: item?.material?.m_sn || '',
tax_price: {edit: true, value: ''},
no_tax_price: {edit: true, value: ''}
non_tax_price: {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
@ -167,10 +161,12 @@
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: ''}
number: item?.material?.m_sn || '',
tax_price: {edit: true, value: item?.quotation?.tax_price || ''},
non_tax_price: {edit: true, value: item?.quotation?.non_tax_price || ''},
quotation_id: item?.quotation?.id || 0
}
})
this.contents = contents;
@ -191,10 +187,11 @@
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: ''}
number: item?.material?.m_sn || '',
tax_price: {edit: true, value: item?.quotation?.tax_price || ''},
non_tax_price: {edit: true, value: item?.quotation?.non_tax_price || ''}
}
})
this.contents = contents;
@ -222,22 +219,51 @@
},
// modal
switchRelation(){
if(this.type == 1) return this.$msg('编辑不可更换关联食堂哦');
this.is_show = !this.is_show;
},
//
selectItem(index){
this.relation_list[index].checked = !this.relation_list[index].checked;
},
//
editMaterial(_t){
//
let list = [];
this.contents.map(item => {
list.push({
id: item.quotation_id,
tax_price: item.tax_price.value,
non_tax_price: item.non_tax_price.value
})
});
//
let state = ['待发起', '待审核'][_t];
this.$http(this.API.API_SUPPLIER_QUOTATIONSAVE, {
data: list,
state: state
}).then(res => {
this.$msg(res.data).then(result => {
this.$toBack();
})
})
},
//
save(_t){
//
if(this.type == 1){
this.editMaterial(_t);
return;
}
//
let list = [];
this.contents.map(item => {
if(item.offer.value){
if(item.tax_price.value && item.non_tax_price.value){
list.push({
m_id: item.material_id,
m_spec_id: item.spec_id,
offer: item.offer.value
tax_price: item.tax_price.value,
non_tax_price: item.non_tax_price.value
})
}
});
@ -261,8 +287,9 @@
state: state,
canteen_ids: canteen_ids
}).then(res => {
console.log("save", res);
this.$msg('操作成功');
this.$msg(res.data).then(result => {
this.$toBack();
})
})
}
}

75
supplier/pages/order/detail.vue

@ -11,23 +11,23 @@
</view>
<view class="lf-row-between list">
<view>报价商</view>
<view class="lf-color-black">{{ order.contact_name }}</view>
<view class="lf-color-black">{{ order.q_name }}</view>
</view>
</view>
<self-line></self-line>
<view class="lf-m-t-30 lf-m-l-32">
<view class="lf-m-t-30 lf-m-l-32 lf-m-r-32">
<view class="lf-font-32 lf-color-black lf-font-bold lf-m-b-20">报价明细</view>
<wyb-table :headers="headers" :contents="contents" :first-line-fixed="true" contentBgColor="#eef6fe" width="max-content" height="350rpx"></wyb-table>
<wyb-table :headers="headers" :contents="contents" :first-line-fixed="true" contentBgColor="#eef6fe" width="max-content" height="550rpx"></wyb-table>
</view>
<view style="height: 100rpx;"></view>
<!-- 操作按钮 -->
<view class="fixed-bottom">
<view class="fixed-bottom" v-if="$isRight(order) && type != 0">
<view v-if="type == 1" class="lf-row-flex-end">
<button class="btn btn2" style="background-color: #FF0000;" @click="revokeOrder">撤销订单</button>
<button class="btn btn2" style="background-color: #FF0000;" @click="orderStateChange('待发起')">撤销订单</button>
</view>
<view v-if="type == 2" class="lf-row-flex-end">
<button class="btn btn1" @click="$url('/pages/offer/index?type=1&code='+ order.q_sn)">编辑</button>
<button class="btn btn2" @click="initiateQuotation">发起报价</button>
<button class="btn btn2" @click="orderStateChange('待审核')">发起报价</button>
</view>
<view v-if="type == 3 || type == 4" class="lf-row-between">
<button class="btn btn1" @click="$url('/pages/offer/index?type=2&code='+ order.q_sn)">复用报价单</button>
@ -45,20 +45,29 @@
components: { wybTable },
data(){
return {
type: 3,
type: 0,
order: {},
headers: [{
label: '菜品名称',
label: '物资名称',
key: 'name'
},{
label: '规格',
key: 'spec'
},{
label: '税前价',
key: 'pre_tax_price'
label: '品牌',
key: 'brand'
},{
label: '税后价',
key: 'after_tax_price'
label: '品级',
key: 'quality_level'
},{
label: '编号',
key: 'number'
},{
label: '含税价',
key: 'tax_price'
},{
label: '非含税价',
key: 'non_tax_price'
}],
contents: [],
q_sn: '' //
@ -68,9 +77,9 @@
stateClass(){
return function(val){
let class_name = {
'已通过': 'quoted-price',
'已通过': 'passed',
'待发起': 'wait',
'待审核': 'passed',
'待审核': 'quoted-price',
'未通过': 'refuse'
}
return class_name[val];
@ -82,40 +91,52 @@
this.getDetail();
},
methods: {
stateType(val){
let type = 0;
switch(val){
case '待审核': type = 1; break;
case '待发起': type = 2; break;
case '已通过': type = 3; break;
case '未通过': type = 4; break;
}
this.type = type;
},
getDetail(){
this.$http(this.API.API_SUPPLIER_QUOTATIONDETAIL, {
q_sn: this.q_sn
}).then(res => {
console.log("getDetail", res);
this.stateType(res.data.order.state);
this.order = res.data.order || {};
let list = res.data.order.item || [];
let contents = list.map(item => {
let obj = {
name: item.material?.m_name,
name: item.material?.m_name || '',
material_id: item.material?.id,
spec: item.spec?.name,
spec: item.spec?.name || '',
spec_id: item.spec?.id,
pre_tax_price: item.tax_price,
after_tax_price: item.non_tax_price
brand: item?.material?.brand || '',
quality_level: item?.material?.quality_level || '',
number: item?.material?.m_sn || '',
tax_price: item.tax_price,
non_tax_price: item.non_tax_price
}
return obj;
});
this.contents = contents;
}).catch(err => {
this.$toBack();
})
},
//
initiateQuotation(){
// todo
},
//
revokeOrder(){
//
orderStateChange(state){
this.$http(this.API.API_SUPPLIER_QUOTATIONUPDATE, {
q_sn: this.q_sn,
state: '待发起'
state: state
}).then(res => {
console.log("revokeOrder", res);
this.$msg('操作成功');
this.getDetail(); //
})
}
}

46
supplier/pages/order/index.vue

@ -35,35 +35,30 @@
<script>
export default {
data(){
let _public = {
loading_class: true,
loading_text: '正在加载中...',
page: 1,
isPage: true,
isRefresher: false, // scroll-view
}
return {
current: 0,
tab_list: [{
name: '全部',
state_name: '',
loading_class: true,
loading_text: '正在加载中...',
page: 1,
isPage: true,
isRefresher: false, // scroll-view
list: []
list: [],
..._public
},{
name: '审核中',
state_name: '审核中',
loading_class: true,
loading_text: '正在加载中...',
page: 1,
isPage: true,
isRefresher: false,
list: []
state_name: '待审核',
list: [],
..._public
},{
name: '已完成',
state_name: '已完成',
loading_class: true,
loading_text: '正在加载中...',
page: 1,
isPage: true,
isRefresher: false,
list: []
state_name: '已通过',
list: [],
..._public
}],
page_size: 10,
windowHeight: 0,
@ -73,9 +68,9 @@
stateClass(){
return function(val){
let class_name = {
'已通过': 'quoted-price',
'已通过': 'passed',
'待发起': 'wait',
'待审核': 'passed',
'待审核': 'quoted-price',
'未通过': 'refuse'
}
return class_name[val];
@ -94,18 +89,19 @@
page: item.page,
page_size: this.page_size
}).then(res => {
let list = res.data.list || {};
if(options && options.refresh){
item.isRefresher = false;
}
// item.isPage = res.isPage; //
item.isPage = this.$isRight(list.next_page_url); //
if(!item.isPage){
item.loading_class = false;
item.loading_text = '已加载全部数据~'
}
if(item.page == 1){
item.list = res.data.list;
item.list = list.data;
}else{
item.list.push(...res.data.list);
item.list.push(...list.data);
}
})
},

Loading…
Cancel
Save