From c16b107a42e8aa0e3232c14c68063e5db84837f3 Mon Sep 17 00:00:00 2001 From: Yang <903110162@qq.com> Date: Sun, 7 May 2023 23:53:46 +0800 Subject: [PATCH] commit by yzf --- src/api/api/material.ts | 10 ++ src/views/half/components/EditMateria.vue | 51 +++----- src/views/half/components/EditView.vue | 151 ++++++++++------------ src/views/half/components/EditViewOFF.vue | 39 ++---- src/views/half/route.vue | 15 ++- 5 files changed, 124 insertions(+), 142 deletions(-) diff --git a/src/api/api/material.ts b/src/api/api/material.ts index 48ff422..262a9cb 100644 --- a/src/api/api/material.ts +++ b/src/api/api/material.ts @@ -63,4 +63,14 @@ export async function GetMaterialById(param) result = data; }); return result; +} + +export async function GetMaterialListByFTestCode(param) +{ + let result = []; + debugger + await http.post('/api/Material/GetMaterialListByFTestCode', param).then((data) => { + result = data; + }); + return result; } \ No newline at end of file diff --git a/src/views/half/components/EditMateria.vue b/src/views/half/components/EditMateria.vue index e25d78d..cad7d70 100644 --- a/src/views/half/components/EditMateria.vue +++ b/src/views/half/components/EditMateria.vue @@ -121,6 +121,9 @@ import { import { getFormulaList } from '/src/api/api/formula'; +import{ + GetMaterialListByFTestCode +} from '/src/api/api/material'; import { InsertDataModel } from '/src/api/api/halfmaterialteamwork' @@ -152,12 +155,7 @@ export default { }, { title: "物料描述", - key: "FDesc", - width: "110px", - }, - { - title: "模式", - key: "FFactoryID", + key: "FName", width: "110px", }, { @@ -261,7 +259,7 @@ export default { this.formulaList = await getFormulaList(); }, async _getMateriaList() { - this._getPageList(true); + this._getPageList(); }, async _getSelectList() { let result = await getDataCode({ @@ -286,7 +284,7 @@ export default { }, //配方检索 _searchPageList(value) { - this._getPageList(true); + this._getPageList(); }, //配方翻页 changePage(obj) { @@ -304,7 +302,7 @@ export default { this.formula1Name = data.FTestCode+"+"+data.FVersionCode+"+"+data.FName; this.fVersion1Code=data.FVersionCode; this.FDesc=data.FName; - this._getPageList(true); + this._getPageList(); } else { this.formula2 = data.FTestCode; this.formula2Name = data.FTestCode+"+"+data.FVersionCode+"+"+data.FName; @@ -315,37 +313,26 @@ export default { }, //配方接口 async _getPageList(isFirst) { - if (isFirst) { - this.pageInfo.current = 1; - this.pageInfo.total = 0; - } - let postData = { - FPageIndex: this.pageInfo.current, - FPageSize: this.pageInfo.limit, - FTestCode: this.formula1 - } - let search = this.dataInfo.FSearchName; - if (search && search != "") { - postData.Or_FPlmCode = postData.Or_FTestCode = postData.Or_FName = postData.Or_FVersionCode = - search; - } - if (this.formula1Name != "") { - let result = await getPageList(postData, "Material"); + + if (this.formula1Name != ""&& this.formula1!="") { + + + let result = await GetMaterialListByFTestCode({ + "FTestCode": this.formula1 + }); let factoryList=[]; for(let i=0;i { - if(factoryList){ - item.FFactoryID=factoryList.find(s=>s.FID==item.FFactoryID).FName; - } + result.Data = result.Data || []; + result.Data.forEach((item) => { let type = this.typeList.find(s => s.FValue == item.FType); item.FTypeName = type == null ? item.FType : type.FName; if (this.dataInfo.FFormulaID == item.FID) this.selectedKey = item.FID }); - this.pageInfo.total = result.Data.Total || 0; - this.dataList = result.Data.List; + debugger + this.dataList = result.Data; + } }, diff --git a/src/views/half/components/EditView.vue b/src/views/half/components/EditView.vue index 4081b89..69b776a 100644 --- a/src/views/half/components/EditView.vue +++ b/src/views/half/components/EditView.vue @@ -1,6 +1,7 @@ -