|  | @@ -107,9 +107,23 @@ import SpringDialog from "@/views/system/selector/spring/index.vue";
 | 
	
		
			
				|  |  |  // import { MittEnum } from "@/enums/mittEnum";
 | 
	
		
			
				|  |  |  // import { getCurrentRecords } from "@/utils/index";
 | 
	
		
			
				|  |  |  import { useUserStore } from "@/stores/modules/user";
 | 
	
		
			
				|  |  | -import { getBedNetAreaList } from "@/api/modules/basicinfo";
 | 
	
		
			
				|  |  | +// import { getBedNetAreaList } from "@/api/modules/basicinfo";
 | 
	
		
			
				|  |  |  import AllFormula from "./components/AllFormula.vue";
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +interface DetailProps {
 | 
	
		
			
				|  |  | +  deptid?: number | string;
 | 
	
		
			
				|  |  | +  bednetid?: number;
 | 
	
		
			
				|  |  | +  state?: string;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +const props = withDefaults(defineProps<DetailProps>(), {
 | 
	
		
			
				|  |  | +  // deptid: 0,
 | 
	
		
			
				|  |  | +  // bednetid: 0,
 | 
	
		
			
				|  |  | +  // state: ""
 | 
	
		
			
				|  |  | +});
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +const emit = defineEmits(["aftersave", "aftercancel"]);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  const { t } = useI18n();
 | 
	
		
			
				|  |  |  const route = useRoute();
 | 
	
		
			
				|  |  |  const router = useRouter();
 | 
	
	
		
			
				|  | @@ -140,7 +154,6 @@ const {
 | 
	
		
			
				|  |  |    getDataMxAdd,
 | 
	
		
			
				|  |  |    getDataMxSpring,
 | 
	
		
			
				|  |  |    dataCallback,
 | 
	
		
			
				|  |  | -  dataCallbackMx,
 | 
	
		
			
				|  |  |    wf_cmp_cb,
 | 
	
		
			
				|  |  |    setMxSpringLength,
 | 
	
		
			
				|  |  |    gotoSummy
 | 
	
	
		
			
				|  | @@ -310,13 +323,17 @@ const orderDefaultAction: detailAction[] = [
 | 
	
		
			
				|  |  |        return !orderStatus.value;
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      clickFunc: item => {
 | 
	
		
			
				|  |  | -      tabRemove(route.fullPath);
 | 
	
		
			
				|  |  | -      if (route.path.indexOf("/new") > -1) {
 | 
	
		
			
				|  |  | -        router.replace("/bednetQuote");
 | 
	
		
			
				|  |  | +      if (typeof props.bednetid != "undefined") {
 | 
	
		
			
				|  |  | +        emit("aftercancel");
 | 
	
		
			
				|  |  |        } else {
 | 
	
		
			
				|  |  | -        router.replace(
 | 
	
		
			
				|  |  | -          `/bednetQuote/detail?id=${LjDetailRef.value._mainData.bednetid}&code=${LjDetailRef.value._mainData.bednetcode}`
 | 
	
		
			
				|  |  | -        );
 | 
	
		
			
				|  |  | +        tabRemove(route.fullPath);
 | 
	
		
			
				|  |  | +        if (route.path.indexOf("/new") > -1) {
 | 
	
		
			
				|  |  | +          router.replace("/bednetQuote");
 | 
	
		
			
				|  |  | +        } else {
 | 
	
		
			
				|  |  | +          router.replace(
 | 
	
		
			
				|  |  | +            `/bednetQuote/detail?id=${LjDetailRef.value._mainData.bednetid}&code=${LjDetailRef.value._mainData.bednetcode}`
 | 
	
		
			
				|  |  | +          );
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    }),
 | 
	
	
		
			
				|  | @@ -387,11 +404,15 @@ const orderDefaultAction: detailAction[] = [
 | 
	
		
			
				|  |  |                  message: t("sys.api.sueccessToSave"),
 | 
	
		
			
				|  |  |                  type: "success"
 | 
	
		
			
				|  |  |                });
 | 
	
		
			
				|  |  | -              if (res.bednet.bednetid) {
 | 
	
		
			
				|  |  | -                tabRemove(route.fullPath);
 | 
	
		
			
				|  |  | -                router.replace(`/bednetQuote/detail?id=${res.bednet.bednetid}`);
 | 
	
		
			
				|  |  | +              if (typeof props.bednetid != "undefined") {
 | 
	
		
			
				|  |  | +                emit("aftersave", res);
 | 
	
		
			
				|  |  |                } else {
 | 
	
		
			
				|  |  | -                router.replace("/bednetQuote");
 | 
	
		
			
				|  |  | +                if (res.bednet.bednetid) {
 | 
	
		
			
				|  |  | +                  tabRemove(route.fullPath);
 | 
	
		
			
				|  |  | +                  router.replace(`/bednetQuote/detail?id=${res.bednet.bednetid}`);
 | 
	
		
			
				|  |  | +                } else {
 | 
	
		
			
				|  |  | +                  router.replace("/bednetQuote");
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  |                }
 | 
	
		
			
				|  |  |                setTimeout(() => {
 | 
	
		
			
				|  |  |                  if (res.message) {
 | 
	
	
		
			
				|  | @@ -570,6 +591,7 @@ const orderDefaultAction: detailAction[] = [
 | 
	
		
			
				|  |  |  ];
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  onMounted(async () => {
 | 
	
		
			
				|  |  | +  console.log("onMounted bednet route.query :>> ", route.query, props);
 | 
	
		
			
				|  |  |    initParams.value.arg_bednetid = Number(route.query?.id ?? 0);
 | 
	
		
			
				|  |  |    initParamsMx.value.arg_bednetid = Number(route.query?.id ?? 0);
 | 
	
		
			
				|  |  |    if (!Number(route.query?.id)) {
 | 
	
	
		
			
				|  | @@ -577,13 +599,17 @@ onMounted(async () => {
 | 
	
		
			
				|  |  |        defaultColumnsValue.value.deptid = route.query?.deptid;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  | -  // defaultColumnsValue.value.sponge_mtrlid = 0;
 | 
	
		
			
				|  |  | -  // console.log(
 | 
	
		
			
				|  |  | -  //   "donMounted efaultColumnsValue.value :>> ",
 | 
	
		
			
				|  |  | -  //   defaultColumnsValue.value,
 | 
	
		
			
				|  |  | -  //   Object.keys(route.query).includes("id"),
 | 
	
		
			
				|  |  | -  //   route.query?.id
 | 
	
		
			
				|  |  | -  // );
 | 
	
		
			
				|  |  | +  console.log('typeof props?.bednetid != "undefined" :>> ', typeof props?.bednetid != "undefined");
 | 
	
		
			
				|  |  | +  if (typeof props?.bednetid != "undefined") {
 | 
	
		
			
				|  |  | +    // 直接读取
 | 
	
		
			
				|  |  | +    orderStatus.value = props.state;
 | 
	
		
			
				|  |  | +    initParams.value.arg_bednetid = props.bednetid;
 | 
	
		
			
				|  |  | +    initParamsMx.value.arg_bednetid = props.bednetid;
 | 
	
		
			
				|  |  | +    defaultColumnsValue.value.deptid = props?.deptid;
 | 
	
		
			
				|  |  | +    // mainData.value = props.data;
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  console.log("initParams.value :>> ", initParams.value);
 | 
	
		
			
				|  |  |  });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  /**
 | 
	
	
		
			
				|  | @@ -639,83 +665,32 @@ const funcAfterMound = async (data: any) => {
 | 
	
		
			
				|  |  |      tableProps_mx.value.editConfig.enabled = true;
 | 
	
		
			
				|  |  |      tableProps_spring.value.editConfig.enabled = true;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    let res = await getBedNetAreaList({});
 | 
	
		
			
				|  |  | +    // let res = await getBedNetAreaList({});
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    if (res.datatable.length) {
 | 
	
		
			
				|  |  | -      AreaList.value = res.datatable;
 | 
	
		
			
				|  |  | -    }
 | 
	
		
			
				|  |  | +    // if (res.datatable.length) {
 | 
	
		
			
				|  |  | +    //   AreaList.value = res.datatable;
 | 
	
		
			
				|  |  | +    // }
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |    // ifAfterMound.value = true;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    console.log(
 | 
	
		
			
				|  |  |      "onMounted detail sale start LjDetailRef.value.mainData :>> ",
 | 
	
		
			
				|  |  | -    AreaList.value,
 | 
	
		
			
				|  |  | +    // AreaList.value,
 | 
	
		
			
				|  |  |      tableProps_mx.value,
 | 
	
		
			
				|  |  |      LjDetailRef.value
 | 
	
		
			
				|  |  |    );
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    if (orderStatus.value != "new") {
 | 
	
		
			
				|  |  | -    // const { enumMap, _mainData } = LjDetailRef.value;
 | 
	
		
			
				|  |  | -    // console.log("enumMap :>> ", enumMap, _mainData);
 | 
	
		
			
				|  |  | -    // let _enum = enumMap.get("mattresstypeid");
 | 
	
		
			
				|  |  | -    // console.log("_enum :>> ", _enum);
 | 
	
		
			
				|  |  | -    // if (_enum) {
 | 
	
		
			
				|  |  | -    //   mattresstypeEnum.value = _enum.find(t => t.value == _mainData.mattresstypeid);
 | 
	
		
			
				|  |  | -    //   console.log("mattresstypeEnum :>> ", mattresstypeEnum);
 | 
	
		
			
				|  |  | -    // }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    // let itmshow = fabricMxTabList.value.find(t => t.visible());
 | 
	
		
			
				|  |  | -    // fabricMxTabs.value = itmshow.name;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    // let res = await getData_mx(initParams.value);
 | 
	
		
			
				|  |  | -    // oriMxData.value = dataCallback(res);
 | 
	
		
			
				|  |  | -    // oriMxData.value.list = oriMxData.value.list.map(t => {
 | 
	
		
			
				|  |  | -    //   t.formulakind = Number(t.formulakind);
 | 
	
		
			
				|  |  | -    //   t.thickness = Number(t.thickness);
 | 
	
		
			
				|  |  | -    //   return t;
 | 
	
		
			
				|  |  | -    // });
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    // getMattressType();
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    // let res = await getDataMxAdd(initParamsMx.value);
 | 
	
		
			
				|  |  | -    // let result = dataCallbackMx(res);
 | 
	
		
			
				|  |  | -    // columnsMx.value = result.tableinfo.columns;
 | 
	
		
			
				|  |  | -    // bednetMxData.value = result.list;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    // res = await getDataMxSpring(initParamsMx.value);
 | 
	
		
			
				|  |  | -    // result = dataCallbackMx(res);
 | 
	
		
			
				|  |  | -    // columnsMxSpring.value = result.tableinfo.columns;
 | 
	
		
			
				|  |  | -    // bednetMxSpringData.value = result.list;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |      await reload_dw2(data, (params: any) => {
 | 
	
		
			
				|  |  |        const { mx, spring } = params;
 | 
	
		
			
				|  |  |        console.log("reload_dw2 22result :>> ", params);
 | 
	
		
			
				|  |  |        bednetMxData.value = mx.list;
 | 
	
		
			
				|  |  |        bednetMxSpringData.value = spring.list;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -      // vxeTableMxSpringRef.value.refresh();
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      nextTick(() => {
 | 
	
		
			
				|  |  |        gotoSummy(8000);
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  | -    // bednetMxData.value = bednetMxData.value.map(t => {
 | 
	
		
			
				|  |  | -    //   // t.formulakind = Number(t.formulakind);
 | 
	
		
			
				|  |  | -    //   // t.thickness = Number(t.thickness);
 | 
	
		
			
				|  |  | -    //   // t.qty = Number(t.qty);
 | 
	
		
			
				|  |  | -    //   return t;
 | 
	
		
			
				|  |  | -    // });
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    // console.log("bednetMxData after:>> ", bednetMxData.value, orderStatus.value, vxeTableMxRef.value.tableColumns);
 | 
	
		
			
				|  |  | -    // nextTick(() => {
 | 
	
		
			
				|  |  | -    //   vxeTableMxRef.value.refresh();
 | 
	
		
			
				|  |  | -    // });
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    // res = await getDataMxSpring(initParams.value);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    // funcChaifenTab();
 | 
	
		
			
				|  |  | -    // funcGetFabricMxShowData(itmshow.name);
 | 
	
		
			
				|  |  | -    // console.log("funcAfterMound resData :>> ", fabricMxData.value);
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  };
 | 
	
		
			
				|  |  |  </script>
 |