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