|
|
@@ -1,4 +1,5 @@
|
|
|
import APP from '@/services';
|
|
|
+import { QueryDeliveryGoodsDetail } from '@/services/go/ermcp/goodsInfo';
|
|
|
import { ErmcpDeliveryGoodsDetailEx, MenuList } from '@/services/go/ermcp/goodsInfo/interface';
|
|
|
import { mergeObj } from '@/utils/objHandle';
|
|
|
import { reactive, Ref, ref } from 'vue';
|
|
|
@@ -53,8 +54,12 @@ export function handleDG() {
|
|
|
// 选中的具体某一天现货品种数据
|
|
|
const selctedDeliveryGoods = reactive<ErmcpDeliveryGoodsDetailEx>(initDG())
|
|
|
const isNormal = ref<boolean>(true) // true => 正常; false => 停用
|
|
|
- // 获取现货品种数据
|
|
|
- function queryDG() {
|
|
|
+ function classfiyDG() {
|
|
|
+ menuList.value.forEach(el => {
|
|
|
+ if (el.children) {
|
|
|
+ el.children.length = 0
|
|
|
+ }
|
|
|
+ });
|
|
|
const res = APP.get('DeliveryGoodsList') as ErmcpDeliveryGoodsDetailEx[]
|
|
|
deliveryGoodsList.value = res;
|
|
|
res.forEach(e => {
|
|
|
@@ -75,6 +80,9 @@ export function handleDG() {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
+ }
|
|
|
+ function queryDG() {
|
|
|
+ classfiyDG()
|
|
|
// 获取默认第一条数据
|
|
|
if (menuList.value[0].children?.length) {
|
|
|
chooseDG({ key: menuList.value[0].children[0].key, is: true })
|
|
|
@@ -95,6 +103,14 @@ export function handleDG() {
|
|
|
console.log('selctedDeliveryGoods', selctedDeliveryGoods);
|
|
|
}
|
|
|
}
|
|
|
- return { loading, deliveryGoodsList, menuList, queryDG, isNormal, selctedDeliveryGoods, chooseDG }
|
|
|
+ /**
|
|
|
+ * 更新数据
|
|
|
+ */
|
|
|
+ function updateDG() {
|
|
|
+ QueryDeliveryGoodsDetail().then(() => {
|
|
|
+ classfiyDG()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ return { loading, deliveryGoodsList, menuList, queryDG, updateDG, isNormal, selctedDeliveryGoods, chooseDG }
|
|
|
}
|
|
|
|