import { InvoiceControllerState, IGood } from '..'; /** * 设置单个货物属性 */ export default async (state: InvoiceControllerState, options?: IGood) => { if (!options || !options.$index) return; const goodsList = state.freightListState.goodsList.map(e => e.$index === options.$index ? { ...e, ...options } : e); state.freightListState = { ...state.freightListState, goodsList }; };