diff --git a/src/views/user/contract-manage/index.vue b/src/views/user/contract-manage/index.vue
index d345fce..f48a21f 100644
--- a/src/views/user/contract-manage/index.vue
+++ b/src/views/user/contract-manage/index.vue
@@ -124,6 +124,16 @@
>
+
+
+ 查看
+
+
@@ -157,7 +167,7 @@
:total="total"
/> -->
-
+
{
- propertyNames.value.push({'propertyName':item,'propertyValue':null})
- options.value.push({'label':item,'value':item})
+ propertyNames.value = deviceTypeList[0].data.maTypeProperties;
+ deviceTypeList[0].data.maTypeProperties.forEach((item:any) =>{
+ options.value.push({'label':item.propertyName,'value':item.propertyName})
})
console.log(propertyNames.value)
}
@@ -539,6 +536,44 @@ const equipRules = ref({
// ],
})
+const maTypeRules = ref({
+ propertyName: [
+ {
+ required: true,
+ message: '请输入属性描述',
+ trigger: 'blur',
+ },
+ ],
+ propertyValue: [
+ {
+ required: true,
+ message: '请输入属性值',
+ trigger: 'blur',
+ },
+ ],
+
+})
+
+const getProertyNameRules = (item:any)=>{
+ if(item.mustHave ==1){
+ return [
+ {required: true, message: '请输入属性描述',trigger: 'blur',}
+ ]
+ }else{
+ return []
+ }
+}
+
+const getProertyValueRules = (item:any)=>{
+ if(item.mustHave ==1){
+ return [
+ {required: true, message: '请输入属性值',trigger: 'blur',}
+ ]
+ }else{
+ return []
+ }
+}
+
const descriptionRules = ref({
insurancePdfs: [{ required: true, message: '请上传合格证', trigger: 'change' }],
examinationPdfs: [{ required: true, message: '请上传检测证明', trigger: 'change' }],
@@ -611,7 +646,7 @@ const submitFun = (type: any) => {
...addAndEditForm.detailsFileList,
...addAndEditForm.detailsFileTempList,
]
-
+ addAndEditForm.devInfoProperties = propertyNames.value;
addAndEditFormRef.value.validate(async (valid: any) => {
if (valid) {
let isDescription = false
@@ -639,11 +674,29 @@ const submitFun = (type: any) => {
} catch (error) {}
}
+ // for(let index = 0;index < propertyNames.value.length;index++){
+ // try {
+ // const result = await new Promise((resolve,reject) => {
+ // addAndEditFormRef.value.validateField(`propertyNames[${index}].propertyValue`,(error) => {
+ // if(error){
+ // reject(error);
+ // }else{
+ // resolve(true);
+ // }
+ // })
+ // })
+
+ // if (!result) {
+ // isDescription = true
+ // throw new Error('表单校验失败')
+ // }
+ // } catch (error) {}
+ // }
if (isDescription) return
addAndEditForm.typeId =
addAndEditForm.deviceTypeList[addAndEditForm.deviceTypeList.length - 1]
- addAndEditForm.devInfoProperties = propertyNamesTwo.value;
+
let SEND_FUN_API: any = null
if (type == 1) {
SEND_FUN_API = equipmentAddApi
@@ -1021,16 +1074,6 @@ const options = ref([
// }
])
- //新增属性
- const addPartItem = () => {
- propertyNamesTwo.value.push({'propertyName':null,'propertyValue':null});
- }
-
- const removePartItem = (index:any)=> {
- if (propertyNamesTwo.value.length > 1) {
- propertyNamesTwo.value.splice(index, 1);
- }
- }
@@ -1445,27 +1488,27 @@ const options = ref([
-->
-
-
-
-
-
-
+
+
-
-
-
-
+
+
+
+
+
([
style="width: 350px;"
>
-
-
-
-
-
-
- 新增属性
-
- 删除属性
-
+