From ca280fb485bba2a247b96909b3ab6efb4e5b38e9 Mon Sep 17 00:00:00 2001 From: mzr Date: Fri, 19 Sep 2025 16:23:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=81=E7=A8=8B=E7=94=9F=E4=BA=A7=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=AF=BC=E5=85=A5=E5=BA=8F=E5=88=97=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mmpac/mmpac/pmo/card/init/initTemplate.js | 17 + .../card/viewControl/btnClickController.js | 5 + .../mmpac/pmo/list/btnclicks/buttonClick.js | 5 + src/mmpac/mmpac/pmo/list/init/initTemplate.js | 872 +++++++++--------- src/mmpac/mmpac/pmo/main/config.json | 6 +- src/mmpac/mmpac/pmo/pmoconst/pmoconst.js | 2 + 6 files changed, 480 insertions(+), 427 deletions(-) diff --git a/src/mmpac/mmpac/pmo/card/init/initTemplate.js b/src/mmpac/mmpac/pmo/card/init/initTemplate.js index 535e6921..f79a3aea 100644 --- a/src/mmpac/mmpac/pmo/card/init/initTemplate.js +++ b/src/mmpac/mmpac/pmo/card/init/initTemplate.js @@ -170,6 +170,23 @@ export default function (props) { } ); props.button.setUploadConfig(PMO_CARD_BUTTON.Import, excelimportconfig); + // 导入序列号 + let excelimportconfig1 = excelImportconfig( + props, + PMO_LIST.excelOutput.module, + 'pmo_sernio', + true, + '', + { + appcode: PMO_LIST.appcode, + pagecode: '50080000_import1' + }, + () => { + //导入按钮的回调 + buttonClick.call(this, props, PMO_CARD_BUTTON.Import); + } + ); + props.button.setUploadConfig(PMO_CARD_BUTTON.ImportNo, excelimportconfig1); } } diff --git a/src/mmpac/mmpac/pmo/card/viewControl/btnClickController.js b/src/mmpac/mmpac/pmo/card/viewControl/btnClickController.js index 11ba2bbb..be215fcf 100644 --- a/src/mmpac/mmpac/pmo/card/viewControl/btnClickController.js +++ b/src/mmpac/mmpac/pmo/card/viewControl/btnClickController.js @@ -622,6 +622,11 @@ export default function clickBtn(props, id, text, record, index) { let importC = importClick.bind(this, props, id); return importC(props); } + case PMO_CARD_BUTTON.ImportNo: { + //导入序列号 + let importC = importClick.bind(this, props, id); + return importC(props); + } case PMO_CARD_BUTTON.PushToPlm: { let billId = props.form.getFormItemsValue(formId, HEADATTRCODE.CPMOHID).value; // 传递设计任务 diff --git a/src/mmpac/mmpac/pmo/list/btnclicks/buttonClick.js b/src/mmpac/mmpac/pmo/list/btnclicks/buttonClick.js index fa9f20c8..0fb0ad53 100644 --- a/src/mmpac/mmpac/pmo/list/btnclicks/buttonClick.js +++ b/src/mmpac/mmpac/pmo/list/btnclicks/buttonClick.js @@ -377,5 +377,10 @@ export default function clickBtn(props, id, text, record, index) { let importC = importClick.bind(this, props, id); return importC(props); } + case PMO_LIST_BUTTON.ImportNo: { + //导入序列号 + let importC = importClick.bind(this, props, id); + return importC(props); + } } } diff --git a/src/mmpac/mmpac/pmo/list/init/initTemplate.js b/src/mmpac/mmpac/pmo/list/init/initTemplate.js index af2c0f30..d300957a 100644 --- a/src/mmpac/mmpac/pmo/list/init/initTemplate.js +++ b/src/mmpac/mmpac/pmo/list/init/initTemplate.js @@ -2,445 +2,467 @@ * 模板初始化 */ -import { base, ajax, toast, cacheTools, getGlobalStorage, removeGlobalStorage, cardCache } from 'nc-lightapp-front'; -import { PMO_LIST, PMO_CARD, DATECONST, PMO_LIST_BUTTON, HEADATTRCODE } from '../../pmoconst'; +import {base, ajax, toast, cacheTools, getGlobalStorage, removeGlobalStorage, cardCache} from 'nc-lightapp-front'; +import {PMO_LIST, PMO_CARD, DATECONST, PMO_LIST_BUTTON, HEADATTRCODE, PMO_CARD_BUTTON} from '../../pmoconst'; import buttonClick from '../btnclicks/buttonClick'; -import { buttonController, btnClickController } from '../viewControl'; -import { transtypeUtils, setPsndocShowLeavePower, setRefShowDisabledData } from '../../../../../mmpub/mmpub/pub/tool'; -import { getLangByResId } from '../../../../../mmpub/mmpub/pub/tool/multiLangUtil'; -import { conf as unitConf } from '../../../../../uapbd/refer/org/FactoryGridRef/index'; +import {buttonController, btnClickController} from '../viewControl'; +import {transtypeUtils, setPsndocShowLeavePower, setRefShowDisabledData} from '../../../../../mmpub/mmpub/pub/tool'; +import {getLangByResId} from '../../../../../mmpub/mmpub/pub/tool/multiLangUtil'; +import {conf as unitConf} from '../../../../../uapbd/refer/org/FactoryGridRef/index'; //excel导入工具类(平台提供) import excelImportconfig from '../../../../../uap/common/components/excelImportconfig'; + let tableId = PMO_LIST.tableId; let searchId = PMO_LIST.searchId; let listpageid = PMO_LIST.pageid; const linkItem = PMO_LIST.vbillcode; const cpmohid = HEADATTRCODE.CPMOHID; const deleteUrl = PMO_LIST.deleteURL; -const { getDefData, setDefData } = cardCache; -export default function(props) { - //查询按钮使用 - this.props.createUIDom( - { - pagecode: listpageid - }, - (templedata) => { - if (templedata) { - transtypeUtils.init.call(this, templedata.context); - if (templedata.template) { - let meta = templedata.template; - transtypeUtils.initQuery.call(this, this.props, meta, searchId, HEADATTRCODE.CTRANTYPEID); - meta = modifierMeta.call(this, this.props, meta); - props.meta.setMeta(meta); - //设置查询模板默认值 - //setQueryDefault.call(this, this.props, meta); - } - if (templedata.button) { - let button = templedata.button; - //初始化excel导入按钮 - initExcelImportConfig.call(this, props); - props.button.setButtons(button); - buttonController.setListButtonVisiable(this.props, PMO_LIST.toCommit); - props.button.setPopContent( - PMO_LIST_BUTTON.delete, - getLangByResId(this, '50080000-000103') /* 国际化处理: 确定要删除吗?*/ - ); - } - toggleShow.call(this); - } - } - ); - function modifierMeta(props, meta) { - let noshowOrgFileds = [ - HEADATTRCODE.APPROVER, - HEADATTRCODE.BILLMAKER, - 'mm_mo.mocloser', - 'mm_mo.vfirsttrantypeid', - 'mm_mo.vfirsttype', - 'mm_mo.vsrctype', - 'mm_mo.vsrctrantypeid' - ]; - meta[searchId].items.map((item) => { - setPsndocShowLeavePower(item); - setRefShowDisabledData(item); - if (item.attrcode == HEADATTRCODE.PK_ORG) { - //设置可多选 - item.isMultiSelectedEnabled = true; - //主组织权限过滤 - item.queryCondition = () => { - return { GridRefActionExt: 'nccloud.web.mmpub.pub.ref.AppPermissionOrgRefFilter' }; - }; - } else if (item.attrcode == HEADATTRCODE.PK_ORG_V) { - //设置可多选 - item.isMultiSelectedEnabled = true; - //主组织权限过滤 - item.queryCondition = () => { - return { GridRefActionExt: 'nccloud.web.mmpub.pub.ref.AppPermissionOrgVidRefFilter' }; - }; - } else if (item.attrcode == HEADATTRCODE.CPLANFACTORYID) { - //设置可多选 - item.isMultiSelectedEnabled = true; - //主组织权限过滤 - item.queryCondition = () => { - return { - orgtype: 'PRODUCEPLANTYPE00000', - GridRefActionExt: 'nccloud.web.mmpub.pub.ref.OrgTypePermissionOrgRefFilter' - }; - //return { GridRefActionExt: 'nccloud.web.mmpub.pub.ref.AppPermissionOrgRefFilter' }; - }; - } else if (item.attrcode == HEADATTRCODE.CPLANFACTORYVID) { - //设置可多选 - item.isMultiSelectedEnabled = true; - //主组织权限过滤 - item.queryCondition = () => { - return { - orgtype: 'PRODUCEPLANTYPE00000', - GridRefActionExt: 'nccloud.web.mmpub.pub.ref.OrgTypePermissionOrgVidRefFilter' - }; - //return { GridRefActionExt: 'nccloud.web.mmpub.pub.ref.AppPermissionOrgVidRefFilter' }; - }; - } else if (item.attrcode == HEADATTRCODE.CTRANTYPEID) { - //设置交易类型 - item.queryCondition = () => { - return { parentbilltype: PMO_LIST.billType }; - }; - } else if (item.attrcode == 'mm_mo.cmaterialid' || item.attrcode == 'mm_mo.cmaterialvid') { - item.isShowUnit = true; - item.queryCondition = () => { - let pk_org = props.search.getSearchValByField(searchId, HEADATTRCODE.PK_ORG); - let condition = { productmode: 1 }; - pk_org = - pk_org != null - ? pk_org.value.firstvalue.includes(',') ? null : pk_org.value.firstvalue - : null; - if (pk_org) { - condition.pk_org = pk_org; - } - condition.productmode = 1; - condition.matchmode = 2; - if (item.attrcode == 'mm_mo.cmaterialid') { - condition.GridRefActionExt = 'nccloud.web.mmpub.pub.ref.MaterialoidRefSqlBuilder'; - } else { - condition.GridRefActionExt = 'nccloud.web.mmpub.pub.ref.MaterialRefSqlBuilder'; - } - return condition; - }; - } else if (item.attrcode == 'mm_mo.cdeptid' || item.attrcode == 'mm_mo.cdeptvid') { - item.isShowUnit = true; - //生产部门 - item.queryCondition = () => { - let data = props.search.getSearchValByField(searchId, HEADATTRCODE.PK_ORG); - data = data != null ? (data.value.firstvalue.includes(',') ? null : data.value.firstvalue) : null; - return { pk_org: data, busifuncode: 'fa' }; - }; - } else if (item.attrcode == 'mm_mo.cwkid') { - //生产线 - item.isShowUnit = true; - item.refName = getLangByResId(this, '50080000-000107') /*生产线*/; - item.queryCondition = () => { - let data = props.search.getSearchValByField(searchId, HEADATTRCODE.PK_ORG); - data = data != null ? (data.value.firstvalue.includes(',') ? null : data.value.firstvalue) : null; - let cdeptid = props.search.getSearchValByField(searchId, 'mm_mo.cdeptid'); - //支持生产部门多选 - cdeptid = cdeptid.value.firstvalue; - let condition = { - pk_org: data, - bprodline: 'Y', - GridRefActionExt: 'nccloud.web.mmpub.pub.ref.WorkCenterRefSqlBuilder' - }; - if (cdeptid) { - condition.pk_dept = cdeptid; - } - return condition; - }; - } else if (item.attrcode == 'mm_mo.cemployeeid') { - item.isShowUnit = true; - item.queryCondition = () => { - let data = props.search.getSearchValByField(searchId, HEADATTRCODE.PK_ORG); - data = data != null ? (data.value.firstvalue.includes(',') ? null : data.value.firstvalue) : null; - return { pk_org: data, busifuncode: 'fa' }; - }; - } else if (item.attrcode == 'mm_mo.cffileid') { - item.queryCondition = () => { - let cmaterialid = props.search.getSearchValByField(searchId, 'mm_mo.cmaterialid').value.firstvalue; - let condition = {}; - condition.pk_group = window.parent.GETBUSINESSINFO().groupId; - condition.cmaterialid = cmaterialid; - return condition; - }; - } else if (item.attrcode == 'mm_mo.ccustmaterialid') { - item.queryCondition = () => { - let cmaterialid = props.search.getSearchValByField(searchId, 'mm_mo.cmaterialid'); - let pk_org = props.search.getSearchValByField(searchId, HEADATTRCODE.PK_ORG); - let condition = {}; - condition.pk_org = - pk_org && pk_org.value - ? pk_org.value.firstvalue.includes(',') ? null : pk_org.value.firstvalue - : null; - return condition; - }; - } else if (item.attrcode == 'mm_mo.tplanstarttime') { - //这里是不是要设置默认值 - let curdays = []; - curdays.push('#day(0)#'); - curdays.push('#day(0)#'); - item.initialvalue = { - display: getLangByResId(this, '50080000-000104'), - value: curdays - }; /* 国际化处理: 今天,今天*/ - } else if (item.attrcode == 'mm_mo.cclassid') { - item.queryCondition = () => { - item.isShowUnit = true; - let pkorg = props.search.getSearchValByField(searchId, HEADATTRCODE.PK_ORG); - pkorg = - pkorg != null ? (pkorg.value.firstvalue.includes(',') ? null : pkorg.value.firstvalue) : null; - let cwkid = props.search.getSearchValByField(searchId, 'mm_mo.cwkid'); - cwkid = cwkid.value.firstvalue; - let condition = { - pk_org: pkorg, - orgshifttype: '2', - GridRefActionExt: 'nccloud.web.mmpub.pub.ref.ShiftRefSqlBuilder' - }; - if (cwkid) { - condition.cwkid = cwkid; - } - return condition; - }; - item.unitProps = unitConf; - } else if (item.attrcode == 'mm_mo.cteamid') { - item.queryCondition = () => { - let pk_org = props.search.getSearchValByField(searchId, HEADATTRCODE.PK_ORG); - pk_org = - pk_org != null - ? pk_org.value.firstvalue.includes(',') ? null : pk_org.value.firstvalue - : null; - return { - pk_org: pk_org, - GridRefActionExt: 'nccloud.web.mmpub.pub.ref.TeamRefSqlBuilder' - }; - }; - item.unitProps = unitConf; - } else if (item.attrcode == HEADATTRCODE.FBILLSTATUS) { - if ((item.options.value = 2)) { - item.options.splice(2, 1); - } - } else if (noshowOrgFileds.includes(item.attrcode)) { - item.queryCondition = () => { - //用户档案的人,不需要显示业务单元 - let data = props.search.getSearchValByField(searchId, HEADATTRCODE.PK_ORG); - data = data != null ? (data.value.firstvalue.includes(',') ? null : data.value.firstvalue) : null; - return { pk_org: data }; - }; - } else { - item.isShowUnit = true; - item.queryCondition = () => { - let data = props.search.getSearchValByField(searchId, HEADATTRCODE.PK_ORG); - data = data != null ? (data.value.firstvalue.includes(',') ? null : data.value.firstvalue) : null; - return { pk_org: data }; - }; - } - }); - // } - //设置显示页码 - meta[tableId].pagination = true; - meta[tableId].items = meta[tableId].items.map((item, key) => { - if (item.attrcode == linkItem) { - item.render = (text, record, index) => { - return ( - { - // let searchVal = props.search.getAllSearchData(searchId); - // cacheTools.set('searchParams', searchVal); - props.pushTo(PMO_CARD.cardUrl, { - pagecode: PMO_CARD.pageid, - status: PMO_CARD.browse, - id: record[cpmohid].value //列表卡片传参 - }); - }} - > +const {getDefData, setDefData} = cardCache; +export default function (props) { + //查询按钮使用 + this.props.createUIDom( + { + pagecode: listpageid + }, + (templedata) => { + if (templedata) { + transtypeUtils.init.call(this, templedata.context); + if (templedata.template) { + let meta = templedata.template; + transtypeUtils.initQuery.call(this, this.props, meta, searchId, HEADATTRCODE.CTRANTYPEID); + meta = modifierMeta.call(this, this.props, meta); + props.meta.setMeta(meta); + //设置查询模板默认值 + //setQueryDefault.call(this, this.props, meta); + } + if (templedata.button) { + let button = templedata.button; + //初始化excel导入按钮 + initExcelImportConfig.call(this, props); + props.button.setButtons(button); + buttonController.setListButtonVisiable(this.props, PMO_LIST.toCommit); + props.button.setPopContent( + PMO_LIST_BUTTON.delete, + getLangByResId(this, '50080000-000103') /* 国际化处理: 确定要删除吗?*/ + ); + } + toggleShow.call(this); + } + } + ); + + function modifierMeta(props, meta) { + let noshowOrgFileds = [ + HEADATTRCODE.APPROVER, + HEADATTRCODE.BILLMAKER, + 'mm_mo.mocloser', + 'mm_mo.vfirsttrantypeid', + 'mm_mo.vfirsttype', + 'mm_mo.vsrctype', + 'mm_mo.vsrctrantypeid' + ]; + meta[searchId].items.map((item) => { + setPsndocShowLeavePower(item); + setRefShowDisabledData(item); + if (item.attrcode == HEADATTRCODE.PK_ORG) { + //设置可多选 + item.isMultiSelectedEnabled = true; + //主组织权限过滤 + item.queryCondition = () => { + return {GridRefActionExt: 'nccloud.web.mmpub.pub.ref.AppPermissionOrgRefFilter'}; + }; + } else if (item.attrcode == HEADATTRCODE.PK_ORG_V) { + //设置可多选 + item.isMultiSelectedEnabled = true; + //主组织权限过滤 + item.queryCondition = () => { + return {GridRefActionExt: 'nccloud.web.mmpub.pub.ref.AppPermissionOrgVidRefFilter'}; + }; + } else if (item.attrcode == HEADATTRCODE.CPLANFACTORYID) { + //设置可多选 + item.isMultiSelectedEnabled = true; + //主组织权限过滤 + item.queryCondition = () => { + return { + orgtype: 'PRODUCEPLANTYPE00000', + GridRefActionExt: 'nccloud.web.mmpub.pub.ref.OrgTypePermissionOrgRefFilter' + }; + //return { GridRefActionExt: 'nccloud.web.mmpub.pub.ref.AppPermissionOrgRefFilter' }; + }; + } else if (item.attrcode == HEADATTRCODE.CPLANFACTORYVID) { + //设置可多选 + item.isMultiSelectedEnabled = true; + //主组织权限过滤 + item.queryCondition = () => { + return { + orgtype: 'PRODUCEPLANTYPE00000', + GridRefActionExt: 'nccloud.web.mmpub.pub.ref.OrgTypePermissionOrgVidRefFilter' + }; + //return { GridRefActionExt: 'nccloud.web.mmpub.pub.ref.AppPermissionOrgVidRefFilter' }; + }; + } else if (item.attrcode == HEADATTRCODE.CTRANTYPEID) { + //设置交易类型 + item.queryCondition = () => { + return {parentbilltype: PMO_LIST.billType}; + }; + } else if (item.attrcode == 'mm_mo.cmaterialid' || item.attrcode == 'mm_mo.cmaterialvid') { + item.isShowUnit = true; + item.queryCondition = () => { + let pk_org = props.search.getSearchValByField(searchId, HEADATTRCODE.PK_ORG); + let condition = {productmode: 1}; + pk_org = + pk_org != null + ? pk_org.value.firstvalue.includes(',') ? null : pk_org.value.firstvalue + : null; + if (pk_org) { + condition.pk_org = pk_org; + } + condition.productmode = 1; + condition.matchmode = 2; + if (item.attrcode == 'mm_mo.cmaterialid') { + condition.GridRefActionExt = 'nccloud.web.mmpub.pub.ref.MaterialoidRefSqlBuilder'; + } else { + condition.GridRefActionExt = 'nccloud.web.mmpub.pub.ref.MaterialRefSqlBuilder'; + } + return condition; + }; + } else if (item.attrcode == 'mm_mo.cdeptid' || item.attrcode == 'mm_mo.cdeptvid') { + item.isShowUnit = true; + //生产部门 + item.queryCondition = () => { + let data = props.search.getSearchValByField(searchId, HEADATTRCODE.PK_ORG); + data = data != null ? (data.value.firstvalue.includes(',') ? null : data.value.firstvalue) : null; + return {pk_org: data, busifuncode: 'fa'}; + }; + } else if (item.attrcode == 'mm_mo.cwkid') { + //生产线 + item.isShowUnit = true; + item.refName = getLangByResId(this, '50080000-000107') /*生产线*/; + item.queryCondition = () => { + let data = props.search.getSearchValByField(searchId, HEADATTRCODE.PK_ORG); + data = data != null ? (data.value.firstvalue.includes(',') ? null : data.value.firstvalue) : null; + let cdeptid = props.search.getSearchValByField(searchId, 'mm_mo.cdeptid'); + //支持生产部门多选 + cdeptid = cdeptid.value.firstvalue; + let condition = { + pk_org: data, + bprodline: 'Y', + GridRefActionExt: 'nccloud.web.mmpub.pub.ref.WorkCenterRefSqlBuilder' + }; + if (cdeptid) { + condition.pk_dept = cdeptid; + } + return condition; + }; + } else if (item.attrcode == 'mm_mo.cemployeeid') { + item.isShowUnit = true; + item.queryCondition = () => { + let data = props.search.getSearchValByField(searchId, HEADATTRCODE.PK_ORG); + data = data != null ? (data.value.firstvalue.includes(',') ? null : data.value.firstvalue) : null; + return {pk_org: data, busifuncode: 'fa'}; + }; + } else if (item.attrcode == 'mm_mo.cffileid') { + item.queryCondition = () => { + let cmaterialid = props.search.getSearchValByField(searchId, 'mm_mo.cmaterialid').value.firstvalue; + let condition = {}; + condition.pk_group = window.parent.GETBUSINESSINFO().groupId; + condition.cmaterialid = cmaterialid; + return condition; + }; + } else if (item.attrcode == 'mm_mo.ccustmaterialid') { + item.queryCondition = () => { + let cmaterialid = props.search.getSearchValByField(searchId, 'mm_mo.cmaterialid'); + let pk_org = props.search.getSearchValByField(searchId, HEADATTRCODE.PK_ORG); + let condition = {}; + condition.pk_org = + pk_org && pk_org.value + ? pk_org.value.firstvalue.includes(',') ? null : pk_org.value.firstvalue + : null; + return condition; + }; + } else if (item.attrcode == 'mm_mo.tplanstarttime') { + //这里是不是要设置默认值 + let curdays = []; + curdays.push('#day(0)#'); + curdays.push('#day(0)#'); + item.initialvalue = { + display: getLangByResId(this, '50080000-000104'), + value: curdays + }; /* 国际化处理: 今天,今天*/ + } else if (item.attrcode == 'mm_mo.cclassid') { + item.queryCondition = () => { + item.isShowUnit = true; + let pkorg = props.search.getSearchValByField(searchId, HEADATTRCODE.PK_ORG); + pkorg = + pkorg != null ? (pkorg.value.firstvalue.includes(',') ? null : pkorg.value.firstvalue) : null; + let cwkid = props.search.getSearchValByField(searchId, 'mm_mo.cwkid'); + cwkid = cwkid.value.firstvalue; + let condition = { + pk_org: pkorg, + orgshifttype: '2', + GridRefActionExt: 'nccloud.web.mmpub.pub.ref.ShiftRefSqlBuilder' + }; + if (cwkid) { + condition.cwkid = cwkid; + } + return condition; + }; + item.unitProps = unitConf; + } else if (item.attrcode == 'mm_mo.cteamid') { + item.queryCondition = () => { + let pk_org = props.search.getSearchValByField(searchId, HEADATTRCODE.PK_ORG); + pk_org = + pk_org != null + ? pk_org.value.firstvalue.includes(',') ? null : pk_org.value.firstvalue + : null; + return { + pk_org: pk_org, + GridRefActionExt: 'nccloud.web.mmpub.pub.ref.TeamRefSqlBuilder' + }; + }; + item.unitProps = unitConf; + } else if (item.attrcode == HEADATTRCODE.FBILLSTATUS) { + if ((item.options.value = 2)) { + item.options.splice(2, 1); + } + } else if (noshowOrgFileds.includes(item.attrcode)) { + item.queryCondition = () => { + //用户档案的人,不需要显示业务单元 + let data = props.search.getSearchValByField(searchId, HEADATTRCODE.PK_ORG); + data = data != null ? (data.value.firstvalue.includes(',') ? null : data.value.firstvalue) : null; + return {pk_org: data}; + }; + } else { + item.isShowUnit = true; + item.queryCondition = () => { + let data = props.search.getSearchValByField(searchId, HEADATTRCODE.PK_ORG); + data = data != null ? (data.value.firstvalue.includes(',') ? null : data.value.firstvalue) : null; + return {pk_org: data}; + }; + } + }); + // } + //设置显示页码 + meta[tableId].pagination = true; + meta[tableId].items = meta[tableId].items.map((item, key) => { + if (item.attrcode == linkItem) { + item.render = (text, record, index) => { + return ( + { + // let searchVal = props.search.getAllSearchData(searchId); + // cacheTools.set('searchParams', searchVal); + props.pushTo(PMO_CARD.cardUrl, { + pagecode: PMO_CARD.pageid, + status: PMO_CARD.browse, + id: record[cpmohid].value //列表卡片传参 + }); + }} + > {record && record[linkItem] && record[linkItem].value} - ); - }; - } - return item; - }); - //添加操作列 - let porCol = { - attrcode: 'opr', - label: getLangByResId(this, '50080000-000061') /* 国际化处理: 操作*/ /* 国际化处理: 操作*/, - //attrcode: 'pay_opr', - itemtype: 'customer', //默认必输 - fixed: 'right', //锁定操作列 - visible: true, - width: '200px', - render: (text, record, index) => { - let state = record.fbillstatus.value; - let buttonAry = buttonController.setRowButtons(state); - return props.button.createOprationButton(buttonAry, { - area: PMO_LIST_BUTTON.list_inner, - buttonLimit: 3, - ignoreHotkeyCode: buttonAry, - onButtonClick: (props, key) => buttonClick.call(this, props, key, text, record, index) - }); - } - }; - // 将操作列添加到列表态的table中 - meta[tableId].items.push(porCol); - return meta; - } - function setQueryDefault(props, meta) { - let searchVal = cacheTools.get('searchVal'); - if (!searchVal) { - props.search.setSearchValue(searchId, [ - { - field: 'mm_mo.tplanstarttime', - oprtype: 'between', - value: { firstvalue: '#day(0)#', secondvalue: '#day(0)#' } - } - ]); - } - } + ); + }; + } + return item; + }); + //添加操作列 + let porCol = { + attrcode: 'opr', + label: getLangByResId(this, '50080000-000061') /* 国际化处理: 操作*/ /* 国际化处理: 操作*/, + //attrcode: 'pay_opr', + itemtype: 'customer', //默认必输 + fixed: 'right', //锁定操作列 + visible: true, + width: '200px', + render: (text, record, index) => { + let state = record.fbillstatus.value; + let buttonAry = buttonController.setRowButtons(state); + return props.button.createOprationButton(buttonAry, { + area: PMO_LIST_BUTTON.list_inner, + buttonLimit: 3, + ignoreHotkeyCode: buttonAry, + onButtonClick: (props, key) => buttonClick.call(this, props, key, text, record, index) + }); + } + }; + // 将操作列添加到列表态的table中 + meta[tableId].items.push(porCol); + return meta; + } - /** - * 处理生产大屏数据穿透 - */ - function process4dashboard() { - let queryCriteria = getGlobalStorage('localStorage', 'QueryCriteria'); - queryCriteria = JSON.parse(queryCriteria); + function setQueryDefault(props, meta) { + let searchVal = cacheTools.get('searchVal'); + if (!searchVal) { + props.search.setSearchValue(searchId, [ + { + field: 'mm_mo.tplanstarttime', + oprtype: 'between', + value: {firstvalue: '#day(0)#', secondvalue: '#day(0)#'} + } + ]); + } + } - if (queryCriteria && queryCriteria.urlParam && queryCriteria.urlParam.condition) { - let condition = queryCriteria.urlParam.condition; - let pagecode = queryCriteria.urlParam.pagecode; - let pk_org = queryCriteria.urlParam.pk_org; - let dimension = queryCriteria.urlParam.dimension; + /** + * 处理生产大屏数据穿透 + */ + function process4dashboard() { + let queryCriteria = getGlobalStorage('localStorage', 'QueryCriteria'); + queryCriteria = JSON.parse(queryCriteria); - let pageInfo = this.props.table.getTablePageInfo(tableId); //分页信息 - let paramdata = - condition + - '#' + - pagecode + - '#' + - pk_org + - '#' + - dimension + - '#' + - pageInfo.pageSize + - '#' + - pageInfo.pageIndex; + if (queryCriteria && queryCriteria.urlParam && queryCriteria.urlParam.condition) { + let condition = queryCriteria.urlParam.condition; + let pagecode = queryCriteria.urlParam.pagecode; + let pk_org = queryCriteria.urlParam.pk_org; + let dimension = queryCriteria.urlParam.dimension; - ajax({ - url: PMO_LIST.queryByCondURL, - data: paramdata, - success: (res) => { - if (res.success) { - if (res.data) { - //调用查询方法 - setDefData(PMO_LIST.dataSource, 'currentTab', PMO_LIST.all); - this.setState({ - currentTab: PMO_LIST.all - }); - let rowsData = { rows: [] }; - if (res.data.currentGrid && res.data.currentGrid[tableId]) { - rowsData = res.data.currentGrid[tableId]; - } - this.props.table.setAllTableData(tableId, rowsData); - buttonController.setListButtonVisiable(this.props, PMO_LIST.all); - } - } - removeGlobalStorage('localStorage', 'QueryCriteria'); - } - }); - } - } - function toggleShow() { - //处理生产大屏数据穿透 - process4dashboard.call(this); - if (!this.linkquery) { - return; - } - let _this = this; - //这里需要处理下计划订单联查流程生产订单服务 - let linkparam = cacheTools.get('55B4LinkTo55A2'); - if (!linkparam) { - //配套变更建议 - linkparam = cacheTools.get('mosLinkTo55A2'); - } + let pageInfo = this.props.table.getTablePageInfo(tableId); //分页信息 + let paramdata = + condition + + '#' + + pagecode + + '#' + + pk_org + + '#' + + dimension + + '#' + + pageInfo.pageSize + + '#' + + pageInfo.pageIndex; - let linkkey = props.getUrlParam(PMO_LIST.LINK_KEY); - //供应链控制台 - if (!linkparam && linkkey) { - linkparam = cacheTools.get(linkkey); - } - let pageInfo = this.props.table.getTablePageInfo(tableId); //分页信息 - //处理其他单据联查 - if (linkparam) { - //this.linkquery = true; - if (linkparam) { - let ids = linkparam.linkids; - if (ids) { - let condition = 'querybyid'; - let byids = JSON.stringify(ids); - let paramdata = - condition + - '#' + - PMO_LIST.pageid + - '#' + - byids + - '#' + - '' + - '#' + - pageInfo.pageSize + - '#' + - pageInfo.pageIndex; - ajax({ - url: PMO_LIST.queryByCondURL, - data: paramdata, - success: (res) => { - if (res.success) { - if (res.data) { - //调用查询方法 - setDefData(PMO_LIST.dataSource, 'currentTab', PMO_LIST.all); - this.setState({ - currentTab: PMO_LIST.all - }); - let rowsData = { rows: [] }; - if (res.data.currentGrid && res.data.currentGrid[tableId]) { - rowsData = res.data.currentGrid[tableId]; - } - this.props.table.setAllTableData(tableId, rowsData); - buttonController.setListButtonVisiable(this.props, PMO_LIST.all); - } - } - } - }); - } - } - if (linkkey) { - this.props.setUrlParam({ [PMO_LIST.LINK_KEY]: null }); - cacheTools.remove(linkkey); - } - } - } - //初始化Excel导入配置 - function initExcelImportConfig(props) { - //导入主子表 - let excelimportconfig = excelImportconfig( - props, - PMO_LIST.excelOutput.module, - PMO_LIST.excelOutput.billtype, - true, - '', - { - appcode: PMO_LIST.appcode, - pagecode: PMO_CARD.pageimportid - }, - () => { - //导入按钮的回调 - buttonClick.call(this, props, PMO_LIST_BUTTON.Import); - } - ); - props.button.setUploadConfig(PMO_LIST_BUTTON.Import, excelimportconfig); - } + ajax({ + url: PMO_LIST.queryByCondURL, + data: paramdata, + success: (res) => { + if (res.success) { + if (res.data) { + //调用查询方法 + setDefData(PMO_LIST.dataSource, 'currentTab', PMO_LIST.all); + this.setState({ + currentTab: PMO_LIST.all + }); + let rowsData = {rows: []}; + if (res.data.currentGrid && res.data.currentGrid[tableId]) { + rowsData = res.data.currentGrid[tableId]; + } + this.props.table.setAllTableData(tableId, rowsData); + buttonController.setListButtonVisiable(this.props, PMO_LIST.all); + } + } + removeGlobalStorage('localStorage', 'QueryCriteria'); + } + }); + } + } + + function toggleShow() { + //处理生产大屏数据穿透 + process4dashboard.call(this); + if (!this.linkquery) { + return; + } + let _this = this; + //这里需要处理下计划订单联查流程生产订单服务 + let linkparam = cacheTools.get('55B4LinkTo55A2'); + if (!linkparam) { + //配套变更建议 + linkparam = cacheTools.get('mosLinkTo55A2'); + } + + let linkkey = props.getUrlParam(PMO_LIST.LINK_KEY); + //供应链控制台 + if (!linkparam && linkkey) { + linkparam = cacheTools.get(linkkey); + } + let pageInfo = this.props.table.getTablePageInfo(tableId); //分页信息 + //处理其他单据联查 + if (linkparam) { + //this.linkquery = true; + if (linkparam) { + let ids = linkparam.linkids; + if (ids) { + let condition = 'querybyid'; + let byids = JSON.stringify(ids); + let paramdata = + condition + + '#' + + PMO_LIST.pageid + + '#' + + byids + + '#' + + '' + + '#' + + pageInfo.pageSize + + '#' + + pageInfo.pageIndex; + ajax({ + url: PMO_LIST.queryByCondURL, + data: paramdata, + success: (res) => { + if (res.success) { + if (res.data) { + //调用查询方法 + setDefData(PMO_LIST.dataSource, 'currentTab', PMO_LIST.all); + this.setState({ + currentTab: PMO_LIST.all + }); + let rowsData = {rows: []}; + if (res.data.currentGrid && res.data.currentGrid[tableId]) { + rowsData = res.data.currentGrid[tableId]; + } + this.props.table.setAllTableData(tableId, rowsData); + buttonController.setListButtonVisiable(this.props, PMO_LIST.all); + } + } + } + }); + } + } + if (linkkey) { + this.props.setUrlParam({[PMO_LIST.LINK_KEY]: null}); + cacheTools.remove(linkkey); + } + } + } + + //初始化Excel导入配置 + function initExcelImportConfig(props) { + //导入主子表 + let excelimportconfig = excelImportconfig( + props, + PMO_LIST.excelOutput.module, + PMO_LIST.excelOutput.billtype, + true, + '', + { + appcode: PMO_LIST.appcode, + pagecode: PMO_CARD.pageimportid + }, + () => { + //导入按钮的回调 + buttonClick.call(this, props, PMO_LIST_BUTTON.Import); + } + ); + props.button.setUploadConfig(PMO_LIST_BUTTON.Import, excelimportconfig); + // 导入序列号 + let excelimportconfig1 = excelImportconfig( + props, + PMO_LIST.excelOutput.module, + 'pmo_sernio', // XML文件名称 + true, + '', + { + appcode: PMO_LIST.appcode, + pagecode: '50080000_import1' + }, + () => { + //导入按钮的回调 + buttonClick.call(this, props, PMO_CARD_BUTTON.Import); + } + ); + props.button.setUploadConfig(PMO_CARD_BUTTON.ImportNo, excelimportconfig1); + } } diff --git a/src/mmpac/mmpac/pmo/main/config.json b/src/mmpac/mmpac/pmo/main/config.json index d420ad48..b2004d7b 100644 --- a/src/mmpac/mmpac/pmo/main/config.json +++ b/src/mmpac/mmpac/pmo/main/config.json @@ -4,14 +4,16 @@ "uap/common/components/ApproveDetail", "uap/common/components/NCUploader", "uap/common/components/approvalTrans", - "ic/ic/components/billReserve" + "ic/ic/components/billReserve", + "uap/common/components/excelImportconfig" ], "dependjs": [ "../../../../uap/common/components/codeConfigModal/index.js", "../../../../uap/common/components/ApproveDetail/index.js", "../../../../uap/common/components/NCUploader/index.js", "../../../../uap/common/components/approvalTrans/index.js", - "../../../../ic/ic/components/billReserve/index.js" + "../../../../ic/ic/components/billReserve/index.js", + "../../../../uap/common/components/excelImportconfig/index.js" ], "report": true } \ No newline at end of file diff --git a/src/mmpac/mmpac/pmo/pmoconst/pmoconst.js b/src/mmpac/mmpac/pmo/pmoconst/pmoconst.js index b525a7e4..deb6ecd5 100644 --- a/src/mmpac/mmpac/pmo/pmoconst/pmoconst.js +++ b/src/mmpac/mmpac/pmo/pmoconst/pmoconst.js @@ -175,6 +175,7 @@ const PMO_LIST_BUTTON = { pmobcdirectprint: 'PMOBCDirectPrint', //直接打印条码 pmobcprint: 'PMOBCPrint', //打印条码 Import: 'Import', //导入 + ImportNo: 'ImportNo', //导入序列号 ExportTem: 'ExportTem' //导出 }; const PMO_CARD_BUTTON = { @@ -307,6 +308,7 @@ const PMO_CARD_BUTTON = { grand_g1: 'grand_g1', oresetno: 'OResetno', //联副产品重新排号 Import: 'Import', //导入 + ImportNo: 'ImportNo', //导入序列号 ExportTem: 'ExportTem', //导出 PushToPlm: 'pushToPlm' //导出 };