修改固定相

master
leo 3 years ago
parent 4fd9703128
commit 65f737a86d

@ -302,7 +302,6 @@
this.pageInfo.total = result.Data.Total || 0; this.pageInfo.total = result.Data.Total || 0;
this.dataList = result.Data.List; this.dataList = result.Data.List;
this.hasLoaded = true; this.hasLoaded = true;
debugger
}, },
// //
dateFormat(dataStr) { dateFormat(dataStr) {

@ -202,8 +202,9 @@ export default {
teamId: this.dataInfoObj.FTeamID, teamId: this.dataInfoObj.FTeamID,
viewType: this.dataInfoObj.FViewType viewType: this.dataInfoObj.FViewType
}); });
console.log('_data', _data);
debugger 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:"";
@ -255,7 +256,6 @@ export default {
let col7 = dataColumn.filter(s => s.fieldType == 7) || []; let col7 = dataColumn.filter(s => s.fieldType == 7) || [];
_data.rows.forEach((item, i) => { _data.rows.forEach((item, i) => {
columnsList = _data.columns.map(function (items) { columnsList = _data.columns.map(function (items) {
let info = _data.infos[i] let info = _data.infos[i]
if (info) { if (info) {
@ -270,7 +270,7 @@ export default {
return items.cellClass = items.cellClass + " three"; return items.cellClass = items.cellClass + " three";
case "4": case "4":
return items.cellClass = items.cellClass + " four"; return items.cellClass = items.cellClass + " four";
} }
} }
} }
@ -301,21 +301,35 @@ export default {
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));
console.log('editColumn', editColumn);
this.editColumn = editColumn; this.editColumn = editColumn;
this.dataList = _data.rows; this.dataList = _data.rows;
this.dataColumn = dataColumn; this.dataColumn = dataColumn;
this.originalColumns = this.deepCopy(dataColumn); this.originalColumns = this.deepCopy(dataColumn);
this.getFreezingColumns();
debugger let freezingColumns = freezingCols.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();
}
this._changeType(_data.rows[0],2); this._changeType(_data.rows[0],2);
setTimeout(function () { setTimeout(function () {
layer.close(idx); layer.close(idx);
}, 500); }, 500);
}, },
async getFreezingColumns() { async getFreezingColumns() {
let result = await GetFreezingColumns(); let result = await GetFreezingColumns();
let freezingColumns = result.FFreezingColumns let freezingColumns = result.FFreezingColumns
if (freezingColumns) { if (freezingColumns) {
@ -348,13 +362,11 @@ export default {
if (result != null && result.FID) { if (result != null && result.FID) {
let col7 = this.dataColumn.filter(s => s.fieldType == 7) || []; let col7 = this.dataColumn.filter(s => s.fieldType == 7) || [];
console.log('this.typeList[0]', this.typeList[0].filter(t => t.FValue == data.FTypeID1)[0]);
col7.forEach((item) => { col7.forEach((item) => {
if (item.table == "TFS_MaterialInfo") { if (item.table == "TFS_MaterialInfo") {
data[item.key] = result[item.key] || data[item.key] || ""; data[item.key] = result[item.key] || data[item.key] || "";
} }
}); });
console.log('data.FTypeID1', data.FTypeID1);
let type1 = this.typeList[0].filter(t => t.FValue == data.FTypeID1)[0]; let type1 = this.typeList[0].filter(t => t.FValue == data.FTypeID1)[0];
let typeName = type1.FName; let typeName = type1.FName;
@ -422,11 +434,9 @@ export default {
}; };
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));
console.log('cacheDataList', cacheDataList);
this.dataList.forEach((row, index) => { this.dataList.forEach((row, index) => {
let cache = cacheDataList[index]; let cache = cacheDataList[index];
let dataObj = {}; let dataObj = {};
console.log('this.editColumn', this.editColumn);
for (let col of this.editColumn) { for (let col of this.editColumn) {
let valTemp = row[col.key]; let valTemp = row[col.key];
if (this.dataInfoObj.FViewType == 10) { if (this.dataInfoObj.FViewType == 10) {
@ -456,8 +466,6 @@ export default {
} }
} }
console.log('dataObj', dataObj);
for (let key in dataObj) { for (let key in dataObj) {
if (!updateObj[key]) updateObj[key] = []; if (!updateObj[key]) updateObj[key] = [];
updateObj[key].push(dataObj[key]); updateObj[key].push(dataObj[key]);
@ -467,8 +475,6 @@ export default {
if (updateLog != "") { if (updateLog != "") {
delete updateObj.LogList delete updateObj.LogList
// //
debugger
console.log('updateObj', updateObj);
let _result = await updateBatchById2(updateObj); let _result = await updateBatchById2(updateObj);
if (_result.Code === 200) { if (_result.Code === 200) {
await commonSave({ await commonSave({
@ -515,7 +521,6 @@ export default {
} else { } else {
this.dataColumn = this.tmpDataColumn; this.dataColumn = this.tmpDataColumn;
} }
this.$nextTick();
}, },
setFreezingColumnsSetting(fcs) { setFreezingColumnsSetting(fcs) {
this.freezingColumnSetting = fcs; this.freezingColumnSetting = fcs;

@ -199,6 +199,8 @@ export default {
teamType: 1 teamType: 1
}, "MaterialTeamwork"); }, "MaterialTeamwork");
let freezingCols = await GetFreezingColumns();
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 || [];
@ -306,7 +308,22 @@ export default {
this.dataList = _data.rows; this.dataList = _data.rows;
this.dataColumn = dataColumn; this.dataColumn = dataColumn;
this.originalColumns = this.deepCopy(dataColumn); this.originalColumns = this.deepCopy(dataColumn);
this.getFreezingColumns();
let freezingColumns = freezingCols.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();
}
if (this.dataInfoObj.FCanEdit != 2) { if (this.dataInfoObj.FCanEdit != 2) {
this._changeType(_data.rows[0],2); this._changeType(_data.rows[0],2);

Loading…
Cancel
Save