| | |
| | | import { onMounted, ref } from 'vue'; |
| | | import { getRoleButtons } from '/@/api/sys/menu'; |
| | | import { isNullOrEmpty } from '/@/utils/is'; |
| | | import { useUserStore } from '/@/store/modules/user'; |
| | | |
| | | const go = useGo(); |
| | | const { currentRoute } = useRouter(); |
| | |
| | | const [registerTable, { reload }] = useTable({ |
| | | title: '物料列表', |
| | | api: getListByPage, |
| | | searchInfo: { TABLE_NAME: 'BAS_ITEM' }, |
| | | searchInfo: { |
| | | TABLE_NAME: 'BAS_ITEM', |
| | | option: { |
| | | //根据据点查询,必需带这个参数 |
| | | UserId: useUserStore().getUserInfo.userId, |
| | | ByOrg: true, |
| | | CurOrg: useUserStore().getUserInfo.orgCode, |
| | | }, |
| | | }, |
| | | columns, |
| | | formConfig: { |
| | | labelWidth: 120, |
| | |
| | | }; |
| | | } |
| | | } |
| | | if(x['DO_METHOD'] == 'goRule'){ |
| | | _click = goRule.bind(null, record); |
| | | } |
| | | actionItem.push({ |
| | | icon: isNullOrEmpty(x['ICON_URL']) ? url : x['ICON_URL'], |
| | | onClick: _click, |
| | | color: color, |
| | | popConfirm: _popConfirm, |
| | | name: '' |
| | | }); |
| | | } |
| | | }); |
| | |
| | | }); |
| | | } |
| | | |
| | | function goRule(record: Recordable) { |
| | | const id = { |
| | | CODE: record['ITEM_CODE'], |
| | | ID: record['ID'], |
| | | Name: 'BAS_ITEM_CUST', |
| | | SessionName: 'BAS_ITEM_CUST_update', |
| | | Title: `编辑物料条码规则:${record['ITEM_CODE']}`, |
| | | IsExist: 'RULE_CODE', |
| | | IsID: false, |
| | | crudColSlots: {BAS_ITEM_CUST:['BAS_CUSTOMER1add', 'BAS_CODE_RULE1add']} /* 增删改表单字段的插槽列表,一般用于弹出选择框按钮 */, |
| | | drawers: [ |
| | | { |
| | | name: 'BAS_ITEM_CUST', |
| | | dataType: 'BAS_ITEM_CUST', //如果这里给了值,则会替换name的实体名去查义数据库 |
| | | code: 'ITEM_CODE', |
| | | type: 'one', |
| | | keyName: 'BAS_ITEM_CUST', |
| | | order: '', |
| | | }, |
| | | ], //drawers是右边弹出增改侧框的名字列表 |
| | | }; |
| | | // 将对象转换为JSON字符串并保存到sessionStorage |
| | | sessionStorage.removeItem(`${id.SessionName}_params`); |
| | | sessionStorage.setItem(`${id.SessionName}_params`, encodeURI(JSON.stringify(id))); |
| | | go(`/BAS_ITEM_CUST/High/${encodeURI(JSON.stringify({ sName: id.SessionName, Name: id.Name }))}`); |
| | | } |
| | | |
| | | onMounted(async () => { |
| | | buttons.value = await getRoleButtons(currentRoute.value.meta.menuCode as string); |
| | | }); |