gaoxizhong 5 maanden geleden
bovenliggende
commit
e2d93201d9
1 gewijzigde bestanden met toevoegingen van 84 en 1 verwijderingen
  1. 84 1
      src/views/rule/config/components/CreateDialog.vue

+ 84 - 1
src/views/rule/config/components/CreateDialog.vue

@@ -137,10 +137,13 @@
                 </el-select>
               </el-form-item>
             </el-col>
-            <!-- 前置条件 -->
+
             <el-col :span="24" style="margin-bottom: 20px;">
               <el-button type="primary" plain icon="el-icon-plus" @click="onAddQZTJ">前置条件</el-button>
+              <el-button type="primary" plain icon="el-icon-plus" @click="onAddZKYJ">质控依据</el-button>
             </el-col>
+
+            <!-- 前置条件 -->
             <el-col v-if="ruleForm.qztj.length" :span="24">
               <el-card v-for="(item, index) of ruleForm.qztj" :key="'qztj'+index" class="box-card" shadow="never">
                 <div slot="header" class="clearfix box-card_header span">
@@ -199,6 +202,49 @@
                 </div>
               </el-card>
             </el-col>
+            <!-- 质控依据 -->
+            <el-col v-if="ruleForm.zkyj.length" :span="24">
+              <el-card v-for="(item, index) of ruleForm.zkyj" :key="'zkyj'+index" class="box-card" shadow="never">
+                <div slot="header" class="clearfix box-card_header span">
+                  <spasn class="text">质控依据{{ index + 1 }}</spasn>
+                  <i class="el-icon-delete" style="float: right; margin-top: 13px; cursor: pointer;" @click="onDeleteZKYJ(index)" />
+                </div>
+                <div>
+                  <el-row v-for="(sItem, sIndex) of item.custom_basis" :key="'tj'+sIndex" :gutter="12" class="mb12">
+                    <el-col :span="2">
+                      <div class="text-right">条件{{ sIndex + 1 }}</div>
+                    </el-col>
+                    <el-col :span="6">
+                      <el-input v-model="sItem.input1" clearable placeholder="请输入" style="width: 100%;" />
+                    </el-col>
+                    <el-col :span="6">
+                      <el-cascader
+                        v-model="sItem.param1"
+                        :options="objects"
+                        :props="{
+                          expandTrigger: 'hover',
+                          value: 'field',
+                          label: 'field_name',
+                          children: 'child'
+                        }"
+                        clearable
+                        filterable
+                        :show-all-levels="false"
+                        placeholder="请选择"
+                        style="width: 100%;"
+                      />
+                    </el-col>
+                    <el-col :span="6">
+                      <el-input v-model="sItem.input2" clearable placeholder="请输入" style="width: 100%;" />
+                    </el-col>
+                    <el-col :span="4">
+                      <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="onAddTJZKYJ(index, sIndex)" />
+                      <el-button v-if="item.custom_basis.length !== 1" size="mini" type="primary" plain icon="el-icon-minus" @click="onDeleteTJZKYJ(index, sIndex)" />
+                    </el-col>
+                  </el-row>
+                </div>
+              </el-card>
+            </el-col>
             <!-- 质控逻辑 -->
             <el-col :span="24">
               <el-divider />
@@ -404,6 +450,15 @@ export default {
               }
             ]
           }
+        ],
+        zkyj: [
+          {
+            custom_basis: [{
+              param1: '',
+              input1: '',
+              input2: ''
+            }]
+          }
         ]
       },
       rules: {
@@ -534,6 +589,34 @@ export default {
     handleSelect(item) {
       console.log(item)
     },
+    // 添加质控依据
+    onAddZKYJ() {
+      this.ruleForm.zkyj.push({
+        custom_basis: [
+          {
+            param1: '',
+            input1: '',
+            input2: ''
+          }
+        ]
+      })
+    },
+    // 删除质控依据大框
+    onDeleteZKYJ(index) {
+      this.ruleForm.zkyj.splice(index, 1)
+    },
+    // 新增质控依据大框中_条件
+    onAddTJZKYJ(index, sIndex) {
+      this.ruleForm.zkyj[index].custom_basis.push({
+        param1: '',
+        input1: '',
+        input2: ''
+      })
+    },
+    // 删除质控依据大框中_条件
+    onDeleteTJZKYJ(index, sIndex) {
+      this.ruleForm.zkyj[index].custom_basis.splice(sIndex, 1)
+    },
     // 添加前置条件大框
     onAddQZTJ() {
       this.ruleForm.qztj.push({