diff --git a/src/views/half/components/EditView.vue b/src/views/half/components/EditView.vue
index 50dee14..2c3aa7a 100644
--- a/src/views/half/components/EditView.vue
+++ b/src/views/half/components/EditView.vue
@@ -529,6 +529,7 @@ export default {
return false;
}
let updateLog = updateObj.LogList.join("、");
+ debugger
// 发送保存请求
console.log('updateObj', updateObj);
delete updateObj.LogList
diff --git a/src/views/half/components/EditViewOFF.vue b/src/views/half/components/EditViewOFF.vue
index d20ea44..dc5c4f5 100644
--- a/src/views/half/components/EditViewOFF.vue
+++ b/src/views/half/components/EditViewOFF.vue
@@ -22,21 +22,22 @@
-
-
-
+
-
+
+
@@ -223,23 +224,19 @@ export default {
methods: {
async getUserPower() {
if (this.dataInfoObj.FCanEdit != 2) {
+
this.userPower[0] = (await getBasicRoleList({
FRoleType: 84,
- FViewType: this.dataInfoObj.FViewType,
- TeamId: this.dataInfoObj.FTeamID,
- Type: 2
- }) || []).map(it => parseInt(it.F2))
- this.userPower[1] = (await getBasicRoleList({
- FRoleType: 44,
- FViewType: this.dataInfoObj.FViewType,
TeamId: this.dataInfoObj.FTeamID,
Type: 2
- }) || []).map(it => parseInt(it.F2))
+ }) || [])
+
}
this.initPage(layer.load(2));
},
async initPage(idx) {
this.idx = idx;
+ let $this = this;
let _data = await getListByHalfMaterialTeamId({
teamId: this.dataInfoObj.FTeamID,
viewType: this.dataInfoObj.FViewType
@@ -266,19 +263,39 @@ export default {
this.typeList[0] = _data.types.filter(s => s.FDepth == 1) || [];
this.typeList[1] = _data.types.filter(s => s.FDepth != 1) || [];
let dataColumn = _data.columns || [];
+ let editColumn=[];
+
- let editColumn = dataColumn.filter(it => {
- let b = false;
- if (this.dataInfoObj.FCanEdit != 2) {
- if (it.fieldType == 7) b = this.userPower[1].indexOf(it.id) >= 0;
- else b = this.userPower[0].indexOf(it.id) >= 0;
- if (b) {
- it.customSlot = it.key;
- it.cellClass = "edit-item"
- }
+ //判断视图权限
+ _data.rows.forEach((itemRow)=>{
+
+ if(!itemRow["Power"])
+ {
+ itemRow["Power"]="";
}
- return b;
- });
+
+ let powerColumns= $this.userPower[0].filter(s=>s.F1==itemRow.FViewType);
+
+ if(powerColumns)
+ {
+ powerColumns.forEach((itemColums)=>{
+ let dataColumn=_data.columns.find(s=>s.id==itemColums.F2);
+ itemRow["Power"]+=dataColumn.key+",";
+
+ if(!editColumn.find(s=>s.key==dataColumn.key))
+ {
+ dataColumn["customSlot"]=dataColumn.key;
+ dataColumn["cellClass"]="edit-item";
+ editColumn.push(dataColumn);
+ }
+
+ })
+ }
+ })
+
+ debugger
+
+
if (editColumn.length > 0) {
if (this.selectDataMap == null) {
@@ -336,7 +353,7 @@ export default {
console.log('editColumn', editColumn);
this.editColumn = editColumn;
- let $this = this;
+
this.dataList = _data.rows.map(function (item) {
item["info"] = $this.materialInfoList.Data.find(s => s.FDataID == item.FTypeID2);
diff --git a/src/views/materia/components/EditView.vue b/src/views/materia/components/EditView.vue
index 5088750..ad41eeb 100644
--- a/src/views/materia/components/EditView.vue
+++ b/src/views/materia/components/EditView.vue
@@ -22,21 +22,22 @@
-
-
-
+
-
+
+
@@ -221,16 +222,10 @@ export default {
if (this.dataInfoObj.FCanEdit != 2) {
this.userPower[0] = (await getBasicRoleList({
FRoleType: 84,
- FViewType: this.dataInfoObj.FViewType,
- TeamId: this.dataInfoObj.FTeamID,
- Type: 1
- }) || []).map(it => parseInt(it.F2))
- this.userPower[1] = (await getBasicRoleList({
- FRoleType: 44,
- FViewType: this.dataInfoObj.FViewType,
TeamId: this.dataInfoObj.FTeamID,
Type: 1
}) || []).map(it => parseInt(it.F2))
+
}
this.initPage(layer.load(2));
},
@@ -247,19 +242,39 @@ export default {
this.typeList[0] = _data.types.filter(s => s.FDepth == 1) || [];
this.typeList[1] = _data.types.filter(s => s.FDepth != 1) || [];
let dataColumn = _data.columns || [];
+ let $this = this;
- let editColumn = dataColumn.filter(it => {
- let b = false;
- if (this.dataInfoObj.FCanEdit != 2) {
- if (it.fieldType == 7) b = this.userPower[1].indexOf(it.id) >= 0;
- else b = this.userPower[0].indexOf(it.id) >= 0;
- if (b) {
- it.customSlot = it.key;
- it.cellClass = "edit-item"
- }
+ let editColumn=[];
+
+
+ //判断视图权限
+ _data.rows.forEach((itemRow)=>{
+
+ if(!itemRow["Power"])
+ {
+ itemRow["Power"]="";
}
- return b;
- });
+
+ let powerColumns= $this.userPower[0].filter(s=>s.F1==itemRow.FViewType);
+
+ if(powerColumns)
+ {
+ powerColumns.forEach((itemColums)=>{
+ let dataColumn=_data.columns.find(s=>s.id==itemColums.F2);
+ itemRow["Power"]+=dataColumn.key+",";
+
+ if(!editColumn.find(s=>s.key==dataColumn.key))
+ {
+ dataColumn["customSlot"]=dataColumn.key;
+ dataColumn["cellClass"]="edit-item";
+ editColumn.push(dataColumn);
+ }
+
+ })
+ }
+ })
+
+
if (editColumn.length > 0) {
if (this.selectDataMap == null) {
@@ -302,19 +317,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) => {
@@ -324,31 +327,13 @@ export default {
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) => {
- // return t.FID === item.FTypeID1
- // });
-
- // let fType2 = this.typeList[1].find((t) => {
- // return t.FID === item.FTypeID2
- // })
-
- // if (fType1) {
- // item.FTypeID1 = fType1.FName;
- // }
-
- // if (fType2) {
- // item.FTypeID2 = fType2.FName;
- // }
-
- // }
});
let saveId = this.dataInfoObj.FViewType + "_" + this.dataInfoObj.FID;
localStorage.setItem('EditView' + saveId, JSON.stringify(_data.rows));
this.editColumn = editColumn;
- 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) => {