| | |
| | | } |
| | | async function getListByPageAsync(params: any) { |
| | | const data = await defHttp.post( |
| | | { url: Api.QueryUrl, params }, |
| | | { url: Api.QueryUrl, params,timeout:30000 }, |
| | | { |
| | | isTransformResponse: false, |
| | | }, |
| | |
| | | default: () => [], |
| | | }, |
| | | |
| | | halfCheckedKeys: { |
| | | type: [Array, Object] as PropType<KeyType[]>, |
| | | default: () => [], |
| | | }, |
| | | |
| | | beforeRightClick: { |
| | | type: Function as PropType<(...arg: any) => Promise<ContextMenuItem[] | ContextMenuOptions>>, |
| | | default: undefined, |
| | |
| | | import { columns, searchFormSchema } from './Material.data'; |
| | | import { DeleteMaterial, getMaterialListByPage } from '../../../../api/tigerapi/bas/MaterialInfo'; |
| | | import { useModal } from '/@/components/Modal'; |
| | | import { getListByPage } from '/@/api/tigerapi/system'; |
| | | import { useGo } from '/@/hooks/web/usePage'; |
| | | |
| | | const go = useGo(); |
| | |
| | | const [registerModal, { openModal: openMaterialModal }] = useModal(); |
| | | const [registerTable, { reload }] = useTable({ |
| | | title: 'ç©æå表', |
| | | api: getMaterialListByPage, |
| | | api: getListByPage, |
| | | searchInfo: { TABLE_NAME: 'BAS_ITEM' }, |
| | | columns, |
| | | formConfig: { |
| | | labelWidth: 120, |
| | |
| | | * @description: 跳转产åå·¥èºç»å®é¡µé¢ |
| | | * @param {*} record |
| | | * @return {*} |
| | | */ |
| | | */ |
| | | function handleBinding(record: Recordable) { |
| | | const id = { |
| | | ID: record.ID, |
| | |
| | | Title: `产å[${record.ITEM_CODE}]å·¥èºç»å®`, |
| | | colSlots: [], |
| | | crudColSlots: [], |
| | | dense: true, |
| | | pageTitle: `产åå·¥èºç»å®`, |
| | | pageContent: `è¿éæ¯ç®¡ç产åçå·¥èºç»å®ï¼ä¸ä¸ªäº§åå¯ä»¥ç»å®å¤ä¸ªå·¥èºè·¯çº¿`, |
| | | }; |
| | | go(`/ProdRouteBinding/CP/${encodeURI(JSON.stringify(id))}`); |
| | | // let obj = JSON.stringify(id); |
| | | // push({ |
| | | // path: '/ProdRouteBinding', |
| | | // state: {obj}, //HTML5 History API çä¼ åï¼åæ°éèä¸å¨å°åæ æ¾ç¤ºï¼historyï¼ |
| | | // }) |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- |
| | | * @Description: å·¥èºè·¯çº¿æ·»å é¡µé¢ |
| | | * @Author: Ben Lin |
| | | * @version: |
| | | * @Date: 2024-06-20 12:13:27 |
| | | * @LastEditors: Ben Lin |
| | | * @LastEditTime: 2024-06-21 00:11:00 |
| | | --> |
| | | <template> |
| | | <Card title="æä½"> |
| | | <CardGrid v-for="item in navItems" :key="item.title" @click="changeItem(item.action)"> |
| | | <span class="flex flex-col items-center"> |
| | | <Icon :icon="item.icon" :color="item.color" size="20" /> |
| | | <span class="text-md mt-2 truncate">{{ item.title }}</span> |
| | | </span> |
| | | </CardGrid> |
| | | </Card> |
| | | <GeneralModal @register="register" @success="handleSuccess"></GeneralModal> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import { Card, CardGrid } from 'ant-design-vue'; |
| | | import Icon from '@/components/Icon/Icon.vue'; |
| | | import { RouteToProd } from '/@/api/tigerapi/mes/router'; |
| | | import GeneralModal from '/@/views/components/GeneralModal.vue'; |
| | | import { useModal } from '/@/components/Modal'; |
| | | import { useI18n } from '/@/hooks/web/useI18n'; |
| | | |
| | | const { t } = useI18n(); |
| | | const [register, { openModal }] = useModal(); |
| | | interface NavItem { |
| | | title: string; |
| | | icon: string; |
| | | color: string; |
| | | url: string; |
| | | action: string; |
| | | } |
| | | // å¿«æ·å¯¼èª |
| | | const navItems: NavItem[] = [ |
| | | { |
| | | title: 'æ·»å å·¥èºè·¯çº¿', |
| | | icon: 'ion:home-outline', |
| | | color: '#1fdaca', |
| | | url: '/workbench', |
| | | action: 'addRoute', |
| | | }, |
| | | { |
| | | title: 'æ·»å 客æ·', |
| | | icon: 'materialreq|svg', |
| | | color: '#bf0c2c', |
| | | url: '/materialreq', |
| | | action: 'addCustomer', |
| | | }, |
| | | // { |
| | | // title: 'éå®åºåºå', |
| | | // icon: 'Out|svg', |
| | | // color: '#e18525', |
| | | // url: '/saleoutorder', |
| | | // }, |
| | | // { |
| | | // title: 'å®å·¥å
¥åºå', |
| | | // icon: 'In|svg', |
| | | // color: '#3fb27f', |
| | | // url: '/finishedwarehouse', |
| | | // }, |
| | | // { |
| | | // title: 'ç产éæå', |
| | | // icon: 'materialret|svg', |
| | | // color: '#4daf1bc9', |
| | | // url: '/materialret', |
| | | // }, |
| | | // { |
| | | // title: 'çç¹å', |
| | | // icon: 'inventory|svg', |
| | | // color: '#00d8ff', |
| | | // url: '/inventory', |
| | | // }, |
| | | // { |
| | | // title: 'è°æ¨å', |
| | | // icon: 'transfer|svg', |
| | | // color: '#00d8ff', |
| | | // url: '/transfer', |
| | | // }, |
| | | // { |
| | | // title: '宿¶åºå', |
| | | // icon: 'WmsItem|svg', |
| | | // color: '#00d8ff', |
| | | // url: '/WmsItem', |
| | | // }, |
| | | ]; |
| | | function changeItem(action) { |
| | | if (action == 'addRoute') { |
| | | openModal(true, { |
| | | title: 'å·¥èºè·¯çº¿å表', |
| | | schemas: [ |
| | | { |
| | | field: 'ROT_CODE', |
| | | component: 'Input', |
| | | label: 'å·¥èºè·¯çº¿ç¼ç ', |
| | | colProps: { |
| | | span: 12, |
| | | }, |
| | | }, |
| | | ], |
| | | ItemColumns: [ |
| | | { |
| | | title: t('å·¥èºè·¯çº¿ç¼ç '), |
| | | dataIndex: 'ROT_CODE', |
| | | resizable: true, |
| | | sorter: true, |
| | | width: 200, |
| | | }, |
| | | { |
| | | title: t('å·¥èºè·¯çº¿åç§°'), |
| | | dataIndex: 'ROT_NAME', |
| | | resizable: true, |
| | | sorter: true, |
| | | width: 180, |
| | | }, |
| | | ], |
| | | tableName: 'MES_ROUTE', |
| | | rowKey: 'ROT_CODE', |
| | | returnFieldName: 'ROUTE_CODE', //è¿åå¼è¦èµå¼çåæ®µåç§° |
| | | searchInfo: { TABLE_NAME: 'MES_ROUTE' }, |
| | | }); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @description: 鿩工èºè·¯çº¿æåè¿åæ¹æ³ |
| | | * @param {*} d |
| | | * @param {*} u |
| | | * @return {*} |
| | | */ |
| | | function handleSuccess(d, u) { |
| | | let codes = d.values.id.split(','); |
| | | let eintity: any[] = []; |
| | | var i; |
| | | for (i = 0; i < codes.length; i++) { |
| | | RouteToProd({ rotId: codes[i], prodCode: 'K5811AA015007' }).then(() => {}); |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <template> |
| | | <PageWrapper dense contentFullHeight fixedHeight contentClass="flex"> |
| | | <PageWrapper |
| | | :dense="dense" |
| | | contentFullHeight |
| | | fixedHeight |
| | | contentClass="flex" |
| | | :title="pageTitle" |
| | | :content="pageContent" |
| | | @back="goBack" |
| | | > |
| | | <GeneralTree |
| | | class="w-1/4 xl:w-1/5" |
| | | @select="handleSelect" |
| | |
| | | /><!-- |
| | | add |
| | | @handle-add="handleAdd" --> |
| | | <div class="w-3/4 xl:w-4/5"></div> |
| | | <div class="w-3/4 xl:w-4/5 p-5"> |
| | | <RouteAction v-if="entityName == 'ProdRouteBinding'" /> |
| | | </div> |
| | | <!-- <BasicTable class="w-3/4 xl:w-4/5" @register="registerTable"> |
| | | <template #toolbar> |
| | | <a-button type="primary" @click="handleCreate" preIcon="add_02|svg"> æ°å¢ </a-button> |
| | |
| | | </template> |
| | | </template> |
| | | </BasicTable> --> |
| | | <normalDrawer @register="registerDrawer" @success="handleSuccess" /> |
| | | <!-- <normalDrawer @register="registerDrawer" @success="handleSuccess" /> --> |
| | | <CustModal |
| | | @register="registerCust" |
| | | @success="custSuccess" |
| | |
| | | import { useModal } from '@/components/Modal'; |
| | | import normalDrawer from '../normalDrawer.vue'; |
| | | import GeneralModal from '/@/views/components/GeneralModal.vue'; |
| | | import RouteAction from './RouteAction.vue'; |
| | | import CustModal from '/@/views/components/CustModal.vue'; |
| | | import { |
| | | GetActionsData, |
| | |
| | | OpenCustModal, |
| | | fetchTreeData, |
| | | getFormSchema, |
| | | getHomeUrl, |
| | | getOthersValues, |
| | | } from '../data'; |
| | | import { onMounted, reactive, ref } from 'vue'; |
| | |
| | | import { TreeItem } from '/@/components/TigerTree'; |
| | | import { createIconByType } from '../data'; |
| | | import { RouteToProd } from '/@/api/tigerapi/mes/router'; |
| | | import { useTabs } from '/@/hooks/web/useTabs'; |
| | | import { useTabs } from '/@/hooks/web/useTabs'; |
| | | import { isNullOrUnDef } from '/@/utils/is'; |
| | | import { useGo } from '/@/hooks/web/usePage'; |
| | | |
| | | defineOptions({ name: 'DeptManagement' }); |
| | | |
| | | const go = useGo(); |
| | | const route = useRoute(); |
| | | const { setTitle } = useTabs(); |
| | | const objParams = ref(JSON.parse(decodeURI(route.params?.id as string))); |
| | | const objParams = ref(JSON.parse(decodeURI(route.params?.id as string))); //ref(JSON.parse(history.state.obj)) |
| | | const entityName = ref(objParams.value.Name); |
| | | const formSchemas = ref({}); //å¼¹åºæ¡æé«çº§é¡µé¢å¤è¡¨åç»æ |
| | | const useModalData = ref({}); //表åä¸ææ§½æ¸²ææé®æå¼æ¨¡ææ¡useModalæ¹æ³ |
| | |
| | | const treeData = ref<TreeItem[]>([]); |
| | | const title = ref(''); |
| | | const fieldNames = ref({}); |
| | | const dense = isNullOrUnDef(objParams.value.dense) ? ref(false) : ref(objParams.value.dense); |
| | | const pageTitle = ref(objParams.value.pageTitle); |
| | | const pageContent = ref(objParams.value.pageContent); |
| | | const others = ref(getOthersValues(entityName.value, objParams.value.CODE, objParams.value.ID)); |
| | | const [registerCust, { openModal: openCustomModal, closeModal }] = useModal(); |
| | | const [registerItemAdd, { openModal: openItemModal }] = useModal(); |
| | |
| | | * @description: è·åæ å½¢æ°æ® |
| | | * @param {*} type |
| | | * @return {*} |
| | | */ |
| | | */ |
| | | async function fetch(type: string) { |
| | | //æ ¹æ®typeè·åæ å½¢æ°æ® |
| | | const data = await fetchTreeData(type, objParams.value.CODE); |
| | | title.value = data.title; |
| | | treeData.value = data.treeData; |
| | | fieldNames.value = data.fieldNames; |
| | | } |
| | | |
| | | /** |
| | | * @description: 页é¢å·¦ä¾§ç¹å»è¿å龿¥æ¶çæä½ |
| | | * @return {*} |
| | | */ |
| | | function goBack() { |
| | | go(getHomeUrl(entityName.value)); |
| | | } |
| | | |
| | | // function handleAdd(){ |
| | |
| | | * @param {*} params |
| | | * @param {*} type |
| | | * @return {*} |
| | | */ |
| | | */ |
| | | function createIcon(params: Recordable<any>) { |
| | | return createIconByType(params, entityName.value); |
| | | } |
| | |
| | | // others: others.value, |
| | | // }); |
| | | // }); |
| | | RouteToProd({rotId: 'e4712192f75b465585107fdcd13d8003', prodCode: 'K5019AA013517'}).then(() => { |
| | | |
| | | }); |
| | | RouteToProd({ rotId: 'e4712192f75b465585107fdcd13d8003', prodCode: 'K5019AA013517' }).then( |
| | | () => {}, |
| | | ); |
| | | } |
| | | |
| | | // function handleEdit(record: Recordable) { |
| | |
| | | // console.log(record); |
| | | // } |
| | | |
| | | function handleSelect(deptId = '') { |
| | | function handleSelect(deptId = '', info) { |
| | | searchInfo.deptId = deptId; |
| | | reload(); |
| | | // reload(); |
| | | } |
| | | |
| | | function handleSuccess() { |
| | | reload(); |
| | | } |
| | | // function handleSuccess() { |
| | | // reload(); |
| | | // } |
| | | |
| | | /** |
| | | * @description: å¼¹åºæ¡ç¡®å®è¿å |
| | |
| | | * @return {*} |
| | | */ |
| | | function custSuccess(d) { |
| | | reload(); |
| | | // reload(); |
| | | } |
| | | |
| | | /** |
| | |
| | | case 'BAS_LABEL_VAR': |
| | | url = `/BAS_LABEL_TEMP/LC/${encodeURI(JSON.stringify({ ID: 'BAS_LABEL_TEMP', colSlots: [], crudColSlots: [] }))}`; |
| | | break; |
| | | case 'ProdRouteBinding': |
| | | url = `/MaterialInfo`; |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | |
| | | let prodTreeData = await GetRoutePTree(itemCode); |
| | | data.treeData = convertToTree(prodTreeData, 'pid', 'id', 'root'); |
| | | data.title = 'å·¥èºè·¯çº¿'; |
| | | data.fieldNames = { key: 'id', title: 'name' } |
| | | data.fieldNames = { key: 'id', title: 'name' }; |
| | | break; |
| | | case 'BAS_PKG_DTL': |
| | | break; |
| | |
| | | } |
| | | //console.log(list,11); |
| | | data.record.menu = list2; |
| | | halfCheckedKeys.value = list; |
| | | expandedKeys.value = list; |
| | | await getRuleOrg(data); |
| | | await getRuleWh(data); |
| | |
| | | } |
| | | }); |
| | | |
| | | //è·åè§è²å¯¹åºçç»ç» |
| | | /** |
| | | * @description: è·åè§è²å¯¹åºçç»ç» |
| | | * @param {*} data |
| | | * @return {*} |
| | | */ |
| | | async function getRuleOrg(data) { |
| | | const orgList = await getROList(data.record.ID); |
| | | var hfList = []; |
| | |
| | | } |
| | | } |
| | | data.record.org = hfList; |
| | | halfCheckedKeysOrg.value = list; |
| | | expandedKeysOrg.value = list; |
| | | } |
| | | |
| | | //è·åè§è²å¯¹åºçä»åº |
| | | /** |
| | | * @description: è·åè§è²å¯¹åºçä»åº |
| | | * @param {*} data |
| | | * @return {*} |
| | | */ |
| | | async function getRuleWh(data) { |
| | | const whList = await getWhList(data.record.ID); |
| | | var hfList = []; |
| | |
| | | } |
| | | } |
| | | data.record.wh = hfList; |
| | | halfCheckedKeysWh.value = list; |
| | | expandedKeysWh.value = list; |
| | | } |
| | | |
| | | /** |
| | | * @description: è·åè§è²å¯¹åºçç产 |
| | | * @param {*} data |
| | | * @return {*} |
| | | */ |
| | | async function getRuleProd(data) { |
| | | const prodList = await getProdList(data.record.ID); |
| | | var hfList = []; |
| | |
| | | } |
| | | } |
| | | data.record.fty = hfList; |
| | | halfCheckedKeysFty.value = list; |
| | | expandedKeysFty.value = list; |
| | | } |
| | | |