Browse Source

字典优化

master
陈裕财 4 years ago
parent
commit
1cfc7fa6cc
  1. 6
      src/views/xm/core/xmIteration/XmIterationInfo.vue
  2. 6
      src/views/xm/core/xmPhase/XmPhaseBatch.vue
  3. 6
      src/views/xm/core/xmPhase/XmPhaseForProduct.vue
  4. 6
      src/views/xm/core/xmPhase/XmPhaseMng.vue
  5. 6
      src/views/xm/core/xmPhase/XmPhaseSelect.vue
  6. 6
      src/views/xm/core/xmProduct/XmProductInfo.vue
  7. 6
      src/views/xm/core/xmProject/XmProjectInfo.vue
  8. 4
      src/views/xm/core/xmProjectMBudgetCostNouser/XmProjectMBudgetCostNouserAdd.vue
  9. 4
      src/views/xm/core/xmProjectMBudgetCostNouser/XmProjectMBudgetCostNouserEdit.vue
  10. 4
      src/views/xm/core/xmProjectMBudgetCostUser/XmProjectMBudgetCostUserAdd.vue
  11. 4
      src/views/xm/core/xmProjectMBudgetCostUser/XmProjectMBudgetCostUserEdit.vue
  12. 4
      src/views/xm/core/xmProjectMCostNouser/XmProjectMCostNouserAdd.vue
  13. 4
      src/views/xm/core/xmProjectMCostUser/XmProjectMCostUserAdd.vue
  14. 6
      src/views/xm/core/xmTask/XmTaskMng.vue

6
src/views/xm/core/xmIteration/XmIterationInfo.vue

