ソースを参照

修复页面bug

oyq28 3 年 前
コミット
be0471797b

+ 2 - 2
imcs-ui/src/views/zuihou/prepareProductMgr/bomMgr/Index.vue

@@ -225,7 +225,7 @@ import TenantView from "./components/View"
 import bomMgrApi from "@/api/prepareProductMgr/bomMgr"
 import elDragDialog from '@/directive/el-drag-dialog'
 import { downloadFile, initEnums, initQueryParams } from '@/utils/commons'
-import axios from 'axios'
+
 export default {
   name: "BomMgr",
   directives: { elDragDialog },
@@ -236,7 +236,7 @@ export default {
     	qiyongStatus: [], //状态
     	statusList: [], // 启用状态
       titleList: [{"field":"partsNo","text":i18n.t("prepare.searchForm.parts_no")},{"field":"bomAlias","text":i18n.t("prepare.searchForm.bomAlias")},{"field":"name","text":i18n.t("prepare.searchForm.name")},{"field":"partsAlias","text":i18n.t("prepare.searchForm.partsAlias")},{"field":"batchNo","text":i18n.t("prepare.searchForm.batchNo")},{"field":"materialBrandName","text":i18n.t("prepare.searchForm.materialBrandName")},{"field":"batchNo","text":i18n.t("prepare.searchForm.batchNo")},
-                   {"field":"keyFlag","text":i18n.t("prepare.searchForm.keyFlag")},{"field":"importantFlag","text":i18n.t("prepare.searchForm.importantFlag")},{"field":"productModuleName","text":i18n.t("prepare.searchForm.productModuleName")},{"field":"remark","text":i18n.t("prepare.searchForm.remark")},{"field":"status","text":i18n.t("prepare.searchForm.status")},{"field":"auditStatus","text":i18n.t("prepare.searchForm.auditStatus")}],
+                   {"field":"keyFlag","text":i18n.t("prepare.searchForm.keyFlag")},{"field":"importantFlag","text":i18n.t("prepare.searchForm.importantFlag")},{"field":"remark","text":i18n.t("prepare.searchForm.remark")},{"field":"status","text":i18n.t("prepare.searchForm.status")},{"field":"auditStatus","text":i18n.t("prepare.searchForm.auditStatus")}],
       dialog: {
         isVisible: false,
         title: ""

+ 25 - 13
imcs-ui/src/views/zuihou/prepareProductMgr/bomMgr/components/Edit.vue

@@ -58,19 +58,20 @@
 	      		<el-input-number v-model="tenant[item.identifier]" :disabled="item.readonly == '1' ? true : false" :min="0" :max="999999999"></el-input-number>
 	      	</el-form-item>
 	      	<!-- 如果是【选择器】-->
-	      	<el-form-item
-	      		v-if="item.identifier == 'zone_id' ? ($store.state.account.user.roles.indexOf('舱体') < 0 || $store.state.account.user.roles.indexOf('框体') < 0) : item.formControlsType == 'select' && item.showStatus == '1'"
+	      	<el-form-item :ref="item.identifier" 
+	      		v-if="item.formControlsType == 'select' && item.showStatus == '1'"
 	      		:key="item.id"
 	      		:label="item.fieldName+':'"
 	      		:prop="item.identifier"
 	      		:rules="{required: item.requireFlag=='1' ? true : false, message: $t('rules.require'), trigger: 'blur'}"
-	      	>			  
-			<el-select v-model="tenant[item.identifier]" 
+	      	    v-show="getShow(item)" 
+			  >			  
+			<el-select v-model="tenant[item.identifier]"  
 			 :disabled=" item.identifier == 'zone_id' ? !zoneEdit:(item.readonly == '1' ? true : false)"
 			 :placeholder='$t("common.pleaseSelect")' filterable style="width: 100%;">
 				    <el-option
 				      v-for="(obj, index) in commList[item.identifier]"
-				      :key="index"
+				      :key="obj.code"
 				      :label="obj.name"
 				      :value="obj.code">
 				    </el-option>
@@ -203,6 +204,14 @@ export default {
       this.dicts = dicts
 	  this.zoneEdit = this.type=='edit' ? false: true
     },
+	getShow(item){
+         if(item.identifier == "zone_id"){			
+            return (this.$store.state.account.user.roles.indexOf('舱体') < 0 && this.$store.state.account.user.roles.indexOf('框体') < 0)
+		}else if(item.identifier == "product_module_id"){
+            return false
+		}
+		return true
+	},
     close () {
       this.$emit('close')
     },
@@ -214,12 +223,13 @@ export default {
     },
     submitForm () {
     	console.log("表单的数据:", this.tenant)
-    	//return false
+	  this.tenant.zone_id = (this.tenant.zone_id==null)?this.commList.zone_id[0].code : this.tenant.zone_id
+	  this.tenant.product_module_id = (this.tenant.product_module_id==null)? this.commList.product_module_id[0].code : this.tenant.product_module_id
       this.$refs.form.validate((valid) => {
         if (valid) {
         	// 清楚对象中一个属性
         	this.tenant.parent_name = undefined
-	        this.confirmDisabled = true
+	        this.confirmDisabled = true			
 	        if (this.type === 'add') {
 	            this.save()
 	        } else {
@@ -251,6 +261,7 @@ export default {
         })
     },
     update () {
+	  console.log(this.tenant)	
       bomMgrApi.update(this.tenant)
         .then((response) => {
           const res = response.data
@@ -300,22 +311,23 @@ export default {
     },
     
     // 加载动态表单的数据-函数
-    getCommList(fieldObj){
+    getCommList(fieldObj){		
+		let that = this
     	modelingCenterApi.formCommList({comboxUrl: fieldObj.comboxUrl}).then(res => {
     		res = res.data
     		console.log("动态表单的数据:", res)
     		if(res.isSuccess){
     			// 初始化,表单的数据
-				if(fieldObj.identifier=="meterial_id" || fieldObj.identifier=="tray_id"){
+				if(fieldObj.identifier=="meterial_id" || fieldObj.identifier=="tray_id" || fieldObj.identifier=="zone_id"){
 				   //数据权限过滤
                     let role =  this.$store.state.account.user.roles.indexOf('舱体')<0 && this.$store.state.account.user.roles.indexOf('框体')<0 ? null : (this.$store.state.account.user.roles.indexOf('舱体')<0? "舱体":"框体")
 					if(role!=null){						
 						res.data = res.data.filter(item=>{							
 							return item.name.indexOf(role) < 0;
-						}) 						
-					} 
-				}
-				this.commList[fieldObj.identifier] = res.data				
+						})					
+					}
+				}                
+				that.commList[fieldObj.identifier] = res.data				
     		}
     	})
     	if(this.isEnd){

+ 2 - 2
imcs-ui/src/views/zuihou/resourceProductMgr/deviceMgr/Index.vue

@@ -131,10 +131,10 @@
           this.$store.state.account.permissions.includes('resource:superview')
         "
       ></el-table-column>
-      <el-table-column
+      <!-- <el-table-column              
         prop="specification"
         :label="$t('resource.table.resours.specification')"
-      ></el-table-column>
+      ></el-table-column> -->
 
       <el-table-column
         prop="capitalNo"