From 99a69a32cb2f738fa1e1867dc580d41d3183826e Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Thu, 19 Dec 2024 14:36:58 +0800 Subject: [PATCH 1/5] =?UTF-8?q?2024-12-19=20=E6=8E=A5=E5=8F=A3=E6=9B=B4?= =?UTF-8?q?=E6=94=B9=E5=92=8C=E9=85=8D=E6=96=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/part/partInformation.js | 7 +- src/api/part/recipeManagement.js | 14 + src/views/modules/part/bomManagement.vue | 537 +++--- .../modules/part/locationInformation.vue | 270 +++ .../modules/part/manufacturerInformation.vue | 52 +- src/views/modules/part/partInformation.vue | 27 +- src/views/modules/part/recipeManagement.vue | 1614 ++++++++++------- 7 files changed, 1439 insertions(+), 1082 deletions(-) create mode 100644 src/views/modules/part/locationInformation.vue diff --git a/src/api/part/partInformation.js b/src/api/part/partInformation.js index 8cbf2fb..f569956 100644 --- a/src/api/part/partInformation.js +++ b/src/api/part/partInformation.js @@ -198,11 +198,6 @@ export const queryPartItem = data => createAPI(`/plm/partInformation/queryPartIt */ export const queryMasterField = data => createAPI(`/plm/partInformation/queryMasterField`,'post',data) -/** - * 临时物料转为正式物料 - */ -export const toBecomeOfficialPart = data => createAPI(`/plm/partInformation/toBecomeOfficialPart`,'post',data) - /** * 查询物料的bom版本列表 */ @@ -316,3 +311,5 @@ export const getItemExclusionAlreadyExists = data => createAPI(`/plm/partInforma export const getPartCharacteristicList = data => createAPI(`/plm/partInformation/getPartCharacteristicList`,'post',data) export const partInformationEdit2 = data => createAPI(`/plm/partInformation/partInformationEdit2`,'post',data) + +export const locationInformationSearch = data => createAPI(`/plm/partInformation/locationInformationSearch`,'post',data) diff --git a/src/api/part/recipeManagement.js b/src/api/part/recipeManagement.js index d245cb6..eb4967b 100644 --- a/src/api/part/recipeManagement.js +++ b/src/api/part/recipeManagement.js @@ -189,4 +189,18 @@ export const queryManufStructCostDistribtionTable = data => createAPI(`/plm/reci */ export const queryMultiLevelStructureTable = data => createAPI(`/plm/recipeManagement/queryMultiLevelStructureTable`,'post',data) +/** + * 查出可创建Recipe的物料 + * @param data + * @returns {*} + */ +export const queryPartListRecipe = data => createAPI(`/plm/recipeManagement/queryPartListRecipe`,'post',data) + +/** + * 查出所有类型的物料 + * @param data + * @returns {*} + */ +export const queryPartListAll = data => createAPI(`/plm/recipeManagement/queryPartListAll`,'post',data) + diff --git a/src/views/modules/part/bomManagement.vue b/src/views/modules/part/bomManagement.vue index 18abd02..d5f0f83 100644 --- a/src/views/modules/part/bomManagement.vue +++ b/src/views/modules/part/bomManagement.vue @@ -51,7 +51,6 @@ type="selection" header-align="center" align="center" - :selectable="selectFlag" width="50"> { @@ -2757,15 +2723,16 @@ export default { } }) }, + // 刷新方法 queryBomByProductTable () { queryBomByProductTable(this.detailData).then(({data}) => { if (data.code === 0) { this.byProductList = data.rows - } }) }, + // 刷新方法 queryManufStructCostDistribtionTable () { queryManufStructCostDistribtionTable(this.detailData).then(({data}) => { @@ -2774,6 +2741,7 @@ export default { } }) }, + // 刷新方法 queryMultiLevelStructureTable () { queryMultiLevelStructureTable(this.detailData).then(({data}) => { @@ -2784,16 +2752,7 @@ export default { }, // ======== 列表数据操作方法 ======== - /** - * 未知 - * @returns {boolean} - */ - selectFlag () { - return true - }, - /** - * 获取数据列表 - */ + // 获取数据列表 getDataList () { //如果是跳转过来的 要判断 if (localStorage.getItem('bomData') != undefined) { @@ -2817,7 +2776,6 @@ export default { if(data.engChgLevel&&data.engChgLevel!==''&&data.engChgLevel!==null){ this.updateModal(this.dataList[0]) } - } } this.queryLoading = false @@ -2828,19 +2786,15 @@ export default { } }) }, - /** - * 复选列表信息 - * @param val - */ + + // 复选列表信息 selectionBom (val) { this.bomSelections = val this.$refs.selectDiv.setLengthselected(this.bomSelections.length) }, // ======== 新增/编辑模态框 ======== - /** - * bom新增模态框 - */ + // bom新增模态框 addModal () { this.modalData = { flag: '1', @@ -2886,9 +2840,8 @@ export default { this.modalDisableFlag = false this.modalFlag = true }, - /** - * bom编辑模态框 - */ + + // bom编辑模态框 async updateModal (row) { this.modalData = { flag: '2', @@ -2926,9 +2879,8 @@ export default { } }) }, - /** - * 替代新增模态框 - */ + + // 替代新增模态框 saveBomDetail () { if (this.modalData.partNo === '' || this.modalData.partNo == null) { this.$message.warning('请先选择Bom物料!') @@ -2974,9 +2926,8 @@ export default { } }) }, - /** - * 替代编辑模态框 - */ + + // 替代编辑模态框 updateBomDetail () { if (this.modalData.partNo === '' || this.modalData.partNo == null) { this.$message.warning('请先选择Bom物料!') @@ -3021,9 +2972,8 @@ export default { } }) }, - /** - * 子明细新增模态框 - */ + + // 子明细新增模态框 saveComponentModal () { if (this.detailData.alternativeNo === '' || this.detailData.alternativeNo == null) { this.$message.warning('请先选择替代!') @@ -3072,9 +3022,8 @@ export default { this.componentDisableFlag = false this.componentSaveModal = true }, - /** - * 副产品新增模态框 - */ + + // 副产品新增模态框 saveByProductModal () { if (this.detailData.alternativeNo === '' || this.detailData.alternativeNo == null) { this.$message.warning('请先选择替代!') @@ -3123,9 +3072,8 @@ export default { this.componentDisableFlag = false this.componentSaveModal = true }, - /** - * 子明细编辑模态框 - */ + + // 子明细编辑模态框 updateComponentModal (row) { // if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') { // this.$message.warning('不可编辑的替代状态!') @@ -3160,9 +3108,8 @@ export default { this.componentDisableFlag = true this.componentSaveModal = true }, - /** - * 副产品编辑模态框 - */ + + // 副产品编辑模态框 updateByProductModal (row) { // if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') { // this.$message.warning('不可编辑的替代状态!') @@ -3197,9 +3144,8 @@ export default { this.componentDisableFlag = true this.componentSaveModal = true }, - /** - * 副产品成本分配编辑模态框 - */ + + // 副产品成本分配编辑模态框 updateManufStructCostDistribModal (row) { // if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') { // this.$message.warning('不可编辑的替代状态!') @@ -3223,11 +3169,8 @@ export default { this.manufStructCostDistribModal = true }, - // ======== 新增/编辑/删除方法 ======== - /** - * bom新增/编辑 - */ + // bom新增/编辑 saveData () { if (this.modalData.partNo === '' || this.modalData.partNo == null) { this.$message.warning('请选择物料编码!') @@ -3320,9 +3263,8 @@ export default { }) } }, - /** - * 新增编辑模态框关闭 - */ + + // 新增编辑模态框关闭 closeModal () { // let tempArr = [] // tempArr.push(this.modalData) @@ -3359,9 +3301,8 @@ export default { //this.getDataList() this.modalFlag = false }, - /** - * 新增编辑模态框关闭 - */ + + // 新增编辑模态框关闭 closeModalX (done) { // let tempArr = [] // tempArr.push(this.modalData) @@ -3398,9 +3339,8 @@ export default { //this.getDataList() done() }, - /** - * bom删除 - */ + + // bom删除 delModal () { if (this.bomSelections.length === 0) { this.$message.warning('请勾选要删除的BOM!') @@ -3433,9 +3373,8 @@ export default { }).catch(() => { }) }, - /** - * 查询物料 - */ + + // 查询物料 queryPartList () { this.partData.limit = this.pageSize2 this.partData.page = this.pageIndex2 @@ -3465,19 +3404,12 @@ export default { this.modalData.partDesc = data.page.list[0].partDesc this.modalData.printUnit = data.page.list[0].printUnit this.modalData.printUnitName = data.page[0].printUnitName - return } } }) - this.modalData.partDesc = '' - this.modalData.printUnit = '' - this.modalData.printUnitName = '' }, - /** - * 双击选中物料 - * @param row - */ + // 双击选中物料 getRowData (row) { this.modalData.partNo = row.partNo this.modalData.partDesc = row.partDesc @@ -3511,10 +3443,7 @@ export default { }) }, - /** - * 双击选中工序 - * @param row - */ + // 双击选中工序 getRowOperationData (row) { this.componentData.operationId = row.operationId this.componentData.operationNo = row.operationNo @@ -3543,9 +3472,7 @@ export default { this.copyPartModelFlag = false }, - /** - * 子物料列表 - */ + // 子物料列表 queryComponentPartModal () { this.componentPartData.limit = this.pageSize3 this.componentPartData.page = this.pageIndex3 @@ -3566,9 +3493,7 @@ export default { }) }, - /** - * copy物料列表 - */ + // copy物料列表 queryCopyPartModal () { this.copyPartData.limit = this.pageSize4 this.copyPartData.page = this.pageIndex4 @@ -3588,9 +3513,7 @@ export default { }) }, - /** - * 物料列表 - */ + // 物料列表 queryComponentPartList () { this.componentPartData.limit = this.pageSize3 this.componentPartData.page = this.pageIndex3 @@ -3607,9 +3530,7 @@ export default { }) }, - /** - * copy物料查询列表 - */ + // copy物料查询列表 queryCopyPartList () { this.copyPartData.limit = this.pageSize4 this.copyPartData.page = this.pageIndex4 @@ -3695,18 +3616,12 @@ export default { }) }, - /** - * 表格的新增 - * @param row - * @param rowIndex - */ + // 表格的新增 rowClassName({ row, rowIndex }) { row.xh = rowIndex + 1 }, - /** - * 选中数据 - * @param selection - */ + + // 选中数据 componentSelectionChange(selection) { this.checkedDetail = selection }, @@ -3714,9 +3629,8 @@ export default { byProductSelection (selection) { this.checkedByProduct = selection }, - /** - * 删除子物料 - */ + + // 删除子物料 deleteComponentPart () { // if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') { // this.$message.warning('不可编辑的替代状态!') @@ -3757,9 +3671,7 @@ export default { } }, - /** - * 删除子物料 - */ + // 删除子物料 deleteByProduct () { // if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') { // this.$message.warning('不可编辑的替代状态!') @@ -3799,10 +3711,8 @@ export default { }) } }, - /** - * 子物料 - * @param row - */ + + // 子物料 // componentPartClickRow (row) { // this.$refs.componentPartTable.toggleRowSelection(row) // }, @@ -3823,9 +3733,7 @@ export default { // // 唯一值,一般都为id // return row.partNo // }, - /** - * 新增子明细方法 - */ + // 新增子明细方法 componentDataSave (isClose) { if (this.componentData.lineSequence === '' || this.componentData.lineSequence == null) { this.$message.warning('序号不能为空!') @@ -3919,9 +3827,7 @@ export default { } }, - /** - * 编辑副产品成本分配方法 - */ + // 编辑副产品成本分配方法 manufStructCostDistribUpdate () { if (this.manufStructCostDistribData.itemCostDistribution < 0 || this.manufStructCostDistribData.itemCostDistribution > 1) { this.$message.warning('项目成本分配系数必须介于0和1之间!') @@ -3944,9 +3850,8 @@ export default { } }) }, - /** - * 回车事件 - */ + + // 回车事件 focusNextInput (index, type) { let aaa = '' if (this.subDetailList.length - 1 === index) { @@ -3958,9 +3863,8 @@ export default { this.$refs[aaa].focus() }) }, - /** - * 保存主表信息 - */ + + // 保存主表信息 saveBomHeader () { if (this.modalData.partNo === '' || this.modalData.partNo == null) { this.$message.warning('请先选择Bom物料!') @@ -4018,9 +3922,7 @@ export default { }) }, - /** - * 复制bom的模态框 - */ + // 复制bom的模态框 copyBomRevision () { this.copyBomData = { site: this.modalData.site, @@ -4050,9 +3952,8 @@ export default { } this.copyBomModelFlag = true }, - /** - * 复制bom的方法 - */ + + // 复制bom的方法 copyBom () { if (this.copyBomData.partNo === '' || this.copyBomData.partNo == null) { this.$message.warning('请选择Bom物料!') @@ -4093,9 +3994,8 @@ export default { this.copyLoading = false }) }, - /** - * 复制alternative的模态框 - */ + + // 复制alternative的模态框 copyBomAlternative () { this.copyAlternativeData = { site: this.detailData.site, @@ -4124,9 +4024,7 @@ export default { this.copyAlternativeModelFlag = true }, - /** - * 复制alternative的方法 - */ + // 复制alternative的方法 copyAlternative () { if (this.copyAlternativeData.partNo === '' || this.copyAlternativeData.partNo == null) { this.$message.warning('请选择Bom物料!') @@ -4171,9 +4069,7 @@ export default { }) }, - /** - * 新增替代方法 - */ + // 新增替代方法 detailDataSave () { if (this.saveDetailData.partNo === '' || this.saveDetailData.partNo == null) { this.$message.warning('请先选择Bom物料!') @@ -4199,10 +4095,6 @@ export default { this.$message.warning('请选择替代状态!') return } - // if (this.saveDetailData.minLotQty === '' || this.saveDetailData.minLotQty == null) { - // this.$message.warning('请填写最小订单数!') - // return - // } this.saveDetailLoading = true if (this.saveDetailData.flag === '1') { bomDetailSave(this.saveDetailData).then(({data}) => { @@ -4247,9 +4139,7 @@ export default { } }, - /** - * 删除替代 - */ + // 删除替代 deleteBomDetail () { if (this.detailData.alternativeNo === '' || this.detailData.alternativeNo == null) { this.$message.warning('请选择要删除的替代编码!') @@ -4284,9 +4174,8 @@ export default { }).catch(() => { }) }, - /** - * 修改替代状态为 Buildable - */ + + // 修改替代状态为 Buildable updateStatusToBuildable () { this.$confirm(`是否修改状态为Buildable?`, '提示', { confirmButtonText: '确定', @@ -4313,9 +4202,8 @@ export default { }).catch(() => { }) }, - /** - * 修改替代状态为 Obsolete - */ + + // 修改替代状态为 Obsolete updateStatusToObsolete () { this.$confirm(`是否修改状态为Obsolete?`, '提示', { confirmButtonText: '确定', @@ -4342,9 +4230,8 @@ export default { }).catch(() => { }) }, - /** - * 替代改变事件 - */ + + // 替代改变事件 alternativeChange () { queryBomComponent(this.detailData).then(({data}) => { if (data && data.code === 0) { @@ -4383,9 +4270,7 @@ export default { }) }, - /** - * 根据物料编码查询工序 - */ + // 根据物料编码查询工序 queryOperationList () { this.operationData.partNo = this.modalData.partNo // 查询所有 @@ -4411,11 +4296,7 @@ export default { }, // ======== chooseList相关方法 ======== - /** - * 获取基础数据列表S - * @param val - * @param type - */ + // 获取基础数据列表S getBaseList (val, type) { this.tagNo = val this.$nextTick(() => { @@ -4426,10 +4307,8 @@ export default { this.$refs.baseList.init(val, strVal) }) }, - /** - * 列表方法的回调 - * @param val - */ + + // 列表方法的回调 getBaseData (val) { if (this.tagNo === 117) { this.componentData.issueToLoc = val.location_id @@ -4438,9 +4317,7 @@ export default { }, // ======== 导出相关方法 ======== - /** - * 导出excel - */ + // 导出excel async createExportData () { this.searchData.limit = -1 this.searchData.page = 1 diff --git a/src/views/modules/part/locationInformation.vue b/src/views/modules/part/locationInformation.vue new file mode 100644 index 0000000..d009fac --- /dev/null +++ b/src/views/modules/part/locationInformation.vue @@ -0,0 +1,270 @@ + + + + + + diff --git a/src/views/modules/part/manufacturerInformation.vue b/src/views/modules/part/manufacturerInformation.vue index 0bd0589..dd5a1f0 100644 --- a/src/views/modules/part/manufacturerInformation.vue +++ b/src/views/modules/part/manufacturerInformation.vue @@ -175,9 +175,9 @@ export default { columnList: [ { userId: this.$store.state.user.name, - functionId: 100006, - serialNumber: '100006Table1ManufacturerId', - tableId: "100006Table1", + functionId: 104007, + serialNumber: '104007Table1ManufacturerId', + tableId: "104007Table1", tableName: "制造商信息表", columnProp: 'manufacturerId', headerAlign: "center", @@ -193,10 +193,10 @@ export default { }, { userId: this.$store.state.user.name, - functionId: 100006, - serialNumber: '100006Table1ManufacturerName', - tableId: "100006Table1", - tableName: "制造商表", + functionId: 104007, + serialNumber: '104007Table1ManufacturerName', + tableId: "104007Table1", + tableName: "制造商信息表", columnProp: 'manufacturerName', headerAlign: "center", align: "left", @@ -210,9 +210,9 @@ export default { columnWidth: 300 }, { - functionId: 100006, - serialNumber: '100006Table1Active', - tableId: '100006Table1', + functionId: 104007, + serialNumber: '104007Table1Active', + tableId: '104007Table1', tableName: '制造商信息表', columnProp: 'active', headerAlign: 'center', @@ -228,10 +228,10 @@ export default { }, { userId: this.$store.state.user.name, - functionId: 100006, - serialNumber: '100006Table1CreateDate', - tableId: '100006Table1', - tableName: '制造商表', + functionId: 104007, + serialNumber: '104007Table1CreateDate', + tableId: '104007Table1', + tableName: '制造商信息表', columnProp: 'createDate', headerAlign: 'center', align: 'center', @@ -246,10 +246,10 @@ export default { }, { userId: this.$store.state.user.name, - functionId: 100006, - serialNumber: '100006Table1CreateBy', - tableId: "100006Table1", - tableName: "制造商表", + functionId: 104007, + serialNumber: '104007Table1CreateBy', + tableId: "104007Table1", + tableName: "制造商信息表", columnProp: 'createBy', headerAlign: "center", align: "center", @@ -264,10 +264,10 @@ export default { }, { userId: this.$store.state.user.name, - functionId: 100006, - serialNumber: '100006Table1UpdateDate', - tableId: "100006Table1", - tableName: "制造商表", + functionId: 104007, + serialNumber: '104007Table1UpdateDate', + tableId: "104007Table1", + tableName: "制造商信息表", columnProp: 'updateDate', headerAlign: "center", align: "center", @@ -282,10 +282,10 @@ export default { }, { userId: this.$store.state.user.name, - functionId: 100006, - serialNumber: '100006Table1UpdateBy', - tableId: "100006Table1", - tableName: "制造商表", + functionId: 104007, + serialNumber: '104007Table1UpdateBy', + tableId: "104007Table1", + tableName: "制造商信息表", columnProp: 'updateBy', headerAlign: "center", align: "center", diff --git a/src/views/modules/part/partInformation.vue b/src/views/modules/part/partInformation.vue index e3abe9d..d6171ea 100644 --- a/src/views/modules/part/partInformation.vue +++ b/src/views/modules/part/partInformation.vue @@ -1544,13 +1544,12 @@ deleteLocation, // 删除物料库位(单删) commitItemValue, // 修改物料属性值 - deleteItem, // 删除模板属性, + deleteItem, // 删除模板属性 getItemLists, // 获取模板属性 addPartItem, // 新增物料属性 deletePartItem, // 删除物料属性 queryPartItem, queryMasterField, // 根据物料编码查 masterPart 属性 - toBecomeOfficialPart, // 临时物料转为正式物料 queryPartRevisionList, // 查询物料的bom版本列表 saveRevision, // 新增物料版本 updateRevision, // 编辑物料版本 @@ -3522,6 +3521,7 @@ cancelButtonText: '取消', type: 'warning' }).then(() => { + row.updateBy = this.$store.state.user.name deleteRevision(row).then(({data}) => { if (data && data.code === 0) { this.queryPartRevisionList() @@ -3541,26 +3541,6 @@ }) }, - // 临时物料转为正式物料 - toBecomeOfficialPart () { - toBecomeOfficialPart(this.modalData).then(({data}) => { - if (data && data.code === 0) { - this.getDataList() - this.modalFlag = false - this.$message({ - message: '操作成功', - type: 'success', - duration: 1500, - onClose: () => {} - }) - } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' - }) - } - }) - }, - // 物料编码失去焦点事件 queryMasterField () { // 根据物料编码查 masterPart 属性 @@ -4633,6 +4613,7 @@ let inData = { site: this.$store.state.user.site, partNo: this.partCurrentRow.partNo, + updateBy: this.$store.state.user.name, locationList: this.locationSelections1 } addDefaultLocation(inData).then(({data}) => { @@ -4662,6 +4643,7 @@ let inData = { site: this.$store.state.user.site, partNo: this.partCurrentRow.partNo, + updateBy: this.$store.state.user.name, locationList: this.locationSelections2 } deleteDefaultLocation(inData).then(({data}) => { @@ -4689,6 +4671,7 @@ cancelButtonText: '取消', type: 'warning' }).then(() => { + row.updateBy = this.$store.state.user.name deleteLocation(row).then(({data}) => { if (data && data.code === 0) { this.getDefaultLocation() diff --git a/src/views/modules/part/recipeManagement.vue b/src/views/modules/part/recipeManagement.vue index e5dd1d6..70904a2 100644 --- a/src/views/modules/part/recipeManagement.vue +++ b/src/views/modules/part/recipeManagement.vue @@ -8,6 +8,17 @@ + + + + + + + + + + + 查询 新增 @@ -40,7 +51,6 @@ type="selection" header-align="center" align="center" - :selectable="selectFlag" width="50"> - + 物料编码 物料编码 - + - + - + - + - - + + - - - - - + + - + 保存 @@ -151,22 +158,22 @@ - + 新增 删除 编辑 - Copy + Copy Build - Retire - 转正式配方 + Retire + 转正式Recipe - + - + - - - - + @@ -192,8 +196,9 @@ + - + @@ -239,7 +244,7 @@ - + @@ -284,7 +289,7 @@ - + - + - + - + - - - - - - + @@ -380,7 +380,7 @@ - +
@@ -415,14 +415,25 @@ + + +
- + 关闭
- + @@ -437,7 +448,7 @@ - 查询 + 查询
+ + + 关闭 - + - + - 子物料编码 + 子物料编码 子物料编码 @@ -482,7 +504,7 @@ - + @@ -493,17 +515,17 @@ - + - + - + 工序 - + 发料库位 @@ -511,9 +533,10 @@ - + + @@ -555,7 +578,7 @@ - + @@ -622,15 +645,18 @@ Source Revision - + - - + + + + + - + @@ -669,22 +695,26 @@
Destination Revision - - + + 物料编码 + - - + + + + + - + - + - - + + @@ -699,26 +729,80 @@
- 保存 + 保存 关闭
+ + + + + + + + + + + 查询 + + + + + + + + + + + + 关闭 + + +
Source Revision - + - - + + + + + - + @@ -736,22 +820,26 @@
Destination Revision - - + + 物料编码 + - - + + + + + - + - - + + @@ -766,7 +854,7 @@
- 保存 + 保存 关闭 @@ -805,10 +893,10 @@ import { queryRecipeByProductTable, // 刷新副产品 queryManufStructCostDistribtionTable, // 刷新项目成本分配 queryMultiLevelStructureTable, // 刷新多级别结构 + queryPartListRecipe, // 查出可创建Recipe的物料 + queryPartListAll, // 查询包含Purchase(Raw)的物料 } from '@/api/part/recipeManagement.js' import ChooseList from '@/views/modules/common/Chooselist' -import dayjs from "dayjs"; -import fa from "element-ui/src/locale/lang/fa"; export default { // 组件 @@ -858,15 +946,17 @@ export default { handler: function (newV, oldV) { this.partData.partNo = this.partData.partNo.toUpperCase() } - } + }, + }, // 对象 data () { return { + initPage:false, // 导出 exportData: [], - exportName: 'recipe物料列表' + this.dayjs().format('YYYYMMDDHHmmss'), - exportHeader: ['recipe物料列表'], + exportName: 'Recipe列表' + this.dayjs().format('YYYYMMDDHHmmss'), + exportHeader: ['Recipe列表'], exportFooter: [], resultList: [], // ======== 行高 ======== @@ -875,12 +965,23 @@ export default { pageIndex: 1, pageSize: 50, totalPage: 0, + pageIndex2: 1, + pageSize2: 20, + totalPage2: 0, + pageIndex3: 1, + pageSize3: 20, + totalPage3: 0, + pageIndex4: 1, + pageSize4: 20, + totalPage4: 0, selectedDataNum: 0, // 条件查询 searchData: { site: this.$store.state.user.site, partNo: '', partDesc: '', + bomType:'', + engChgLevel:'', page: 1, limit: 10 }, @@ -889,6 +990,8 @@ export default { saveHeaderLoading: false, saveDetailLoading: false, saveAllLoading: false, + toBecomeOfficialLoading: false, + copyLoading: false, // 初始页签 detailTable: 'recipe_detail', subDetailTable: 'recipe_sub_detail', @@ -949,6 +1052,7 @@ export default { shrinkageFactor: '', lineItemNo: '', operationId: '', + operationNo: '', issueToLoc: '', issueToLocName: '', noteText: '', @@ -964,12 +1068,24 @@ export default { site: this.$store.state.user.site, partNo: '', partDesc: '', + page: 1, + limit: 10 }, componentPartData: { site: this.$store.state.user.site, partNo: '', partDesc: '', - status: '' + status: '', + page: 1, + limit: 10 + }, + copyPartData: { + type: '', + site: this.$store.state.user.site, + partNo: '', + partDesc: '', + page: 1, + limit: 10 }, saveDetailData: { flag: '', @@ -1001,6 +1117,7 @@ export default { copyRecipeData: { site: '', partNo: '', + partDesc: '', engChgLevel: '', bomType: '', effPhaseInDate: '', @@ -1012,6 +1129,7 @@ export default { copyAlternativeData: { site: '', partNo: '', + partDesc: '', engChgLevel: '', bomType: '', alternativeNo: '', @@ -1043,6 +1161,7 @@ export default { dataList: [], partList: [], componentPartList: [], + copyPartList: [], componentPartSelections: [], subDetailList: [], byProductList: [], @@ -1056,10 +1175,10 @@ export default { columnList: [ { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table1PartNo', - tableId: '104002Table1', - tableName: '配方信息表', + functionId: 104002003, + serialNumber: '104002003Table1PartNo', + tableId: '104002003Table1', + tableName: 'Recipe信息表', columnProp: 'partNo', headerAlign: 'center', align: 'center', @@ -1074,10 +1193,10 @@ export default { }, { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table1PartDesc', - tableId: '104002Table1', - tableName: '配方信息表', + functionId: 104002003, + serialNumber: '104002003Table1PartDesc', + tableId: '104002003Table1', + tableName: 'Recipe信息表', columnProp: 'partDesc', headerAlign: 'center', align: 'left', @@ -1088,17 +1207,17 @@ export default { sortLv: 0, status: true, fixed: '', - columnWidth: 120 + columnWidth: 300 }, { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table1BomType', - tableId: '104002Table1', - tableName: '配方信息表', + functionId: 104002003, + serialNumber: '104002003Table1BomType', + tableId: '104002003Table1', + tableName: 'Recipe信息表', columnProp: 'bomType', headerAlign: 'center', - align: 'center', + align: 'left', columnLabel: '制造类型', columnHidden: false, columnImage: false, @@ -1110,28 +1229,28 @@ export default { }, { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table1EngChgLevel', - tableId: '104002Table1', - tableName: '配方信息表', + functionId: 104002003, + serialNumber: '104002003Table1EngChgLevel', + tableId: '104002003Table1', + tableName: 'Recipe信息表', columnProp: 'engChgLevel', headerAlign: 'center', - align: 'center', - columnLabel: '配方版本号', + align: 'right', + columnLabel: 'Recipe版本号', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', - columnWidth: 120 + columnWidth: 100 }, { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table1engRevision', - tableId: '104002Table1', - tableName: '配方信息表', + functionId: 104002003, + serialNumber: '104002003Table1engRevision', + tableId: '104002003Table1', + tableName: 'Recipe信息表', columnProp: 'engRevision', headerAlign: 'center', align: 'center', @@ -1142,32 +1261,32 @@ export default { sortLv: 0, status: true, fixed: '', - columnWidth: 120 - }, - { - userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table1NetWeight', - tableId: '104002Table1', - tableName: '配方信息表', - columnProp: 'netWeight', - headerAlign: 'center', - align: 'right', - columnLabel: '净重', - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: '', - columnWidth: 80 + columnWidth: 100 }, + // { + // userId: this.$store.state.user.name, + // functionId: 104002003, + // serialNumber: '104002003Table1NetWeight', + // tableId: '104002003Table1', + // tableName: 'Recipe信息表', + // columnProp: 'netWeight', + // headerAlign: 'center', + // align: 'right', + // columnLabel: '净重', + // columnHidden: false, + // columnImage: false, + // columnSortable: false, + // sortLv: 0, + // status: true, + // fixed: '', + // columnWidth: 100 + // }, { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table1EffPhaseInDate', - tableId: '104002Table1', - tableName: '配方信息表', + functionId: 104002003, + serialNumber: '104002003Table1EffPhaseInDate', + tableId: '104002003Table1', + tableName: 'Recipe信息表', columnProp: 'effPhaseInDate', headerAlign: 'center', align: 'center', @@ -1182,10 +1301,10 @@ export default { }, { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table1EffPhaseOutDate', - tableId: '104002Table1', - tableName: '配方信息表', + functionId: 104002003, + serialNumber: '104002003Table1EffPhaseOutDate', + tableId: '104002003Table1', + tableName: 'Recipe信息表', columnProp: 'effPhaseOutDate', headerAlign: 'center', align: 'center', @@ -1200,10 +1319,10 @@ export default { }, { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table1CreateDate', - tableId: '104002Table1', - tableName: '配方信息表', + functionId: 104002003, + serialNumber: '104002003Table1CreateDate', + tableId: '104002003Table1', + tableName: 'Recipe信息表', columnProp: 'createDate', headerAlign: 'center', align: 'center', @@ -1214,14 +1333,14 @@ export default { sortLv: 0, status: true, fixed: '', - columnWidth: 130 + columnWidth: 170 }, { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table1CreateBy', - tableId: '104002Table1', - tableName: '配方信息表', + functionId: 104002003, + serialNumber: '104002003Table1CreateBy', + tableId: '104002003Table1', + tableName: 'Recipe信息表', columnProp: 'createBy', headerAlign: 'center', align: 'center', @@ -1232,14 +1351,14 @@ export default { sortLv: 0, status: true, fixed: '', - columnWidth: 80 + columnWidth: 100 }, { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table1UpdateDate', - tableId: '104002Table1', - tableName: '配方信息表', + functionId: 104002003, + serialNumber: '104002003Table1UpdateDate', + tableId: '104002003Table1', + tableName: 'Recipe信息表', columnProp: 'updateDate', headerAlign: 'center', align: 'center', @@ -1250,14 +1369,14 @@ export default { sortLv: 0, status: true, fixed: '', - columnWidth: 130 + columnWidth: 170 }, { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table1UpdateBy', - tableId: '104002Table1', - tableName: '配方信息表', + functionId: 104002003, + serialNumber: '104002003Table1UpdateBy', + tableId: '104002003Table1', + tableName: 'Recipe信息表', columnProp: 'updateBy', headerAlign: 'center', align: 'center', @@ -1268,7 +1387,7 @@ export default { sortLv: 0, status: true, fixed: '', - columnWidth: 80 + columnWidth: 100 } ], partColumnList: [ @@ -1283,6 +1402,7 @@ export default { sortLv: 0, status: true, fixed: '', + columnWidth: 120 }, { columnProp: 'partDesc', @@ -1293,37 +1413,63 @@ export default { columnImage: false, status: true, fixed: '', + columnWidth: 200 }, { - columnProp: 'partType', + columnProp: 'familyName', headerAlign: "center", align: "center", - columnLabel: '零件类型', + columnLabel: '物料分类', columnHidden: false, columnImage: false, status: true, fixed: '', + columnWidth: 100 + }, + { + columnProp: 'printUnit', + headerAlign: "center", + align: "left", + columnLabel: '计量单位', + columnHidden: false, + columnImage: false, + status: true, + fixed: '', + columnWidth: 100 }, { columnProp: 'spec', headerAlign: "center", - align: "center", + align: "left", columnLabel: '规格型号', columnHidden: false, columnImage: false, status: true, fixed: '', + columnWidth: 100 }, { - columnProp: 'printUnitName', + columnProp: 'partType', headerAlign: "center", - align: "center", - columnLabel: '计量单位', + align: "left", + columnLabel: '零件类型', columnHidden: false, columnImage: false, status: true, fixed: '', + columnWidth: 140 }, + { + columnProp: 'partStatusDesc', + headerAlign: "center", + align: "left", + columnLabel: '零件状态', + columnHidden: false, + columnImage: false, + status: true, + fixed: '', + columnWidth: 120 + } ], componentPartColumnList: [ { @@ -1335,6 +1481,7 @@ export default { columnImage: false, status: true, fixed: '', + columnWidth: 120 }, { columnProp: 'partDesc', @@ -1345,45 +1492,71 @@ export default { columnImage: false, status: true, fixed: '', + columnWidth: 200 }, { - columnProp: 'partType', + columnProp: 'familyName', headerAlign: "center", align: "center", - columnLabel: '零件类型', + columnLabel: '物料分类', + columnHidden: false, + columnImage: false, + status: true, + fixed: '', + columnWidth: 100 + }, + { + columnProp: 'printUnit', + headerAlign: "center", + align: "left", + columnLabel: '计量单位', columnHidden: false, columnImage: false, status: true, fixed: '', + columnWidth: 100 }, { columnProp: 'spec', headerAlign: "center", - align: "center", + align: "left", columnLabel: '规格型号', columnHidden: false, columnImage: false, status: true, fixed: '', + columnWidth: 100 }, { - columnProp: 'printUnitName', + columnProp: 'partType', headerAlign: "center", align: "center", - columnLabel: '计量单位', + columnLabel: '零件类型', columnHidden: false, columnImage: false, status: true, fixed: '', + columnWidth: 130 }, + { + columnProp: 'partStatusDesc', + headerAlign: "center", + align: "left", + columnLabel: '零件状态', + columnHidden: false, + columnImage: false, + status: true, + fixed: '', + columnWidth: 120 + } ], columnSubDetailList: [ { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table2LineSequence', - tableId: '104002Table2', - tableName: '配方子物料表', + functionId: 104002003, + serialNumber: '104002003Table2LineSequence', + tableId: '104002003Table2', + tableName: 'Recipe子物料表', columnProp: 'lineSequence', headerAlign: 'center', align: 'center', @@ -1398,10 +1571,10 @@ export default { }, { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table2ComponentPart', - tableId: '104002Table2', - tableName: '配方子物料表', + functionId: 104002003, + serialNumber: '104002003Table2ComponentPart', + tableId: '104002003Table2', + tableName: 'Recipe子物料表', columnProp: 'componentPart', headerAlign: 'center', align: 'center', @@ -1416,10 +1589,10 @@ export default { }, { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table2ComponentPartDesc', - tableId: '104002Table2', - tableName: '配方子物料表', + functionId: 104002003, + serialNumber: '104002003Table2ComponentPartDesc', + tableId: '104002003Table2', + tableName: 'Recipe子物料表', columnProp: 'componentPartDesc', headerAlign: 'center', align: 'left', @@ -1434,10 +1607,46 @@ export default { }, { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table2QtyPerAssembly', - tableId: '104002Table2', - tableName: '配方子物料表', + functionId: 104002003, + serialNumber: '104002003Table2PartStatus', + tableId: '104002003Table2', + tableName: 'Recipe子物料表', + columnProp: 'partStatus', + headerAlign: 'center', + align: 'left', + columnLabel: '零件状态编码', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 100 + }, + { + userId: this.$store.state.user.name, + functionId: 104002003, + serialNumber: '104002003Table2PartStatusDesc', + tableId: '104002003Table2', + tableName: 'Recipe子物料表', + columnProp: 'partStatusDesc', + headerAlign: 'center', + align: 'left', + columnLabel: '零件状态名称', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 100 + }, + { + userId: this.$store.state.user.name, + functionId: 104002003, + serialNumber: '104002003Table2QtyPerAssembly', + tableId: '104002003Table2', + tableName: 'Recipe子物料表', columnProp: 'qtyPerAssembly', headerAlign: 'center', align: 'right', @@ -1448,14 +1657,14 @@ export default { sortLv: 0, status: true, fixed: '', - columnWidth: 80 + columnWidth: 110 }, { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table2ComponentScrap', - tableId: '104002Table2', - tableName: '配方子物料表', + functionId: 104002003, + serialNumber: '104002003Table2ComponentScrap', + tableId: '104002003Table2', + tableName: 'Recipe子物料表', columnProp: 'componentScrap', headerAlign: 'center', align: 'right', @@ -1466,14 +1675,14 @@ export default { sortLv: 0, status: true, fixed: '', - columnWidth: 80 + columnWidth: 110 }, { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table2ShrinkageFactor', - tableId: '104002Table2', - tableName: '配方子物料表', + functionId: 104002003, + serialNumber: '104002003Table2ShrinkageFactor', + tableId: '104002003Table2', + tableName: 'Recipe子物料表', columnProp: 'shrinkageFactor', headerAlign: 'center', align: 'right', @@ -1488,10 +1697,10 @@ export default { }, { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table2ConsumptionItem', - tableId: '104002Table2', - tableName: '配方子物料表', + functionId: 104002003, + serialNumber: '104002003Table2ConsumptionItem', + tableId: '104002003Table2', + tableName: 'Recipe子物料表', columnProp: 'consumptionItem', headerAlign: 'center', align: 'left', @@ -1506,11 +1715,11 @@ export default { }, { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table2PrintUnitName', - tableId: '104002Table2', - tableName: '配方子物料表', - columnProp: 'printUnitName', + functionId: 104002003, + serialNumber: '104002003Table2PrintUnit', + tableId: '104002003Table2', + tableName: 'Recipe子物料表', + columnProp: 'printUnit', headerAlign: 'center', align: 'center', columnLabel: '单位', @@ -1524,10 +1733,10 @@ export default { }, { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table2IssueType', - tableId: '104002Table2', - tableName: '配方子物料表', + functionId: 104002003, + serialNumber: '104002003Table2IssueType', + tableId: '104002003Table2', + tableName: 'Recipe子物料表', columnProp: 'issueType', headerAlign: 'center', align: 'center', @@ -1538,15 +1747,15 @@ export default { sortLv: 0, status: true, fixed: '', - columnWidth: 80 + columnWidth: 140 }, { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table2OperationDesc', - tableId: '104002Table2', - tableName: '配方子物料表', - columnProp: 'operationId', + functionId: 104002003, + serialNumber: '104002003Table2OperationNo', + tableId: '104002003Table2', + tableName: 'Recipe子物料表', + columnProp: 'operationNo', headerAlign: 'center', align: 'center', columnLabel: '工序', @@ -1560,10 +1769,10 @@ export default { }, { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table2IssueToLoc', - tableId: '104002Table2', - tableName: '配方子物料表', + functionId: 104002003, + serialNumber: '104002003Table2IssueToLoc', + tableId: '104002003Table2', + tableName: 'Recipe子物料表', columnProp: 'issueToLocName', headerAlign: 'center', align: 'center', @@ -1578,10 +1787,10 @@ export default { }, { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table2NoteText', - tableId: '104002Table2', - tableName: '配方子物料表', + functionId: 104002003, + serialNumber: '104002003Table2NoteText', + tableId: '104002003Table2', + tableName: 'Recipe子物料表', columnProp: 'noteText', headerAlign: 'center', align: 'left', @@ -1598,10 +1807,10 @@ export default { columnSubDetailList2: [ { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table3LineSequence', - tableId: '104002Table3', - tableName: '配方副产品表', + functionId: 104002003, + serialNumber: '104002003Table3LineSequence', + tableId: '104002003Table3', + tableName: 'Recipe副产品表', columnProp: 'lineSequence', headerAlign: 'center', align: 'center', @@ -1616,10 +1825,10 @@ export default { }, { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table3ComponentPart', - tableId: '104002Table3', - tableName: '配方副产品表', + functionId: 104002003, + serialNumber: '104002003Table3ComponentPart', + tableId: '104002003Table3', + tableName: 'Recipe副产品表', columnProp: 'componentPart', headerAlign: 'center', align: 'center', @@ -1634,10 +1843,10 @@ export default { }, { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table3ComponentPartDesc', - tableId: '104002Table3', - tableName: '配方副产品表', + functionId: 104002003, + serialNumber: '104002003Table3ComponentPartDesc', + tableId: '104002003Table3', + tableName: 'Recipe副产品表', columnProp: 'componentPartDesc', headerAlign: 'center', align: 'left', @@ -1652,10 +1861,46 @@ export default { }, { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table3QtyPerAssembly', - tableId: '104002Table3', - tableName: '配方副产品表', + functionId: 104002003, + serialNumber: '104002003Table3PartStatus', + tableId: '104002003Table3', + tableName: 'Recipe副产品表', + columnProp: 'partStatus', + headerAlign: 'center', + align: 'left', + columnLabel: '零件状态编码', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 100 + }, + { + userId: this.$store.state.user.name, + functionId: 104002003, + serialNumber: '104002003Table3PartStatusDesc', + tableId: '104002003Table3', + tableName: 'Recipe副产品表', + columnProp: 'partStatusDesc', + headerAlign: 'center', + align: 'left', + columnLabel: '零件状态名称', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 100 + }, + { + userId: this.$store.state.user.name, + functionId: 104002003, + serialNumber: '104002003Table3QtyPerAssembly', + tableId: '104002003Table3', + tableName: 'Recipe副产品表', columnProp: 'qtyPerAssembly', headerAlign: 'center', align: 'right', @@ -1666,14 +1911,14 @@ export default { sortLv: 0, status: true, fixed: '', - columnWidth: 80 + columnWidth: 110 }, { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table3ComponentScrap', - tableId: '104002Table3', - tableName: '配方副产品表', + functionId: 104002003, + serialNumber: '104002003Table3ComponentScrap', + tableId: '104002003Table3', + tableName: 'Recipe副产品表', columnProp: 'componentScrap', headerAlign: 'center', align: 'right', @@ -1684,14 +1929,14 @@ export default { sortLv: 0, status: true, fixed: '', - columnWidth: 80 + columnWidth: 110 }, { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table3ShrinkageFactor', - tableId: '104002Table3', - tableName: '配方副产品表', + functionId: 104002003, + serialNumber: '104002003Table3ShrinkageFactor', + tableId: '104002003Table3', + tableName: 'Recipe副产品表', columnProp: 'shrinkageFactor', headerAlign: 'center', align: 'right', @@ -1706,11 +1951,11 @@ export default { }, { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table3PrintUnitName', - tableId: '104002Table3', - tableName: '配方副产品表', - columnProp: 'printUnitName', + functionId: 104002003, + serialNumber: '104002003Table3PrintUnit', + tableId: '104002003Table3', + tableName: 'Recipe副产品表', + columnProp: 'printUnit', headerAlign: 'center', align: 'center', columnLabel: '单位', @@ -1724,10 +1969,10 @@ export default { }, { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table3IssueType', - tableId: '104002Table3', - tableName: '配方副产品表', + functionId: 104002003, + serialNumber: '104002003Table3IssueType', + tableId: '104002003Table3', + tableName: 'Recipe副产品表', columnProp: 'issueType', headerAlign: 'center', align: 'center', @@ -1738,15 +1983,15 @@ export default { sortLv: 0, status: true, fixed: '', - columnWidth: 80 + columnWidth: 140 }, { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table3OperationDesc', - tableId: '104002Table3', - tableName: '配方副产品表', - columnProp: 'operationId', + functionId: 104002003, + serialNumber: '104002003Table3OperationNo', + tableId: '104002003Table3', + tableName: 'Recipe副产品表', + columnProp: 'operationNo', headerAlign: 'center', align: 'center', columnLabel: '工序', @@ -1760,10 +2005,10 @@ export default { }, { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table3IssueToLoc', - tableId: '104002Table3', - tableName: '配方副产品表', + functionId: 104002003, + serialNumber: '104002003Table3IssueToLoc', + tableId: '104002003Table3', + tableName: 'Recipe副产品表', columnProp: 'issueToLocName', headerAlign: 'center', align: 'center', @@ -1778,10 +2023,10 @@ export default { }, { userId: this.$store.state.user.name, - functionId: 104002, - serialNumber: '104002Table3NoteText', - tableId: '104002Table3', - tableName: '配方副产品表', + functionId: 104002003, + serialNumber: '104002003Table3NoteText', + tableId: '104002003Table3', + tableName: 'Recipe副产品表', columnProp: 'noteText', headerAlign: 'center', align: 'left', @@ -1884,6 +2129,7 @@ export default { columnImage: false, status: true, fixed: '', + columnWidth: 100 }, { columnProp: 'alternativeDescription', @@ -1894,6 +2140,7 @@ export default { columnImage: false, status: true, fixed: '', + columnWidth: 200 }, { columnProp: 'status', @@ -1904,6 +2151,7 @@ export default { columnImage: false, status: true, fixed: '', + columnWidth: 100 }, ], columnManufStructCostDistribList: [ @@ -2012,7 +2260,7 @@ export default { columnProp: 'engChgLevel', headerAlign: "center", align: "center", - columnLabel: '配方版本号', + columnLabel: 'Recipe版本号', columnHidden: false, columnImage: false, status: true, @@ -2083,10 +2331,10 @@ export default { columnImage: false, status: true, fixed: '', - columnWidth: 60 + columnWidth: 110 }, { - columnProp: 'printUnitName', + columnProp: 'printUnit', headerAlign: "center", align: "left", columnLabel: '计量单位', @@ -2311,6 +2559,7 @@ export default { modalDisableFlag: false, partModelFlag: false, componentPartModelFlag: false, + copyPartModelFlag: false, saveDetailModalFlag :false, saveDetailModalDisable: false, componentSaveModal: false, @@ -2329,67 +2578,115 @@ export default { }) }, - created () { - this.getDataList() - }, - activated() { - if (this.$route.params.partNo) { + if (this.$route.params && this.$route.params.type && this.$route.params.type === 'quote') { + this.handleQueryRecipeByQuote() + } else if (this.$route.params.partNo) { this.searchData.partNo = this.$route.params.partNo + this.getDataList() + } else if (this.initPage === false) { + this.getDataList() } - this.getDataList() + this.initPage = true }, // js methods: { + // === 报价查询 === + handleQueryRecipeByQuote () { + let params = { + site: this.$route.params.site, + partNo: this.$route.params.partNo, + bomType: this.$route.params.bomType, + engChgLevel: this.$route.params.engChgLevel, + page: this.pageIndex, + limit: this.pageSize + } + this.queryLoading = true + recipeManagementSearch(params).then(({data})=>{ + if (data && data.code === 0) { + this.dataList = data.page.list + this.pageIndex = data.page.currPage + this.pageSize = data.page.pageSize + this.totalPage = data.page.totalCount + this.$refs.selectDiv.setLengthAll( this.dataList.length) + } + this.queryLoading = false + }) + }, // ======== 分页相关方法 ======== - /** - * 每页数 - * @param val - */ + // 每页数 sizeChangeHandle (val) { this.pageSize = val this.pageIndex = 1 this.getDataList() }, - /** - * 当前页 - * @param val - */ + + // 当前页 currentChangeHandle (val) { this.pageIndex = val this.getDataList() }, + // 每页数 + sizeChangeHandle2 (val) { + this.pageSize2 = val + this.pageIndex2 = 1 + this.queryPartList() + }, + + // 当前页 + currentChangeHandle2 (val) { + this.pageIndex2 = val + this.queryPartList() + }, + + // 每页数 + sizeChangeHandle3 (val) { + this.pageSize3 = val + this.pageIndex3 = 1 + this.queryComponentPartList() + }, + + // 当前页 + currentChangeHandle3 (val) { + this.pageIndex3 = val + this.queryComponentPartList() + }, + + // 每页数 + sizeChangeHandle4 (val) { + this.pageSize4 = val + this.pageIndex4 = 1 + this.queryCopyPartModal() + }, + + // 当前页 + currentChangeHandle4 (val) { + this.pageIndex4 = val + this.queryCopyPartModal() + }, + // ======== 页签切换相关方法 ======== - /** - * 明细页签选择替换 - * @param tab - * @param event - */ + // 明细页签选择替换 tabDetailClick (tab, event) { // 刷新列表数据 this.refreshDetailTable() }, - /** - * 子明细页签选择替换 - * @param tab - * @param event - */ + + // 子明细页签选择替换 tabSubDetailClick (tab, event) { // 刷新列表数据 this.refreshSubDetailTable() }, - /** - * 刷新明细页签的table数据 - */ + + // 刷新明细页签的table数据 refreshDetailTable () { if (this.detailTable === 'recipe_detail') { } }, - /** - * 刷新子明细页签的table数据 - */ + + // 刷新子明细页签的table数据 refreshSubDetailTable () { if (this.subDetailTable === 'recipe_sub_detail') { this.queryRecipeComponentTable() @@ -2401,6 +2698,7 @@ export default { this.queryMultiLevelStructureTable() } }, + // 刷新方法 queryRecipeComponentTable () { queryRecipeComponentTable(this.detailData).then(({data}) => { @@ -2409,15 +2707,16 @@ export default { } }) }, + // 刷新方法 queryRecipeByProductTable () { queryRecipeByProductTable(this.detailData).then(({data}) => { if (data.code === 0) { this.byProductList = data.rows - } }) }, + // 刷新方法 queryManufStructCostDistribtionTable () { queryManufStructCostDistribtionTable(this.detailData).then(({data}) => { @@ -2426,6 +2725,7 @@ export default { } }) }, + // 刷新方法 queryMultiLevelStructureTable () { queryMultiLevelStructureTable(this.detailData).then(({data}) => { @@ -2436,17 +2736,16 @@ export default { }, // ======== 列表数据操作方法 ======== - /** - * 未知 - * @returns {boolean} - */ - selectFlag () { - return true - }, - /** - * 获取数据列表 - */ + + // 获取数据列表 getDataList () { + //如果是跳转过来的 要判断 + if (localStorage.getItem('recipeData') != undefined) { + let data = JSON.parse(localStorage.getItem('recipeData')) + this.searchData.partNo = data.partNo + this.searchData.bomType = data.bomType + this.searchData.engChgLevel = data.engChgLevel + } this.searchData.limit = this.pageSize this.searchData.page = this.pageIndex this.queryLoading = true @@ -2457,23 +2756,30 @@ export default { this.pageSize = data.page.pageSize this.totalPage = data.page.totalCount this.$refs.selectDiv.setLengthAll( this.dataList.length) + if (localStorage.getItem('recipeData') != undefined) { + let data = JSON.parse(localStorage.getItem('recipeData')) + if(data.engChgLevel&&data.engChgLevel!==''&&data.engChgLevel!==null){ + this.updateModal(this.dataList[0]) + } + } } this.queryLoading = false + if (localStorage.getItem('recipeData') != undefined) { + this.$nextTick(function () { + localStorage.removeItem('recipeData') + }) + } }) }, - /** - * 复选列表信息 - * @param val - */ + + // 复选列表信息 selectionRecipe (val) { this.recipeSelections = val this.$refs.selectDiv.setLengthselected(this.recipeSelections.length) }, // ======== 新增/编辑模态框 ======== - /** - * recipe新增模态框 - */ + // recipe新增模态框 addModal () { this.modalData = { flag: '1', @@ -2519,9 +2825,8 @@ export default { this.modalDisableFlag = false this.modalFlag = true }, - /** - * recipe编辑模态框 - */ + + // recipe编辑模态框 async updateModal (row) { this.modalData = { flag: '2', @@ -2539,7 +2844,9 @@ export default { updateBy: this.$store.state.user.name, printUnit: row.printUnit, printUnitName: row.printUnitName, - officialFlag: row.officialFlag + officialFlag: row.officialFlag, + alternativeNo: row.alternativeNo, + ifsPartNo: row.ifsPartNo } this.subDetailTable = 'recipe_sub_detail' // 查recipe明细 @@ -2547,9 +2854,6 @@ export default { if (data && data.code === 0) { this.detailDataList = data.rows.detailList this.subDetailList = data.rows.componentList - this.byProductList = data.rows.byProductList - this.manufStructCostDistribList = data.rows.manufStructCostDistribList - this.multiLevelStructureList = data.rows.multiLevelStructureList this.detailData = data.rows.detailData this.modalDisableFlag = true this.modalFlag = true @@ -2560,16 +2864,15 @@ export default { } }) }, - /** - * 替代新增模态框 - */ + + // 替代新增模态框 saveRecipeDetail () { if (this.modalData.partNo === '' || this.modalData.partNo == null) { - this.$message.warning('请先选择配方物料!') + this.$message.warning('请先选择Recipe物料!') return } if (this.modalData.engChgLevel === '' || this.modalData.engChgLevel == null) { - this.$message.warning('请先填写配方版本号!') + this.$message.warning('请先填写Recipe版本号!') return } if (this.modalData.bomType === '' || this.modalData.bomType == null) { @@ -2599,7 +2902,7 @@ export default { this.saveDetailModalFlag = true this.saveDetailModalDisable = false } else { - this.$message.warning('请先保存配方主记录!') + this.$message.warning('请先保存Recipe主记录!') } } else { this.$alert(data.msg, '提示', { @@ -2608,16 +2911,15 @@ export default { } }) }, - /** - * 替代编辑模态框 - */ + + // 替代编辑模态框 updateRecipeDetail () { if (this.modalData.partNo === '' || this.modalData.partNo == null) { - this.$message.warning('请先选择配方物料!') + this.$message.warning('请先选择Recipe物料!') return } if (this.modalData.engChgLevel === '' || this.modalData.engChgLevel == null) { - this.$message.warning('请先填写配方版本号!') + this.$message.warning('请先填写Recipe版本号!') return } if (this.modalData.bomType === '' || this.modalData.bomType == null) { @@ -2646,7 +2948,7 @@ export default { this.saveDetailModalFlag = true this.saveDetailModalDisable = true } else { - this.$message.warning('请先保存配方主记录!') + this.$message.warning('请先保存Recipe主记录!') } } else { this.$alert(data.msg, '提示', { @@ -2655,18 +2957,13 @@ export default { } }) }, - /** - * 子明细新增模态框 - */ + + // 子明细新增模态框 saveComponentModal () { if (this.detailData.alternativeNo === '' || this.detailData.alternativeNo == null) { this.$message.warning('请先选择替代!') return } - if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') { - this.$message.warning('不可编辑的替代状态!') - return - } this.componentData = { flag: '1', site: this.$store.state.user.site, @@ -2680,10 +2977,11 @@ export default { printUnitName: '', qtyPerAssembly: 0, componentScrap: 0, - issueType: 'Reserve and Backflush', + issueType: 'Reserve And Backflush', shrinkageFactor: 0, lineItemNo: '', operationId: '', + operationNo: '', issueToLoc: '', issueToLocName: '', noteText: '', @@ -2692,6 +2990,7 @@ export default { consumptionItem: 'Consumed', productFlag: 'component' } + // 获取子料的序号 getComponentLineSequence(this.componentData).then(({data}) => { if (data && data.code === 0) { @@ -2705,18 +3004,13 @@ export default { this.componentDisableFlag = false this.componentSaveModal = true }, - /** - * 副产品新增模态框 - */ + + // 副产品新增模态框 saveByProductModal () { if (this.detailData.alternativeNo === '' || this.detailData.alternativeNo == null) { this.$message.warning('请先选择替代!') return } - if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') { - this.$message.warning('不可编辑的替代状态!') - return - } this.componentData = { flag: '1', site: this.$store.state.user.site, @@ -2730,10 +3024,11 @@ export default { printUnitName: '', qtyPerAssembly: 0, componentScrap: 0, - issueType: 'Reserve and Backflush', + issueType: 'Reserve And Backflush', shrinkageFactor: 0, lineItemNo: '', operationId: '', + operationNo: '', issueToLoc: '', issueToLocName: '', noteText: '', @@ -2755,14 +3050,9 @@ export default { this.componentDisableFlag = false this.componentSaveModal = true }, - /** - * 子明细编辑模态框 - */ + + // 子明细编辑模态框 updateComponentModal (row) { - if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') { - this.$message.warning('不可编辑的替代状态!') - return - } this.componentData = { flag: '2', site: row.site, @@ -2780,6 +3070,7 @@ export default { shrinkageFactor: row.shrinkageFactor, lineItemNo: row.lineItemNo, operationId: row.operationId, + operationNo: row.operationNo, issueToLoc: row.issueToLoc, issueToLocName: row.issueToLocName, noteText: row.noteText, @@ -2791,14 +3082,9 @@ export default { this.componentDisableFlag = true this.componentSaveModal = true }, - /** - * 副产品编辑模态框 - */ + + // 副产品编辑模态框 updateByProductModal (row) { - if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') { - this.$message.warning('不可编辑的替代状态!') - return - } this.componentData = { flag: '2', site: row.site, @@ -2816,6 +3102,7 @@ export default { shrinkageFactor: row.shrinkageFactor, lineItemNo: row.lineItemNo, operationId: row.operationId, + operationNo: row.operationNo, issueToLoc: row.issueToLoc, issueToLocName: row.issueToLocName, noteText: row.noteText, @@ -2827,14 +3114,9 @@ export default { this.componentDisableFlag = true this.componentSaveModal = true }, - /** - * 副产品成本分配编辑模态框 - */ + + // 副产品成本分配编辑模态框 updateManufStructCostDistribModal (row) { - if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') { - this.$message.warning('不可编辑的替代状态!') - return - } this.manufStructCostDistribData = { site: row.site, partNo: row.partNo, @@ -2853,11 +3135,8 @@ export default { this.manufStructCostDistribModal = true }, - // ======== 新增/编辑/删除方法 ======== - /** - * recipe新增/编辑 - */ + // recipe新增/编辑 saveData () { if (this.modalData.partNo === '' || this.modalData.partNo == null) { this.$message.warning('请选择物料编码!') @@ -2876,7 +3155,7 @@ export default { return } if (this.modalData.engChgLevel === '' || this.modalData.engChgLevel == null) { - this.$message.warning('请填写配方版本号!') + this.$message.warning('请填写Recipe版本号!') return } if (this.detailData.alternativeNo === '' || this.detailData.alternativeNo == null) { @@ -2950,93 +3229,24 @@ export default { }) } }, - /** - * 新增编辑模态框关闭 - */ + + // 新增编辑模态框关闭 closeModal () { - // let tempArr = [] - // tempArr.push(this.modalData) - // if (this.modalData.flag === '1') { - // this.$confirm(`是否不保存且删除该条配方记录?`, '提示', { - // confirmButtonText: '确定', - // cancelButtonText: '取消', - // type: 'warning' - // }).then(() => { - // let tempData = { - // informationList: tempArr - // } - // recipeManagementDelete(tempData).then(({data}) => { - // if (data && data.code === 0) { - // this.getDataList() - // this.modalFlag = false - // this.$message({ - // message: '操作成功', - // type: 'success', - // duration: 1500, - // onClose: () => {} - // }) - // } else { - // this.$alert(data.msg, '错误', { - // confirmButtonText: '确定' - // }) - // } - // }) - // }).catch(() => { - // }) - // } else { - // this.modalFlag = false - // } - this.getDataList() this.modalFlag = false }, - /** - * 新增编辑模态框关闭 - */ + + // 新增编辑模态框关闭 closeModalX (done) { - // let tempArr = [] - // tempArr.push(this.modalData) - // if (this.modalData.flag === '1') { - // this.$confirm(`是否不保存且删除该条配方记录?`, '提示', { - // confirmButtonText: '确定', - // cancelButtonText: '取消', - // type: 'warning' - // }).then(() => { - // let tempData = { - // informationList: tempArr - // } - // recipeManagementDelete(tempData).then(({data}) => { - // if (data && data.code === 0) { - // this.getDataList() - // done() - // this.$message({ - // message: '操作成功', - // type: 'success', - // duration: 1500, - // onClose: () => {} - // }) - // } else { - // this.$alert(data.msg, '错误', { - // confirmButtonText: '确定' - // }) - // } - // }) - // }).catch(() => { - // }) - // } else { - // done() - // } - this.getDataList() done() }, - /** - * recipe删除 - */ + + // recipe删除 delModal () { if (this.recipeSelections.length === 0) { - this.$message.warning('请勾选要删除的配方!') + this.$message.warning('请勾选要删除的Recipe!') return } - this.$confirm(`是否删除这 `+ this.recipeSelections.length +` 条配方?`, '提示', { + this.$confirm(`是否删除这 `+ this.recipeSelections.length +` 条Recipe?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' @@ -3063,13 +3273,17 @@ export default { }).catch(() => { }) }, - /** - * 查询物料 - */ + + // 查询物料 queryPartList () { - queryPartList(this.partData).then(({data}) => { + this.partData.limit = this.pageSize2 + this.partData.page = this.pageIndex2 + queryPartListRecipe(this.partData).then(({data}) => { if (data && data.code === 0) { - this.partList = data.rows + this.partList = data.page.list + this.pageIndex2 = data.page.currPage + this.pageSize2 = data.page.pageSize + this.totalPage2 = data.page.totalCount this.partModelFlag = true } else { this.$alert(data.msg, '错误', { @@ -3081,69 +3295,37 @@ export default { // 物料编码失焦事件 partNoBlur () { + this.partData.limit = this.pageSize2 + this.partData.page = this.pageIndex2 this.partData.partNo = this.modalData.partNo queryPartList(this.partData).then(({data}) => { if (data && data.code === 0) { - if (data.rows.length === 1) { - this.modalData.partDesc = data.rows[0].partDesc - this.modalData.printUnit = data.rows[0].printUnit - this.modalData.printUnitName = data.rows[0].printUnitName - } else { - this.modalData.partDesc = '' - this.modalData.printUnit = '' - this.modalData.printUnitName = '' + if (data.page.list.length === 1) { + this.modalData.partDesc = data.page.list[0].partDesc + this.modalData.printUnit = data.page.list[0].printUnit + this.modalData.printUnitName = data.page[0].printUnitName } } }) }, - /** - * 双击选中物料 - * @param row - */ + // 双击选中物料 getRowData (row) { this.modalData.partNo = row.partNo this.modalData.partDesc = row.partDesc this.modalData.printUnit = row.printUnit this.modalData.printUnitName = row.printUnitName - // // 获取物料的recipe版本号 - // getRecipeEngChgLevel(this.modalData).then(({data}) => { - // if (data && data.code === 0) { - // this.modalData.engChgLevel = data.engChgLevel - // } else { - // this.$alert(data.msg, '错误', { - // confirmButtonText: '确定' - // }) - // } - // this.partModelFlag = false - // }) this.partModelFlag = false }, - // recipe类型改变 - bomTypeChange () { - // 获取物料的recipe版本号 - getRecipeEngChgLevel(this.modalData).then(({data}) => { - if (data && data.code === 0) { - this.modalData.engChgLevel = data.engChgLevel - } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' - }) - } - }) - }, - - /** - * 双击选中工序 - * @param row - */ + // 双击选中工序 getRowOperationData (row) { this.componentData.operationId = row.operationId - this.componentData.operationName = row.operationName + this.componentData.operationNo = row.operationNo this.operationModelFlag = false }, + // 双击选中子物料 getComponentRowData (row) { this.componentData.componentPart = row.partNo this.componentData.componentPartDesc = row.partDesc @@ -3152,14 +3334,31 @@ export default { this.componentPartModelFlag = false }, - /** - * 物料列表 - */ - queryComponentPartList () { + // 双击选择copy物料 + getCopyRowData (row) { + if (this.copyPartData.type === '1') { + this.copyRecipeData.partNo = row.partNo + this.copyRecipeData.partDesc = row.partDesc + this.copyBomTypeChange() + } else { + this.copyAlternativeData.partNo = row.partNo + this.copyAlternativeData.partDesc = row.partDesc + } + this.copyPartModelFlag = false + }, + + // 子物料列表 + queryComponentPartModal () { + this.componentPartData.limit = this.pageSize3 + this.componentPartData.page = this.pageIndex3 + this.componentPartData.status = 'Y' // 查询所有物料 - queryPartList(this.componentPartData).then(({data}) => { + queryPartListAll(this.componentPartData).then(({data}) => { if (data && data.code === 0) { - this.componentPartList = data.rows + this.componentPartList = data.page.list + this.pageIndex3 = data.page.currPage + this.pageSize3 = data.page.pageSize + this.totalPage3 = data.page.totalCount this.componentPartModelFlag = true } else { this.$alert(data.msg, '错误', { @@ -3169,36 +3368,135 @@ export default { }) }, + // copy物料列表 + queryCopyPartModal () { + this.copyPartData.limit = this.pageSize4 + this.copyPartData.page = this.pageIndex4 + // 查询所有物料 + queryPartList(this.copyPartData).then(({data}) => { + if (data && data.code === 0) { + this.copyPartList = data.page.list + this.pageIndex4 = data.page.currPage + this.pageSize4 = data.page.pageSize + this.totalPage4 = data.page.totalCount + this.copyPartModelFlag = true + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + + // 物料列表 + queryComponentPartList () { + this.componentPartData.limit = this.pageSize3 + this.componentPartData.page = this.pageIndex3 + // 查询所有物料 + queryPartListAll(this.componentPartData).then(({data}) => { + if (data && data.code === 0) { + this.componentPartList = data.page.list + this.pageIndex3 = data.page.currPage + this.pageSize3 = data.page.pageSize + this.totalPage3 = data.page.totalCount + } else { + this.componentPartList = [] + } + }) + }, + + // copy物料查询列表 + queryCopyPartList () { + this.copyPartData.limit = this.pageSize4 + this.copyPartData.page = this.pageIndex4 + // 查询所有物料 + queryPartList(this.copyPartData).then(({data}) => { + if (data && data.code === 0) { + this.copyPartList = data.page.list + this.pageIndex4 = data.page.currPage + this.pageSize4 = data.page.pageSize + this.totalPage4 = data.page.totalCount + } else { + this.copyPartList = [] + } + }) + }, + // 子物料编码失焦事件 componentPartBlur () { - this.componentPartData.partNo = this.componentData.componentPart - queryPartList(this.componentPartData).then(({data}) => { - if (data && data.code === 0) { - if (data.rows.length === 1) { - this.componentData.componentPartDesc = data.rows[0].partDesc - this.componentData.printUnit = data.rows[0].printUnit - this.componentData.printUnitName = data.rows[0].printUnitName - } else { - this.componentData.componentPartDesc = '' - this.componentData.printUnit = '' - this.componentData.printUnitName = '' + if (this.componentData.componentPart != null && this.componentData.componentPart !== '') { + this.componentPartData.limit = this.pageSize3 + this.componentPartData.page = this.pageIndex3 + this.componentPartData.partNo = this.componentData.componentPart + queryPartListAll(this.componentPartData).then(({data}) => { + if (data && data.code === 0) { + if (data.page.list.length === 1) { + this.componentData.componentPartDesc = data.page.list[0].partDesc + this.componentData.printUnit = data.page.list[0].printUnit + this.componentData.printUnitName = data.page.list[0].printUnitName + return + } } + }) + } + this.componentData.componentPartDesc = '' + this.componentData.printUnit = '' + this.componentData.printUnitName = '' + }, + + // copy物料编码失焦事件 + copyPartBlur () { + if (this.copyPartData.type === '1') { + if (this.copyRecipeData.partNo != null && this.copyRecipeData.partNo !== '') { + this.copyPartData.limit = this.pageSize4 + this.copyPartData.page = this.pageIndex4 + this.copyPartData.partNo = this.copyRecipeData.partNo + queryPartList(this.copyPartData).then(({data}) => { + if (data && data.code === 0) { + if (data.page.list.length === 1) { + this.copyRecipeData.partDesc = data.page.list[0].partDesc + return + } + } + }) + } + this.copyRecipeData.partDesc = '' + } else { + if (this.copyAlternativeData.partNo != null && this.copyAlternativeData.partNo !== '') { + this.copyPartData.limit = this.pageSize4 + this.copyPartData.page = this.pageIndex4 + this.copyPartData.partNo = this.copyAlternativeData.partNo + queryPartList(this.copyPartData).then(({data}) => { + if (data && data.code === 0) { + if (data.page.list.length === 1) { + this.copyAlternativeData.partDesc = data.page.list[0].partDesc + return + } + } + }) + } + this.copyAlternativeData.partDesc = '' + } + }, + + // copy Recipe类型改变 + copyBomTypeChange () { + // 获取物料的recipe版本号 + getRecipeEngChgLevel(this.copyRecipeData).then(({data}) => { + if (data && data.code === 0) { + this.copyRecipeData.engChgLevel = data.engChgLevel + } else { + this.copyRecipeData.engChgLevel = '' } }) }, - /** - * 表格的新增 - * @param row - * @param rowIndex - */ + // 表格的新增 rowClassName({ row, rowIndex }) { row.xh = rowIndex + 1 }, - /** - * 选中数据 - * @param selection - */ + + // 选中数据 componentSelectionChange(selection) { this.checkedDetail = selection }, @@ -3206,14 +3504,9 @@ export default { byProductSelection (selection) { this.checkedByProduct = selection }, - /** - * 删除子物料 - */ + + // 删除子物料 deleteComponentPart () { - if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') { - this.$message.warning('不可编辑的替代状态!') - return - } if (this.checkedDetail.length === 0) { this.$message.warning('请选择要删除子物料!') return @@ -3249,14 +3542,8 @@ export default { } }, - /** - * 删除子物料 - */ + // 删除子物料 deleteByProduct () { - if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') { - this.$message.warning('不可编辑的替代状态!') - return - } if (this.checkedByProduct.length === 0) { this.$message.warning('请选择要删除副产品!') return @@ -3291,33 +3578,17 @@ export default { }) } }, - /** - * 子物料 - * @param row - */ - // componentPartClickRow (row) { - // this.$refs.componentPartTable.toggleRowSelection(row) - // }, + + // 子物料 componentClickRow (row) { this.$refs.componentTable.toggleRowSelection(row) }, + byProductClickRow (row) { this.$refs.byProductTable.toggleRowSelection(row) }, - // /** - // * 多选子物料 - // * @param val - // */ - // selectionComponentPart (val) { - // this.componentPartSelections = val - // }, - // getRowKeys(row) { - // // 唯一值,一般都为id - // return row.partNo - // }, - /** - * 新增子明细方法 - */ + + // 新增子明细方法 componentDataSave (isClose) { if (this.componentData.lineSequence === '' || this.componentData.lineSequence == null) { this.$message.warning('序号不能为空!') @@ -3332,7 +3603,7 @@ export default { return } if (this.componentData.engChgLevel === '' || this.componentData.engChgLevel == null) { - this.$message.warning('请填写主记录配方版本号!') + this.$message.warning('请填写主记录Recipe版本号!') return } if (this.componentData.componentPart === '' || this.componentData.componentPart == null) { @@ -3355,18 +3626,10 @@ export default { this.$message.warning('请填写调机量!') return } - if (this.componentData.componentScrap === 0) { - this.$message.warning('调机量不能为0!') - return - } if (this.componentData.shrinkageFactor === '' || this.componentData.shrinkageFactor == null) { this.$message.warning('请填写损耗率!') return } - if (this.componentData.shrinkageFactor === 0) { - this.$message.warning('损耗率不能为0!') - return - } if (this.componentData.issueType === '' || this.componentData.issueType == null) { this.$message.warning('请选择生产属性!') return @@ -3419,11 +3682,9 @@ export default { } }, - /** - * 编辑副产品成本分配方法 - */ + // 编辑副产品成本分配方法 manufStructCostDistribUpdate () { - if (this.manufStructCostDistribData.shrinkageFactor < 0 || this.manufStructCostDistribData.shrinkageFactor > 1) { + if (this.manufStructCostDistribData.itemCostDistribution < 0 || this.manufStructCostDistribData.itemCostDistribution > 1) { this.$message.warning('项目成本分配系数必须介于0和1之间!') return } @@ -3444,9 +3705,8 @@ export default { } }) }, - /** - * 回车事件 - */ + + // 回车事件 focusNextInput (index, type) { let aaa = '' if (this.subDetailList.length - 1 === index) { @@ -3458,16 +3718,15 @@ export default { this.$refs[aaa].focus() }) }, - /** - * 保存主表信息 - */ + + // 保存主表信息 saveRecipeHeader () { if (this.modalData.partNo === '' || this.modalData.partNo == null) { - this.$message.warning('请先选择配方物料!') + this.$message.warning('请先选择Recipe物料!') return } if (this.modalData.engChgLevel === '' || this.modalData.engChgLevel == null) { - this.$message.warning('请先填写配方版本号!') + this.$message.warning('请先填写Recipe版本号!') return } if (this.modalData.bomType === '' || this.modalData.bomType == null) { @@ -3517,14 +3776,14 @@ export default { this.saveHeaderLoading = false }) }, - /** - * 复制recipe的模态框 - */ + + // 复制recipe的模态框 copyRecipeRevision () { this.copyRecipeData = { site: this.modalData.site, partNo: this.modalData.partNo, - engChgLevel: this.modalData.engChgLevel + 1, + partDesc: this.modalData.partDesc, + engChgLevel: '', bomType: this.modalData.bomType, effPhaseInDate: this.dayjs(new Date()).format('YYYY-MM-DD'), effPhaseOutDate: '', @@ -3532,29 +3791,48 @@ export default { createBy: this.$store.state.user.name, officialFlag: 'N' } + // 获取物料的recipe版本号 + getRecipeEngChgLevel(this.copyRecipeData).then(({data}) => { + if (data && data.code === 0) { + this.copyRecipeData.engChgLevel = data.engChgLevel + } + }) + this.copyPartData = { + type: '1', + site: this.$store.state.user.site, + partNo: '', + partDesc: '', + page: 1, + limit: 10 + } this.copyRecipeModelFlag = true }, - /** - * 复制recipe的方法 - */ + + // 复制recipe的方法 copyRecipe () { if (this.copyRecipeData.partNo === '' || this.copyRecipeData.partNo == null) { - this.$message.warning('请选择配方物料!') + this.$message.warning('请选择Recipe物料!') return } if (this.copyRecipeData.engChgLevel === '' || this.copyRecipeData.engChgLevel == null) { - this.$message.warning('请填写配方版本号!') + this.$message.warning('请填写Recipe版本号!') return } if (this.copyRecipeData.bomType === '' || this.copyRecipeData.bomType == null) { this.$message.warning('请选择制造类型!') return } + if (this.copyRecipeData.effPhaseOutDate != null && this.copyRecipeData.effPhaseOutDate !== '' && this.copyRecipeData.effPhaseOutDate < this.copyRecipeData.effPhaseInDate) { + this.$message.warning('失效日期必须大于生效日期!') + return + } this.copyRecipeData.previousVersion = this.modalData + this.copyLoading = true // 新增主表信息 copyRecipe(this.copyRecipeData).then(({data}) => { if (data && data.code === 0) { this.copyRecipeModelFlag = false + this.updateModal(data.rows) this.$message({ message: '操作成功', type: 'success', @@ -3566,15 +3844,18 @@ export default { confirmButtonText: '确定' }) } + this.copyLoading = false + }).catch(()=>{ + this.copyLoading = false }) }, - /** - * 复制alternative的模态框 - */ + + // 复制alternative的模态框 copyRecipeAlternative () { this.copyAlternativeData = { site: this.detailData.site, partNo: this.detailData.partNo, + partDesc: this.modalData.partDesc, engChgLevel: this.detailData.engChgLevel, bomType: this.detailData.bomType, alternativeNo: this.detailData.alternativeNo, @@ -3587,19 +3868,25 @@ export default { previousVersion: {}, createBy: this.$store.state.user.name } + this.copyPartData = { + type: '2', + site: this.$store.state.user.site, + partNo: '', + partDesc: '', + page: 1, + limit: 10 + } this.copyAlternativeModelFlag = true }, - /** - * 复制alternative的方法 - */ + // 复制alternative的方法 copyAlternative () { if (this.copyAlternativeData.partNo === '' || this.copyAlternativeData.partNo == null) { - this.$message.warning('请选择配方物料!') + this.$message.warning('请选择Recipe物料!') return } if (this.copyAlternativeData.engChgLevel === '' || this.copyAlternativeData.engChgLevel == null) { - this.$message.warning('请填写配方版本号!') + this.$message.warning('请填写Recipe版本号!') return } if (this.copyAlternativeData.bomType === '' || this.copyAlternativeData.bomType == null) { @@ -3615,10 +3902,11 @@ export default { return } this.copyAlternativeData.previousVersion = this.detailData + this.copyLoading = true copyAlternative(this.copyAlternativeData).then(({data}) => { if (data && data.code === 0) { - this.detailDataList = data.rows.detailDataList this.copyAlternativeModelFlag = false + this.updateModal(data.rows) this.$message({ message: '操作成功', type: 'success', @@ -3630,19 +3918,20 @@ export default { confirmButtonText: '确定' }) } + this.copyLoading = false + }).catch(()=>{ + this.copyLoading = false }) }, - /** - * 新增替代方法 - */ + // 新增替代方法 detailDataSave () { if (this.saveDetailData.partNo === '' || this.saveDetailData.partNo == null) { - this.$message.warning('请先选择配方物料!') + this.$message.warning('请先选择Recipe物料!') return } if (this.saveDetailData.engChgLevel === '' || this.saveDetailData.engChgLevel == null) { - this.$message.warning('请先填写配方版本号!') + this.$message.warning('请先填写Recipe版本号!') return } if (this.saveDetailData.bomType === '' || this.saveDetailData.bomType == null) { @@ -3661,10 +3950,6 @@ export default { this.$message.warning('请选择替代状态!') return } - if (this.saveDetailData.minLotQty === '' || this.saveDetailData.minLotQty == null) { - this.$message.warning('请填写最小订单数!') - return - } this.saveDetailLoading = true if (this.saveDetailData.flag === '1') { recipeDetailSave(this.saveDetailData).then(({data}) => { @@ -3709,9 +3994,7 @@ export default { } }, - /** - * 删除替代 - */ + // 删除替代 deleteRecipeDetail () { if (this.detailData.alternativeNo === '' || this.detailData.alternativeNo == null) { this.$message.warning('请选择要删除的替代编码!') @@ -3746,9 +4029,8 @@ export default { }).catch(() => { }) }, - /** - * 修改替代状态为 Buildable - */ + + // 修改替代状态为 Buildable updateStatusToBuildable () { this.$confirm(`是否修改状态为Buildable?`, '提示', { confirmButtonText: '确定', @@ -3772,12 +4054,10 @@ export default { this.alternativeChange() } }) - }).catch(() => { }) }, - /** - * 修改替代状态为 Obsolete - */ + + // 修改替代状态为 Obsolete updateStatusToObsolete () { this.$confirm(`是否修改状态为Obsolete?`, '提示', { confirmButtonText: '确定', @@ -3801,12 +4081,10 @@ export default { this.alternativeChange() } }) - }).catch(() => { }) }, - /** - * 替代改变事件 - */ + + // 替代改变事件 alternativeChange () { queryRecipeComponent(this.detailData).then(({data}) => { if (data && data.code === 0) { @@ -3823,6 +4101,7 @@ export default { // 临时Recipe转为正式Recipe toBecomeOfficialRecipe () { + this.toBecomeOfficialLoading = true toBecomeOfficialRecipe(this.detailData).then(({data}) => { if (data && data.code === 0) { this.getDataList() @@ -3838,69 +4117,13 @@ export default { confirmButtonText: '确定' }) } + this.toBecomeOfficialLoading = false + }).catch(()=>{ + this.toBecomeOfficialLoading = false }) }, - // ======= 正则校验 ======= - handleInput (value, type) { - // 大于等于0,且只能输入4位小数 - let val = value.replace(/^\D*([0-9]\d*\.?\d{0,4})?.*$/,'$1') - if (val === null || val === undefined || val === '') { - val = 0 - } - if (type === 1) { - this.modalData.netWeight = val - } else if (type === 2) { - this.detailData.minLotQty = val - } else if (type === 3) { - this.saveDetailData.minLotQty = val - } else if (type === 5) { - this.componentData.componentScrap = val - } else if (type === 6) { - this.manufStructCostDistribData.itemCostDistribution = val - } - }, - - handleInput16 (value, type) { - // 大于等于0,且只能输入4位小数 - let val = value.replace(/^\D*([0-9]\d*\.?\d{0,16})?.*$/,'$1') - if (val === null || val === undefined || val === '') { - val = 0 - } - if (type === 1) { - this.componentData.qtyPerAssembly = val - } - }, - - handleInputB (value) { - // 0-100 - const reg = /^(([1-9]?\d{0,1}(\.\d{1,2})?)|100|100\.(0){1,2})$/ - if (reg.test(value) === true) { - this.componentData.shrinkageFactor = value - } else if (value > 100) { - this.componentData.shrinkageFactor = 100 - } else { - this.componentData.shrinkageFactor = 0 - } - }, - // handleInputC (value, type) { - // // 正整数 - // // let val = value.replace(/^\+?[1-9][0-9]*$/,'$1') - // // if (val === null || val === undefined || val === '') { - // // val = 1 - // // } - // // if (type === 1) { - // // this.modalData.engChgLevel = val - // // } - // const reg = /^\+?[1-9][0-9]*$/ - // if (reg.test(value) === true) { - // this.modalData.engChgLevel = value - // } - // - // }, - /** - * 根据物料编码查询工序 - */ + // 根据物料编码查询工序 queryOperationList () { this.operationData.partNo = this.modalData.partNo // 查询所有 @@ -3926,11 +4149,7 @@ export default { }, // ======== chooseList相关方法 ======== - /** - * 获取基础数据列表S - * @param val - * @param type - */ + // 获取基础数据列表S getBaseList (val, type) { this.tagNo = val this.$nextTick(() => { @@ -3941,10 +4160,8 @@ export default { this.$refs.baseList.init(val, strVal) }) }, - /** - * 列表方法的回调 - * @param val - */ + + // 列表方法的回调 getBaseData (val) { if (this.tagNo === 117) { this.componentData.issueToLoc = val.location_id @@ -3953,9 +4170,7 @@ export default { }, // ======== 导出相关方法 ======== - /** - * 导出excel - */ + // 导出excel async createExportData () { this.searchData.limit = -1 this.searchData.page = 1 @@ -4013,6 +4228,7 @@ export default { -moz-appearance: textfield; padding-right: 5px !important; } + From 4b77082d40e658e0da25684d2eedc8d73fff406c Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Fri, 20 Dec 2024 09:33:07 +0800 Subject: [PATCH 2/5] =?UTF-8?q?2024-12-20=20=E6=8E=A5=E5=8F=A3=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/part/bomManagement.vue | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/src/views/modules/part/bomManagement.vue b/src/views/modules/part/bomManagement.vue index d5f0f83..3f41d9f 100644 --- a/src/views/modules/part/bomManagement.vue +++ b/src/views/modules/part/bomManagement.vue @@ -3688,7 +3688,8 @@ export default { }).then(() => { let tempData = { informationList: this.checkedByProduct, - productFlag: 'byProduct' + productFlag: 'byProduct', + updateBy: this.$store.state.user.name, } deleteBomComponent(tempData).then(({data}) => { if (data && data.code === 0) { @@ -3707,32 +3708,17 @@ export default { }) } }) - }).catch(() => { }) } }, - // 子物料 - // componentPartClickRow (row) { - // this.$refs.componentPartTable.toggleRowSelection(row) - // }, componentClickRow (row) { this.$refs.componentTable.toggleRowSelection(row) }, byProductClickRow (row) { this.$refs.byProductTable.toggleRowSelection(row) }, - // /** - // * 多选子物料 - // * @param val - // */ - // selectionComponentPart (val) { - // this.componentPartSelections = val - // }, - // getRowKeys(row) { - // // 唯一值,一般都为id - // return row.partNo - // }, + // 新增子明细方法 componentDataSave (isClose) { if (this.componentData.lineSequence === '' || this.componentData.lineSequence == null) { @@ -4154,6 +4140,7 @@ export default { cancelButtonText: '取消', type: 'warning' }).then(() => { + this.detailData.updateBy = this.$store.state.user.name bomDetailDelete(this.detailData).then(({data}) => { if (data && data.code === 0) { this.detailData = data.rows.detailData @@ -4171,7 +4158,6 @@ export default { }) } }) - }).catch(() => { }) }, @@ -4182,6 +4168,7 @@ export default { cancelButtonText: '取消', type: 'warning' }).then(() => { + this.detailData.updateBy = this.$store.state.user.name updateAlternativeStatus(this.detailData).then(({data}) => { if (data && data.code === 0) { this.detailDataList = data.rows.detailDataList @@ -4248,6 +4235,7 @@ export default { // 临时Bom转为正式Bom toBecomeOfficialBom () { + this.detailData.updateBy = this.$store.state.user.name this.toBecomeOfficialLoading = true toBecomeOfficialBom(this.detailData).then(({data}) => { if (data && data.code === 0) { From 5b21bfec6b2444c9474f2bb4e878fca50d7c6755 Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Fri, 20 Dec 2024 13:55:54 +0800 Subject: [PATCH 3/5] =?UTF-8?q?2024-12-20=20=E6=8E=A5=E5=8F=A3=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/part/routingManagement.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/views/modules/part/routingManagement.vue b/src/views/modules/part/routingManagement.vue index 33ca51f..e059758 100644 --- a/src/views/modules/part/routingManagement.vue +++ b/src/views/modules/part/routingManagement.vue @@ -3504,6 +3504,7 @@ export default { type: "warning" }).then(() => { let tempData = { + updateBy: this.$store.state.user.name, informationList: this.checkedDetail } deleteRoutingComponent(tempData).then(({data}) => { @@ -4175,6 +4176,7 @@ export default { cancelButtonText: '取消', type: 'warning' }).then(() => { + this.detailData.updateBy = this.$store.state.user.site routingDetailDelete(this.detailData).then(({data}) => { if (data && data.code === 0) { this.detailData = data.rows.detailData @@ -4204,6 +4206,7 @@ export default { cancelButtonText: '取消', type: 'warning' }).then(() => { + this.detailData.updateBy = this.$store.state.user.name updateAlternativeStatus(this.detailData).then(({data}) => { if (data && data.code === 0) { this.detailDataList = data.rows.detailDataList @@ -4272,6 +4275,7 @@ export default { // 临时Routing转为正式Routing toBecomeOfficialRouting () { + this.detailData.updateBy = this.$store.state.user.name this.toBecomeOfficialLoading = true toBecomeOfficialRouting(this.detailData).then(({data}) => { if (data && data.code === 0) { @@ -4364,6 +4368,7 @@ export default { type: "warning" }).then(() => { let tempData = { + updateBy: this.$store.state.user.name, informationList: this.checkedTool } deleteRoutingTool(tempData).then(({data}) => { From c9db99b22d57a7619276889981190a7f73c1b318 Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Fri, 20 Dec 2024 17:42:35 +0800 Subject: [PATCH 4/5] =?UTF-8?q?2024-12-20=20=E6=8E=A5=E5=8F=A3=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projectInfo/com_project_info_part.vue | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/views/modules/project/projectInfo/com_project_info_part.vue b/src/views/modules/project/projectInfo/com_project_info_part.vue index 6a4ed5d..857976d 100644 --- a/src/views/modules/project/projectInfo/com_project_info_part.vue +++ b/src/views/modules/project/projectInfo/com_project_info_part.vue @@ -875,7 +875,6 @@ import { } from "@/api/base/properties.js" import { queryMasterField, // 根据物料编码查 masterPart 属性 - toBecomeOfficialPart, // 临时物料转为正式物料 partInformationSave2, // 物料信息新增 getProjectPartNo, // 获取项目物料编码 getProjectPartRow, // 获取当前行项目物料对象 @@ -2646,24 +2645,6 @@ import { }) }, - // 临时物料转为正式物料 - toBecomeOfficialPart () { - toBecomeOfficialPart(this.modalData).then(({data}) => { - if (data && data.code === 0) { - this.$message({ - message: '操作成功', - type: 'success', - duration: 1500, - onClose: () => {} - }) - } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' - }) - } - }) - }, - // 页签选择替换 inventoryPartClick (tab, event) { this.refreshInventoryPartTable() From 540041c9e95506b2a4879d1326efc179ea540dbc Mon Sep 17 00:00:00 2001 From: DouDou <877258667@qq.com> Date: Mon, 23 Dec 2024 12:00:13 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=B7=A5=E5=85=B7=E7=9A=84=E4=BB=A3?= =?UTF-8?q?=E7=A0=81BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tooling/components/com_tool_instance_date_add_update.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/modules/tooling/components/com_tool_instance_date_add_update.vue b/src/views/modules/tooling/components/com_tool_instance_date_add_update.vue index 389d930..2a84a36 100644 --- a/src/views/modules/tooling/components/com_tool_instance_date_add_update.vue +++ b/src/views/modules/tooling/components/com_tool_instance_date_add_update.vue @@ -23,7 +23,7 @@ @@ -173,7 +173,7 @@ export default { } const begin = this.dayjs(this.pageData.beginDate); const now = this.dayjs(this.dayjs().format('YYYY-MM-DD')); - if (begin.valueOf() < now.valueOf()) { + if (this.addFlag && begin.valueOf() < now.valueOf()) { this.$message.error('开始日期不能小于当前日期!'); this.pageData.beginDate = ''; }