Browse Source

fix:修改字典dicts去value

lupeng 11 months ago
parent
commit
2046e2946e

+ 10 - 10
src/components/CommonTable/configs/tableConfig.ts

@@ -19,7 +19,7 @@ export const tableConfig = {
 				filterable: true,
 				type: "select",
 				dataType: "string",
-				dicData: dicts.value.material_properties,
+				dicData: dicts.material_properties,
 				props: { label: "dictLabel", value: "dictValue" },
 			},
 			{
@@ -47,7 +47,7 @@ export const tableConfig = {
 				filterable: true,
 				type: "select",
 				dataType: "string",
-				dicData: dicts.value.quality_testing_plan,
+				dicData: dicts.quality_testing_plan,
 				props: { label: "dictLabel", value: "dictValue" },
 			},
 			{
@@ -57,7 +57,7 @@ export const tableConfig = {
 				filterable: true,
 				type: "select",
 				dataType: "string",
-				dicData: dicts.value.material_level,
+				dicData: dicts.material_level,
 				props: { label: "dictLabel", value: "dictValue" },
 			},
 			{
@@ -67,7 +67,7 @@ export const tableConfig = {
 				filterable: true,
 				type: "select",
 				dataType: "string",
-				dicData: dicts.value.packaging_method,
+				dicData: dicts.packaging_method,
 				props: { label: "dictLabel", value: "dictValue" },
 			},
 			{
@@ -77,7 +77,7 @@ export const tableConfig = {
 				filterable: true,
 				type: "select",
 				dataType: "string",
-				dicData: dicts.value.quality_grade,
+				dicData: dicts.quality_grade,
 				props: { label: "dictLabel", value: "dictValue" },
 			},
 			{
@@ -87,7 +87,7 @@ export const tableConfig = {
 				filterable: true,
 				type: "select",
 				dataType: "string",
-				dicData: dicts.value.selection_type,
+				dicData: dicts.selection_type,
 				props: { label: "dictLabel", value: "dictValue" },
 			},
 			{
@@ -97,7 +97,7 @@ export const tableConfig = {
 				filterable: true,
 				type: "select",
 				dataType: "string",
-				dicData: dicts.value.stage,
+				dicData: dicts.stage,
 				props: { label: "dictLabel", value: "dictValue" },
 			},
 			{
@@ -107,7 +107,7 @@ export const tableConfig = {
 				filterable: true,
 				type: "select",
 				dataType: "string",
-				dicData: dicts.value.danwei_type,
+				dicData: dicts.danwei_type,
 				props: { label: "dictLabel", value: "dictValue" },
 			},
 			{ label: "备注", prop: "remark", type: "textarea", search: true },
@@ -369,7 +369,7 @@ export const tableConfig = {
 				type: "select",
 				search: true,
 				dicData:
-					dicts.value.device_type,
+        dicts.device_type,
 				props: {
 					label: "dictLabel",
 					value: "dictValue",
@@ -429,7 +429,7 @@ export const tableConfig = {
 				label: "物料属性",
 				prop: "bomMaterialAttribute",
 				type: 'select',
-				dicData: dicts.value.material_properties,
+				dicData: dicts.material_properties,
 				props: { label: "dictLabel", value: "dictValue" },
 			},
 			{

+ 1 - 1
src/plugins/permission.ts

@@ -26,7 +26,7 @@ export function setupPermission() {
         ) {
           const res = await getUserDicts(dictStore.types);
           if (res.data) {
-            dictStore.dicts.value = res?.data ?? [];
+            dictStore.dicts = res?.data;
           }
         }
 

+ 1 - 1
src/views/base/accessories/index.vue

@@ -110,7 +110,7 @@ option.value = Object.assign(option.value, {
       prop: "accessoriesType",
       search: true,
       type: "select",
-      dicData: dicts.value.accessories_type,
+      dicData: dicts.accessories_type,
       props: {
         label: "dictLabel",
         value: "dictValue",

+ 17 - 17
src/views/base/bom/index.vue

@@ -297,7 +297,7 @@ option.value = Object.assign(option.value, {
       label: "物料属性",
       prop: "bomMaterialAttribute",
       type: 'select',
-      dicData:dicts.value.material_properties,
+      dicData:dicts.material_properties,
       props: { label: "dictLabel", value: "dictValue" },
     },
     {
@@ -357,32 +357,32 @@ const queryMaterialDetail = () => {
     ({ data }) => {
       dataDetail.value=data;
 
-      if(null!=dicts.value.material_properties&&undefined!=dicts.value.material_properties&&dicts.value.material_properties.length>0){
-        for(var i=0;i<dicts.value.material_properties.length;i++){
-          if(data.attributeDictValue===dicts.value.material_properties[i].dictValue){
-            dataDetail.value.attributeDictValue=dicts.value.material_properties[i].dictLabel;
+      if(null!=dicts.material_properties&&undefined!=dicts.material_properties&&dicts.material_properties.length>0){
+        for(var i=0;i<dicts.material_properties.length;i++){
+          if(data.attributeDictValue===dicts.material_properties[i].dictValue){
+            dataDetail.value.attributeDictValue=dicts.material_properties[i].dictLabel;
           }
         }
       }
 
-      if(null!=dicts.value.danwei_type&&undefined!=dicts.value.danwei_type&&dicts.value.danwei_type.length>0){
-        for(var i=0;i<dicts.value.danwei_type.length;i++){
-          if(data.unitDictValue===dicts.value.danwei_type[i].dictValue){
-            dataDetail.value.unitDictValue=dicts.value.danwei_type[i].dictLabel;
+      if(null!=dicts.danwei_type&&undefined!=dicts.danwei_type&&dicts.danwei_type.length>0){
+        for(var i=0;i<dicts.danwei_type.length;i++){
+          if(data.unitDictValue===dicts.danwei_type[i].dictValue){
+            dataDetail.value.unitDictValue=dicts.danwei_type[i].dictLabel;
           }
         }
       }
-      if(null!=dicts.value.material_level&&undefined!=dicts.value.material_level&&dicts.value.material_level.length>0){
-        for(var i=0;i<dicts.value.material_level.length;i++){
-          if(data.levelDictValue===dicts.value.material_level[i].dictValue){
-            dataDetail.value.levelDictValue=dicts.value.material_level[i].dictLabel;
+      if(null!=dicts.material_level&&undefined!=dicts.material_level&&dicts.material_level.length>0){
+        for(var i=0;i<dicts.material_level.length;i++){
+          if(data.levelDictValue===dicts.material_level[i].dictValue){
+            dataDetail.value.levelDictValue=dicts.material_level[i].dictLabel;
           }
         }
       }
-      if(null!=dicts.value.stage&&undefined!=dicts.value.stage&&dicts.value.stage.length>0){
-        for(var i=0;i<dicts.value.stage.length;i++){
-          if(data.stageDictValue===dicts.value.stage[i].dictValue){
-            dataDetail.value.stageDictValue=dicts.value.stage[i].dictLabel;
+      if(null!=dicts.stage&&undefined!=dicts.stage&&dicts.stage.length>0){
+        for(var i=0;i<dicts.stage.length;i++){
+          if(data.stageDictValue===dicts.stage[i].dictValue){
+            dataDetail.value.stageDictValue=dicts.stage[i].dictLabel;
           }
         }
       }

+ 3 - 3
src/views/base/craftManagement/route/components/configs.ts

@@ -22,7 +22,7 @@ export const getTableConfig = (id : string) => {
 					filterable: true,
 					type: "select",
 					dataType: "string",
-					dicData: dicts.value.danwei_type,
+					dicData: dicts.danwei_type,
 					props: { label: "dictLabel", value: "dictValue" },
 				},
 				{ label: "标准值", prop: "standard" },
@@ -53,7 +53,7 @@ export const getTableConfig = (id : string) => {
 					filterable: true,
 					type: "select",
 					dataType: "string",
-					dicData: dicts.value.trace_type,
+					dicData: dicts.trace_type,
 					props: { label: "dictLabel", value: "dictValue" },
 				},
 				{
@@ -63,7 +63,7 @@ export const getTableConfig = (id : string) => {
 					filterable: true,
 					type: "select",
 					dataType: "string",
-					dicData: dicts.value.danwei_type,
+					dicData: dicts.danwei_type,
 					props: { label: "dictLabel", value: "dictValue" },
 				},
 				{

+ 9 - 9
src/views/base/materials/index.vue

@@ -184,7 +184,7 @@ option.value = Object.assign(option.value, {
       type: "select",
       width: 100,
       overHidden: true,
-      dicData: dicts.value.material_properties,
+      dicData: dicts.material_properties,
       props: { label: "dictLabel", value: "dictValue" },
       rules: [
         {
@@ -212,7 +212,7 @@ option.value = Object.assign(option.value, {
       prop: "unitDictValue",
       filterable: true,
       type: "select",
-      dicData: dicts.value.danwei_type,
+      dicData: dicts.danwei_type,
       props: { label: "dictLabel", value: "dictValue" },
       rules: [
         {
@@ -230,7 +230,7 @@ option.value = Object.assign(option.value, {
       type: "select",
       width: 100,
       overHidden: true,
-      dicData: dicts.value.material_level,
+      dicData: dicts.material_level,
       props: { label: "dictLabel", value: "dictValue" },
       rules: [
         {
@@ -261,7 +261,7 @@ option.value = Object.assign(option.value, {
       type: "select",
       width: 100,
       overHidden: true,
-      dicData: dicts.value.quality_testing_plan,
+      dicData: dicts.quality_testing_plan,
       props: { label: "dictLabel", value: "dictValue" },
     },
     {
@@ -272,7 +272,7 @@ option.value = Object.assign(option.value, {
       type: "select",
       width: 100,
       overHidden: true,
-      dicData: dicts.value.applicable_platforms,
+      dicData: dicts.applicable_platforms,
       props: { label: "dictLabel", value: "dictValue" },
       rules: [
         {
@@ -290,7 +290,7 @@ option.value = Object.assign(option.value, {
       overHidden: true,
       filterable: true,
       type: "select",
-      dicData: dicts.value.quality_grade,
+      dicData: dicts.quality_grade,
       props: { label: "dictLabel", value: "dictValue" },
       rules: [
         {
@@ -308,7 +308,7 @@ option.value = Object.assign(option.value, {
       width: 100,
       overHidden: true,
       type: "select",
-      dicData: dicts.value.selection_type,
+      dicData: dicts.selection_type,
       props: { label: "dictLabel", value: "dictValue" },
     },
     {
@@ -319,7 +319,7 @@ option.value = Object.assign(option.value, {
       width: 100,
       overHidden: true,
       type: "select",
-      dicData: dicts.value.stage,
+      dicData: dicts.stage,
       props: { label: "dictLabel", value: "dictValue" },
     },
     { label: "客户型号", prop: "customerModel", width: 100, overHidden: true },
@@ -339,7 +339,7 @@ option.value = Object.assign(option.value, {
       overHidden: true,
       filterable: true,
       type: "select",
-      dicData: dicts.value.packaging_method,
+      dicData: dicts.packaging_method,
       props: { label: "dictLabel", value: "dictValue" },
     },
 

+ 2 - 2
src/views/base/modeling/station/columns.ts

@@ -38,7 +38,7 @@ export const columns = [
       trigger: "blur"
     }],
     type: 'select',
-    dicData:dicts.value.station_type,
+    dicData:dicts.station_type,
     searchClearable: false, //可清空的输入框,默认为true
     filterable: true, //添加filterable属性即可启用搜索功能
     props: {
@@ -57,7 +57,7 @@ export const columns = [
       trigger: "blur"
     }],
     type: 'select',
-    dicData:dicts.value.station_operate_type,
+    dicData:dicts.station_operate_type,
     props: {
       label: "dictLabel", // 下拉菜单显示的字段
       value: "dictValue" // 下拉菜单值的字

+ 1 - 1
src/views/base/modeling/station/components/columns.ts

@@ -26,7 +26,7 @@ export const columns = [
       trigger: "blur"
     }],
     type: 'select',
-    dicData:dicts.value.device_type,
+    dicData:dicts.device_type,
     searchClearable: false, //可清空的输入框,默认为true
     filterable: true, //添加filterable属性即可启用搜索功能
     props: {

+ 2 - 2
src/views/base/modeling/station/index.vue

@@ -187,7 +187,7 @@
           trigger: "blur"
         }],
         type: 'select',
-        dicData:dicts.value.station_type,
+        dicData:dicts.station_type,
         searchClearable: false, //可清空的输入框,默认为true
         filterable: true, //添加filterable属性即可启用搜索功能
         props: {
@@ -206,7 +206,7 @@
           trigger: "blur"
         }],
         type: 'select',
-        dicData:dicts.value.station_operate_type,
+        dicData:dicts.station_operate_type,
         props: {
           label: "dictLabel", // 下拉菜单显示的字段
           value: "dictValue" // 下拉菜单值的字

+ 1 - 1
src/views/base/skill/components/user-skill.vue

@@ -267,7 +267,7 @@ option.value = Object.assign(option.value,{
     headerAlign: 'center',
     span:24,
     type: 'select',
-    dicData:dicts.value.skill_type,
+    dicData:dicts.skill_type,
     props: { label: "dictLabel", value: "dictValue" },
   },
     {

+ 4 - 4
src/views/quality/faultHandle/components/fault-detail.vue

@@ -153,11 +153,11 @@
     getFaultDetails(props.escalationFaultId).then((data) => {
 
       faultDetails1.value = data.data;
-      if (dicts.value.disposal_measures_type.length>0) {
+      if (dicts.disposal_measures_type.length>0) {
 
-      for (let i = 0; i < dicts.value.disposal_measures_type.length; i++) {
-        if (faultDetails1.value.disposalMeasures === dicts.value.disposal_measures_type[i].dictValue) {
-          faultDetails1.value.disposalMeasures = dicts.value.disposal_measures_type[i].dictLabel;
+      for (let i = 0; i < dicts.disposal_measures_type.length; i++) {
+        if (faultDetails1.value.disposalMeasures === dicts.disposal_measures_type[i].dictValue) {
+          faultDetails1.value.disposalMeasures = dicts.disposal_measures_type[i].dictLabel;
         }
       }
     }

+ 4 - 4
src/views/quality/faultHandle/components/fault-examine.vue

@@ -153,9 +153,9 @@
     getFaultDetails(props.escFaultId).then((data) => {
 
       faultDetails1.value=data.data;
-      for(let i=0;i<dicts.value.disposal_measures_type.length;i++){
-        if(faultDetails1.value.disposalMeasures===dicts.value.disposal_measures_type[i].dictValue){
-          faultDetails1.value.disposalMeasures=dicts.value.disposal_measures_type[i].dictLabel;
+      for(let i=0;i<dicts.disposal_measures_type.length;i++){
+        if(faultDetails1.value.disposalMeasures===dicts.disposal_measures_type[i].dictValue){
+          faultDetails1.value.disposalMeasures=dicts.disposal_measures_type[i].dictLabel;
         }
       }
     });
@@ -196,7 +196,7 @@
       {
         label: "缺陷大类",
         prop: "bugType",
-        dicData:dicts.value.defect_mana,
+        dicData:dicts.defect_mana,
         props: { label: "dictLabel", value: "dictValue" },
       },
       {

+ 4 - 4
src/views/quality/faultHandle/components/fault-page.vue

@@ -159,9 +159,9 @@
     getFaultDetails(props.faultId).then((data) => {
 
       faultDetails.value=data.data;
-      for(let i=0;i<dicts.value.disposal_measures_type.length;i++){
-        if(faultDetails.value.disposalMeasures===dicts.value.disposal_measures_type[i].dictValue){
-          faultDetails.value.disposalMeasures=dicts.value.disposal_measures_type[i].dictLabel;
+      for(let i=0;i<dicts.disposal_measures_type.length;i++){
+        if(faultDetails.value.disposalMeasures===dicts.disposal_measures_type[i].dictValue){
+          faultDetails.value.disposalMeasures=dicts.disposal_measures_type[i].dictLabel;
         }
       }
     });
@@ -234,7 +234,7 @@ const faultHandle=ref({});
       {
         label: "缺陷大类",
         prop: "bugType",
-        dicData:dicts.value.defect_mana,
+        dicData:dicts.defect_mana,
         props: { label: "dictLabel", value: "dictValue" },
       },
       {