From 82dadc8d462776ce3633ad749a5c3a84b89a4125 Mon Sep 17 00:00:00 2001 From: Yang <903110162@qq.com> Date: Sat, 6 May 2023 13:13:29 +0800 Subject: [PATCH] commit by yzf --- src/api/api/material.ts | 8 + src/api/http.ts | 4 +- .../Need/components/EditFSuccedaneum.vue | 40 +++-- src/views/Need/components/EditView.vue | 71 ++++++-- src/views/Team/all.vue | 37 +++- src/views/Team/components/ShowData1.vue | 35 +++- src/views/half/components/EditView.vue | 170 +++++++++--------- src/views/half/components/EditViewOFF.vue | 151 +++++++++------- src/views/half/route.vue | 4 +- src/views/log/log.vue | 4 +- src/views/materia/components/EditView.vue | 61 +++++-- 11 files changed, 366 insertions(+), 219 deletions(-) diff --git a/src/api/api/material.ts b/src/api/api/material.ts index 440a96d..48ff422 100644 --- a/src/api/api/material.ts +++ b/src/api/api/material.ts @@ -56,3 +56,11 @@ export async function UpdateDataModel(param) return result; } +export async function GetMaterialById(param) +{ + let result = []; + await http.post('/api/Material/GetMaterialById', param).then((data) => { + result = data; + }); + return result; +} \ No newline at end of file diff --git a/src/api/http.ts b/src/api/http.ts index 870a88a..b2666ef 100644 --- a/src/api/http.ts +++ b/src/api/http.ts @@ -5,13 +5,13 @@ const config = { timeout: 600000, //baseURL: "http://124.222.104.55:58178/", baseURL: "http://localhost:58178/", - // baseURL: "http://plm-pw-test.hbflavor.com:81/", + //baseURL: "http://plm-pw-test.hbflavor.com:81/", headers: { 'Content-Type': 'application/json;charset=UTF-8', }, async: false } - //let userToken = ""; +//let userToken = ""; // let userToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJGSUQiOjIsIkZVc2VyIjoib2F0ZXN0MiIsIkZOYW1lIjoi5rWL6K-V5bel5Y6CIiwiRkV4cGlyZVRpbWUiOiIyMDIzLTAxLTE3IDIwOjIwOjA1In0.ZNN-fVE1JJ3tN82pM9DylqqMMpMUVLZWJKTBwz8M3bU" let userToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJGSUQiOjIsIkZVc2VyIjoiSEIxMTAwMjgzIiwiRk5hbWUiOiLmnY7mtKrkvJ8iLCJGRXhwaXJlVGltZSI6IjIwMjMtMDctMjYgMjA6NTU6MDEifQ.qE281pbJFVWxkGqOiTjOeMZvmkN7lM9ObDS0D9bcbHA" diff --git a/src/views/Need/components/EditFSuccedaneum.vue b/src/views/Need/components/EditFSuccedaneum.vue index 6d9bf19..5edde11 100644 --- a/src/views/Need/components/EditFSuccedaneum.vue +++ b/src/views/Need/components/EditFSuccedaneum.vue @@ -106,13 +106,7 @@ export default { FormulaView, }, setup() { - let dataColumn = [{ - title: "ID", - key: "FID", - width: "160px", - align: 'center', - hide: false - }, + let dataColumn = [ { title: "试验号", key: "FTestCode", @@ -128,7 +122,7 @@ export default { }, { title: "物料描述", - key: "FDesc", + key: "FName", width: "360px", align: 'center' }, @@ -227,11 +221,15 @@ export default { if (this.dataInfoObj.FCanEdit != 2) { this.userPower[0] = (await getBasicRoleList({ FRoleType: 40, - FViewType: this.dataInfoObj.FViewType + FViewType: this.dataInfoObj.FViewType, + TeamId:this.dataInfoObj.FTeamID, + Type:0 }) || []).map(it => parseInt(it.F2)) this.userPower[1] = (await getBasicRoleList({ FRoleType: 44, - FViewType: this.dataInfoObj.FViewType + FViewType: this.dataInfoObj.FViewType, + TeamId:this.dataInfoObj.FTeamID, + Type:0 }) || []).map(it => parseInt(it.F2)) } this.initPage(layer.load(2)); @@ -240,16 +238,20 @@ export default { let _data = await GetMaterialInfoListByTeamId({ tempId: this.dataInfoObj.FTeamID }); - this.dataList = _data.Data.map(function (item) { - if (item.FSuccedaneumID == -1) { - item["selected"] = "不需要"; - } - else if (item.FSuccedaneumID > 0) { - item["selected"] = "需要"; - } - return item; - }); + if(_data.Code==200){ + this.dataList = _data.Data.map(function (item) { + if (item.FSuccedaneumID == -1) { + item["selected"] = "不需要"; + } + else if (item.FSuccedaneumID > 0) { + item["selected"] = "需要"; + } + + return item; + }); + } + setTimeout(function () { layer.close(idx); }, 500); diff --git a/src/views/Need/components/EditView.vue b/src/views/Need/components/EditView.vue index 1a70233..5239bcc 100644 --- a/src/views/Need/components/EditView.vue +++ b/src/views/Need/components/EditView.vue @@ -96,6 +96,11 @@ import { getListByTeamId, updateBatchById2 } from "/src/api/api/view"; + +import { + GetMaterialById +} from "/src/api/api/material"; + import { getBasicRoleList, GetFreezingColumns @@ -174,6 +179,7 @@ export default { const idx = ref([]); const materialInfoList=ref([]); + return { dataColumn, dataList, @@ -213,7 +219,6 @@ export default { }, methods: { async getUserPower() { - debugger if (this.dataInfoObj.FCanEdit != 2) { this.userPower[0] = (await getBasicRoleList({ FRoleType: 84, @@ -239,10 +244,17 @@ export default { }); this.materialInfoList = await GetMaterialInfoList() || null; let freezingCols = await GetFreezingColumns(); - + if (this.dataInfoObj.FViewType == 1 || this.dataInfoObj.FViewType == 10) { - this.inputCodeValue = _data.rows[0]?_data.rows[0].HalfCode:""; - this.inputDescValue = _data.rows[0]?_data.rows[0].HalfDesc:""; + let dataResult=await GetMaterialById({ + ID:this.dataInfoObj.FMaterialHalfIDs + }) + if(dataResult) + { + this.inputCodeValue =dataResult.Data.FCode; + this.inputDescValue =dataResult.Data.FName; + } + this.isShow = true; } else if (this.dataInfoObj.FViewType == 2 || this.dataInfoObj.FViewType == 3 || this.dataInfoObj.FViewType == 4) { this.isBomShow = true; @@ -311,19 +323,7 @@ export default { return items["cellClass"]=""; }) - // let k3Code = item.FBaseMaterialDesc; - // if (k3Code.indexOf("@") > 0) { - // item.FK3Code = k3Code.substr(0, k3Code.indexOf("@")); - // item.FK3Name = k3Code.substr(k3Code.indexOf("@") + 1); - // } else { - // item.FK3Code = ""; - // item.FK3Name = ""; - // } - // if (k3Code.lastIndexOf(".") > 0) { - // item.FK3ShortCode = item.FK3Code.substr(item.FK3Code.lastIndexOf(".") + 1); - // } else { - // item.FK3ShortCode = ""; - // } + let info = _data.infos.find(s => s.FDataID == item.FMaterialID) || null; if (info != null) { col7.forEach((col) => { @@ -332,6 +332,7 @@ export default { } item.FTypeID1 = (item.FTypeID1 == 0 || item.FTypeID1 == -1) ? "" : item.FTypeID1; item.FTypeID2 = (item.FTypeID2 == 0 || item.FTypeID2 == -1) ? "" : item.FTypeID2; + }); let saveId = this.dataInfoObj.FViewType + "_" + this.dataInfoObj.FID; localStorage.setItem('EditView' + saveId, JSON.stringify(_data.rows)); @@ -340,6 +341,39 @@ export default { let $this=this; this.dataList = _data.rows.map(function (item) { item["info"]=$this.materialInfoList.Data.find(s=>s.FDataID==item.FTypeID2); + + let fType1 = $this.typeList[0].find((t) => { + if (item.FTypeID1) { + return t.FID == item.FTypeID1 + } + }); + + let fType2 = $this.typeList[1].find((t) => { + if (item.FTypeID2) { + return t.FID == item.FTypeID2 + } + }) + if ($this.dataInfoObj.FCanEdit == 2) { + item.FTypeID1 = fType1 ? fType1.FName : item.FTypeID1; + item.FTypeID2 = fType2 ? fType2.FName : item.FTypeID2; + } + else{ + + let isFTypeID1 = $this.editColumn.find((t)=>{ + return t.key=="FTypeID1"; + }) + let isFTypeID2 = $this.editColumn.find((t)=>{ + return t.key=="FTypeID2"; + }) + + if(!isFTypeID1&&!isFTypeID2){ + item.FTypeID1 = fType1 ? fType1.FName : item.FTypeID1; + item.FTypeID2 = fType2 ? fType2.FName : item.FTypeID2; + } + } + + + return item; }); this.dataColumn = dataColumn; @@ -362,7 +396,7 @@ export default { } - this._changeType(_data.rows[0],2); + // this._changeType(_data.rows[0],2); setTimeout(function () { layer.close(idx); }, 500); @@ -484,7 +518,6 @@ export default { this.dataList.forEach((row, index) => { let cache = cacheDataList[index]; let dataObj = {}; - debugger if (row["FTypeID1"]==-1 || row["FTypeID2"]==-1||row["FTypeID1"]==''||row["FTypeID2"]=='') { layer.msg("请先为所有物料选择分类", { icon : 2, time: 1000}); layer.close(idx); diff --git a/src/views/Team/all.vue b/src/views/Team/all.vue index ddd0652..35c07b0 100644 --- a/src/views/Team/all.vue +++ b/src/views/Team/all.vue @@ -85,6 +85,9 @@ import { checkIsHasPower } from "/src/api/api/common"; + import{ + getFactoryList + }from "/src/api/api/factory"; import AddTerm from './components/AddTerm.vue'; import ShowData1 from './components/ShowData1.vue'; @@ -121,16 +124,23 @@ key: "FFormulaTestCode", width: "190px" }, + { + title: "模式", + key: "FCreateFactoryID", + width: "190px" + }, { title: "发起时间", key: "FAddDate", width: "182px" }, + { title: "发起人", key: "FAddUserName", width: "126px" }, + { title: "完成度", key: "FProgress", @@ -184,6 +194,7 @@ id: "100", name: "已完成" }]); + const factoryLists=ref([]); return { objInfoObj, editBoxTitle, @@ -198,14 +209,20 @@ searchObj, postData, stateList, - userRolePower + userRolePower, + factoryLists }; }, mounted() { this._checkIsHasPower() - this._getPageList(true); + this._getFactoryList(); + //this._getPageList(true); }, methods: { + async _getFactoryList(){ + this.factoryLists=await getFactoryList()||[]; + this._getPageList(true); + }, //判断权限 async _checkIsHasPower() { let result = await checkIsHasPower({ @@ -225,6 +242,13 @@ }, //获取数据集合 async _getPageList(isFirst, showOk) { + + let factoryList=[]; + for(let i=0;is.FID==item.FCreateFactoryID).FName; + } + return item; + }); }, //日期处理 dateFormat(dataStr) { diff --git a/src/views/Team/components/ShowData1.vue b/src/views/Team/components/ShowData1.vue index 86ee959..1be9a52 100644 --- a/src/views/Team/components/ShowData1.vue +++ b/src/views/Team/components/ShowData1.vue @@ -290,7 +290,16 @@ async _getViewList() { let result = await getBasicRoleList({ FRoleType: 39 + + }) || []; + + let result2 = await getBasicRoleList({ + FRoleType: 39, + TeamId:this.dataInfoObj.FID, + Type:0 + }) || []; + console.log('result', result); console.log('this.dataInfoObj', this.dataInfoObj); let dataList = []; @@ -298,6 +307,7 @@ result.forEach((item) => { let viewData = dataList.find(s => s.name == item.FName) || null; + debugger if (viewData == null) { if (hasType.indexOf(item.FCode) != -1) { viewData = { @@ -305,13 +315,30 @@ seeCode: "", outCode: "" }; - if (item.FRemark.indexOf("查看") != -1) viewData.seeCode = item.FCode; - if (item.FRemark.indexOf("导出") != -1) viewData.outCode = item.FCode; + if(result2){ + let dataResult=result2.find((x)=>{ + return x.FID==item.FID; + }) + if(dataResult){ + if (item.FRemark.indexOf("查看") != -1) viewData.seeCode = item.FCode; + if (item.FRemark.indexOf("导出") != -1) viewData.outCode = item.FCode; + } + + } + dataList.push(viewData); } } else { - if (item.FRemark.indexOf("查看") != -1) viewData.seeCode = item.FCode; - if (item.FRemark.indexOf("导出") != -1) viewData.outCode = item.FCode; + if(result2){ + let dataResult=result2.find((x)=>{ + return x.FID==item.FID; + }) + if(dataResult){ + if (item.FRemark.indexOf("查看") != -1) viewData.seeCode = item.FCode; + if (item.FRemark.indexOf("导出") != -1) viewData.outCode = item.FCode; + } + + } } }); diff --git a/src/views/half/components/EditView.vue b/src/views/half/components/EditView.vue index fdfd8fd..9f55b04 100644 --- a/src/views/half/components/EditView.vue +++ b/src/views/half/components/EditView.vue @@ -7,6 +7,7 @@ + -