|
|
@@ -1,7 +1,6 @@
|
|
|
-import { QueryDeliveryGoodsDetail } from '@/services/go/ermcp/goodsInfo';
|
|
|
+import APP from '@/services';
|
|
|
import { ErmcpDeliveryGoodsDetailEx, MenuList } from '@/services/go/ermcp/goodsInfo/interface';
|
|
|
import { mergeObj } from '@/utils/objHandle';
|
|
|
-import { message } from 'ant-design-vue';
|
|
|
import { reactive, Ref, ref } from 'vue';
|
|
|
import { getInitMenuData } from '../../setup';
|
|
|
|
|
|
@@ -55,37 +54,33 @@ export function handleDG() {
|
|
|
const selctedDeliveryGoods = reactive<ErmcpDeliveryGoodsDetailEx>(initDG())
|
|
|
const isNormal = ref<boolean>(true) // true => 正常; false => 停用
|
|
|
// 获取现货品种数据
|
|
|
- function queryDG(param?: number) {
|
|
|
- loading.value = true;
|
|
|
- QueryDeliveryGoodsDetail(param).then(res => {
|
|
|
- deliveryGoodsList.value = res;
|
|
|
- res.forEach(e => {
|
|
|
- const { dgstatus, isvalid, deliverygoodsname, deliverygoodsid } = e.data
|
|
|
- if (isvalid) { // 有效
|
|
|
- const normal = 'goods_info_spot_normal', disable = 'goods_info_spot_disable';
|
|
|
- const result = { key: deliverygoodsid.toString(), title: deliverygoodsname }
|
|
|
- if (dgstatus) { //1:正常
|
|
|
- if (menuMap.has(normal)) {
|
|
|
- const index = menuMap.get(normal) as number;
|
|
|
- menuList.value[index].children?.push(result)
|
|
|
- }
|
|
|
- } else { // 0:未激活
|
|
|
- if (menuMap.has(disable)) {
|
|
|
- const index = menuMap.get(disable) as number;
|
|
|
- menuList.value[index].children?.push(result)
|
|
|
- }
|
|
|
+ function queryDG() {
|
|
|
+ const res = APP.get('DeliveryGoodsList') as ErmcpDeliveryGoodsDetailEx[]
|
|
|
+ deliveryGoodsList.value = res;
|
|
|
+ res.forEach(e => {
|
|
|
+ const { dgstatus, isvalid, deliverygoodsname, deliverygoodsid } = e.data
|
|
|
+ if (isvalid) { // 有效
|
|
|
+ const normal = 'goods_info_spot_normal', disable = 'goods_info_spot_disable';
|
|
|
+ const result = { key: deliverygoodsid.toString(), title: deliverygoodsname }
|
|
|
+ if (dgstatus) { //1:正常
|
|
|
+ if (menuMap.has(normal)) {
|
|
|
+ const index = menuMap.get(normal) as number;
|
|
|
+ menuList.value[index].children?.push(result)
|
|
|
+ }
|
|
|
+ } else { // 0:未激活
|
|
|
+ if (menuMap.has(disable)) {
|
|
|
+ const index = menuMap.get(disable) as number;
|
|
|
+ menuList.value[index].children?.push(result)
|
|
|
}
|
|
|
}
|
|
|
- })
|
|
|
- // 获取默认第一条数据
|
|
|
- if (menuList.value[0].children?.length) {
|
|
|
- chooseDG({ key: menuList.value[0].children[0].key, is: true })
|
|
|
- } else if (menuList.value[1].children?.length) {
|
|
|
- chooseDG({ key: menuList.value[1].children[0].key, is: false })
|
|
|
}
|
|
|
- }).catch(err => {
|
|
|
- message.error(err)
|
|
|
- }).finally(() => loading.value = false)
|
|
|
+ })
|
|
|
+ // 获取默认第一条数据
|
|
|
+ if (menuList.value[0].children?.length) {
|
|
|
+ chooseDG({ key: menuList.value[0].children[0].key, is: true })
|
|
|
+ } else if (menuList.value[1].children?.length) {
|
|
|
+ chooseDG({ key: menuList.value[1].children[0].key, is: false })
|
|
|
+ }
|
|
|
}
|
|
|
interface Value {
|
|
|
key: string;
|