lucw 7 miesięcy temu
rodzic
commit
620bfba005

+ 43 - 14
src/components/selectReleaseRules/select-release-rules.vue

@@ -17,6 +17,16 @@
         :datasource="datasource"
         :selection.sync="selection"
       >
+        <!-- 单选列 -->
+        <template v-slot:radio="{ row }">
+          <el-radio
+            class="radio"
+            v-model="currentRowId"
+            :label="row.id"
+            @change="radioChange($event, row)"
+            ><i></i
+          ></el-radio>
+        </template>
       </ele-pro-table>
     </el-card>
     <template v-slot:footer>
@@ -53,21 +63,14 @@
     },
     computed: {
       columns() {
-        return [
+        const list = [
           {
             columnKey: 'index',
             label: '序号',
             type: 'index',
             width: 55,
             align: 'center',
-            showOverflowTooltip: true,
-            fixed: 'left'
-          },
-          {
-            width: 45,
-            type: 'selection',
-            columnKey: 'selection',
-            align: 'center'
+            showOverflowTooltip: true
           },
           {
             prop: 'code',
@@ -190,6 +193,25 @@
             }
           }
         ];
+
+        if (this.multiple) {
+          list.unshift({
+            type: 'selection',
+            width: 50,
+            align: 'center',
+            fixed: 'left'
+          });
+        } else {
+          list.unshift({
+            prop: 'radio',
+            width: 50,
+            align: 'center',
+            fixed: 'left',
+            slot: 'radio'
+          });
+        }
+
+        return list;
       }
     },
     data() {
@@ -198,7 +220,9 @@
         visible: false,
         selection: [],
         produceTaskId: '',
-        reportWorkType: '' // 记录规则报工类型 产前、过程、产后
+        reportWorkType: '', // 记录规则报工类型 产前、过程、产后
+        currentRowId: null,
+        currentRow: null
       };
     },
     created() {
@@ -212,6 +236,8 @@
 
         this.visible = true;
         this.selection = [];
+        this.currentRowId = null;
+        this.currentRow = null;
         this.reportWorkType = reportWorkType || '';
         this.produceTaskId = produceTaskId || '';
         this.reload(); // 刷新表格
@@ -244,21 +270,24 @@
         });
       },
       confirmSelection() {
-        if (this.selection.length === 0) {
+        if (this.multiple && this.selection.length === 0) {
           this.$message.warning('请先选择记录规则');
           return;
         }
 
-        if (!this.multiple && this.selection.length > 1) {
-          this.$message.warning('只能选择一条记录规则');
+        if (!this.multiple && !this.currentRow) {
+          this.$message.warning('请先选择记录规则');
           return;
         }
 
         this.$emit(
           'chooseRules',
-          this.multiple ? this.selection : this.selection[0]
+          this.multiple ? this.selection : this.currentRow
         );
         this.visible = false;
+      },
+      radioChange(_, row) {
+        this.currentRow = row;
       }
     }
   };

+ 4 - 6
src/views/batchRecord/components/editModal.vue

@@ -9,7 +9,7 @@
     width="80%"
   >
     <div>
-      <!-- <div
+      <div
         class="switch"
         v-if="details && details.processInstanceId"
         :maxable="true"
@@ -27,7 +27,7 @@
             </li>
           </ul>
         </div>
-      </div> -->
+      </div>
 
       <el-form
         v-if="activeComp == 'main'"
@@ -52,7 +52,6 @@
             <el-form-item label="类型" required prop="itemType">
               <DictSelection
                 dictName="记录规则事项类型"
-                clearable
                 v-model="form.itemType"
                 @change="itemTypeChange"
               >
@@ -63,7 +62,6 @@
             <el-form-item label="执行方式" required prop="executeMethod">
               <DictSelection
                 dictName="记录规则执行方式"
-                clearable
                 v-model="form.executeMethod"
                 disabled
               >
@@ -392,11 +390,11 @@
         </el-row> -->
       </el-form>
 
-      <!-- <bpmDetail
+      <bpmDetail
         v-if="activeComp == 'bpm' && details && details.processInstanceId"
         :id="details.processInstanceId"
       >
-      </bpmDetail> -->
+      </bpmDetail>
     </div>
 
     <template v-if="type == 'detail'" v-slot:footer>

+ 6 - 6
src/views/produce/components/prenatalExamination/releaseRulesDialog.vue

@@ -752,31 +752,31 @@
           list = [
             ...list,
             {
-              lbel: '检查工具',
+              label: '检查工具',
               prop: 'toolNames',
               minWidth: 120,
               slot: 'toolNames'
             },
             {
-              lbel: '检查人',
+              label: '检查人',
               prop: 'checkUsersIds',
               minWidth: 120,
               slot: 'checkUsersIds'
             },
             {
-              lbel: '检查情况',
+              label: '检查情况',
               prop: 'checkStatus',
               minWidth: 120,
               slot: 'checkStatus'
             },
             {
-              lbel: '描述',
+              label: '描述',
               prop: 'errorMsg',
               minWidth: 120,
               slot: 'errorMsg'
             },
             {
-              lbel: '检查结果',
+              label: '检查结果',
               prop: 'checkResult',
               minWidth: 120,
               slot: 'checkResult'
@@ -784,7 +784,7 @@
           ];
         } else {
           list.push({
-            lbel: '描述',
+            label: '描述',
             prop: 'errorMsg',
             minWidth: 120,
             slot: 'errorMsg'