¶Ô±ÈÐÂÎļþ |
| | |
| | | import { buildUUID } from '../../../../utils/uuid'; |
| | | //import { ApiAction, ApiActionPage } from '../../model/baseModel'; |
| | | import { genAction, Api } from '../../system'; |
| | | import { useUserStore } from '/@/store/modules/user'; |
| | | import { defHttp } from '/@/utils/http/axios'; |
| | | import { isNullOrEmpty } from '/@/utils/is'; |
| | | import { formatToDateTime } from '/@/utils/dateUtil'; |
| | | |
| | | /* |
| | | * è·åé¡èè¶æ°´ä¿¡æ¯ |
| | | */ |
| | | |
| | | export const getsolderListByPage = async (params: any) => { |
| | | let order = '' |
| | | if (params.order != undefined) { |
| | | order = params.order == 'descend' ? (params.field + ' desc') : params.field |
| | | } |
| | | let sqlcmd = '1=1'; |
| | | if (params?.UPN != undefined && params?.UPN != '') { |
| | | sqlcmd += " And UPN like '%" + params?.UPN + "%'"; |
| | | } |
| | | |
| | | let option ={ |
| | | UserId:useUserStore().getUserInfo.userId as string, |
| | | ByOrg:true, |
| | | OrgCode:useUserStore().getUserInfo.orgCode as string |
| | | } |
| | | if (!isNullOrEmpty(params.page)) { |
| | | const usParams = genAction('SMT_SOLDER', { |
| | | QueryAble_T: '', |
| | | where: sqlcmd, |
| | | order: order, |
| | | page: { |
| | | pageAble_T: 'string', |
| | | draw: 1, |
| | | pageIndex: params.page, |
| | | pageSize: params.pageSize, |
| | | } |
| | | }); |
| | | return getFinishedwarehouseListByPageAsync(usParams); |
| | | } else { |
| | | const usParams = genAction('SMT_SOLDER', { |
| | | QueryAble_T: '', |
| | | where: sqlcmd, |
| | | option |
| | | },option); |
| | | return getFinishedwarehouseListByPageAsync(usParams); |
| | | } |
| | | // const rParams = genActionPage('BIZ_ERP_PROD_IN', sqlcmd, params.page, params.pageSize,option); |
| | | // return getFinishedwarehouseListByPageAsync(rParams); |
| | | }; |
| | | async function getFinishedwarehouseListByPageAsync(params: any) { |
| | | const data = await defHttp.post( |
| | | { url: Api.QueryUrl, params }, |
| | | { |
| | | isTransformResponse: false, |
| | | }, |
| | | ); |
| | | const model = { |
| | | items: data.Data.page.data, |
| | | total: data.Data.page.totals, |
| | | }; |
| | | return model; |
| | | } |
| | | //æ°å¢é¡èè¶æ°´ä¿¡æ¯ |
| | | export const SaveSolder = async (params: Recordable, isUpdate: boolean) => { |
| | | const Solderitem: any = { |
| | | ID: params.ID, |
| | | CREATE_TIME: params?.CREATE_TIME, |
| | | CREATE_USER: params?.CREATE_USER, |
| | | UPDATE_TIME: params?.UPDATE_TIME, |
| | | UPDATE_USER: params?.UPDATE_USER, |
| | | GHOST_ROW: params?.GHOST_ROW, |
| | | AUTH_ORG: params?.AUTH_ORG, |
| | | AUTH_PROD: params?.AUTH_PROD, |
| | | AUTH_WH: params?.AUTH_WH, |
| | | UPN: params.UPN, |
| | | CPN: params.CPN, |
| | | TYPE: params.TYPE, |
| | | STATUS: params?.STATUS, |
| | | EXP_DATE: params.EXP_DATE, |
| | | LINE_CODE: params?.LINE_CODE, |
| | | IS_OUT: params?.IS_OUT, |
| | | OUT_DATE: params?.OUT_DATE, |
| | | OUT_USER: params?.OUT_USER, |
| | | IS_SEND: params?.IS_SEND, |
| | | SEND_DATE: params?.SEND_DATE, |
| | | SEND_USER: params?.SEND_USER, |
| | | IS_OPEN: params?.IS_OPEN, |
| | | OPEN_DATE: params?.OPEN_DATE, |
| | | OPEN_USER: params?.OPEN_USER, |
| | | FIRST_DATE: params?.FIRST_DATE, |
| | | FIRST_USER: params?.FIRST_USER, |
| | | STIR_SEQ: params?.STIR_SEQ, |
| | | STIR_DATE: params?.STIR_DATE, |
| | | STIR_USER: params?.STIR_USER, |
| | | REFREEZE_SEQ: params?.REFREEZE_SEQ, |
| | | REFREEZE_DATE: params?.REFREEZE_DATE, |
| | | REFREEZE_USER: params?.REFREEZE_USER, |
| | | REMARK: params?.REMARK, |
| | | |
| | | }; |
| | | let data; |
| | | |
| | | if (isUpdate) { |
| | | Solderitem.STATUS=6; |
| | | const time = new Date(); |
| | | Solderitem.UPDATE_TIME = formatToDateTime(time); |
| | | Solderitem.UPDATE_USER = useUserStore().getUserInfo.userId as string; |
| | | // regionitem.ORG_CODE = useUserStore().getUserInfo.orgCode as string; |
| | | // regionitem.AUTH_ORG = useUserStore().getUserInfo.orgCode as string; |
| | | data = await defHttp.post( |
| | | { url: Api.UpdateEntity, params: genAction('SMT_SOLDER', Solderitem) }, |
| | | { |
| | | errorMessageMode: 'none', |
| | | isTransformResponse: false, |
| | | }, |
| | | ); |
| | | } else { |
| | | // const usParams = genAction( |
| | | // 'SMT_SOLDER', |
| | | // "REGION_CODE='" + params.REGION_CODE + "'AND AUTH_ORG='" + regionitem.ORG_CODE + "'", |
| | | // ); |
| | | //var check = await isExist(usParams); |
| | | //console.log('check',check) |
| | | //if (!check.Data) { |
| | | Solderitem.ID = buildUUID(); //çæGUID |
| | | Solderitem.UPDATE_TIME = formatToDateTime(new Date()); |
| | | Solderitem.CREATE_USER = useUserStore().getUserInfo.userId as string; |
| | | Solderitem.UPDATE_USER = useUserStore().getUserInfo.userId as string; |
| | | // regionitem.ORG_CODE = useUserStore().getUserInfo.orgCode as string; |
| | | // regionitem.AUTH_ORG = useUserStore().getUserInfo.orgCode as string; |
| | | data = await defHttp.post( |
| | | { url: Api.AddEntity, params: genAction('SMT_SOLDER', Solderitem) }, |
| | | { |
| | | errorMessageMode: 'none', |
| | | isTransformResponse: false, |
| | | }, |
| | | ); |
| | | //} else { |
| | | // return check.Message; |
| | | //return 'éå¤äº'; |
| | | //} |
| | | } |
| | | return data; |
| | | }; |
| | | //䏿å表 |
| | | // STATUSs åæ®ç¶æ |
| | | export const optionsListApi = async (params: Recordable) => { |
| | | const usParams = genAction('SMT_SOLDER+STATUSs', ''); |
| | | return await defHttp.post( |
| | | { url: Api.urlQueryEnum, params: usParams }, |
| | | { |
| | | errorMessageMode: 'none', |
| | | isTransformResponse: false, |
| | | // apiUrl: globSetting.taskApiUrl |
| | | }, |
| | | ); |
| | | }; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { buildUUID } from '../../../../utils/uuid'; |
| | | //import { ApiAction, ApiActionPage } from '../../model/baseModel'; |
| | | import { genAction, Api } from '../../system'; |
| | | import { useUserStore } from '/@/store/modules/user'; |
| | | import { defHttp } from '/@/utils/http/axios'; |
| | | import { isNullOrEmpty } from '/@/utils/is'; |
| | | import { formatToDateTime } from '/@/utils/dateUtil'; |
| | | |
| | | /* |
| | | * è·åé¡èè¶æ°´ä¿¡æ¯ |
| | | */ |
| | | |
| | | export const getsolderListByPage = async (params: any) => { |
| | | let order = '' |
| | | if (params.order != undefined) { |
| | | order = params.order == 'descend' ? (params.field + ' desc') : params.field |
| | | } |
| | | let sqlcmd = '1=1'; |
| | | if (params?.UPN != undefined && params?.UPN != '') { |
| | | sqlcmd += " And UPN like '%" + params?.UPN + "%'"; |
| | | } |
| | | |
| | | let option ={ |
| | | UserId:useUserStore().getUserInfo.userId as string, |
| | | ByOrg:true, |
| | | OrgCode:useUserStore().getUserInfo.orgCode as string |
| | | } |
| | | if (!isNullOrEmpty(params.page)) { |
| | | const usParams = genAction('SMT_SOLDER_HIS', { |
| | | QueryAble_T: '', |
| | | where: sqlcmd, |
| | | order: order, |
| | | page: { |
| | | pageAble_T: 'string', |
| | | draw: 1, |
| | | pageIndex: params.page, |
| | | pageSize: params.pageSize, |
| | | } |
| | | }); |
| | | return getFinishedwarehouseListByPageAsync(usParams); |
| | | } else { |
| | | const usParams = genAction('SMT_SOLDER_HIS', { |
| | | QueryAble_T: '', |
| | | where: sqlcmd, |
| | | option |
| | | },option); |
| | | return getFinishedwarehouseListByPageAsync(usParams); |
| | | } |
| | | // const rParams = genActionPage('BIZ_ERP_PROD_IN', sqlcmd, params.page, params.pageSize,option); |
| | | // return getFinishedwarehouseListByPageAsync(rParams); |
| | | }; |
| | | async function getFinishedwarehouseListByPageAsync(params: any) { |
| | | const data = await defHttp.post( |
| | | { url: Api.QueryUrl, params }, |
| | | { |
| | | isTransformResponse: false, |
| | | }, |
| | | ); |
| | | const model = { |
| | | items: data.Data.page.data, |
| | | total: data.Data.page.totals, |
| | | }; |
| | | return model; |
| | | } |
| | | //䏿å表 |
| | | // STATUSs åæ®ç¶æ |
| | | export const optionsListApi = async (params: Recordable) => { |
| | | const usParams = genAction('SMT_SOLDER+STATUSs', ''); |
| | | return await defHttp.post( |
| | | { url: Api.urlQueryEnum, params: usParams }, |
| | | { |
| | | errorMessageMode: 'none', |
| | | isTransformResponse: false, |
| | | // apiUrl: globSetting.taskApiUrl |
| | | }, |
| | | ); |
| | | }; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <BasicModal width="700px" :height=300 v-bind="$attrs" @register="register" :title="t('æ·»å é¡èè¶æ°´è®°å½')" @ok="handleSubmit"> |
| | | <div style="width: 600px;height: 300px;" class="pt-24px pr-12px"> |
| | | <BasicForm @register="registerForm" :model="model" /> |
| | | </div> |
| | | </BasicModal> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { defineComponent, ref, nextTick, unref } from 'vue'; |
| | | import { BasicModal, useModalInner } from '/@/components/Modal'; |
| | | import { BasicForm, FormSchema, useForm } from '/@/components/Form/index'; |
| | | import { SaveSolder,optionsListApi } from '/@/api/tigerapi/mes/smt/solder'; |
| | | import { useI18n } from '/@/hooks/web/useI18n'; |
| | | import { useMessage } from '/@/hooks/web/useMessage'; |
| | | import{ useLocale } from '/@/locales/useLocale'; |
| | | |
| | | const { getLocale }=useLocale(); |
| | | |
| | | const { t } = useI18n(''); |
| | | const { createMessage } = useMessage(); |
| | | const schemas: FormSchema[] = [ |
| | | { |
| | | field: 'UPN', |
| | | component: 'Input', |
| | | label: 'UPN', |
| | | defaultValue: '', |
| | | colProps: { |
| | | span: 12, |
| | | }, |
| | | required: true, |
| | | }, |
| | | { |
| | | field: 'CPN', |
| | | component: 'Input', |
| | | label: 'CPNç¼ç ', |
| | | defaultValue: '', |
| | | colProps: { |
| | | span: 12, |
| | | }, |
| | | required: true, |
| | | }, |
| | | { |
| | | field: 'TYPE', |
| | | label: 'ç±»å', |
| | | component: 'ApiSelect', |
| | | colProps: { span: 12 }, |
| | | componentProps: { |
| | | api: optionsListApi, |
| | | resultField: 'Data', |
| | | labelField: unref(getLocale)=='zh_CN'?'Desc':'Name', |
| | | valueField: 'Value', |
| | | }, |
| | | }, |
| | | { |
| | | field: 'EXP_DATE', |
| | | component: 'DatePicker', |
| | | label: 'æææ', |
| | | colProps: { |
| | | span: 12, |
| | | }, |
| | | required: true, |
| | | }, |
| | | ]; |
| | | export default defineComponent({ |
| | | components: { BasicModal, BasicForm }, |
| | | props: { |
| | | userData: { type: Object }, |
| | | }, |
| | | emit: ['success', 'register'], |
| | | setup(_, { emit }) { |
| | | const modelRef = ref({}); |
| | | const [ |
| | | registerForm, |
| | | { |
| | | // setFieldsValue, |
| | | // setProps |
| | | validate, |
| | | }, |
| | | ] = useForm({ |
| | | labelWidth: 120, |
| | | schemas, |
| | | showActionButtonGroup: false, |
| | | actionColOptions: { |
| | | span: 24, |
| | | }, |
| | | }); |
| | | |
| | | const [register, { setModalProps, closeModal }] = useModalInner((data) => { |
| | | setModalProps({ confirmLoading: false }); |
| | | data && onDataReceive(data); |
| | | }); |
| | | |
| | | function onDataReceive(data) { |
| | | console.log('Data Received', data); |
| | | // æ¹å¼1; |
| | | // setFieldsValue({ |
| | | // field2: data.data, |
| | | // field1: data.info, |
| | | // }); |
| | | |
| | | // // æ¹å¼2 |
| | | modelRef.value = { field2: data.data, field1: data.info, SHELF_CODE: '', SHELF_NAME: '' }; |
| | | |
| | | // setProps({ |
| | | // model:{ field2: data.data, field1: data.info } |
| | | // }) |
| | | } |
| | | |
| | | // function handleVisibleChange(v) { |
| | | // v && props.userData && nextTick(() => onDataReceive(props.userData)); |
| | | // } |
| | | |
| | | async function handleSubmit() { |
| | | try { |
| | | const values = await validate(); |
| | | setModalProps({ confirmLoading: true }); |
| | | // TODO custom api |
| | | //æ·»å é¡èè¶æ°´è®°å½ |
| | | const apiAction = SaveSolder(values, unref(false)); |
| | | apiAction.then((action) => { |
| | | if (action) { |
| | | if (action.IsSuccessed) { |
| | | closeModal(); |
| | | createMessage.success(t('æ·»å æå')); |
| | | emit('success', { |
| | | isUpdate: unref(false), |
| | | values: { ...values, id: 0 }, |
| | | }); |
| | | } |
| | | } else { |
| | | createMessage.error(t('æ·»å 失败,代ç 已使ç¨')); |
| | | } |
| | | }); |
| | | } finally { |
| | | setModalProps({ confirmLoading: false }); |
| | | } |
| | | } |
| | | |
| | | return { register, schemas, registerForm, model: modelRef, handleSubmit, t }; |
| | | }, |
| | | }); |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <BasicTable @register="registerTable"> |
| | | <template #toolbar> |
| | | <a-button color="primary" @click="solderAdd"> æ°å¢ </a-button> |
| | | </template> |
| | | <template #action="{ record }"> |
| | | <TableAction :actions="[ |
| | | { |
| | | icon: 'clarity:info-standard-line', |
| | | tooltip: 'æ¥åº', |
| | | onClick: handleEdit.bind(null, record), |
| | | }, |
| | | ]" /> |
| | | </template> |
| | | </BasicTable> |
| | | <Loading :loading="compState.loading" :tip="compState.tip" /> |
| | | <!-- <WmsItemDrawer @register="registerDrawer" @success="handleSuccess" /> --> |
| | | <SolderModal @register="registerSolder" @success="handleSuccess" /> |
| | | </div> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import { reactive } from 'vue'; |
| | | import { aoaToSheetXlsx } from '/@/components/Excel'; |
| | | import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
| | | import SolderModal from './SolderModal.vue'; |
| | | import { useModal } from '/@/components/Modal'; |
| | | import { columns, searchFormSchema } from './smt_solder.data'; |
| | | import { getsolderListByPage } from '/@/api/tigerapi/mes/smt/solder'; |
| | | import { useGo } from '/@/hooks/web/usePage'; |
| | | import { Loading } from '/@/components/Loading'; |
| | | import { useMessage } from '/@/hooks/web/useMessage'; |
| | | import { useI18n } from '/@/hooks/web/useI18n'; |
| | | import { SaveSolder } from '/@/api/tigerapi/mes/smt/solder'; |
| | | |
| | | const { t } = useI18n(); |
| | | const { createMessage } = useMessage(); |
| | | const go = useGo(); |
| | | const compState = reactive({ |
| | | absolute: false, |
| | | loading: false, |
| | | tip: 'å è½½ä¸...', |
| | | }); |
| | | const [registerSolder, { openModal: openSolderModal }] = useModal(); |
| | | const [registerTable,{getForm,getPaginationRef,reload}] = useTable({ |
| | | title: 'é¡èè¶æ°´ä¿¡æ¯', |
| | | api: getsolderListByPage, |
| | | columns, |
| | | formConfig: { |
| | | labelWidth: 120, |
| | | schemas: searchFormSchema, |
| | | }, |
| | | actionColumn: { |
| | | width: 80, |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | slots: { customRender: 'action' }, |
| | | fixed: 'right', //undefined, |
| | | }, |
| | | ellipsis:true, |
| | | useSearchForm: true, |
| | | showTableSetting: false, |
| | | bordered: true, |
| | | showIndexColumn: false, |
| | | }); |
| | | let arr: any[] = []; |
| | | //å¯¼åº |
| | | // function aoaToExcel() { |
| | | // const totals = getPaginationRef().total |
| | | // if (totals < 30000) { |
| | | // arr = []; |
| | | // compState.loading = true; |
| | | // const col = getForm().getFieldsValue() |
| | | // getWmsItemSumByPage(col).then((res) => { |
| | | // res.items.forEach(element => { |
| | | // arr.push({ |
| | | // 'ä»åº': element.WH_CODE, |
| | | // 'ç©æä»£ç ': element.ITEM_CODE, |
| | | // 'ç©æåç§°': element.ITEM_NAME, |
| | | // 'æ°é': element.ZK_QTY, |
| | | // 'åä½': element.UNIT |
| | | // }); |
| | | // }); |
| | | // const arrHeader = columns.map((column) => column.title); |
| | | // const arrData = arr.map((item) => { |
| | | // return Object.keys(item).map((key) => item[key]); |
| | | // }); |
| | | // // ä¿è¯data顺åºä¸headerä¸è´ |
| | | // if(arr.length<30000){ |
| | | // aoaToSheetXlsx({ |
| | | // data: arrData, |
| | | // header: arrHeader, |
| | | // filename: 'æ±æ»æ¥è¡¨.xlsx', |
| | | // }); |
| | | // }else{ |
| | | // createMessage.error(t('å¯¼åºæ°æ®ä¸è½è¶
è¿ä¸ä¸æ¡ï¼å¦éè¦æ´å¤ç请è系管çå')); |
| | | // } |
| | | |
| | | // compState.loading = false; |
| | | |
| | | // }) |
| | | |
| | | // } else { |
| | | // createMessage.error(t('å¯¼åºæ°æ®ä¸è½è¶
è¿ä¸ä¸æ¡ï¼å¦éè¦æ´å¤ç请è系管çå')); |
| | | // } |
| | | |
| | | |
| | | // } |
| | | //跳转å°å®æ¶åºå |
| | | function handleEdit(record: any) { |
| | | //è·³è½¬é¡µé¢ |
| | | //go('/WmsItem/' + record.ITEM_CODE); |
| | | const apiAction = SaveSolder(record, true); |
| | | apiAction.then((action) => { |
| | | if (action) { |
| | | if (action.IsSuccessed) { |
| | | createMessage.success(t('å·²æ¥åºæå')); |
| | | } |
| | | } else { |
| | | createMessage.error(action.Message); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | function solderAdd(){ |
| | | //alert("æ°å¢") |
| | | openSolderModal(true, { |
| | | data: 'content', |
| | | info: 'Info', |
| | | }); |
| | | } |
| | | |
| | | function handleSuccess() { |
| | | reload(); |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { BasicColumn } from '/@/components/Table'; |
| | | import { FormSchema } from '/@/components/Table'; |
| | | import { optionsListApi } from '/@/api/tigerapi/wms/wms_item'; |
| | | import { h } from 'vue'; |
| | | import { Tag, Tooltip } from 'ant-design-vue'; |
| | | |
| | | export const columns: BasicColumn[] = [ |
| | | { |
| | | title: 'é¡èUPNç¼ç ', |
| | | dataIndex: 'UPN', |
| | | width:200, |
| | | sorter: true, |
| | | resizable:true |
| | | }, |
| | | { |
| | | title: 'CPNç¼ç ', |
| | | dataIndex: 'CPN', |
| | | width: 200, |
| | | sorter: true, |
| | | resizable:true |
| | | }, |
| | | { |
| | | title: 'ç±»å', |
| | | dataIndex: 'TYPE', |
| | | width: 100, |
| | | sorter: true, |
| | | resizable:true, |
| | | customRender: ({ record }) => { |
| | | const status = record.TYPE; |
| | | var text = ''; |
| | | var color = ''; |
| | | switch (status) { |
| | | case '0': |
| | | text = 'é¡è'; |
| | | color = 'green'; |
| | | break; |
| | | case '1': |
| | | text = 'è¶æ°´'; |
| | | color = 'blue'; |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | return h(Tooltip, { title: 'xxxxxx' }, () => h(Tag, { color: color }, () => text)); |
| | | }, |
| | | }, |
| | | { |
| | | title: 'è¶
ææ¶é´ç¼ç ', |
| | | dataIndex: 'EXP_DATE', |
| | | width:100, |
| | | sorter: true, |
| | | resizable:true |
| | | }, |
| | | { |
| | | title: 'å建人', |
| | | dataIndex: 'CREATE_USER', |
| | | width:100, |
| | | sorter: true, |
| | | resizable:true |
| | | } |
| | | , |
| | | { |
| | | title: 'å建æ¶é´', |
| | | dataIndex: 'CREATE_TIME', |
| | | width:100, |
| | | sorter: true, |
| | | resizable:true |
| | | } |
| | | ]; |
| | | |
| | | export const searchFormSchema: FormSchema[] = [ |
| | | { |
| | | field: 'UPN', |
| | | label: 'é¡èUPNç¼ç ', |
| | | component: 'Input', |
| | | colProps: { span: 8 }, |
| | | } |
| | | ]; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <BasicTable @register="registerTable"> |
| | | <!-- <template #toolbar> |
| | | <a-button color="primary" @click="solderAdd"> æ°å¢ </a-button> |
| | | </template> --> |
| | | <template #action="{ record }"> |
| | | <!-- <TableAction :actions="[ |
| | | { |
| | | icon: 'clarity:info-standard-line', |
| | | tooltip: '详æ
', |
| | | onClick: handleEdit.bind(null, record), |
| | | }, |
| | | ]" /> --> |
| | | </template> |
| | | </BasicTable> |
| | | <Loading :loading="compState.loading" :tip="compState.tip" /> |
| | | <!-- <WmsItemDrawer @register="registerDrawer" @success="handleSuccess" /> --> |
| | | <!-- <SolderModal @register="registerSolder" @success="handleSuccess" /> --> |
| | | </div> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import { reactive } from 'vue'; |
| | | import { aoaToSheetXlsx } from '/@/components/Excel'; |
| | | import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
| | | //import SolderModal from './SolderModal.vue'; |
| | | import { useModal } from '/@/components/Modal'; |
| | | import { columns, searchFormSchema } from './smt_solder.data'; |
| | | import { getsolderListByPage } from '/@/api/tigerapi/mes/smt/solderhis'; |
| | | import { useGo } from '/@/hooks/web/usePage'; |
| | | import { Loading } from '/@/components/Loading'; |
| | | import { useMessage } from '/@/hooks/web/useMessage'; |
| | | import { useI18n } from '/@/hooks/web/useI18n'; |
| | | import { SaveSolder } from '/@/api/tigerapi/mes/smt/solder'; |
| | | |
| | | const { t } = useI18n(); |
| | | const { createMessage } = useMessage(); |
| | | const go = useGo(); |
| | | const compState = reactive({ |
| | | absolute: false, |
| | | loading: false, |
| | | tip: 'å è½½ä¸...', |
| | | }); |
| | | //const [registerSolder, { openModal: openSolderModal }] = useModal(); |
| | | const [registerTable,{getForm,getPaginationRef,reload}] = useTable({ |
| | | title: 'é¡èè¶æ°´åå²', |
| | | api: getsolderListByPage, |
| | | columns, |
| | | formConfig: { |
| | | labelWidth: 120, |
| | | schemas: searchFormSchema, |
| | | }, |
| | | // actionColumn: { |
| | | // width: 80, |
| | | // title: 'æä½', |
| | | // dataIndex: 'action', |
| | | // slots: { customRender: 'action' }, |
| | | // fixed: 'right', //undefined, |
| | | // }, |
| | | ellipsis:true, |
| | | useSearchForm: true, |
| | | showTableSetting: false, |
| | | bordered: true, |
| | | showIndexColumn: false, |
| | | }); |
| | | let arr: any[] = []; |
| | | //å¯¼åº |
| | | // function aoaToExcel() { |
| | | // const totals = getPaginationRef().total |
| | | // if (totals < 30000) { |
| | | // arr = []; |
| | | // compState.loading = true; |
| | | // const col = getForm().getFieldsValue() |
| | | // getWmsItemSumByPage(col).then((res) => { |
| | | // res.items.forEach(element => { |
| | | // arr.push({ |
| | | // 'ä»åº': element.WH_CODE, |
| | | // 'ç©æä»£ç ': element.ITEM_CODE, |
| | | // 'ç©æåç§°': element.ITEM_NAME, |
| | | // 'æ°é': element.ZK_QTY, |
| | | // 'åä½': element.UNIT |
| | | // }); |
| | | // }); |
| | | // const arrHeader = columns.map((column) => column.title); |
| | | // const arrData = arr.map((item) => { |
| | | // return Object.keys(item).map((key) => item[key]); |
| | | // }); |
| | | // // ä¿è¯data顺åºä¸headerä¸è´ |
| | | // if(arr.length<30000){ |
| | | // aoaToSheetXlsx({ |
| | | // data: arrData, |
| | | // header: arrHeader, |
| | | // filename: 'æ±æ»æ¥è¡¨.xlsx', |
| | | // }); |
| | | // }else{ |
| | | // createMessage.error(t('å¯¼åºæ°æ®ä¸è½è¶
è¿ä¸ä¸æ¡ï¼å¦éè¦æ´å¤ç请è系管çå')); |
| | | // } |
| | | |
| | | // compState.loading = false; |
| | | |
| | | // }) |
| | | |
| | | // } else { |
| | | // createMessage.error(t('å¯¼åºæ°æ®ä¸è½è¶
è¿ä¸ä¸æ¡ï¼å¦éè¦æ´å¤ç请è系管çå')); |
| | | // } |
| | | |
| | | |
| | | // } |
| | | //跳转å°å®æ¶åºå |
| | | function handleEdit(record: any) { |
| | | //è·³è½¬é¡µé¢ |
| | | //go('/WmsItem/' + record.ITEM_CODE); |
| | | // const apiAction = SaveSolder(record, true); |
| | | // apiAction.then((action) => { |
| | | // if (action) { |
| | | // if (action.IsSuccessed) { |
| | | // createMessage.success(t('å·²æ¥åºæå')); |
| | | // } |
| | | // } else { |
| | | // createMessage.error(action.Message); |
| | | // } |
| | | // }); |
| | | |
| | | } |
| | | // function solderAdd(){ |
| | | // //alert("æ°å¢") |
| | | // openSolderModal(true, { |
| | | // data: 'content', |
| | | // info: 'Info', |
| | | // }); |
| | | // } |
| | | |
| | | function handleSuccess() { |
| | | reload(); |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { BasicColumn } from '/@/components/Table'; |
| | | import { FormSchema } from '/@/components/Table'; |
| | | import { optionsListApi } from '/@/api/tigerapi/wms/wms_item'; |
| | | import { h } from 'vue'; |
| | | import { Tag, Tooltip } from 'ant-design-vue'; |
| | | |
| | | export const columns: BasicColumn[] = [ |
| | | { |
| | | title: 'é¡èUPNç¼ç ', |
| | | dataIndex: 'UPN', |
| | | width: 200, |
| | | sorter: true, |
| | | resizable: true |
| | | }, |
| | | { |
| | | title: 'CPNç¼ç ', |
| | | dataIndex: 'CPN', |
| | | width: 200, |
| | | sorter: true, |
| | | resizable: true |
| | | }, |
| | | { |
| | | title: '线å«', |
| | | dataIndex: 'LINE_CODE', |
| | | width: 150, |
| | | sorter: true, |
| | | resizable: true |
| | | }, |
| | | { |
| | | title: 'å
³èé¢ç½', |
| | | dataIndex: 'SMT_STENCIL', |
| | | width: 150, |
| | | sorter: true, |
| | | resizable: true |
| | | }, |
| | | { |
| | | title: 'ç¶æ', |
| | | dataIndex: 'STATUS', |
| | | width: 100, |
| | | sorter: true, |
| | | resizable: true, |
| | | customRender: ({ record }) => { |
| | | const status = record.STATUS; |
| | | var text = ''; |
| | | var color = ''; |
| | | switch (status) { |
| | | case 0: |
| | | text = 'ç»è®°'; |
| | | color = 'green'; |
| | | break; |
| | | case 1: |
| | | text = 'å
¥åº'; |
| | | color = 'blue'; |
| | | break; |
| | | case 2: |
| | | text = '忏©'; |
| | | color = 'blue'; |
| | | break; |
| | | case 3: |
| | | text = 'é¢ç¨'; |
| | | color = 'blue'; |
| | | break; |
| | | case 4: |
| | | text = 'ä¸çº¿'; |
| | | color = 'blue'; |
| | | break; |
| | | case 5: |
| | | text = 'æ
æ'; |
| | | color = 'blue'; |
| | | break; |
| | | case 6: |
| | | text = 'ä¸çº¿'; |
| | | color = 'blue'; |
| | | break; |
| | | case 7: |
| | | text = 'ç¨æ¯'; |
| | | color = 'blue'; |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | return h(Tooltip, { title: 'xxxxxx' }, () => h(Tag, { color: color }, () => text)); |
| | | }, |
| | | }, |
| | | { |
| | | title: 'å建人', |
| | | dataIndex: 'CREATE_USER', |
| | | width: 100, |
| | | sorter: true, |
| | | resizable: true |
| | | } |
| | | , |
| | | { |
| | | title: 'å建æ¶é´', |
| | | dataIndex: 'CREATE_TIME', |
| | | width: 100, |
| | | sorter: true, |
| | | resizable: true |
| | | } |
| | | ]; |
| | | |
| | | export const searchFormSchema: FormSchema[] = [ |
| | | { |
| | | field: 'UPN', |
| | | label: 'é¡èUPNç¼ç ', |
| | | component: 'Input', |
| | | colProps: { span: 8 }, |
| | | } |
| | | ]; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <BasicTable @register="registerTable"> |
| | | <template #toolbar> |
| | | <a-button preIcon="OutR|svg" ghost color="success" @click="aoaToExcel"> å¯¼åº </a-button> |
| | | </template> |
| | | <template #action="{ record }"> |
| | | <TableAction :actions="[ |
| | | { |
| | | icon: 'clarity:info-standard-line', |
| | | tooltip: 'æ¥çåæ®è¯¦æ
', |
| | | onClick: handleEdit.bind(null, record), |
| | | }, |
| | | ]" /> |
| | | </template> |
| | | </BasicTable> |
| | | <Loading :loading="compState.loading" :tip="compState.tip" /> |
| | | <!-- <WmsItemDrawer @register="registerDrawer" @success="handleSuccess" /> --> |
| | | </div> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import { reactive } from 'vue'; |
| | | import { aoaToSheetXlsx } from '/@/components/Excel'; |
| | | import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
| | | |
| | | import { columns, searchFormSchema } from './wms_item_sum.data'; |
| | | import { getWmsItemSumByPage } from '/@/api/tigerapi/wms/wms_item'; |
| | | import { useGo } from '/@/hooks/web/usePage'; |
| | | import { Loading } from '/@/components/Loading'; |
| | | import { useMessage } from '/@/hooks/web/useMessage'; |
| | | import { useI18n } from '/@/hooks/web/useI18n'; |
| | | |
| | | const { t } = useI18n(); |
| | | const { createMessage } = useMessage(); |
| | | const go = useGo(); |
| | | const compState = reactive({ |
| | | absolute: false, |
| | | loading: false, |
| | | tip: 'å è½½ä¸...', |
| | | }); |
| | | const [registerTable,{getForm,getPaginationRef}] = useTable({ |
| | | title: 'åºåæ±æ»', |
| | | api: getWmsItemSumByPage, |
| | | columns, |
| | | formConfig: { |
| | | labelWidth: 120, |
| | | schemas: searchFormSchema, |
| | | }, |
| | | actionColumn: { |
| | | width: 80, |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | slots: { customRender: 'action' }, |
| | | fixed: 'right', //undefined, |
| | | }, |
| | | ellipsis:true, |
| | | useSearchForm: true, |
| | | showTableSetting: false, |
| | | bordered: true, |
| | | showIndexColumn: false, |
| | | }); |
| | | let arr: any[] = []; |
| | | function aoaToExcel() { |
| | | const totals = getPaginationRef().total |
| | | if (totals < 30000) { |
| | | arr = []; |
| | | compState.loading = true; |
| | | const col = getForm().getFieldsValue() |
| | | getWmsItemSumByPage(col).then((res) => { |
| | | res.items.forEach(element => { |
| | | arr.push({ |
| | | 'ä»åº': element.WH_CODE, |
| | | 'ç©æä»£ç ': element.ITEM_CODE, |
| | | 'ç©æåç§°': element.ITEM_NAME, |
| | | 'æ°é': element.ZK_QTY, |
| | | 'åä½': element.UNIT |
| | | }); |
| | | }); |
| | | const arrHeader = columns.map((column) => column.title); |
| | | const arrData = arr.map((item) => { |
| | | return Object.keys(item).map((key) => item[key]); |
| | | }); |
| | | // ä¿è¯data顺åºä¸headerä¸è´ |
| | | if(arr.length<30000){ |
| | | aoaToSheetXlsx({ |
| | | data: arrData, |
| | | header: arrHeader, |
| | | filename: 'æ±æ»æ¥è¡¨.xlsx', |
| | | }); |
| | | }else{ |
| | | createMessage.error(t('å¯¼åºæ°æ®ä¸è½è¶
è¿ä¸ä¸æ¡ï¼å¦éè¦æ´å¤ç请è系管çå')); |
| | | } |
| | | |
| | | compState.loading = false; |
| | | |
| | | }) |
| | | |
| | | } else { |
| | | createMessage.error(t('å¯¼åºæ°æ®ä¸è½è¶
è¿ä¸ä¸æ¡ï¼å¦éè¦æ´å¤ç请è系管çå')); |
| | | } |
| | | |
| | | |
| | | } |
| | | //跳转å°å®æ¶åºå |
| | | function handleEdit(record: any) { |
| | | go('/WmsItem/' + record.ITEM_CODE); |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { BasicColumn } from '/@/components/Table'; |
| | | import { FormSchema } from '/@/components/Table'; |
| | | import { optionsListApi } from '/@/api/tigerapi/wms/wms_item'; |
| | | import { h } from 'vue'; |
| | | import { Tag } from 'ant-design-vue'; |
| | | |
| | | export const columns: BasicColumn[] = [ |
| | | { |
| | | title: 'ä»åº', |
| | | dataIndex: 'WH_CODE', |
| | | width:100, |
| | | sorter: true, |
| | | resizable:true |
| | | }, |
| | | { |
| | | title: 'ç©æä»£ç ', |
| | | dataIndex: 'ITEM_CODE', |
| | | width: 200, |
| | | sorter: true, |
| | | resizable:true |
| | | }, |
| | | { |
| | | title: 'ç©æåç§°', |
| | | dataIndex: 'ITEM_NAME', |
| | | width: 300, |
| | | sorter: true, |
| | | resizable:true |
| | | }, |
| | | { |
| | | title: 'æ°é', |
| | | dataIndex: 'ZK_QTY', |
| | | width:100, |
| | | sorter: true, |
| | | resizable:true |
| | | } |
| | | ]; |
| | | |
| | | export const searchFormSchema: FormSchema[] = [ |
| | | { |
| | | field: 'WH_CODE', |
| | | label: 'ä»åº', |
| | | component: 'Input', |
| | | colProps: { span: 8 }, |
| | | }, |
| | | |
| | | { |
| | | field: 'ITEM_CODE', |
| | | label: 'ç©æä»£ç ', |
| | | component: 'Input', |
| | | colProps: { span: 8 }, |
| | | } |
| | | ]; |
| | |
| | | <template> |
| | | <div> |
| | | <div style="margin: auto 10px;"> |
| | | <!-- <p></p> |
| | | <p>订é
ç主é¢</p> |
| | | <input type="text"> |
| | | <p>åå¸ä¿¡æ¯</p> |
| | | <input type="text"> |
| | | <button style="color:aquamarine;background-color: brown;" @click="">åé</button> |
| | | |
| | | <div style="background-color:darkgrey;height: 500px; width: 500px;position:relative;left: 260px;top:-110px"> |
| | | |
| | | </div> --> |
| | | </div> |
| | | |
| | | </template> |
| | | <script lang="ts"> |
| | | import { defineComponent, ref, unref } from 'vue'; |
| | |
| | | connectTimeout:4000, |
| | | clientId:'mqtt_'+ Math.random().toString(16), |
| | | } |
| | | client = mqtt.connect('ws://192.168.31.151/mgtt',options) |
| | | client = mqtt.connect('ws://broker.emqx.io/mqtt',options) |
| | | export default { |
| | | name: 'Helloworld', |
| | | data(){ |
| | |
| | | mqttMsg(){ |
| | | client.on('connect',(e)=>{ |
| | | console.log('è¿æ¥æå') |
| | | client.subscribe('/test/helloworld',{qos:0},(error)=>{ |
| | | client.subscribe('sensor/1/temperature',{qos:0},(error)=>{ |
| | | console.log(error) |
| | | }) |
| | | client.on("message",(topic,message)=>{ |
| | | console.log('æ¶å°æ¥èª',topic,'çæ¶æ¯',message.tostring()) |
| | | console.log('æ¶å°æ¥èª',topic,'çæ¶æ¯',message.toString()) |
| | | if(message.toString()=='hi'){ |
| | | client.publish('testtopic/one','hello',{ |
| | | qos:0,rein:false |
| | | },(error)=>{ |
| | | console.log('error',error) |
| | | }) |
| | | client.on("reconnect",(error)=>{ |
| | | console.log('æ£å¨éè¿',error) |
| | | } |
| | | }) |
| | | client.on("reconnect",(error)=>{ |
| | | console.log('è¿æ¥å¤±è´¥',error) |
| | | }) |
| | | // client.on("reconnect",(error)=>{ |
| | | // console.log('æ£å¨éè¿',error) |
| | | // }) |
| | | // client.on("reconnect",(error)=>{ |
| | | // console.log('è¿æ¥å¤±è´¥',error) |
| | | // }) |
| | | }) |
| | | } |
| | | } |