| | |
| | | */ |
| | | |
| | | export const getSmttableListByPage = async (params: any) => { |
| | | let order = '' |
| | | let order = ''; |
| | | if (params.order != undefined) { |
| | | order = params.order == 'descend' ? (params.field + ' desc') : params.field |
| | | order = params.order == 'descend' ? params.field + ' desc' : params.field; |
| | | } |
| | | let sqlcmd = '1=1'; |
| | | if (params?.LINE_CODE != undefined && params?.LINE_CODE != '') { |
| | |
| | | if (params?.SMT_CODE != undefined && params?.SMT_CODE != '') { |
| | | sqlcmd += " And SMT_CODE like '%" + params?.SMT_CODE + "%'"; |
| | | } |
| | | if (params?.PCB_SURFACE != undefined && params?.PCB_SURFACE!='') { |
| | | if (params?.PCB_SURFACE != undefined && params?.PCB_SURFACE != '') { |
| | | sqlcmd += " And PCB_SURFACE like '%" + params?.PCB_SURFACE + "%'"; |
| | | } |
| | | |
| | | let option = { |
| | | const option = { |
| | | UserId: useUserStore().getUserInfo.userId as string, |
| | | ByOrg: true, |
| | | OrgCode: useUserStore().getUserInfo.orgCode as string |
| | | } |
| | | OrgCode: useUserStore().getUserInfo.orgCode as string, |
| | | }; |
| | | if (!isNullOrEmpty(params.page)) { |
| | | const usParams = genAction('SMT_WO_TABLE', { |
| | | QueryAble_T: '', |
| | |
| | | draw: 1, |
| | | pageIndex: params.page, |
| | | pageSize: params.pageSize, |
| | | } |
| | | }, |
| | | }); |
| | | return getSmttableListByPageAsync(usParams); |
| | | } else { |
| | | const usParams = genAction('SMT_WO_TABLE', { |
| | | QueryAble_T: '', |
| | | where: sqlcmd |
| | | where: sqlcmd, |
| | | }); |
| | | return getSmttableListByPageAsync(usParams); |
| | | } |
| | |
| | | isTransformResponse: false, |
| | | }, |
| | | ); |
| | | let model = {} |
| | | let model = {}; |
| | | if (isNullOrEmpty(data.Data.page)) { |
| | | model = { |
| | | items: data.Data.Items, |
| | |
| | | }; |
| | | //删除 |
| | | export const DeleteSmttable = async (Smttable_Id: string) => { |
| | | const usParams = genAction('SMT_WO_TABLE', `ID='${Smttable_Id}'`) |
| | | const usParams = genAction('SMT_WO_TABLE', `ID='${Smttable_Id}'`); |
| | | return await defHttp.post( |
| | | { url: Api.DeleteWhere, params: usParams }, |
| | | { |
| | | errorMessageMode: 'none', |
| | | isTransformResponse: false |
| | | } |
| | | ) |
| | | } |
| | | isTransformResponse: false, |
| | | }, |
| | | ); |
| | | }; |
| | | //下拉列表 |
| | | // STATUSs 单据状态 |
| | | export const optionsListApi = async (params: Recordable) => { |
| | | const usParams = genAction('MES_LINE', { |
| | | QueryAble_T: '', |
| | | }); |
| | | var data = await defHttp.post( |
| | | const data = await defHttp.post( |
| | | { url: Api.QueryUrl, params: usParams }, |
| | | { |
| | | errorMessageMode: 'none', |
| | |
| | | //类型 |
| | | export const ExportTable = async (params: Recordable) => { |
| | | const usParams = genAction('SMT_WO_TABLE', params[0].dataSource.toString()); |
| | | var data = await defHttp.post( |
| | | { url: Api.ValidateTableImport, params:params[0].dataSource}, |
| | | const data = await defHttp.post( |
| | | { url: Api.ValidateTableImport, params: params[0].dataSource }, |
| | | { |
| | | errorMessageMode: 'none', |
| | | isTransformResponse: false, |
| | |
| | | }; |
| | | export const SaveExportTable = async (params: Recordable) => { |
| | | const usParams = genAction('SMT_WO_TABLE', params[0].dataSource.toString()); |
| | | var data = await defHttp.post( |
| | | { url: Api.SaveValidateTableImport, params:params[0].dataSource}, |
| | | const data = await defHttp.post( |
| | | { url: Api.SaveValidateTableImport, params: params[0].dataSource }, |
| | | { |
| | | errorMessageMode: 'none', |
| | | isTransformResponse: false, |
| | |
| | | }, |
| | | ); |
| | | return data; |
| | | }; |
| | | }; |