Browse Source

维保资料配置优化

pengyh 1 year ago
parent
commit
fa8186ba11
1 changed files with 30 additions and 16 deletions
  1. 30 16
      src/views/engineeringMaintenance/basicData/detail.vue

+ 30 - 16
src/views/engineeringMaintenance/basicData/detail.vue

@@ -32,7 +32,7 @@
 							</el-col>
 							</el-col>
 							<el-col :span="12">
 							<el-col :span="12">
 								<el-form-item label="联系电话" prop="mobile">
 								<el-form-item label="联系电话" prop="mobile">
-									<el-input type="number" v-model="formData.mobile" :disabled="formType==2" placeholder="请输入"></el-input>
+									<el-input type="number" v-model="formData.mobile" oninput="if(value.length > 11) value=value.slice(0, 11)" :disabled="formType==2" placeholder="请输入"></el-input>
 								</el-form-item>
 								</el-form-item>
 							</el-col>
 							</el-col>
 							<el-col :span="12">
 							<el-col :span="12">
@@ -151,17 +151,21 @@
 										<el-select v-model="scope.row.main" value-key="categoryId" @change="(e)=>{
 										<el-select v-model="scope.row.main" value-key="categoryId" @change="(e)=>{
 											scope.row.mainId = e.categoryId
 											scope.row.mainId = e.categoryId
 											scope.row.mainName = e.name
 											scope.row.mainName = e.name
-											if(e.categoryId == 0){
-												scope.row.small = {categoryId: '0', name: '不限'}
-												scope.row.smallName = '不限'
-												scope.row.smallId = '0'
-											}else{
-												scope.row.small = null
-												scope.row.smallName = ''
-												scope.row.smallId = ''
-											}
+											//if(e.categoryId == 0){
+											//	scope.row.small = {categoryId: '0', name: '不限'}
+											//	scope.row.smallName = '不限'
+											//	scope.row.smallId = '0'
+											//}else{
+											//	scope.row.small = null
+											//	scope.row.smallName = ''
+											//	scope.row.smallId = ''
+											//}
+											//scope.row.smallList = e.children?[...[{categoryId: '0', name: '不限'}],...e.children]:[]
+											scope.row.small = null
+											scope.row.smallName = ''
+											scope.row.smallId = ''
 											
 											
-											scope.row.smallList = e.children?[...[{categoryId: '0', name: '不限'}],...e.children]:[]
+											scope.row.smallList = e.children?e.children:[]
 										}" :disabled="isEdit1 != scope.$index || formType == 2" placeholder="请选择" style="width: 100%;">
 										}" :disabled="isEdit1 != scope.$index || formType == 2" placeholder="请选择" style="width: 100%;">
 										    <el-option
 										    <el-option
 										      v-for="(item,ind) in mainList"
 										      v-for="(item,ind) in mainList"
@@ -250,7 +254,7 @@
 								<template slot-scope="scope">
 								<template slot-scope="scope">
 									<el-form-item :prop="'byList.' + scope.$index + '.mobile'"
 									<el-form-item :prop="'byList.' + scope.$index + '.mobile'"
 										:rules="[{ required: true, message: `请输入联系电话`, trigger: 'blur' },{ pattern:/^((1[3456789]\d{9}))$/, message: '电话号码格式不正确', trigger: 'blur' }]">
 										:rules="[{ required: true, message: `请输入联系电话`, trigger: 'blur' },{ pattern:/^((1[3456789]\d{9}))$/, message: '电话号码格式不正确', trigger: 'blur' }]">
-										<el-input type="number" v-model="scope.row.mobile" :disabled="isEdit2 != scope.$index || formType == 2" placeholder="请输入"></el-input>
+										<el-input type="number" oninput="if(value.length > 11) value=value.slice(0, 11)" v-model="scope.row.mobile" :disabled="isEdit2 != scope.$index || formType == 2" placeholder="请输入"></el-input>
 									</el-form-item>
 									</el-form-item>
 								</template>
 								</template>
 							</el-table-column>
 							</el-table-column>
@@ -309,7 +313,7 @@
 							<el-table-column align="center" label="移动电话" >
 							<el-table-column align="center" label="移动电话" >
 								<template slot-scope="scope">
 								<template slot-scope="scope">
 									<el-form-item>
 									<el-form-item>
-										<el-input type="number" v-model="scope.row.mobile" disabled placeholder="请输入"></el-input>
+										<el-input type="text" v-model="scope.row.mobile" disabled placeholder="请输入"></el-input>
 									</el-form-item>
 									</el-form-item>
 								</template>
 								</template>
 							</el-table-column>
 							</el-table-column>
@@ -460,7 +464,8 @@
 					let data = []
 					let data = []
 					this.mainList.forEach(item=>{
 					this.mainList.forEach(item=>{
 						if(item.categoryId == id){
 						if(item.categoryId == id){
-							data = item.children?[...[{categoryId: '0', name: '不限'}],...item.children]:[]
+							// data = item.children?[...[{categoryId: '0', name: '不限'}],...item.children]:[]
+							data = item.children?item.children:[]
 						}
 						}
 					})
 					})
 					return data
 					return data
@@ -531,12 +536,14 @@
 			},
 			},
 			getBrandList(){
 			getBrandList(){
 				getBrand().then(res => {
 				getBrand().then(res => {
-					this.brandList = [...[{id: '0',brandName: '不限'}],...res.data]
+					// this.brandList = [...[{id: '0',brandName: '不限'}],...res.data]
+					this.brandList = res.data
 				})
 				})
 			},
 			},
 			getMainList(){
 			getMainList(){
 				getMainList({type: 2}).then(res => {
 				getMainList({type: 2}).then(res => {
-					this.mainList = [...[{categoryId: '0',name: '不限',children: [{categoryId: '0',name: '不限'}]}],...res.data]
+					// this.mainList = [...[{categoryId: '0',name: '不限',children: [{categoryId: '0',name: '不限'}]}],...res.data]
+					this.mainList = res.data
 				})
 				})
 			},
 			},
 			getinitlbslist() {
 			getinitlbslist() {
@@ -791,4 +798,11 @@
 			margin-top: 10px;
 			margin-top: 10px;
 		}
 		}
 	}
 	}
+	::v-deep .numrule input::-webkit-outer-spin-button,
+	::v-deep .numrule input::-webkit-inner-spin-button {
+	    -webkit-appearance: none!important;
+	}
+	::v-deep .numrule input[type="number"]{
+	    -moz-appearance: textfield;
+	}
 </style>
 </style>