@ -251,11 +251,11 @@
} else {
return v[j];
}
const options = this.$refs.xmMenuWithPlan.dicts;
if(options[key]==undefined || options[key]==null || options[key].length==0 ){
const dicts = this.$refs.xmMenuWithPlan.dicts;
if(dicts[key]==undefined || dicts[key]==null || dicts[key].length==0 ){
return v[j];
}
var rowData=options[key].filter(i=>i.id==v[j])
var rowData=dicts[key].filter(i=>i.id==v[j])
if(rowData.length>0){
return rowData[0].name
}else{

6
src/views/xm/core/xmPhase/XmPhaseBatch.vue

@ -1588,11 +1588,11 @@ export default {
/**end 自定义函数请在上面加**/
formateOption: function (itemCode, value) {
if (this.dicts[itemCode]) {
var options = this.dicts[itemCode].filter(
var dicts = this.dicts[itemCode].filter(
(i) => i.id == value
);
if (options && dicts.length > 0) {
return options[0].name;
if (dicts && dicts.length > 0) {
return dicts[0].name;
} else {
return value;
}

6
src/views/xm/core/xmPhase/XmPhaseForProduct.vue

@ -1106,9 +1106,9 @@ import XmTaskList from '../xmTask/XmTaskList.vue';
/**end 自定义函数请在上面加**/
formateOption:function(itemCode,value){
if(this.dicts[itemCode]){
var options=this.dicts[itemCode].filter(i=>i.id==value);
if(options && dicts.length > 0){
return options[0].name
var dicts=this.dicts[itemCode].filter(i=>i.id==value);
if(dicts && dicts.length > 0){
return dicts[0].name
}else{
return value;
}

6
src/views/xm/core/xmPhase/XmPhaseMng.vue

@ -1141,9 +1141,9 @@ import XmTaskList from '../xmTask/XmTaskList.vue';
/**end 自定义函数请在上面加**/
formateOption:function(itemCode,value){
if(this.dicts[itemCode]){
var options=this.dicts[itemCode].filter(i=>i.id==value);
if(options && dicts.length > 0){
return options[0].name
var dicts=this.dicts[itemCode].filter(i=>i.id==value);
if(dicts && dicts.length > 0){
return dicts[0].name
}else{
return value;
}

6
src/views/xm/core/xmPhase/XmPhaseSelect.vue

@ -441,9 +441,9 @@
/**end 自定义函数请在上面加**/
formateOption:function(itemCode,value){
if(this.dicts[itemCode]){
var options=this.dicts[itemCode].filter(i=>i.id==value);
if(options && dicts.length > 0){
return options[0].name
var dicts=this.dicts[itemCode].filter(i=>i.id==value);
if(dicts && dicts.length > 0){
return dicts[0].name
}else{
return value;
}

6
src/views/xm/core/xmProduct/XmProductInfo.vue

@ -365,11 +365,11 @@ import XmProjectForLink from '../xmProject/XmProjectForLink.vue';
} else {
return v[j];
}
const options = this.$refs.xmMenuWithPlan.dicts;
if(options[key]==undefined || options[key]==null || options[key].length==0 ){
const dicts = this.$refs.xmMenuWithPlan.dicts;
if(dicts[key]==undefined || dicts[key]==null || dicts[key].length==0 ){
return v[j];
}
var rowData=options[key].filter(i=>i.id==v[j])
var rowData=dicts[key].filter(i=>i.id==v[j])
if(rowData.length>0){
return rowData[0].name
}else{

6
src/views/xm/core/xmProject/XmProjectInfo.vue

@ -362,11 +362,11 @@
} else {
return v[j];
}
const options = this.$refs.xmMenuWithPlan.dicts;
if(options[key]==undefined || options[key]==null || options[key].length==0 ){
const dicts = this.$refs.xmMenuWithPlan.dicts;
if(dicts[key]==undefined || dicts[key]==null || dicts[key].length==0 ){
return v[j];
}
var rowData=options[key].filter(i=>i.id==v[j])
var rowData=dicts[key].filter(i=>i.id==v[j])
if(rowData.length>0){
return rowData[0].name
}else{

4
src/views/xm/core/xmProjectMBudgetCostNouser/XmProjectMBudgetCostNouserAdd.vue

@ -98,9 +98,9 @@
this.addForm.budgetCost=totalBudgetCost/this.allMonths.length;
} ,
'addForm.subjectId':function(subjectId) {
var options=this.dicts.projectSubject.filter(i=>i.id==subjectId)
var dicts=this.dicts.projectSubject.filter(i=>i.id==subjectId)
if(options!=null && dicts.length>0){
this.addForm.subjectName=options[0].name
this.addForm.subjectName=dicts[0].name
}else{
this.addForm.subjectName="";
}

4
src/views/xm/core/xmProjectMBudgetCostNouser/XmProjectMBudgetCostNouserEdit.vue

@ -63,9 +63,9 @@
}
},
'editForm.subjectId':function(subjectId) {
var options=this.dicts.projectSubject.filter(i=>i.id==subjectId)
var dicts=this.dicts.projectSubject.filter(i=>i.id==subjectId)
if(options!=null && dicts.length>0){
this.editForm.subjectName=options[0].name
this.editForm.subjectName=dicts[0].name
}else{
this.editForm.subjectName="";
}

4
src/views/xm/core/xmProjectMBudgetCostUser/XmProjectMBudgetCostUserAdd.vue

@ -100,9 +100,9 @@
this.addForm.budgetCost=totalBudgetCost/this.allMonths.length;
},
'addForm.subjectId':function(subjectId) {
var options=this.dicts.projectSubject.filter(i=>i.id==subjectId)
var dicts=this.dicts.projectSubject.filter(i=>i.id==subjectId)
if(options!=null && dicts.length>0){
this.addForm.subjectName=options[0].name
this.addForm.subjectName=dicts[0].name
}else{
this.addForm.subjectName="";
}

4
src/views/xm/core/xmProjectMBudgetCostUser/XmProjectMBudgetCostUserEdit.vue

@ -69,9 +69,9 @@
} ,
'editForm.subjectId':function(subjectId) {
console.log("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxlg" + subjectId);
var options=this.dicts.projectSubject.filter(i=>i.id==subjectId)
var dicts=this.dicts.projectSubject.filter(i=>i.id==subjectId)
if(options!=null && dicts.length>0){
this.editForm.subjectName=options[0].name
this.editForm.subjectName=dicts[0].name
}else{
this.editForm.subjectName="";
}

4
src/views/xm/core/xmProjectMCostNouser/XmProjectMCostNouserAdd.vue

@ -63,9 +63,9 @@
}
},
'addForm.subjectId':function(subjectId) {
var options=this.dicts.projectSubject.filter(i=>i.id==subjectId)
var dicts=this.dicts.projectSubject.filter(i=>i.id==subjectId)
if(options!=null && dicts.length>0){
this.addForm.subjectName=options[0].name
this.addForm.subjectName=dicts[0].name
}else{
this.addForm.subjectName="";
}

4
src/views/xm/core/xmProjectMCostUser/XmProjectMCostUserAdd.vue

@ -76,9 +76,9 @@
} ,
'addForm.subjectId':function(subjectId) {
console.log("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxlg" + subjectId);
var options=this.dicts.projectSubject.filter(i=>i.id==subjectId)
var dicts=this.dicts.projectSubject.filter(i=>i.id==subjectId)
if(options!=null && dicts.length>0){
this.addForm.subjectName=options[0].name
this.addForm.subjectName=dicts[0].name
}else{
this.addForm.subjectName="";
}

6
src/views/xm/core/xmTask/XmTaskMng.vue

@ -1983,11 +1983,11 @@ export default {
},
formateOption: function (itemCode, value) {
if (this.dicts[itemCode]) {
var options = this.dicts[itemCode].filter(
var dicts = this.dicts[itemCode].filter(
(i) => i.id == value
);
if (options && dicts.length > 0) {
return options[0].name;
if (dicts && dicts.length > 0) {
return dicts[0].name;
} else {
return value;
}

Loading…
Cancel
Save