|
|
@@ -81,6 +81,7 @@ export function handleDG() {
|
|
|
const deliveryGoodsList = ref<ErmcpDeliveryGoodsDetailEx[]>([])
|
|
|
// 选中的具体某一天现货品种数据
|
|
|
const selctedDeliveryGoods = reactive<ErmcpDeliveryGoodsDetailEx>(initDG())
|
|
|
+ const isNormal = ref<boolean>(true) // true => 正常; false => 停用
|
|
|
// const menuList = ref<MenuList[]>(initMenu());
|
|
|
// 获取现货品种数据
|
|
|
function queryDG(param?: number) {
|
|
|
@@ -107,23 +108,28 @@ export function handleDG() {
|
|
|
})
|
|
|
// 获取默认第一条数据
|
|
|
if (menuList.value[0].children?.length) {
|
|
|
- chooseDG(menuList.value[0].children[0].key)
|
|
|
+ chooseDG({ key: menuList.value[0].children[0].key, is: true })
|
|
|
} else if (menuList.value[1].children?.length) {
|
|
|
- chooseDG(menuList.value[1].children[0].key)
|
|
|
+ chooseDG({ key: menuList.value[1].children[0].key, is: false })
|
|
|
}
|
|
|
}).catch(err => {
|
|
|
message.error(err)
|
|
|
}).finally(() => loading.value = false)
|
|
|
}
|
|
|
+ interface Value {
|
|
|
+ key: string;
|
|
|
+ is: boolean;
|
|
|
+ }
|
|
|
// 选择某条现货数据
|
|
|
- function chooseDG(key: string) {
|
|
|
+ function chooseDG({ key, is }: Value) {
|
|
|
+ isNormal.value = is
|
|
|
const obj = deliveryGoodsList.value.find(e => e.data.deliverygoodsid === Number(key))
|
|
|
if (obj) {
|
|
|
mergeObj(selctedDeliveryGoods, obj)
|
|
|
console.log('selctedDeliveryGoods', selctedDeliveryGoods);
|
|
|
}
|
|
|
}
|
|
|
- return { loading, deliveryGoodsList, menuList, queryDG, selctedDeliveryGoods, chooseDG }
|
|
|
+ return { loading, deliveryGoodsList, menuList, queryDG, isNormal, selctedDeliveryGoods, chooseDG }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -141,15 +147,3 @@ export function getGoodsUnit(unit: number) {
|
|
|
export function getGoodsUnitList() {
|
|
|
return getItemEnum('goodsunit')
|
|
|
}
|
|
|
-
|
|
|
-/**
|
|
|
- * 处理现货品种的状态
|
|
|
- * @returns
|
|
|
- */
|
|
|
-export function handleGDStatue() {
|
|
|
- const isNormal = ref<boolean>(true) // true => 正常; false => 停用
|
|
|
- function changeStatue(value: boolean) {
|
|
|
- isNormal.value = value;
|
|
|
- }
|
|
|
- return { isNormal, changeStatue }
|
|
|
-}
|