|
|
|
@ -15,10 +15,11 @@ const useOrderStore = create((set, get) => ({
|
|
|
|
|
fetchOrderDetail: async (colisn) => {
|
|
|
|
|
const json = await fetchJSON(`${API_HOST}/getorderinfo`, { colisn })
|
|
|
|
|
if (json.errcode === 0 && json.result.length > 0) {
|
|
|
|
|
const orderResult = json.result[0]
|
|
|
|
|
set(() => ({
|
|
|
|
|
orderDetail: json.result[0],
|
|
|
|
|
customerDetail: json.result[0].contact[0],
|
|
|
|
|
lastQuotation: json.result[0].quotes.length > 0 ? json.result[0].quotes[0] : {},
|
|
|
|
|
orderDetail: orderResult,
|
|
|
|
|
customerDetail: orderResult.contact.length > 0 ? orderResult.contact[0] : {},
|
|
|
|
|
lastQuotation: orderResult.quotes.length > 0 ? orderResult.quotes[0] : {},
|
|
|
|
|
}))
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|