|
@@ -213,25 +213,15 @@
|
|
|
@input="getUrl"></ObsImageUpload>
|
|
|
</el-form-item>
|
|
|
</el-row>
|
|
|
- <el-row v-for="(item, index) in form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo" :key="index">
|
|
|
- <!-- 在此处添加默认的行内容 -->
|
|
|
- <template v-if="index === null">
|
|
|
- <div>默认的行内容</div>
|
|
|
- </template>
|
|
|
- <!-- 循环输出的行内容 -->
|
|
|
- <template v-else>
|
|
|
- <div>{{ item }}</div>
|
|
|
- </template>
|
|
|
- <el-col :span="7">
|
|
|
+ <el-row v-for="(item, index) in form.zEngineeringNodeBo.zEngineeringInfoBo.zEngineeringMaterialBo" :key="index" >
|
|
|
+ <el-col :span="7" >
|
|
|
<el-form-item
|
|
|
- :prop="'zEngineeringMaterialBo.' + index + '.materialQuality'"
|
|
|
- label-width="50px"
|
|
|
+ :prop="`zEngineeringMaterialBo.${index}.materialQuality`"
|
|
|
+ :rules="{ required:true, validator: validateState, trigger: 'blur', index:index }"
|
|
|
+ label-width="auto"
|
|
|
label="材质"
|
|
|
-
|
|
|
>
|
|
|
- <!-- :rules="{required: true, message: '请输入材质', trigger: 'blur'}"-->
|
|
|
- <!-- <el-input v-model="item.materialQuality" placeholder="请输入材质" style="width: 100%"/>-->
|
|
|
- <el-select v-model="item.materialQuality" placeholder="请选择材质" style="width: 100%" @change="getEnginSpecificationsList(item, index)">
|
|
|
+ <el-select v-model="item.materialQuality" placeholder="请选择材质" style="width: 70%" @change="getEnginSpecificationsList(item, index)">
|
|
|
<el-option
|
|
|
v-for="e in materialQualityList"
|
|
|
:key="e.id"
|
|
@@ -241,16 +231,14 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="7">
|
|
|
+ <el-col :span="7" >
|
|
|
<el-form-item
|
|
|
- :prop="'zEngineeringMaterialBo.' + index + '.specifications'"
|
|
|
- label-width="50px"
|
|
|
+ :prop="`zEngineeringMaterialBo.${index}.specifications`"
|
|
|
+ :rules="{ required:true, validator: validateSize, trigger: 'blur', index:index }"
|
|
|
+ label-width="auto"
|
|
|
label="规格"
|
|
|
-
|
|
|
>
|
|
|
- <!-- :rules="{required: true, message: '请输入规格', trigger: 'blur'}"-->
|
|
|
- <!-- <el-input v-model="item.specifications" placeholder="请输入规格" style="width: 100%"/>-->
|
|
|
- <el-select v-model="item.specifications" placeholder="请选择规格" style="width: 100%">
|
|
|
+ <el-select v-model="item.specifications" placeholder="请选择规格" style="width: 70%">
|
|
|
<el-option
|
|
|
v-for="e in specificationsList"
|
|
|
:key="e.id"
|
|
@@ -260,14 +248,13 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="7">
|
|
|
+ <el-col :span="7" >
|
|
|
<el-form-item
|
|
|
- :prop="'zEngineeringMaterialBo.' + index + '.number'"
|
|
|
- label-width="50px"
|
|
|
+ :prop="`zEngineeringMaterialBo.${index}.number`"
|
|
|
+ :rules="{ required:true, validator: validateNumber, trigger: 'blur', index:index }"
|
|
|
+ label-width="auto"
|
|
|
label="数量"
|
|
|
-
|
|
|
>
|
|
|
- <!-- :rules="[{required: true, message: '请输入数量', trigger: 'change'},{validator: [checkPositiveInteger], trigger: 'blur'}]"-->
|
|
|
<div class="block" style="display: inline-block; margin-right: 20px;">
|
|
|
<el-input v-model="item.number" placeholder="请输入数量" style="width: 100%" maxlength="8"/>
|
|
|
</div>
|
|
@@ -479,6 +466,39 @@ export default {
|
|
|
},500)
|
|
|
},
|
|
|
methods: {
|
|
|
+ validateState(rule,value,callback){
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ if (value !==null && value !== undefined && value !== '' && value !== 0)
|
|
|
+ {
|
|
|
+ resolve(true)
|
|
|
+ } else {
|
|
|
+ return callback(new Error('材质不能为空'))
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ validateSize(rule,value,callback){
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ if (value !==null && value !== undefined && value !== '' && value !== 0)
|
|
|
+ {
|
|
|
+ resolve(true)
|
|
|
+ } else {
|
|
|
+ return callback(new Error('规格不能为空'))
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ validateNumber(rule,value,callback){
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ console.log("·························")
|
|
|
+ console.log(value);
|
|
|
+ // 至少有一个图片、一个用料信息、一个创建时间
|
|
|
+ if (value !==null && value !== undefined && value !== '' && value !== 0 && !isNaN(value))
|
|
|
+ {
|
|
|
+ resolve(true)
|
|
|
+ } else {
|
|
|
+ return callback(new Error('数量不能为空且只能为数字'))
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 验证正整数(不包含0的正整数)
|
|
|
checkPositiveInteger,
|
|
|
// 根据所选材质获取对应规格
|
|
@@ -685,6 +705,8 @@ export default {
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
+
|
|
|
+
|
|
|
::v-deep .appendElDialog {
|
|
|
width: 70%;
|
|
|
height: 80%;
|
|
@@ -720,14 +742,16 @@ export default {
|
|
|
// width: 70%;
|
|
|
height: 80%;
|
|
|
|
|
|
-
|
|
|
+ .el-select{
|
|
|
+ width:70%
|
|
|
+ }
|
|
|
.el-dialog__body {
|
|
|
height: 85%;
|
|
|
}
|
|
|
|
|
|
.el-form-item {
|
|
|
margin-bottom: 22px;
|
|
|
- width: 44%;
|
|
|
+ width: 100%;
|
|
|
display: inline-block;
|
|
|
}
|
|
|
|