|
|
|
@ -25,6 +25,22 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<self-line></self-line> |
|
|
|
<!-- 报价时间 --> |
|
|
|
<view class="lf-row-between lf-p-30 lf-p-l-32 lf-p-r-32 lf-font-28"> |
|
|
|
<view class="lf-color-black">报价生效时间</view> |
|
|
|
<picker mode="date" :value="deadline_start" @change="pickerChange($event, 'deadline_start')"> |
|
|
|
<view class="lf-color-555 lf-text-right" style="width: 400rpx;">{{ deadline_start || '请选择...' }}</view> |
|
|
|
</picker> |
|
|
|
</view> |
|
|
|
<view class="lf-row-between lf-p-30 lf-p-l-32 lf-p-r-32 lf-font-28"> |
|
|
|
<view class="lf-color-black">报价失效时间</view> |
|
|
|
<picker mode="date" :value="deadline_end" @change="pickerChange($event, 'deadline_end')"> |
|
|
|
<view class="lf-color-555 lf-text-right" style="width: 400rpx;">{{ deadline_end || '请选择...' }}</view> |
|
|
|
</picker> |
|
|
|
</view> |
|
|
|
<self-line></self-line> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 物料table --> |
|
|
|
<view class="box"> |
|
|
|
<view class="lf-font-32 lf-color-black lf-font-bold lf-m-b-20">报价明细</view> |
|
|
|
@ -54,6 +70,10 @@ |
|
|
|
wybTable |
|
|
|
}, |
|
|
|
data(){ |
|
|
|
// PS 获取30天后日期 |
|
|
|
var date1 = new Date(); |
|
|
|
var date2 = new Date(date1); |
|
|
|
date2.setDate(date1.getDate() + 30); |
|
|
|
return { |
|
|
|
headers: [{ |
|
|
|
label: '物资名称', |
|
|
|
@ -94,7 +114,9 @@ |
|
|
|
relation_list: [], // 关联食堂列表 |
|
|
|
node_top: 0, |
|
|
|
code: '', // 订单号,批次号,如果有 |
|
|
|
type: 0 |
|
|
|
type: 0, |
|
|
|
deadline_start: '', |
|
|
|
deadline_end: '' |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
@ -175,9 +197,9 @@ |
|
|
|
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 || '', |
|
|
|
@ -187,10 +209,10 @@ |
|
|
|
brand: item?.material?.brand || '', |
|
|
|
quality_level: item?.material?.quality_level || '', |
|
|
|
number: item?.material?.m_sn || '', |
|
|
|
purchase_limit: {edit: true, value: item?.quotation?.purchase_limit || ''}, |
|
|
|
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, |
|
|
|
purchase_limit: {edit: true, value: item?.quotation_item?.purchase_limit || ''}, |
|
|
|
tax_price: {edit: true, value: item?.quotation_item?.tax_price || ''}, |
|
|
|
non_tax_price: {edit: true, value: item?.quotation_item?.non_tax_price || ''}, |
|
|
|
quotation_id: item?.quotation_item?.id || 0, |
|
|
|
operation: {button: true, key: 'delete', value: '删除'}, |
|
|
|
unit: item?.material?.unit?.unit_name || '', |
|
|
|
category: item?.material?.category?.m_cate_name || '' |
|
|
|
@ -201,6 +223,20 @@ |
|
|
|
return obj; |
|
|
|
}) |
|
|
|
this.contents = contents; |
|
|
|
// 处理报价生效、失效时间 |
|
|
|
let deadline_start = ''; |
|
|
|
let deadline_end = ''; |
|
|
|
if(list[0] && list[0]?.quotation_item?.quotation){ |
|
|
|
let quotation = list[0]?.quotation_item?.quotation || {}; |
|
|
|
if(quotation.deadline_start){ |
|
|
|
deadline_start = quotation.deadline_start.split(' ')[0]; |
|
|
|
} |
|
|
|
if(quotation.deadline){ |
|
|
|
deadline_end = quotation.deadline.split(' ')[0]; |
|
|
|
} |
|
|
|
} |
|
|
|
this.deadline_start = deadline_start; |
|
|
|
this.deadline_end = deadline_end; |
|
|
|
this.getCanteenList(canteen); |
|
|
|
}) |
|
|
|
}, |
|
|
|
@ -212,6 +248,7 @@ |
|
|
|
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 || '', |
|
|
|
@ -227,6 +264,20 @@ |
|
|
|
} |
|
|
|
}) |
|
|
|
this.contents = contents; |
|
|
|
// 处理报价生效、失效时间 |
|
|
|
let deadline_start = ''; |
|
|
|
let deadline_end = ''; |
|
|
|
if(list[0] && list[0]?.quotation_item?.quotation){ |
|
|
|
let quotation = list[0]?.quotation_item?.quotation || {}; |
|
|
|
if(quotation.deadline_start){ |
|
|
|
deadline_start = quotation.deadline_start.split(' ')[0]; |
|
|
|
} |
|
|
|
if(quotation.deadline){ |
|
|
|
deadline_end = quotation.deadline.split(' ')[0]; |
|
|
|
} |
|
|
|
} |
|
|
|
this.deadline_start = deadline_start; |
|
|
|
this.deadline_end = deadline_end; |
|
|
|
this.getCanteenList(canteen); |
|
|
|
}) |
|
|
|
}, |
|
|
|
@ -267,6 +318,10 @@ |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
// 日期选择器值被改变 |
|
|
|
pickerChange(event, current_name){ |
|
|
|
this[current_name] = event.detail.value; |
|
|
|
}, |
|
|
|
// 切换显示关联食堂modal |
|
|
|
switchRelation(){ |
|
|
|
if(this.type == 1) return this.$msg('编辑不可更换关联食堂哦'); |
|
|
|
@ -293,7 +348,9 @@ |
|
|
|
this.$http(this.API.API_SUPPLIER_QUOTATIONSAVE, { |
|
|
|
data: list, |
|
|
|
state: state, |
|
|
|
q_sn: this.code |
|
|
|
q_sn: this.code, |
|
|
|
start: this.deadline_start, |
|
|
|
end: this.deadline_end |
|
|
|
}).then(res => { |
|
|
|
this.$msg('操作成功').then(result => { |
|
|
|
this.$toBack(); |
|
|
|
@ -330,15 +387,23 @@ |
|
|
|
if(canteen_ids.length <= 0){ |
|
|
|
return this.$msg('您未选择关联食堂哦') |
|
|
|
} |
|
|
|
if(!this.deadline_start){ |
|
|
|
return this.$msg('您未选择报价生效时间哦') |
|
|
|
} |
|
|
|
if(!this.deadline_end){ |
|
|
|
return this.$msg('您未选择报价失效时间哦') |
|
|
|
} |
|
|
|
if(list.length <= 0){ |
|
|
|
return this.$msg('没有需要报价的物资') |
|
|
|
return this.$msg('请补充完整物资报价信息') |
|
|
|
} |
|
|
|
// 操作状态,是保存还是直接发起 |
|
|
|
let state = ['待发起', '待审核'][_t]; |
|
|
|
this.$http(this.API.API_SUPPLIER_QUOTATIONAPPLY, { |
|
|
|
data: list, |
|
|
|
state: state, |
|
|
|
canteen_ids: canteen_ids |
|
|
|
canteen_ids: canteen_ids, |
|
|
|
start: this.deadline_start, |
|
|
|
end: this.deadline_end |
|
|
|
}).then(res => { |
|
|
|
this.$msg(res.data).then(result => { |
|
|
|
this.$toBack(); |
|
|
|
|