|
|
@ -128,7 +128,8 @@ |
|
|
deadline_end: '', |
|
|
deadline_end: '', |
|
|
table_loading: true, |
|
|
table_loading: true, |
|
|
searchValue: '', // 搜索内容 |
|
|
searchValue: '', // 搜索内容 |
|
|
button_click: false |
|
|
|
|
|
|
|
|
button_click: false, |
|
|
|
|
|
selected_canteens: [] |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
|
@ -149,6 +150,7 @@ |
|
|
onLoad(options){ |
|
|
onLoad(options){ |
|
|
this.code = options.code || ''; |
|
|
this.code = options.code || ''; |
|
|
this.type = options.type || 0; |
|
|
this.type = options.type || 0; |
|
|
|
|
|
this.getOfferList(); |
|
|
if(options.type == 1){ |
|
|
if(options.type == 1){ |
|
|
// 编辑,不可更换食堂 |
|
|
// 编辑,不可更换食堂 |
|
|
this.materialListByOrder(); |
|
|
this.materialListByOrder(); |
|
|
@ -182,6 +184,28 @@ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
// 获取订单列表(取出食堂id) |
|
|
|
|
|
getOfferList(){ |
|
|
|
|
|
this.$http(this.API.API_SUPPLIER_QUOTATIONORDERLIST, { |
|
|
|
|
|
state: 1, |
|
|
|
|
|
page: 1, |
|
|
|
|
|
page_size: 10 |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
let list = res.data?.list?.data || []; |
|
|
|
|
|
// 数组对象去重 |
|
|
|
|
|
list = this.$shared.deWeightFour(list, 'canteen_id'); |
|
|
|
|
|
let selected_canteens = []; |
|
|
|
|
|
list.map(item => { |
|
|
|
|
|
if(item.state == '待审核'){ |
|
|
|
|
|
selected_canteens.push({ |
|
|
|
|
|
id: item.canteen_id, |
|
|
|
|
|
q_sn: item.q_sn |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
this.selected_canteens = selected_canteens; |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
hideIcon() { |
|
|
hideIcon() { |
|
|
if(this.searchValue != '') { |
|
|
if(this.searchValue != '') { |
|
|
this.show_icon = false; |
|
|
this.show_icon = false; |
|
|
@ -406,6 +430,7 @@ |
|
|
// 报价订单编辑时保存 |
|
|
// 报价订单编辑时保存 |
|
|
editMaterial(_t){ |
|
|
editMaterial(_t){ |
|
|
// 物资列表 |
|
|
// 物资列表 |
|
|
|
|
|
let that = this; |
|
|
let list = []; |
|
|
let list = []; |
|
|
this.contents.map(item => { |
|
|
this.contents.map(item => { |
|
|
list.push({ |
|
|
list.push({ |
|
|
@ -415,22 +440,49 @@ |
|
|
purchase_limit: Number(item.purchase_limit.value) || 1 |
|
|
purchase_limit: Number(item.purchase_limit.value) || 1 |
|
|
}) |
|
|
}) |
|
|
}); |
|
|
}); |
|
|
// 操作状态,是保存还是直接发起 |
|
|
|
|
|
let state = ['待发起', '待审核'][_t]; |
|
|
|
|
|
this.$http(this.API.API_SUPPLIER_QUOTATIONSAVE, { |
|
|
|
|
|
data: list, |
|
|
|
|
|
state: state, |
|
|
|
|
|
q_sn: this.code, |
|
|
|
|
|
start: this.deadline_start, |
|
|
|
|
|
end: this.deadline_end |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
this.$msg('操作成功').then(result => { |
|
|
|
|
|
this.$toBack(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 已报价的食堂 |
|
|
|
|
|
let already_offer; |
|
|
|
|
|
// 关联食堂 |
|
|
|
|
|
this.relation_list.map(item => { |
|
|
|
|
|
if(item.checked){ |
|
|
|
|
|
already_offer = this.selected_canteens.find(s_item => s_item.id == item.id); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
if(_t == 1 && typeof(already_offer) != 'undefined'){ |
|
|
|
|
|
uni.showModal({ |
|
|
|
|
|
title: '您当前已有相同食堂报价单审核中', |
|
|
|
|
|
content: `编号【${already_offer.q_sn}】,仍要发起,之前待审核报价单将会撤回`, |
|
|
|
|
|
success: result => { |
|
|
|
|
|
if(result.confirm){ |
|
|
|
|
|
launchRequest(); |
|
|
|
|
|
}else{ |
|
|
|
|
|
this.button_click = false; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
}) |
|
|
}) |
|
|
}).catch(err => this.button_click = false) |
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
launchRequest(); |
|
|
|
|
|
} |
|
|
|
|
|
function launchRequest(){ |
|
|
|
|
|
// 操作状态,是保存还是直接发起 |
|
|
|
|
|
let state = ['待发起', '待审核'][_t]; |
|
|
|
|
|
that.$http(that.API.API_SUPPLIER_QUOTATIONSAVE, { |
|
|
|
|
|
data: list, |
|
|
|
|
|
state: state, |
|
|
|
|
|
q_sn: that.code, |
|
|
|
|
|
start: that.deadline_start, |
|
|
|
|
|
end: that.deadline_end |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
that.$msg('操作成功').then(result => { |
|
|
|
|
|
that.$toBack(); |
|
|
|
|
|
}) |
|
|
|
|
|
}).catch(err => that.button_click = false) |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
// 保存 |
|
|
// 保存 |
|
|
save(_t){ |
|
|
save(_t){ |
|
|
|
|
|
let that = this; |
|
|
// 拦截按钮重复点击 |
|
|
// 拦截按钮重复点击 |
|
|
if(this.button_click){ |
|
|
if(this.button_click){ |
|
|
return; |
|
|
return; |
|
|
@ -454,11 +506,14 @@ |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
// 已报价的食堂 |
|
|
|
|
|
let already_offer; |
|
|
// 关联食堂 |
|
|
// 关联食堂 |
|
|
let canteen_ids = []; |
|
|
let canteen_ids = []; |
|
|
this.relation_list.map(item => { |
|
|
this.relation_list.map(item => { |
|
|
if(item.checked){ |
|
|
if(item.checked){ |
|
|
canteen_ids.push(item.id); |
|
|
canteen_ids.push(item.id); |
|
|
|
|
|
already_offer = this.selected_canteens.find(s_item => s_item.id == item.id); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
if(canteen_ids.length <= 0){ |
|
|
if(canteen_ids.length <= 0){ |
|
|
@ -477,19 +532,36 @@ |
|
|
this.button_click = false; |
|
|
this.button_click = false; |
|
|
return this.$msg('请补充完整物资报价信息') |
|
|
return this.$msg('请补充完整物资报价信息') |
|
|
} |
|
|
} |
|
|
// 操作状态,是保存还是直接发起 |
|
|
|
|
|
let state = ['待发起', '待审核'][_t]; |
|
|
|
|
|
this.$http(this.API.API_SUPPLIER_QUOTATIONAPPLY, { |
|
|
|
|
|
data: list, |
|
|
|
|
|
state: state, |
|
|
|
|
|
canteen_ids: canteen_ids, |
|
|
|
|
|
start: this.deadline_start, |
|
|
|
|
|
end: this.deadline_end |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
this.$msg(res.data).then(result => { |
|
|
|
|
|
this.$toBack(); |
|
|
|
|
|
|
|
|
if(_t == 1 && typeof(already_offer) != 'undefined'){ |
|
|
|
|
|
uni.showModal({ |
|
|
|
|
|
title: '您当前已有相同食堂报价单审核中', |
|
|
|
|
|
content: `编号【${already_offer.q_sn}】,仍要发起,之前待审核报价单将会撤回`, |
|
|
|
|
|
success: result => { |
|
|
|
|
|
if(result.confirm){ |
|
|
|
|
|
launchRequest(); |
|
|
|
|
|
}else{ |
|
|
|
|
|
this.button_click = false; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
}) |
|
|
}) |
|
|
}).catch(err => this.button_click = false) |
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
launchRequest(); |
|
|
|
|
|
} |
|
|
|
|
|
function launchRequest(){ |
|
|
|
|
|
// 操作状态,是保存还是直接发起 |
|
|
|
|
|
let state = ['待发起', '待审核'][_t]; |
|
|
|
|
|
that.$http(that.API.API_SUPPLIER_QUOTATIONAPPLY, { |
|
|
|
|
|
data: list, |
|
|
|
|
|
state: state, |
|
|
|
|
|
canteen_ids: canteen_ids, |
|
|
|
|
|
start: that.deadline_start, |
|
|
|
|
|
end: that.deadline_end |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
that.$msg(res.data).then(result => { |
|
|
|
|
|
that.$toBack(); |
|
|
|
|
|
}) |
|
|
|
|
|
}).catch(err => that.button_click = false) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|