commit by yzf

master
Yang 3 years ago
parent f60bb48482
commit 6d56fcaf5d

@ -54,4 +54,5 @@ export async function UpdateDataModel(param)
result = data; result = data;
}); });
return result; return result;
} }

@ -19,3 +19,12 @@ export async function changeInfoData(param) {
} }
//获取物料分类
export async function GetMaterialInfoList(param)
{
let result = [];
await http.post('/api/Material/GetMaterialInfoList', param).then((data) => {
result = data;
});
return result;
}

@ -215,12 +215,24 @@ export default {
if (this.userInfo.FUser == "" || this.userInfo.FPassword == "" || this.userInfo.FName == "") { if (this.userInfo.FUser == "" || this.userInfo.FPassword == "" || this.userInfo.FName == "") {
return false; return false;
} }
var str="";
if (this.userInfo.FID && this.userInfo.FID > 0) { if (this.userInfo.FID && this.userInfo.FID > 0) {
for (let i = 0; i < sItemsCount; i++) { for (let i = 0; i < sItemsCount; i++) {
if (document.querySelectorAll(".sItem")[i].querySelectorAll("select")[0].value > -1 && document.querySelectorAll(".sItem")[i].querySelectorAll("select")[1].value > -1 if (document.querySelectorAll(".sItem")[i].querySelectorAll("select")[0].value > -1 && document.querySelectorAll(".sItem")[i].querySelectorAll("select")[1].value > -1
&&document.querySelectorAll(".sItem")[i].querySelectorAll("select")[0].value!=""&&document.querySelectorAll(".sItem")[i].querySelectorAll("select")[1].value!="") { &&document.querySelectorAll(".sItem")[i].querySelectorAll("select")[0].value!=""&&document.querySelectorAll(".sItem")[i].querySelectorAll("select")[1].value!="") {
let indexValue=document.querySelectorAll(".sItem")[i].querySelectorAll("select")[0].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);
if(item!=null)
{
layer.msg("已存在相同模式", {
time: 1000,
icon: 2
});
return false;
}
arr1.push(document.querySelectorAll(".sItem")[i].querySelectorAll("select")[0].value); arr1.push(document.querySelectorAll(".sItem")[i].querySelectorAll("select")[0].value);
arr2.push(document.querySelectorAll(".sItem")[i].querySelectorAll("select")[1].value); arr2.push(document.querySelectorAll(".sItem")[i].querySelectorAll("select")[1].value);
arr.push({ arr.push({
@ -228,6 +240,8 @@ export default {
FFactoryID: document.querySelectorAll(".sItem")[i].querySelectorAll("select")[0].value, FFactoryID: document.querySelectorAll(".sItem")[i].querySelectorAll("select")[0].value,
FRole: document.querySelectorAll(".sItem")[i].querySelectorAll("select")[1].value FRole: document.querySelectorAll(".sItem")[i].querySelectorAll("select")[1].value
}); });
str+=document.querySelectorAll(".sItem")[i].querySelectorAll("select")[0].options[indexValue].text+"=>"+document.querySelectorAll(".sItem")[i].querySelectorAll("select")[1].options[indexName].text+"\r\n";
} }
else { else {
layer.msg("权限不能为空", { layer.msg("权限不能为空", {
@ -236,11 +250,10 @@ export default {
}) })
return false; return false;
} }
} }
this.userInfo.FFactoryList=","+arr1.join(",")+","; this.userInfo.FFactoryList=","+arr1.join(",")+",";
this.userInfo.FRoleList=","+arr2.join(",")+","; this.userInfo.FRoleList=","+arr2.join(",")+",";
this.userInfo.FRoleName=str;
result = await updateDataInfo(this.userInfo, "User") || 0; result = await updateDataInfo(this.userInfo, "User") || 0;
result = await CreatePower(arr) || 0; result = await CreatePower(arr) || 0;
@ -253,6 +266,19 @@ export default {
for (let i = 0; i < sItemsCount; i++) { for (let i = 0; i < sItemsCount; i++) {
if (document.querySelectorAll(".sItem")[i].querySelectorAll("select")[0].value > -1 && document.querySelectorAll(".sItem")[i].querySelectorAll("select")[1].value > -1 if (document.querySelectorAll(".sItem")[i].querySelectorAll("select")[0].value > -1 && document.querySelectorAll(".sItem")[i].querySelectorAll("select")[1].value > -1
&&document.querySelectorAll(".sItem")[i].querySelectorAll("select")[0].value!=""&&document.querySelectorAll(".sItem")[i].querySelectorAll("select")[1].value!="") { &&document.querySelectorAll(".sItem")[i].querySelectorAll("select")[0].value!=""&&document.querySelectorAll(".sItem")[i].querySelectorAll("select")[1].value!="") {
let indexValue=document.querySelectorAll(".sItem")[i].querySelectorAll("select")[0].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);
if(item!=null)
{
layer.msg("已存在相同模式", {
time: 1000,
icon: 2
});
return false;
}
arr1.push(document.querySelectorAll(".sItem")[i].querySelectorAll("select")[0].value); arr1.push(document.querySelectorAll(".sItem")[i].querySelectorAll("select")[0].value);
arr2.push(document.querySelectorAll(".sItem")[i].querySelectorAll("select")[1].value); arr2.push(document.querySelectorAll(".sItem")[i].querySelectorAll("select")[1].value);
arr.push({ arr.push({
@ -260,6 +286,8 @@ export default {
FFactoryID: document.querySelectorAll(".sItem")[i].querySelectorAll("select")[0].value, FFactoryID: document.querySelectorAll(".sItem")[i].querySelectorAll("select")[0].value,
FRole: document.querySelectorAll(".sItem")[i].querySelectorAll("select")[1].value FRole: document.querySelectorAll(".sItem")[i].querySelectorAll("select")[1].value
}); });
str+=document.querySelectorAll(".sItem")[i].querySelectorAll("select")[0].options[indexValue].text+"=>"+document.querySelectorAll(".sItem")[i].querySelectorAll("select")[1].options[indexName].text+"\r\n";
} }
else { else {
layer.msg("权限不能为空", { layer.msg("权限不能为空", {
@ -268,9 +296,9 @@ export default {
}) })
return false; return false;
} }
this.userInfo.FFactoryList=","+arr1.join(",")+","; this.userInfo.FFactoryList=","+arr1.join(",")+",";
this.userInfo.FRoleList=","+arr2.join(",")+","; this.userInfo.FRoleList=","+arr2.join(",")+",";
this.userInfo.FRoleName=str;
} }
if(arr.length>0) if(arr.length>0)

@ -227,20 +227,20 @@ export default {
result.Data.List.forEach((item) => { result.Data.List.forEach((item) => {
let state = this.stateList.find(s => s.FValue == item.FState); let state = this.stateList.find(s => s.FValue == item.FState);
item.FStateName = state == null ? "" : state.FName; item.FStateName = state == null ? "" : state.FName;
let str = ""; // let str = "";
var power = this.powerList.filter(function (p) { // var power = this.powerList.filter(function (p) {
return p.FUserID == item.FID; // return p.FUserID == item.FID;
}); // });
for (let i = 0; i < power.length; i++) { // for (let i = 0; i < power.length; i++) {
if (power[i].FRole != "" && power[i].FFactoryID != "") { // if (power[i].FRole != "" && power[i].FFactoryID != "") {
let factory = this.factoryList.find(s => s.FID == power[i].FFactoryID); // let factory = this.factoryList.find(s => s.FID == power[i].FFactoryID);
let role = this.roleLists.find(s => s.FID == power[i].FRole); // let role = this.roleLists.find(s => s.FID == power[i].FRole);
str += factory.FName + "=>" + role.FName + "\r\n"; // str += factory.FName + "=>" + role.FName + "\r\n";
} // }
} // }
item.FRoleName = str; //item.FRoleName = str;
item.FLoginDate = item.FLoginDate == null ? "" : this.dateFormat(item.FLoginDate); item.FLoginDate = item.FLoginDate == null ? "" : this.dateFormat(item.FLoginDate);

@ -193,6 +193,10 @@ export default {
const formula2 = ref(-1); const formula2 = ref(-1);
const formula2Name = ref(""); const formula2Name = ref("");
const factoryID = ref(""); const factoryID = ref("");
const fVersion1Code=ref("");
const fVersion2Code=ref("");
const FDesc=ref("");
const FNewDesc=ref("");
return { return {
dataInfo, dataInfo,
formulaList, formulaList,
@ -211,8 +215,12 @@ export default {
formula2, formula2,
formula1Name, formula1Name,
formula2Name, formula2Name,
fVersion1Code,
fVersion2Code,
dataType, dataType,
factoryID factoryID,
FDesc,
FNewDesc
} }
}, },
props: { props: {
@ -284,19 +292,21 @@ export default {
}, },
selectMaterial(str) { selectMaterial(str) {
this.dataType = str; this.dataType = str;
this.showEditBox = true; this.showEditBox = true;
this.editDataInfo.FName = "";
}, },
_getSeachData(data) { _getSeachData(data) {
debugger debugger
if (this.dataType == 1) { if (this.dataType == 1) {
this.formula1 = data.FTestCode; this.formula1 = data.FTestCode;
this.formula1Name = data.FName; this.formula1Name = data.FName;
this.fVersion1Code=data.FVersionCode;
this.FDesc=data.FDesc;
this._getPageList(true); this._getPageList(true);
} else { } else {
this.formula2 = data.FTestCode; this.formula2 = data.FTestCode;
this.formula2Name = data.FName; this.formula2Name = data.FName;
this.fVersion2Code=data.FVersionCode;
this.FNewDesc=data.FDesc;
} }
this.showEditBox = false; this.showEditBox = false;
}, },
@ -324,7 +334,6 @@ export default {
item.FTypeName = type == null ? item.FType : type.FName; item.FTypeName = type == null ? item.FType : type.FName;
if (this.dataInfo.FFormulaID == item.FID) this.selectedKey = item.FID if (this.dataInfo.FFormulaID == item.FID) this.selectedKey = item.FID
}); });
debugger
this.pageInfo.total = result.Data.Total || 0; this.pageInfo.total = result.Data.Total || 0;
this.dataList = result.Data.List; this.dataList = result.Data.List;
} }
@ -332,7 +341,15 @@ export default {
}, },
//- //-
async submitClick(isCreate) { async submitClick(isCreate) {
let postData = { "FTestCode": this.formula1, "FNewTestCode": this.formula2, "FCreateFactoryID": this.factoryID }; let postData = {
"FTestCode": this.formula1,
"FNewTestCode": this.formula2,
"FVersionCode":this.fVersion1Code,
"FNewVersionCode":this.fVersion2Code,
"FCreateFactoryID": this.factoryID,
"FDesc":this.FDesc,
"FNewDesc":this.FNewDesc
};
if (this.formula1Name.trim() == "") { if (this.formula1Name.trim() == "") {
layer.msg('请选择试验号'); layer.msg('请选择试验号');
@ -346,23 +363,17 @@ export default {
layer.msg('请选择模式'); layer.msg('请选择模式');
return false; return false;
} }
if (this.dataList.length <= 0) {
layer.msg('未找到需要变更的物料');
return false;
}
let ids = layer.load(0) let ids = layer.load(0)
debugger
let result = await InsertDataModel(postData);
try {
let result = await InsertDataModel(postData);
if (result.Code == 200) { if (result.Code == 200) {
layer.msg('创建成功'); layer.msg('创建成功');
this.cancelClick(true); this.cancelClick(true);
} else { } else {
layer.msg('创建失败'); //layer.msg('');
} }
} catch (e) { }
layer.close(ids); layer.close(ids);
@ -403,9 +414,9 @@ export default {
let result = 0; let result = 0;
let idx = layer.load(2); let idx = layer.load(2);
if (postData.FID && postData.FID > 0) { if (postData.FID && postData.FID > 0) {
result = await updateDataInfo(postData, "Teamwork") || 0; result = await updateDataInfo(postData, "HalfMaterialTeamwork") || 0;
} else { } else {
result = await insertDataInfo(postData, "Teamwork") || 0; result = await insertDataInfo(postData, "HalfMaterialTeamwork") || 0;
} }
if (result > 0) { if (result > 0) {
this.cancelClick(true); this.cancelClick(true);

@ -1,12 +1,12 @@
<template> <template>
<lay-container fluid="true" class="content-box"> <lay-container fluid="true" class="content-box">
<!-- <FormulaView :teamId="dataInfoObj.FTeamID" :halfId="dataInfoObj.FMaterialHalfIDs"></FormulaView> --> <!-- <FormulaView :teamId="dataInfoObj.FTeamID" :dataInfoObj="dataInfoObj" :halfId="dataInfoObj.FMaterialHalfIDs"></FormulaView> -->
<lay-layer area="90%" v-model="showFreezingColumnSettingBox" title="固定列设置" :end="closeFreezingSetting"> <lay-layer area="90%" v-model="showFreezingColumnSettingBox" title="固定列设置" :end="closeFreezingSetting">
<FreezingColumnSetting v-if="showFreezingColumnSettingBox" :columns="originalColumns" <FreezingColumnSetting v-if="showFreezingColumnSettingBox" :columns="originalColumns"
:freezingColumns="freezingColumnSetting" @cancelClick="setFreezingColumnsSetting"></FreezingColumnSetting> :freezingColumns="freezingColumnSetting" @cancelClick="setFreezingColumnsSetting"></FreezingColumnSetting>
</lay-layer> </lay-layer>
<lay-table id="dataTable" v-if="dataColumn.length > 0" height="320px" :columns="dataColumn" :dataInfoObj="dataInfoObj" :data-source="dataList" <lay-table id="dataTable" v-if="dataColumn.length > 0" height="320px" :columns="dataColumn"
:cellStyle="cellStyle" :cellClassName="cellClassName"> :dataInfoObj="dataInfoObj" :data-source="dataList" :cellStyle="cellStyle" :cellClassName="cellClassName">
<template v-slot:toolbar v-if="dataInfoObj.FCanEdit != 2"> <template v-slot:toolbar v-if="dataInfoObj.FCanEdit != 2">
<lay-button size="sm" @click="saveBatch" type="primary" :disabled="editColumn.length === 0">保存 <lay-button size="sm" @click="saveBatch" type="primary" :disabled="editColumn.length === 0">保存
</lay-button> </lay-button>
@ -103,12 +103,13 @@ import {
} from "/src/api/api/user"; } from "/src/api/api/user";
import { import {
getDataCode, getDataCode,
commonSave commonSave,
getPageList
} from "/src/api/api/common"; } from "/src/api/api/common";
import { import {
getInfoData, getInfoData,
changeInfoData 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,7 +129,8 @@ export default {
const showFreezingColumnSettingBox = ref(false); const showFreezingColumnSettingBox = ref(false);
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([
[], [],
[] []
@ -137,7 +139,7 @@ export default {
[], [],
[] []
]); ]);
const inputCodeValue = ref(""); const inputCodeValue = ref("");
const inputDescValue = ref(""); const inputDescValue = ref("");
const visible2 = ref(false) const visible2 = ref(false)
@ -149,27 +151,29 @@ 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)" : "";
let info = row["info"];
if (info) {
if (typeof(document.getElementsByClassName(column.key + "_" + rowIndex + "_" + columnIndex)[0])!="undefined") {
switch (info[column.key + "Type"]) {
case "1":
return document.getElementsByClassName(column.key + "_" + rowIndex + "_" + columnIndex)[0].classList.add("one");
case "2":
return document.getElementsByClassName(column.key + "_" + rowIndex + "_" + columnIndex)[0].classList.add("twe");
case "3":
return document.getElementsByClassName(column.key + "_" + rowIndex + "_" + columnIndex)[0].classList.add("three");
case "4":
return document.getElementsByClassName(column.key + "_" + rowIndex + "_" + columnIndex)[0].classList.add("four");
}
}
}
return back; return back;
} };
const cellClassName = function (row, column, rowIndex, columnIndex) { const cellClassName = function (row, column, rowIndex, columnIndex) {
return column.cellClass = column.key + "_" + rowIndex + "_" + columnIndex;
debugger };
const idx = ref([]);
let info=row["info"];
switch (info[column.key+"Type"]) {
case "1":
return column.cellClass = column.cellClass + " one";
case "2":
return column.cellClass = column.cellClass + " twe";
case "3":
return column.cellClass = column.cellClass + " three";
case "4":
return column.cellClass = column.cellClass + " four";
}
return column.cellClass || "";
}
return { return {
dataColumn, dataColumn,
dataList, dataList,
@ -189,7 +193,10 @@ export default {
freezingColumnSetting, freezingColumnSetting,
originalColumns, originalColumns,
tmpDataColumn, tmpDataColumn,
infoList infoList,
materialInfoList,
idx
}; };
}, },
props: { props: {
@ -204,6 +211,7 @@ export default {
}, },
mounted() { mounted() {
this.getUserPower(); this.getUserPower();
this.initPage(this.idx);
}, },
methods: { methods: {
async getUserPower() { async getUserPower() {
@ -220,16 +228,18 @@ export default {
this.initPage(layer.load(2)); this.initPage(layer.load(2));
}, },
async initPage(idx) { async initPage(idx) {
this.idx=idx;
let _data = await getListByHalfMaterialTeamId({ let _data = await getListByHalfMaterialTeamId({
teamId: this.dataInfoObj.FTeamID, teamId: this.dataInfoObj.FTeamID,
viewType: this.dataInfoObj.FViewType viewType: this.dataInfoObj.FViewType
}); });
this.infoList=_data; this.materialInfoList = await GetMaterialInfoList() || null;
this.infoList = _data;
console.log('_data', _data); console.log('_data', _data);
let freezingCols = await GetFreezingColumns(); let freezingCols = await GetFreezingColumns();
if (this.dataInfoObj.FViewType == 1 || this.dataInfoObj.FViewType == 10) { if (this.dataInfoObj.FViewType == 1 || this.dataInfoObj.FViewType == 10) {
this.inputCodeValue = _data.rows[0]?_data.rows[0].HalfCode:""; this.inputCodeValue = _data.rows[0] ? _data.rows[0].HalfCode : "";
this.inputDescValue = _data.rows[0]?_data.rows[0].HalfDesc:""; this.inputDescValue = _data.rows[0] ? _data.rows[0].HalfDesc : "";
this.isShow = true; this.isShow = true;
} else if (this.dataInfoObj.FViewType == 2 || this.dataInfoObj.FViewType == 3 || this.dataInfoObj.FViewType == 4) { } else if (this.dataInfoObj.FViewType == 2 || this.dataInfoObj.FViewType == 3 || this.dataInfoObj.FViewType == 4) {
this.isBomShow = true; this.isBomShow = true;
@ -238,7 +248,7 @@ export default {
this.typeList[0] = _data.types.filter(s => s.FDepth == 1) || []; this.typeList[0] = _data.types.filter(s => s.FDepth == 1) || [];
this.typeList[1] = _data.types.filter(s => s.FDepth != 1) || []; this.typeList[1] = _data.types.filter(s => s.FDepth != 1) || [];
let dataColumn = _data.columns || []; let dataColumn = _data.columns || [];
let editColumn = dataColumn.filter(it => { let editColumn = dataColumn.filter(it => {
let b = false; let b = false;
if (this.dataInfoObj.FCanEdit != 2) { if (this.dataInfoObj.FCanEdit != 2) {
@ -293,9 +303,9 @@ export default {
return items.cellClass = items.cellClass + " four"; return items.cellClass = items.cellClass + " four";
} }
} }
} }
return items["cellClass"]=""; return items["cellClass"] = "";
}) })
let k3Code = item.FBaseMaterialDesc; let k3Code = item.FBaseMaterialDesc;
if (k3Code.indexOf("@") > 0) { if (k3Code.indexOf("@") > 0) {
@ -320,28 +330,29 @@ export default {
item.FTypeID2 = (item.FTypeID2 == 0 || item.FTypeID2 == -1) ? "" : item.FTypeID2; item.FTypeID2 = (item.FTypeID2 == 0 || item.FTypeID2 == -1) ? "" : item.FTypeID2;
if (this.dataInfoObj.FCanEdit == 2) { if (this.dataInfoObj.FCanEdit == 2) {
let fType1 = this.typeList[0].find((t) => { let fType1 = this.typeList[0].find((t) => {
if(item.FTypeID1){ if (item.FTypeID1) {
return t.FID == item.FTypeID1 return t.FID == item.FTypeID1
} }
}); });
let fType2 = this.typeList[1].find((t) => { let fType2 = this.typeList[1].find((t) => {
if(item.FTypeID2){ if (item.FTypeID2) {
return t.FID == item.FTypeID2 return t.FID == item.FTypeID2
} }
}) })
item.FTypeID1 = fType1?fType1.FName:item.FTypeID1; item.FTypeID1 = fType1 ? fType1.FName : item.FTypeID1;
item.FTypeID2 = fType2?fType2.FName:item.FTypeID2; item.FTypeID2 = fType2 ? fType2.FName : item.FTypeID2;
} }
}); });
let saveId = this.dataInfoObj.FViewType + "_" + this.dataInfoObj.FID; let saveId = this.dataInfoObj.FViewType + "_" + this.dataInfoObj.FID;
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;
@ -351,7 +362,7 @@ export default {
if (freezingColumns) { if (freezingColumns) {
let c_list = freezingColumns.split(",") let c_list = freezingColumns.split(",")
c_list.forEach(c => { c_list.forEach(c => {
if(c && c.length > 0) { if (c && c.length > 0) {
this.freezingColumnSetting.push(c) this.freezingColumnSetting.push(c)
} }
}) })
@ -432,35 +443,12 @@ export default {
data.FViewType = 1 data.FViewType = 1
} }
this.dataColumn.map(function (item) { this.dataList.map(function (item) {
let str = result[item.key + "Type"];
if (typeof (str) != "undefined") {
switch (str) {
case "1":
if (typeof (item.cellClass) == "undefined") {
return item["cellClass"] = "one";
}
return item.cellClass = item.cellClass.split(" ")[0] + " one";
case "2":
if (typeof (item.cellClass) == "undefined") {
return item["cellClass"] = "twe";
}
return item.cellClass = item.cellClass.split(" ")[0] + " twe";
case "3":
if (typeof (item.cellClass) == "undefined") {
return item["cellClass"] = "three";
}
return item.cellClass = item.cellClass.split(" ")[0] + " three";
case "4":
if (typeof (item.cellClass) == "undefined") {
return item["cellClass"] = "four";
}
return item.cellClass = item.cellClass.split(" ")[0] + " four";
}
}
return item["cellClass"]=""; if (item.FID == data.FID) {
item.info = result;
}
return item;
}) })
} }
} }
@ -518,10 +506,8 @@ export default {
} }
}); });
let updateLog = updateObj.LogList.join("、"); let updateLog = updateObj.LogList.join("、");
if (updateLog != "") { //
delete updateObj.LogList console.log('updateObj', updateObj);
//
console.log('updateObj', updateObj);
let _result = await updateBatchById3(updateObj); let _result = await updateBatchById3(updateObj);
if (_result.Code === 200) { if (_result.Code === 200) {
await commonSave({ await commonSave({
@ -539,10 +525,6 @@ export default {
$this.$refs.OperateLog._getPageList(); $this.$refs.OperateLog._getPageList();
}, 500); }, 500);
} }
} else {
layer.close(idx);
layer.msg('您没有做任何更改')
}
}, },
_clickFreezingColumnSetting() { _clickFreezingColumnSetting() {
this.dataColumn = ref([]); this.dataColumn = ref([]);
@ -564,9 +546,9 @@ export default {
}) })
this.dataColumn = freezingColumns.concat(this.tmpDataColumn); this.dataColumn = freezingColumns.concat(this.tmpDataColumn);
} else { } else {
this.dataColumn = this.tmpDataColumn; this.dataColumn = this.tmpDataColumn;
} }
this.$nextTick(); this.$nextTick();
}, },

@ -6,7 +6,7 @@
:freezingColumns="freezingColumnSetting" @cancelClick="setFreezingColumnsSetting"></FreezingColumnSetting> :freezingColumns="freezingColumnSetting" @cancelClick="setFreezingColumnsSetting"></FreezingColumnSetting>
</lay-layer> </lay-layer>
<lay-table id="dataTable" v-if="dataColumn.length > 0" height="320px" :columns="dataColumn" :data-source="dataList" <lay-table id="dataTable" v-if="dataColumn.length > 0" height="320px" :columns="dataColumn" :data-source="dataList"
:cellStyle="cellStyle" :cellClassName="cellClassName"> :cellClassName="cellClassName" :cellStyle="cellStyle">
<template v-slot:toolbar v-if="dataInfoObj.FCanEdit != 2"> <template v-slot:toolbar v-if="dataInfoObj.FCanEdit != 2">
<lay-button size="sm" @click="saveBatch" type="primary" :disabled="editColumn.length === 0">保存 <lay-button size="sm" @click="saveBatch" type="primary" :disabled="editColumn.length === 0">保存
</lay-button> </lay-button>
@ -107,7 +107,8 @@ import {
import { import {
getInfoData, getInfoData,
changeInfoData changeInfoData,
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";
@ -134,35 +135,26 @@ 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)" : "";
let info=row["info"]; let info = row["info"];
debugger if (info) {
switch (info[column.key+"Type"]) { if (typeof(document.getElementsByClassName(column.key + "_" + rowIndex + "_" + columnIndex)[0])!="undefined") {
case "1": switch (info[column.key + "Type"]) {
return document.getElementsByClassName(column.key+"_"+rowIndex+"_"+columnIndex)[0].classList.add("one"); case "1":
case "2": return document.getElementsByClassName(column.key + "_" + rowIndex + "_" + columnIndex)[0].classList.add("one");
return document.getElementsByClassName(column.key+"_"+rowIndex+"_"+columnIndex)[0].classList.add("twe"); case "2":
case "3": return document.getElementsByClassName(column.key + "_" + rowIndex + "_" + columnIndex)[0].classList.add("twe");
return document.getElementsByClassName(column.key+"_"+rowIndex+"_"+columnIndex)[0].classList.add("three"); case "3":
case "4": return document.getElementsByClassName(column.key + "_" + rowIndex + "_" + columnIndex)[0].classList.add("three");
return document.getElementsByClassName(column.key+"_"+rowIndex+"_"+columnIndex)[0].classList.add("four"); case "4":
return document.getElementsByClassName(column.key + "_" + rowIndex + "_" + columnIndex)[0].classList.add("four");
}
}
} }
return back; return back;
} }
const cellClassName = function (row, column, rowIndex, columnIndex) { const cellClassName = function (row, column, rowIndex, columnIndex) {
debugger return column.cellClass = column.key + "_" + rowIndex + "_" + columnIndex;
// let info=row["info"];
// switch (info[column.key+"Type"]) {
// case "1":
// return column.cellClass = column.cellClass + " one";
// case "2":
// return column.cellClass = column.cellClass + " twe";
// case "3":
// return column.cellClass = column.cellClass + " three";
// case "4":
// return column.cellClass = column.cellClass + " four";
// }
return column.cellClass = column.key+"_"+rowIndex+"_"+columnIndex;
} }
const inputCodeValue = ref(""); const inputCodeValue = ref("");
const inputDescValue = ref(""); const inputDescValue = ref("");
@ -174,6 +166,8 @@ export default {
const freezingColumnSetting = ref([]); const freezingColumnSetting = ref([]);
const originalColumns = ref([]); const originalColumns = ref([]);
const tmpDataColumn = ref([]); const tmpDataColumn = ref([]);
const materialInfoList = ref([]);
const idx = ref([]);
return { return {
dataColumn, dataColumn,
dataList, dataList,
@ -181,8 +175,8 @@ export default {
selectDataMap, selectDataMap,
typeList, typeList,
userPower, userPower,
cellStyle,
cellClassName, cellClassName,
cellStyle,
inputCodeValue, inputCodeValue,
inputDescValue, inputDescValue,
isShow: false, isShow: false,
@ -192,7 +186,9 @@ export default {
showFreezingColumnSettingBox, showFreezingColumnSettingBox,
freezingColumnSetting, freezingColumnSetting,
originalColumns, originalColumns,
tmpDataColumn tmpDataColumn,
materialInfoList,
idx
}; };
}, },
props: { props: {
@ -207,6 +203,7 @@ export default {
}, },
mounted() { mounted() {
this.getUserPower(); this.getUserPower();
this.initPage(this.idx);
}, },
methods: { methods: {
async getUserPower() { async getUserPower() {
@ -223,32 +220,15 @@ export default {
this.initPage(layer.load(2)); this.initPage(layer.load(2));
}, },
async initPage(idx) { async initPage(idx) {
this.idx = idx;
debugger
let _data = await getListByHalfMaterialTeamId({ let _data = await getListByHalfMaterialTeamId({
teamId: this.dataInfoObj.FTeamID, teamId: this.dataInfoObj.FTeamID,
viewType: this.dataInfoObj.FViewType viewType: this.dataInfoObj.FViewType
}); });
let FTpye2IDList=this.getParamValues("FTypeID2",_data.rows); this.materialInfoList = await GetMaterialInfoList() || null;
FTpye2IDList=FTpye2IDList.filter(function(value,index,self){
return self.indexOf(value) === index;
});
let TypeInfo={};
let $thie=this;
FTpye2IDList.forEach((item, i)=>{
// let result = $this.getInfoData({
// "FDataID": item,
// "FType": 1
// }) || null;
// TypeInfo.push(result);
})
// let result = await getInfoData({
// "FDataID": data.FTypeID2,
// "FType": 1
// }) || null;
let freezingCols = await GetFreezingColumns(); let freezingCols = await GetFreezingColumns();
console.log('_data', _data); console.log('_data', _data);
@ -292,12 +272,7 @@ export default {
}); });
} }
} }
// //
// if (this.dataInfoObj.FCanEdit != 2) {
// let tempColumn1 = dataColumn.filter(s => s.customSlot) || [];
// let tempColumn2 = dataColumn.filter(s => s.customSlot == undefined) || [];
// dataColumn = [...tempColumn1, ...tempColumn2];
// }
} }
let columnsList = []; let columnsList = [];
let col7 = dataColumn.filter(s => s.fieldType == 7) || []; let col7 = dataColumn.filter(s => s.fieldType == 7) || [];
@ -343,27 +318,8 @@ export default {
item[col.key] = info[col.key] || item[col.key] || ""; item[col.key] = info[col.key] || item[col.key] || "";
}); });
} }
// item.FTypeID1 = (item.FTypeID1 == 0 || item.FTypeID1 == -1) ? "" : item.FTypeID1;
// item.FTypeID2 = (item.FTypeID2 == 0 || item.FTypeID2 == -1) ? "" : item.FTypeID2;
// if (this.dataInfoObj.FCanEdit == 2) {
// 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
// }
// })
// item.FTypeID1 = fType1?fType1.FName:item.FTypeID1;
// item.FTypeID2 = fType2?fType2.FName:item.FTypeID2;
//}
});
});
let saveId = this.dataInfoObj.FViewType + "_" + this.dataInfoObj.FID; let saveId = this.dataInfoObj.FViewType + "_" + this.dataInfoObj.FID;
localStorage.setItem('EditView' + saveId, JSON.stringify(_data.rows)); localStorage.setItem('EditView' + saveId, JSON.stringify(_data.rows));
@ -388,7 +344,10 @@ export default {
item.FTypeID1 = fType1 ? fType1.FName : item.FTypeID1; item.FTypeID1 = fType1 ? fType1.FName : item.FTypeID1;
item.FTypeID2 = fType2 ? fType2.FName : item.FTypeID2; item.FTypeID2 = fType2 ? fType2.FName : item.FTypeID2;
} }
item["info"]=_data.infos.find(s => s.FDataID == item.FMaterialID) || null;
item["info"] = $this.materialInfoList.Data.find(s => s.FDataID == item.FTypeID2);
return item; return item;
}); });
this.dataColumn = dataColumn; this.dataColumn = dataColumn;
@ -415,29 +374,11 @@ export default {
layer.close(idx); layer.close(idx);
}, 500); }, 500);
}, },
// async getFreezingColumns() {
// let result = await GetFreezingColumns(); getParamValues(name, arr) {
// let freezingColumns = result.FFreezingColumns
// if (freezingColumns) {
// let c_list = freezingColumns.split(",")
// c_list.forEach(c => {
// if (c && c.length > 0) {
// this.freezingColumnSetting.push(c)
// }
// })
// }
// if (this.freezingColumnSetting && this.freezingColumnSetting.length > 0) {
// this.dataColumn = ref([]);
// this.setFreezingColumns();
// }
// },
getParamValues(name,arr){
var ret = [] var ret = []
for (var i = 0, len = arr.length; i < len; i++) { for (var i = 0, len = arr.length; i < len; i++) {
if(arr[i][name]) if (arr[i][name]) {
{
ret.push(arr[i][name]) ret.push(arr[i][name])
} }
} }
@ -488,61 +429,15 @@ export default {
if (typeName.indexOf("成品") > 0) { if (typeName.indexOf("成品") > 0) {
data.FViewType = 1 data.FViewType = 1
} }
this.dataList.map(function(item){ this.dataList.map(function (item) {
if(item.FID==data.FID)
{
debugger
item.info=result; if (item.FID == data.FID) {
item.info = result;
} }
return item; return item;
}) })
// this.dataColumn.forEach((item,i){
// })
// for(let key in this.dataList){
// debugger
// }
// this.dataList.map(function(item){
// debugger
// let list=result.find(s=>s.FDataID==data.FTypeID2)||"";
// if(list)
// {
// }
// });
this.dataColumn.map(function (item) { this.dataColumn.map(function (item) {
// let str = result[item.key + "Type"];
// if (typeof (str) != "undefined") {
// switch (str) {
// case "1":
// if (typeof (item.cellClass) == "undefined") {
// return item["cellClass"] = "one";
// }
// return item.cellClass = item.cellClass.split(" ")[0] + " one";
// case "2":
// if (typeof (item.cellClass) == "undefined") {
// return item["cellClass"] = "twe";
// }
// return item.cellClass = item.cellClass.split(" ")[0] + " twe";
// case "3":
// if (typeof (item.cellClass) == "undefined") {
// return item["cellClass"] = "three";
// }
// return item.cellClass = item.cellClass.split(" ")[0] + " three";
// case "4":
// if (typeof (item.cellClass) == "undefined") {
// return item["cellClass"] = "four";
// }
// return item.cellClass = item.cellClass.split(" ")[0] + " four";
// }
// }
return item["cellClass"] = ""; return item["cellClass"] = "";
}) })
@ -555,7 +450,8 @@ export default {
let updateObj = { let updateObj = {
LogList: [], LogList: [],
FTeamID: this.dataInfoObj['FTeamID'], FTeamID: this.dataInfoObj['FTeamID'],
FViewType: this.dataInfoObj.FViewType FViewType: this.dataInfoObj.FViewType,
FType:this.dataInfoObj.FType
}; };
let saveId = this.dataInfoObj.FViewType + "_" + this.dataInfoObj.FID; let saveId = this.dataInfoObj.FViewType + "_" + this.dataInfoObj.FID;
let cacheDataList = JSON.parse(localStorage.getItem('EditView' + saveId)); let cacheDataList = JSON.parse(localStorage.getItem('EditView' + saveId));
@ -601,8 +497,7 @@ export default {
} }
}); });
let updateLog = updateObj.LogList.join("、"); let updateLog = updateObj.LogList.join("、");
if (updateLog != "") { delete updateObj.LogList
delete updateObj.LogList
// //
console.log('updateObj', updateObj); console.log('updateObj', updateObj);
let _result = await updateBatchById4(updateObj); let _result = await updateBatchById4(updateObj);
@ -622,10 +517,6 @@ export default {
$this.$refs.OperateLog._getPageList(); $this.$refs.OperateLog._getPageList();
}, 500); }, 500);
} }
} else {
layer.close(idx);
layer.msg('您没有做任何更改')
}
}, },
_clickFreezingColumnSetting() { _clickFreezingColumnSetting() {
this.dataColumn = ref([]); this.dataColumn = ref([]);

@ -83,7 +83,7 @@
width: "56" width: "56"
}]; }];
let dataList = []; let dataList = [];
debugger
let postData = { let postData = {
FTeamID: this.dataInfoObj.FID, FTeamID: this.dataInfoObj.FID,
FViewType: 2, FViewType: 2,

@ -5,11 +5,11 @@
<lay-row space="10"> <lay-row space="10">
<lay-col md="6"><div class="grid-demo" style="text-align: right;">原配方</div></lay-col> <lay-col md="6"><div class="grid-demo" style="text-align: right;">原配方</div></lay-col>
<lay-col md="18"><div class="grid-demo" style="text-align: left;">{{dataInfoObj.FTestCode}}+{{dataInfoObj.FVersionCode}}+{{dataInfoObj.FDesc.trim()}}</div></lay-col> <lay-col md="18"><div class="grid-demo" style="text-align: left;">{{dataInfoObj.FTestCode}}+{{dataInfoObj.FVersionCode}}+{{dataInfoObj.FDesc}}</div></lay-col>
</lay-row> </lay-row>
<lay-row space="10"> <lay-row space="10">
<lay-col md="6"><div class="grid-demo" style="text-align: right;">变更后的配方</div></lay-col> <lay-col md="6"><div class="grid-demo" style="text-align: right;">变更后的配方</div></lay-col>
<lay-col md="18"><div class="grid-demo" style="text-align: left;">{{dataInfoObj.NewFTestCode}}+{{dataInfoObj.NewFVersionCode}}+{{dataInfoObj.NewFDesc.trim()}}</div></lay-col> <lay-col md="18"><div class="grid-demo" style="text-align: left;">{{dataInfoObj.FNewTestCode}}+{{dataInfoObj.FNewVersionCode}}+{{dataInfoObj.FNewDesc}}</div></lay-col>
</lay-row> </lay-row>
</lay-container> </lay-container>
<lay-quote v-if="dataList.length>0"></lay-quote> <lay-quote v-if="dataList.length>0"></lay-quote>

@ -107,23 +107,24 @@ export default {
}, },
{ {
title: "新试验号", title: "新试验号",
key: "NewFTestCode", key: "FNewTestCode",
width: "160px", width: "160px",
align: 'center', align: 'center',
hide: false hide: false
}, },
{ {
title: "新版本号", title: "新版本号",
key: "NewFVersionCode", key: "FNewVersionCode",
width: "400px", width: "160px",
align: 'center' align: 'center'
}, },
{ {
title: "产品分类", title: "产品分类",
key: "FType", key: "FType",
width: "400px", width: "150px",
align: 'center' align: 'center'
}, },
{ {
title: "发起时间", title: "发起时间",
key: "FAddDate", key: "FAddDate",
@ -136,6 +137,13 @@ export default {
width: "178px", width: "178px",
align: 'center' align: 'center'
}, },
{
title: "状态",
key: "FStateName",
width: "100px",
align: 'center',
customSlot: 'FStateName',
},
{ {
title: "操作", title: "操作",
key: "operator", key: "operator",
@ -249,6 +257,13 @@ export default {
let result = await GetMaterialTeamworkPageList(this.postData); let result = await GetMaterialTeamworkPageList(this.postData);
this.dataList = result.Data.List.map(function(item){ this.dataList = result.Data.List.map(function(item){
item.FAddDate = item.FAddDate == null ? "" : $this.dateFormat(item.FAddDate); item.FAddDate = item.FAddDate == null ? "" : $this.dateFormat(item.FAddDate);
if(item.FState==2)
{
item["FStateName"]="已完成";
}
else if(item.FState==1){
item["FStateName"]="进行中";
}
return item; return item;
}); });
debugger debugger

@ -100,7 +100,7 @@ export default {
}, { }, {
title: "新试验号", title: "新试验号",
key: "FNewTestCode", key: "FNewTestCode",
width: "300px", width: "160px",
align: 'center', align: 'center',
hide: false hide: false
}, },
@ -119,10 +119,11 @@ export default {
hide: false hide: false
}, },
{ {
title: "产品分类", title: "状态",
key: "FormulaType", key: "FStateName",
width: "400px", width: "160px",
align: 'center' align: 'center',
customSlot: 'FStateName',
}, },
{ {
title: "发起时间", title: "发起时间",
@ -138,7 +139,7 @@ export default {
}, },
{ {
title: "负责人", title: "负责人",
key: "F8", key: "FUserName1",
width: "98px", width: "98px",
align: 'center', align: 'center',
customSlot: '', customSlot: '',
@ -263,6 +264,13 @@ export default {
let $this=this; let $this=this;
this.dataList = result.Data.List.map(function (item) { this.dataList = result.Data.List.map(function (item) {
item.FAddDate = item.FAddDate == null ? "" : $this.dateFormat(item.FAddDate); item.FAddDate = item.FAddDate == null ? "" : $this.dateFormat(item.FAddDate);
if(item.FState==2)
{
item["FStateName"]="已完成";
}
else if(item.FState==1){
item["FStateName"]="进行中";
}
return item; return item;
}); });
this.hasLoaded = true; this.hasLoaded = true;
@ -295,7 +303,7 @@ export default {
} }
else if (data.FType == 1) { else if (data.FType == 1) {
data.FBoxType = 1; // data.FBoxType = 1; //
}else if(data.FType == 2){ }else if(data.FType == 2||data.FType==3){
data.FBoxType = 3; data.FBoxType = 3;
} }
else { else {

Loading…
Cancel
Save