Browse Source

LY 特种设备 定点侧厚

ly 3 years ago
parent
commit
e1f116deeb
2 changed files with 16 additions and 7 deletions
  1. 1 1
      ui/src/utils/ruoyi.js
  2. 15 6
      ui/src/views/sems/thickness/index.vue

+ 1 - 1
ui/src/utils/ruoyi.js

@@ -80,7 +80,7 @@ export function selectDictLabel(datas, value) {
 // 回显数据字典(字符串数组)
 export function selectDictLabels(datas, value, separator) {
   if (!value) {
-    return
+    return ''
   }
 	var actions = [];
 	var currentSeparator = undefined === separator ? "," : separator;

+ 15 - 6
ui/src/views/sems/thickness/index.vue

@@ -1111,9 +1111,6 @@ export default {
         corrosionType: [
           { required: true, message: this.$t('腐蚀类型')+this.$t('不能为空'), trigger: "change" }
         ],
-        inspectionMethod: [
-          { required: true, message: this.$t('检测方法')+this.$t('不能为空'), trigger: "blur" }
-        ],
         /*analysis: [
           { required: true, message: "原因分析不能为空", trigger: "blur" }
         ],*/
@@ -1288,7 +1285,11 @@ export default {
       const id = row.id || this.ids
       getThickness(id).then(response => {
         this.form = response.data;
-        this.form.inspectionMethod = this.form.inspectionMethod.split(",");
+        if (this.form.inspectionMethod) {
+          this.form.inspectionMethod = this.form.inspectionMethod.split(",");
+        }else {
+          this.form.inspectionMethod = []
+        }
         this.open = true;
         this.title = this.$t('修改') + this.$t('定点测厚');
         if (this.form.photo!= null){
@@ -1313,7 +1314,11 @@ export default {
       const id = row.id
       getThickness(id).then(response => {
         this.dataForm = response.data;
-        this.dataForm.inspectionMethod = this.dataForm.inspectionMethod.split(",");
+        if (this.dataForm.inspectionMethod) {
+          this.dataForm.inspectionMethod = this.dataForm.inspectionMethod.split(",");
+        }else {
+          this.dataForm.inspectionMethod = []
+        }
         this.visible = true;
         this.title = this.$t('查看') + this.$t('定点测厚');
         if (this.dataForm.photo!= null){
@@ -1343,7 +1348,11 @@ export default {
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
-          this.form.inspectionMethod = this.form.inspectionMethod.join(",");
+          if (this.form.inspectionMethod) {
+            this.form.inspectionMethod = this.form.inspectionMethod.join(",");
+          }else {
+            this.form.inspectionMethod = ''
+          }
           if (this.form.id != null) {
             updateThickness(this.form).then(response => {
               this.msgSuccess(this.$t('修改成功'));