commit by yzf

master
Yang 3 years ago
parent 49faa7d480
commit 95fbbae9f1

@ -223,7 +223,8 @@ export default {
let indexValue=document.querySelectorAll(".sItem")[i].querySelectorAll("select")[0].selectedIndex; let indexValue=document.querySelectorAll(".sItem")[i].querySelectorAll("select")[0].selectedIndex;
let indexName=document.querySelectorAll(".sItem")[i].querySelectorAll("select")[1].selectedIndex; let indexName=document.querySelectorAll(".sItem")[i].querySelectorAll("select")[1].selectedIndex;
let item =arr1.find(m=>m.FFactoryID==document.querySelectorAll(".sItem")[i].querySelectorAll("select")[0].value); let item =arr1.find(m=>m==document.querySelectorAll(".sItem")[i].querySelectorAll("select")[0].value);
debugger
if(item!=null) if(item!=null)
{ {
layer.msg("已存在相同模式", { layer.msg("已存在相同模式", {
@ -269,7 +270,7 @@ export default {
let indexValue=document.querySelectorAll(".sItem")[i].querySelectorAll("select")[0].selectedIndex; let indexValue=document.querySelectorAll(".sItem")[i].querySelectorAll("select")[0].selectedIndex;
let indexName=document.querySelectorAll(".sItem")[i].querySelectorAll("select")[1].selectedIndex; let indexName=document.querySelectorAll(".sItem")[i].querySelectorAll("select")[1].selectedIndex;
let item =arr1.find(m=>m.FFactoryID==document.querySelectorAll(".sItem")[i].querySelectorAll("select")[0].value); let item =arr1.find(m=>m==document.querySelectorAll(".sItem")[i].querySelectorAll("select")[0].value);
if(item!=null) if(item!=null)
{ {
layer.msg("已存在相同模式", { layer.msg("已存在相同模式", {

@ -130,7 +130,7 @@ export default {
const freezingColumnSetting = ref([]); const freezingColumnSetting = ref([]);
const originalColumns = ref([]); const originalColumns = ref([]);
const infoList = ref([]); const infoList = ref([]);
const materialInfoList=ref([]);
const typeList = ref([ const typeList = ref([
[], [],
[] []
@ -173,7 +173,7 @@ export default {
return column.cellClass = column.key + "_" + rowIndex + "_" + columnIndex; return column.cellClass = column.key + "_" + rowIndex + "_" + columnIndex;
}; };
const idx = ref([]); const idx = ref([]);
const materialInfoList=ref([]);
return { return {
dataColumn, dataColumn,
dataList, dataList,

@ -102,7 +102,8 @@ import {
} from "/src/api/api/common"; } from "/src/api/api/common";
import { import {
getInfoData getInfoData,
GetMaterialInfoList
} from "/src/api/api/materialType"; } from "/src/api/api/materialType";
import OperateLog from "./OperateLog.vue"; import OperateLog from "./OperateLog.vue";
import FormulaView from "./FormulaView.vue"; import FormulaView from "./FormulaView.vue";
@ -128,25 +129,28 @@ export default {
[] []
]); ]);
const cellStyle = function (row, column, rowIndex, columnIndex) { const cellStyle = function (row, column, rowIndex, columnIndex) {
let back = column.table == "TFS_ViewMaterial" ? "background:rgb(246, 246, 246)" : "" let back = column.table == "TFS_ViewMaterial" ? "background:rgb(246, 246, 246)" : "";
return back; let info = row["info"];
} if (info) {
const cellClassName = function (row, column, rowIndex, columnIndex) { if (typeof(document.getElementsByClassName(column.key + "_" + rowIndex + "_" + columnIndex)[0])!="undefined") {
debugger switch (info[column.key + "Type"]) {
let info=row["info"]; case "1":
switch (info[column.key+"Type"]) { return document.getElementsByClassName(column.key + "_" + rowIndex + "_" + columnIndex)[0].classList.add("one");
case "1": case "2":
return column.cellClass = column.cellClass + " one"; return document.getElementsByClassName(column.key + "_" + rowIndex + "_" + columnIndex)[0].classList.add("twe");
case "2": case "3":
return column.cellClass = column.cellClass + " twe"; return document.getElementsByClassName(column.key + "_" + rowIndex + "_" + columnIndex)[0].classList.add("three");
case "3": case "4":
return column.cellClass = column.cellClass + " three"; return document.getElementsByClassName(column.key + "_" + rowIndex + "_" + columnIndex)[0].classList.add("four");
case "4": }
return column.cellClass = column.cellClass + " four";
} }
return column.cellClass || ""; }
} return back;
};
const cellClassName = function (row, column, rowIndex, columnIndex) {
return column.cellClass = column.key + "_" + rowIndex + "_" + columnIndex;
};
const inputCodeValue = ref(""); const inputCodeValue = ref("");
const inputDescValue = ref(""); const inputDescValue = ref("");
const visible2 = ref(false) const visible2 = ref(false)
@ -157,6 +161,9 @@ export default {
const freezingColumnSetting = ref([]); const freezingColumnSetting = ref([]);
const originalColumns = ref([]); const originalColumns = ref([]);
const tmpDataColumn = ref([]); const tmpDataColumn = ref([]);
const idx = ref([]);
const materialInfoList=ref([]);
return { return {
dataColumn, dataColumn,
dataList, dataList,
@ -175,7 +182,9 @@ export default {
showFreezingColumnSettingBox, showFreezingColumnSettingBox,
freezingColumnSetting, freezingColumnSetting,
originalColumns, originalColumns,
tmpDataColumn tmpDataColumn,
materialInfoList,
idx
}; };
}, },
props: { props: {
@ -190,6 +199,7 @@ export default {
}, },
mounted() { mounted() {
this.getUserPower(); this.getUserPower();
this.initPage(this.idx);
}, },
methods: { methods: {
async getUserPower() { async getUserPower() {
@ -206,12 +216,13 @@ export default {
this.initPage(layer.load(2)); this.initPage(layer.load(2));
}, },
async initPage(idx) { async initPage(idx) {
this.idx=idx;
let _data = await getMaterialViewsByTeamId({ let _data = await getMaterialViewsByTeamId({
teamId: this.dataInfoObj.FTeamID, teamId: this.dataInfoObj.FTeamID,
teamWorkType: this.dataInfoObj.FTeamworkType, teamWorkType: this.dataInfoObj.FTeamworkType,
teamType: 1 teamType: 1
}, "MaterialTeamwork"); }, "MaterialTeamwork");
this.materialInfoList = await GetMaterialInfoList() || null;
let freezingCols = await GetFreezingColumns(); let freezingCols = await GetFreezingColumns();
this.typeList[0] = _data.types.filter(s => s.FDepth == 1) || []; this.typeList[0] = _data.types.filter(s => s.FDepth == 1) || [];
@ -318,10 +329,11 @@ export default {
localStorage.setItem('EditView' + saveId, JSON.stringify(_data.rows)); localStorage.setItem('EditView' + saveId, JSON.stringify(_data.rows));
this.editColumn = editColumn; this.editColumn = editColumn;
this.dataList = _data.rows.map(function(item){ let $this=this;
item["info"]=_data.infos.find(s => s.FDataID == item.FMaterialID) || null; this.dataList = _data.rows.map(function (item) {
item["info"]=$this.materialInfoList.Data.find(s=>s.FDataID==item.FTypeID2);
return item; return item;
});; });
this.dataColumn = dataColumn; this.dataColumn = dataColumn;
this.originalColumns = this.deepCopy(dataColumn); this.originalColumns = this.deepCopy(dataColumn);

Loading…
Cancel
Save