heyang 1 anno fa
parent
commit
fb551f6eba

+ 18 - 0
src/api/integratedManagement/index.js

@@ -311,6 +311,24 @@ export function laboratorySubRelInfoUpdate(data) {
     data: data
   })
 }
+//实验室-关联配置-详情
+export function laboratorySubRelInfoGetHazardSubRelInfo(query) {
+  return request({
+    url: '/laboratory/subRelInfo/getHazardSubRelInfo',
+    method: 'get',
+    params: query
+  })
+}
+//实验室-关联配置-提交
+export function laboratorySubRelInfoUpdateHazardSubRel(data) {
+  return request({
+    url: '/laboratory/subRelInfo/updateHazardSubRel',
+    method: 'post',
+    data: data
+  })
+}
+
+
 //实验室-详情
 export function laboratorySubRelInfoGetDetailInfo(query) {
   return request({

+ 45 - 43
src/views/hazardManagement/hazard/addLaboratory.vue

@@ -6,51 +6,53 @@
       <p class="page-top-title-out-p" @click="backPage">返回</p>
       <p class="page-top-title-submit-p" @click="previewButton">提交</p>
     </div>
-    <el-form :model="form" ref="form" :rules="rules" label-position="right" label-width="120px" style="margin-top: 46px">
-      <el-form-item label="名称:" prop="chName">
-        <el-input
-          style=width:600px;
-          v-model="form.chName"
-          maxlength="20"
-          placeholder="请输入危险源名称"
-          clearable
-          size="small"
-        />
-      </el-form-item>
-      <el-form-item label="编号:" prop="hazardCode">
-        <el-input
-          style=width:600px;
-          v-model="form.hazardCode"
-          maxlength="10"
-          placeholder="请输入危险源编号"
-          clearable
-          size="small"
-        />
-      </el-form-item>
-      <el-form-item label="大分类:" prop="bigTypeValue">
-        <el-select v-model="form.bigTypeValue" clearable placeholder="请选择大分类" @change="bigClassifyChange()" style="width: 600px">
-          <el-option
-            v-for="dict in bigClassifyOptions"
-            :key="dict.value"
-            :label="dict.label"
-            :value="dict.value"
+    <div class="content-box scrollbar-box">
+      <el-form :model="form" ref="form" :rules="rules" label-position="right" label-width="120px" style="margin-top: 46px">
+        <el-form-item label="名称:" prop="chName">
+          <el-input
+            style=width:600px;
+            v-model="form.chName"
+            maxlength="20"
+            placeholder="请输入危险源名称"
+            clearable
+            size="small"
           />
-        </el-select>
-      </el-form-item>
-      <el-form-item label="小分类:" prop="smallTypeValue">
-        <el-select v-model="form.smallTypeValue" clearable placeholder="请选择大分类"  @change="smallClassifyChange()" style="width: 600px">
-          <el-option
-            v-for="dict in smallClassifyOptions"
-            :key="dict.value"
-            :label="dict.label"
-            :value="dict.value"
+        </el-form-item>
+        <el-form-item label="编号:" prop="hazardCode">
+          <el-input
+            style=width:600px;
+            v-model="form.hazardCode"
+            maxlength="10"
+            placeholder="请输入危险源编号"
+            clearable
+            size="small"
           />
-        </el-select>
-      </el-form-item>
-      <el-form-item label="详情:" prop="content">
-        <UEditor ref="UEditor" :content="form.content" :min-height="192" />
-      </el-form-item>
-    </el-form>
+        </el-form-item>
+        <el-form-item label="大分类:" prop="bigTypeValue">
+          <el-select v-model="form.bigTypeValue" clearable placeholder="请选择大分类" @change="bigClassifyChange()" style="width: 600px">
+            <el-option
+              v-for="dict in bigClassifyOptions"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="小分类:" prop="smallTypeValue">
+          <el-select v-model="form.smallTypeValue" clearable placeholder="请选择大分类"  @change="smallClassifyChange()" style="width: 600px">
+            <el-option
+              v-for="dict in smallClassifyOptions"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="详情:" prop="content">
+          <UEditor ref="UEditor" :content="form.content" :min-height="192" />
+        </el-form-item>
+      </el-form>
+    </div>
     <el-dialog title="预览" class="richTextDialog" v-if="richTextDialogType" :close-on-click-modal="false" :visible.sync="richTextDialogType" append-to-body>
       <div class="button-max-box">
         <el-select v-model="previewKey" placeholder="请选择" style="margin-bottom:20px;">

+ 363 - 357
src/views/integratedManagement/laboratoryManagement/subject/associationConfiguration.vue

@@ -1,225 +1,209 @@
 <!--关联配置-->
 <template>
-  <div class="associationConfiguration scrollbar-box">
-    <el-form v-if="versionField() != 'xiBeiNongLinDaXue'" ref="form" :model="form" label-width="160px" :rules="rules">
-      <div class="title-box">
-        <p class="left-title">检查项信息</p>
-      </div>
-      <div>
-        <el-form-item label="穿戴检查项"  prop="checkIn" class="form-item" v-if="form.checkIn">
-          <el-select v-model="form.checkIn" multiple placeholder="请选择穿戴检查项目" @change="radioChange" style="width:320px;">
-            <el-option
-              v-for="dict in onepcOutcheckIn"
-              :key="dict.dictValue"
-              :label="dict.dictLabel"
-              :value="dict.dictValue"
-            ></el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="穿戴检查可跳过" prop="skipped" class="form-item">
-          <el-radio-group v-model="form.skipped" style="width:260px;" @change="radioChange">
-            <el-radio :label="1" style="width:100px;margin-left:50px;margin-top:4px;">是</el-radio>
-            <el-radio :label="0" style="width:100px;margin-top:4px;">否</el-radio>
-          </el-radio-group>
-        </el-form-item>
-        <el-form-item label="穿戴检查识别上限"  prop="checkCount" class="form-item" v-if="form.skipped == 1 && form.checkIn[0]">
-          <el-input placeholder="请输入内容" oninput="value=value.replace(/[^0-9.]/g,'')" maxlength="2" v-model="form.checkCount" style="width:320px;">
-            <template slot="prepend" style="height:20px;">次</template>
-            <div slot="append" style="display: flex;flex-direction: column;">
-              <p class="el-icon-arrow-up" @click="addNum" style="line-height:18px;width:30px;font-size:14px;text-align: center;border-bottom:1px solid #E0E0E0;cursor: pointer;"></p>
-              <p class="el-icon-arrow-down" @click="reduceNum" style="line-height:19px;width:30px;font-size:14px;text-align: center;cursor: pointer;"></p>
-            </div>
-          </el-input>
-        </el-form-item>
-      </div>
-      <div>
-        <el-form-item label="离开时检查项"  prop="checkOutArr" class="form-item">
-          <el-select v-model="form.checkOut" multiple placeholder="请选择离开检查项"  style="width:320px;">
-            <el-option
-              v-for="dict in onepcOutcheck"
-              :key="dict.dictValue"
-              :label="dict.dictLabel"
-              :value="dict.dictValue"
-            ></el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="签到有效时间"  prop="signTime" class="form-item">
-          <el-input placeholder="请输入内容" oninput="value=value.replace(/[^0-9.]/g,'')" maxlength="2" v-model="form.signTime" style="width:320px;">
-            <template slot="prepend" style="height:20px;">小时</template>
-            <div slot="append" style="display: flex;flex-direction: column;">
-              <p class="el-icon-arrow-up" @click="addNumOne" style="line-height:18px;width:30px;font-size:14px;text-align: center;border-bottom:1px solid #E0E0E0;cursor: pointer;"></p>
-              <p class="el-icon-arrow-down" @click="reduceNumOne" style="line-height:19px;width:30px;font-size:14px;text-align: center;cursor: pointer;"></p>
-            </div>
-          </el-input>
-        </el-form-item>
-      </div>
-      <div class="title-box">
-        <p class="left-title">检查项信息(巡查人员)</p>
-      </div>
-      <div>
-        <el-form-item label="穿戴检查项"  prop="inspectCheckIn" class="form-item" v-if="form.inspectCheckIn">
-          <el-select v-model="form.inspectCheckIn" multiple placeholder="请选择穿戴检查项目" @change="radioChange2" style="width:320px;">
-            <el-option
-              v-for="dict in onepcOutcheckIn"
-              :key="dict.dictValue"
-              :label="dict.dictLabel"
-              :value="dict.dictValue"
-            ></el-option>
-          </el-select>
+  <div class="page-container associationConfiguration">
+    <div class="page-top-title-box">
+      <p class="page-top-title-name-p">关联配置</p>
+      <p class="page-top-title-out-p" @click="backPage">返回</p>
+      <p class="page-top-title-submit-p" @click="submitForm">提交</p>
+    </div>
+    <div class="content-box scrollbar-box">
+      <el-form  ref="form"  :model="form" label-width="160px" :rules="rules">
+        <div class="title-box">
+          <p class="left-title">检查项信息</p>
+        </div>
+        <div>
+          <el-form-item label="穿戴检查项"  prop="checkIn" class="form-item" v-if="form.checkIn">
+            <el-select v-model="form.checkIn" multiple placeholder="请选择穿戴检查项目" @change="radioChange" style="width:320px;">
+              <el-option
+                v-for="dict in onepcOutcheckIn"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="穿戴检查可跳过" prop="skipped" class="form-item">
+            <el-radio-group v-model="form.skipped" style="width:260px;" @change="radioChange">
+              <el-radio :label="1" style="width:70px;margin-left:50px;margin-top:4px;">是</el-radio>
+              <el-radio :label="0" style="width:70px;margin-top:4px;">否</el-radio>
+            </el-radio-group>
+          </el-form-item>
+          <el-form-item label="穿戴检查识别上限"  prop="checkCount" class="form-item" v-if="form.skipped == 1 && form.checkIn[0]">
+            <el-input placeholder="请输入内容" oninput="value=value.replace(/[^0-9.]/g,'')" maxlength="2" v-model="form.checkCount" style="width:320px;">
+              <template slot="prepend" style="height:20px;">次</template>
+              <div slot="append" style="display: flex;flex-direction: column;">
+                <p class="el-icon-arrow-up" @click="addNum" style="line-height:18px;width:30px;font-size:14px;text-align: center;border-bottom:1px solid #E0E0E0;cursor: pointer;"></p>
+                <p class="el-icon-arrow-down" @click="reduceNum" style="line-height:19px;width:30px;font-size:14px;text-align: center;cursor: pointer;"></p>
+              </div>
+            </el-input>
+          </el-form-item>
+        </div>
+        <div>
+          <el-form-item label="离开时检查项"  prop="checkOutArr" class="form-item">
+            <el-select v-model="form.checkOut" multiple placeholder="请选择离开检查项"  style="width:320px;">
+              <el-option
+                v-for="dict in onepcOutcheck"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="签到有效时间"  prop="signTime" class="form-item">
+            <el-input placeholder="请输入内容" oninput="value=value.replace(/[^0-9.]/g,'')" maxlength="2" v-model="form.signTime" style="width:320px;">
+              <template slot="prepend" style="height:20px;">小时</template>
+              <div slot="append" style="display: flex;flex-direction: column;">
+                <p class="el-icon-arrow-up" @click="addNumOne" style="line-height:18px;width:30px;font-size:14px;text-align: center;border-bottom:1px solid #E0E0E0;cursor: pointer;"></p>
+                <p class="el-icon-arrow-down" @click="reduceNumOne" style="line-height:19px;width:30px;font-size:14px;text-align: center;cursor: pointer;"></p>
+              </div>
+            </el-input>
+          </el-form-item>
+        </div>
+        <div class="title-box">
+          <p class="left-title">检查项信息(巡查人员)</p>
+        </div>
+        <div>
+          <el-form-item label="穿戴检查项"  prop="inspectCheckIn" class="form-item" v-if="form.inspectCheckIn">
+            <el-select v-model="form.inspectCheckIn" multiple placeholder="请选择穿戴检查项目" @change="radioChange2" style="width:320px;">
+              <el-option
+                v-for="dict in onepcOutcheckIn"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="穿戴检查可跳过" prop="inspectSkipped" class="form-item">
+            <el-radio-group v-model="form.inspectSkipped" style="width:260px;" @change="radioChange2">
+              <el-radio :label="1" style="width:70px;margin-left:50px;margin-top:4px;">是</el-radio>
+              <el-radio :label="0" style="width:70px;margin-top:4px;">否</el-radio>
+            </el-radio-group>
+          </el-form-item>
+          <el-form-item label="穿戴检查识别上限"  prop="inspectCheckCount" class="form-item" v-if="form.inspectSkipped == 1 && form.inspectCheckIn[0]">
+            <el-input placeholder="请输入内容" oninput="value=value.replace(/[^0-9.]/g,'')" maxlength="2" v-model="form.inspectCheckCount" style="width:320px;">
+              <template slot="prepend" style="height:20px;">次</template>
+              <div slot="append" style="display: flex;flex-direction: column;">
+                <p class="el-icon-arrow-up" @click="addNum" style="line-height:18px;width:30px;font-size:14px;text-align: center;border-bottom:1px solid #E0E0E0;cursor: pointer;"></p>
+                <p class="el-icon-arrow-down" @click="reduceNum" style="line-height:19px;width:30px;font-size:14px;text-align: center;cursor: pointer;"></p>
+              </div>
+            </el-input>
+          </el-form-item>
+        </div>
+        <div>
+          <el-form-item label="签到有效时间"  prop="inspectSignTime" class="form-item">
+            <el-input placeholder="请输入内容" oninput="value=value.replace(/[^0-9.]/g,'')" maxlength="2" v-model="form.inspectSignTime" style="width:320px;">
+              <template slot="prepend" style="height:20px;">小时</template>
+              <div slot="append" style="display: flex;flex-direction: column;">
+                <p class="el-icon-arrow-up" @click="addNumOne" style="line-height:18px;width:30px;font-size:14px;text-align: center;border-bottom:1px solid #E0E0E0;cursor: pointer;"></p>
+                <p class="el-icon-arrow-down" @click="reduceNumOne" style="line-height:19px;width:30px;font-size:14px;text-align: center;cursor: pointer;"></p>
+              </div>
+            </el-input>
+          </el-form-item>
+        </div>
+        <div class="title-box">
+          <p class="left-title">危险源信息</p>
+        </div>
+        <el-form-item label="气瓶存放总量" prop="bottleTotal" class="form-item input-number-none-box-left">
+          <el-input
+            oninput="value=value.replace(/[^0-9.]/g,'')"
+            style="width:320px;"
+            v-model="form.bottleTotal"
+            placeholder="请输入数量"
+            maxLength="3"
+            clearable
+          />
         </el-form-item>
-        <el-form-item label="穿戴检查可跳过" prop="inspectSkipped" class="form-item">
-          <el-radio-group v-model="form.inspectSkipped" style="width:260px;" @change="radioChange2">
-            <el-radio :label="1" style="width:100px;margin-left:50px;margin-top:4px;">是</el-radio>
-            <el-radio :label="0" style="width:100px;margin-top:4px;">否</el-radio>
-          </el-radio-group>
+        <el-form-item label="气瓶单人可存放总量" prop="bottleUserTotal" class="form-item input-number-none-box-left">
+          <el-input
+            oninput="value=value.replace(/[^0-9.]/g,'')"
+            style="width:320px;"
+            v-model="form.bottleUserTotal"
+            placeholder="请输入数量"
+            clearable
+            maxLength="3"
+          />
         </el-form-item>
-        <el-form-item label="穿戴检查识别上限"  prop="inspectCheckCount" class="form-item" v-if="form.inspectSkipped == 1 && form.inspectCheckIn[0]">
-          <el-input placeholder="请输入内容" oninput="value=value.replace(/[^0-9.]/g,'')" maxlength="2" v-model="form.inspectCheckCount" style="width:320px;">
-            <template slot="prepend" style="height:20px;">次</template>
-            <div slot="append" style="display: flex;flex-direction: column;">
-              <p class="el-icon-arrow-up" @click="addNum" style="line-height:18px;width:30px;font-size:14px;text-align: center;border-bottom:1px solid #E0E0E0;cursor: pointer;"></p>
-              <p class="el-icon-arrow-down" @click="reduceNum" style="line-height:19px;width:30px;font-size:14px;text-align: center;cursor: pointer;"></p>
-            </div>
-          </el-input>
-        </el-form-item>
-      </div>
-      <div>
-        <el-form-item label="签到有效时间"  prop="inspectSignTime" class="form-item">
-          <el-input placeholder="请输入内容" oninput="value=value.replace(/[^0-9.]/g,'')" maxlength="2" v-model="form.inspectSignTime" style="width:320px;">
-            <template slot="prepend" style="height:20px;">小时</template>
-            <div slot="append" style="display: flex;flex-direction: column;">
-              <p class="el-icon-arrow-up" @click="addNumOne" style="line-height:18px;width:30px;font-size:14px;text-align: center;border-bottom:1px solid #E0E0E0;cursor: pointer;"></p>
-              <p class="el-icon-arrow-down" @click="reduceNumOne" style="line-height:19px;width:30px;font-size:14px;text-align: center;cursor: pointer;"></p>
-            </div>
-          </el-input>
+        <div>
+          <el-form-item label="危险源"  prop="hazardId" class="form-item">
+            <p class="hazard-add" @click="hazardClick">+配置危险源</p>
+          </el-form-item>
+        </div>
+        <div class="hazard-for-box" v-for="(item,index) in form.hazardSubRelInnerList">
+          <el-form-item label="危险源名称" :prop="'hazardSubRelInnerList.'+ index +'.anotherName'" :rules="rules.anotherName"
+                        class="form-item" label-width="160px">
+            <el-input placeholder="请输入危险源名称" maxlength="20" v-model="item.anotherName"/>
+          </el-form-item>
+          <el-form-item label="类型" :prop="'hazardSubRelInnerList.'+ index +'.anotherCode'" :rules="rules.anotherCode"
+                        class="form-item" label-width="60px">
+            <el-input placeholder="请输入类型" disabled maxlength="10" v-model="item.anotherCode"/>
+          </el-form-item>
+          <el-form-item label="型号" :prop="'hazardSubRelInnerList.'+ index +'.anotherCode'" :rules="rules.anotherCode"
+                        class="form-item" label-width="60px">
+            <el-input placeholder="请输入型号" disabled maxlength="10" v-model="item.anotherCode"/>
+          </el-form-item>
+          <el-form-item label="" class="form-item" label-width="20px">
+            <span class="del-hazard el-icon-error" style="line-height:40px;font-size:24px;" @click="delHazard(index)"></span>
+          </el-form-item>
+          <el-form-item label="" class="form-item" v-if="item.hazardRelId"  label-width="20px">
+            <p class="look-code-p" @click="dialogQrCodeOn(item)">查看二维码</p>
+          </el-form-item>
+        </div>
+      </el-form>
+    </div>
+    <!--新增弹窗-->
+    <el-dialog class="iotClassification-dialog" title='选择危险源' width="682px"
+               append-to-body
+               :visible.sync="dialogVisible"
+               :close-on-click-modal="false" :close-on-press-escape="false">
+      <el-form :model="queryParams" ref="queryParams" :inline="true" label-width="140px">
+        <el-form-item label="" prop="chName" >
+          <el-input
+            v-model="queryParams.chName"
+            placeholder="危险源名称"
+            clearable
+            size="small"
+          />
         </el-form-item>
-      </div>
-      <div class="title-box">
-        <p class="left-title">危险源信息</p>
-      </div>
-      <el-form-item label="气瓶存放总量" prop="bottleTotal" class="form-item input-number-none-box-left">
-        <el-input
-          oninput="value=value.replace(/[^0-9.]/g,'')"
-          style="width:320px;"
-          v-model="form.bottleTotal"
-          placeholder="请输入数量"
-          maxLength="3"
-          clearable
-        />
-      </el-form-item>
-      <el-form-item label="气瓶单人可存放总量" prop="bottleUserTotal" class="form-item input-number-none-box-left">
-        <el-input
-          oninput="value=value.replace(/[^0-9.]/g,'')"
-          style="width:320px;"
-          v-model="form.bottleUserTotal"
-          placeholder="请输入数量"
-          clearable
-          maxLength="3"
+        <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>
+        <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
+      </el-form>
+      <el-table class="table-box"  border :data="dataList"
+                ref="multipleTable"
+                @selection-change="handleSelectionChange" :row-key="getRowKeys">
+        <el-table-column type="selection"  width="55" :reserve-selection="true" align="center"></el-table-column>
+        <el-table-column label="名称" show-overflow-tooltip align="left" prop="chName"/>
+        <el-table-column label="型号" align="left" prop="hazardCode"/>
+        <el-table-column label="类型" align="left" prop="smallTypeName" />
+      </el-table>
+      <div class="selected-num-box" v-show="total>0">
+        <p class="selected-num-p">
+          <i class="el-icon-warning"></i>
+          已选择 {{selectedNum}} 项
+        </p>
+        <pagination :page-sizes="[20, 30, 40, 50]"
+                    :total="total"
+                    :page.sync="queryParams.page"
+                    :limit.sync="queryParams.pageSize"
+                    @pagination="getList"
         />
-      </el-form-item>
-      <div>
-        <el-form-item label="危险源"  prop="hazardId" class="form-item">
-          <el-select placeholder="请选择危险源" v-model="hazardId" style="width:320px;" @change="hazardClick">
-            <el-option
-              v-for="dict in hazardList"
-              :key="dict.id"
-              :label="dict.text"
-              :value="dict.id"
-            ></el-option>
-          </el-select>
-        </el-form-item>
-      </div>
-      <div class="hazard-for-box" v-for="(item,index) in form.hazardRelations">
-        <el-form-item label="危险源名称" :prop="'hazardRelations.'+ index +'.anotherName'" :rules="rules.anotherName"
-                      class="form-item" label-width="160px">
-          <el-input placeholder="请输入危险源名称" maxlength="20" v-model="item.anotherName"/>
-        </el-form-item>
-        <el-form-item label="型号" :prop="'hazardRelations.'+ index +'.anotherCode'" :rules="rules.anotherCode"
-                      class="form-item" label-width="60px">
-          <el-input placeholder="请输入型号" disabled maxlength="10" v-model="item.anotherCode"/>
-        </el-form-item>
-        <el-form-item label="" class="form-item" label-width="20px">
-          <span class="del-hazard el-icon-error" style="line-height:40px;font-size:24px;" @click="delHazard(index)"></span>
-        </el-form-item>
-        <el-form-item label="" class="form-item" v-if="item.xyId">
-          <p class="look-code-p" @click="qrCodeDialogButton(item.xyId,item.anotherName+'-'+item.anotherCode)">查看二维码</p>
-        </el-form-item>
-      </div>
-      <div class="page-bottom-button-box">
-        <p class="page-bottom-button-null-p"></p>
-        <p class="page-bottom-button-cancel-p" @click="backPage">取消</p>
-        <p class="page-bottom-button-submit-p" @click="upData">提交</p>
-        <p class="page-bottom-button-null-p"></p>
       </div>
-    </el-form>
-    <el-form v-if="versionField() == 'xiBeiNongLinDaXue'" ref="form" :model="form" label-width="160px" :rules="rules">
-      <div class="title-box">
-        <p class="left-title">危险源信息</p>
+      <div slot="footer" class="dialog-footer dialog-footer-box">
+        <p class="dialog-footer-button-null"></p>
+        <p class="dialog-footer-button-info" @click="dialogOff()">取消</p>
+        <p class="dialog-footer-button-primary" @click="dialogSubmit">提交</p>
+        <p class="dialog-footer-button-null"></p>
       </div>
-      <el-form-item label="气瓶存放总量" prop="bottleTotal" class="form-item input-number-none-box-left">
-        <el-input
-          oninput="value=value.replace(/[^0-9.]/g,'')"
-          style="width:320px;"
-          v-model="form.bottleTotal"
-          placeholder="请输入数量"
-          maxLength="3"
-          clearable
-        />
-      </el-form-item>
-      <el-form-item label="气瓶单人可存放总量" prop="bottleUserTotal" class="form-item input-number-none-box-left">
-        <el-input
-          oninput="value=value.replace(/[^0-9.]/g,'')"
-          style="width:320px;"
-          v-model="form.bottleUserTotal"
-          placeholder="请输入数量"
-          clearable
-          maxLength="3"
-        />
-      </el-form-item>
-      <div>
-        <el-form-item label="危险源"  prop="hazardId" class="form-item">
-          <el-select placeholder="请选择危险源" v-model="hazardId" style="width:320px;" @change="hazardClick">
-            <el-option
-              v-for="dict in hazardList"
-              :key="dict.id"
-              :label="dict.text"
-              :value="dict.id"
-            ></el-option>
-          </el-select>
-        </el-form-item>
-      </div>
-      <div class="hazard-for-box" v-for="(item,index) in form.hazardRelations">
-        <el-form-item label="危险源名称" :prop="'hazardRelations.'+ index +'.anotherName'" :rules="rules.anotherName"
-                      class="form-item" label-width="160px">
-          <el-input placeholder="请输入危险源名称" maxlength="20" v-model="item.anotherName"/>
-        </el-form-item>
-        <el-form-item label="型号" :prop="'hazardRelations.'+ index +'.anotherCode'" :rules="rules.anotherCode"
-                      class="form-item" label-width="60px">
-          <el-input placeholder="请输入型号" disabled maxlength="10" v-model="item.anotherCode"/>
-        </el-form-item>
-        <el-form-item label="" class="form-item" label-width="20px">
-          <span class="del-hazard el-icon-error" style="line-height:40px;font-size:24px;" @click="delHazard(index)"></span>
-        </el-form-item>
-        <el-form-item label="" class="form-item" v-if="item.xyId">
-          <p class="look-code-p" @click="qrCodeDialogButton(item.xyId,item.anotherName+'-'+item.anotherCode)">查看二维码</p>
-        </el-form-item>
-      </div>
-      <div class="page-bottom-button-box">
-        <p class="page-bottom-button-null-p"></p>
-        <p class="page-bottom-button-cancel-p" @click="backPage">取消</p>
-        <p class="page-bottom-button-submit-p" @click="upData">提交</p>
-        <p class="page-bottom-button-null-p"></p>
-      </div>
-    </el-form>
+    </el-dialog>
     <qr-code-dialog ref="qrCodeDialog" :qrCodeDialogData="qrCodeDialogData"></qr-code-dialog>
   </div>
 </template>
 
 <script>
-  import { listHazard } from "@/apiDemo/permissionRequired";
-  import { updateSubjectEditJoinHazard } from "@/apiDemo/laboratory/subject";
   import { getBottleInfo} from "@/apiDemo/gasManage3_0/gasManage";
   import qrCodeDialog from "@/components/qrCodeDialog/index.vue"
+  import { laboratorySubRelInfoUpdateHazardSubRel } from '@/api/integratedManagement'
+  import { laboratoryHazardList } from '@/api/hazardManagement'
+  import { getDicts } from '@/api/commonality/noPermission'
   export default {
     name: "associationConfiguration",
     props:{
@@ -232,8 +216,20 @@
       return {
         onepcOutcheckIn:[],
         onepcOutcheck:[],
-        hazardList:[],
         form:{},
+        //二维码组件参数
+        qrCodeDialogData:{},
+        queryParams:{
+          chName:'',
+        },
+        dialogVisible:false,
+        dataList:[],
+        total:0,
+        // 选中数组
+        selectedNum:0,
+        ids:[],
+        selectedData:[],
+        multiple:true,
         rules:{
           anotherName:[
             {required: true, message: '请输入危险源名称', trigger: 'blur'},
@@ -244,91 +240,146 @@
             { required: true, message: "请输入型号", validator: this.spaceJudgment, trigger: "blur" }
           ],
         },
-        hazardId:"",
-        //二维码组件参数
-        qrCodeDialogData:{},
       }
     },
     created() {
+      this.getDicts();
+      this.getList();
     },
     mounted(){
       let self = this;
       //获取气瓶存放总量
-      this.getBottleInfo();
-      this.getDicts("sub_check_in").then(response => {
-        this.onepcOutcheckIn = response.data;
-      });
-      this.getDicts("lab_onepc_outcheck").then(response => {
-        this.onepcOutcheck = response.data;
-      });
-      this.listHazard();
-      if(this.subjectData.id){
-        this.form.id = this.subjectData.id;
-      }
-      if(this.subjectData.signTime) {
-        this.$set(this.form,'signTime',this.subjectData.signTime);
-      }
-      /** 检查项信息*/
-      if(this.subjectData.checkIn){
-        let list = this.subjectData.checkIn.split(",");
-        this.$set(this.form,'checkIn',list);
-        // this.form.checkIn = this.subjectData.checkIn.split(",");
-      }else{
-        this.$set(this.form,'checkIn',[]);
-      }
-      if(this.subjectData.checkOut){
-        let list = this.subjectData.checkOut.split(",");
-        this.$set(this.form,'checkOut',list);
-        // this.form.checkOut = this.subjectData.checkOut.split(",");
-      }
-      if(this.subjectData.skipped && this.subjectData.skipped!=null){
-        this.$set(this.form,'skipped',this.subjectData.skipped)
-      }else{
-        this.$set(this.form,'skipped',0)
-      }
-      if(this.subjectData.checkCount){
-        this.$set(this.form,'checkCount',this.subjectData.checkCount)
-      }else{
-        this.$set(this.form,'checkCount',0)
-      }
-      /** 检查项信息-巡查人员*/
+      //this.getBottleInfo();
+      //this.listHazard();
+      //编辑
+      if(this.subjectData){
+        this.form=this.subjectData
+        /** 检查项信息*/
+        if(this.subjectData.checkIn){
+          let list = this.subjectData.checkIn.split(",");
+          this.$set(this.form,'checkIn',list);
+        }else{
+          this.$set(this.form,'checkIn',[]);
+        }
+        if(this.subjectData.checkOut){
+          let list = this.subjectData.checkOut.split(",");
+          this.$set(this.form,'checkOut',list);
+        }
+        if(this.subjectData.skipped && this.subjectData.skipped!=null){
+          this.$set(this.form,'skipped',this.subjectData.skipped)
+        }else{
+          this.$set(this.form,'skipped',0)
+        }
+        if(this.subjectData.checkCount){
+          this.$set(this.form,'checkCount',this.subjectData.checkCount)
+        }else{
+          this.$set(this.form,'checkCount',0)
+        }
+        /** 检查项信息-巡查人员*/
+        if(this.subjectData.inspectCheckIn){
+          let list = this.subjectData.inspectCheckIn.split(",");
+          this.$set(this.form,'inspectCheckIn',list);
+        }else{
+          this.$set(this.form,'inspectCheckIn',[]);
+        }
+        if(this.subjectData.inspectSkipped && this.subjectData.inspectSkipped!=null){
+          this.$set(this.form,'inspectSkipped',this.subjectData.inspectSkipped)
+        }else{
+          this.$set(this.form,'inspectSkipped',0)
+        }
+        if(this.subjectData.inspectSignTime) {
+          this.$set(this.form,'inspectSignTime',this.subjectData.inspectSignTime);
+        }
+        if(this.subjectData.inspectCheckCount){
+          this.$set(this.form,'inspectCheckCount',this.subjectData.inspectCheckCount)
+        }else{
+          this.$set(this.form,'inspectCheckCount',0)
+        }
 
-      if(this.subjectData.inspectCheckIn){
-        let list = this.subjectData.inspectCheckIn.split(",");
-        this.$set(this.form,'inspectCheckIn',list);
       }else{
-        this.$set(this.form,'inspectCheckIn',[]);
-      }
-      if(this.subjectData.inspectSkipped && this.subjectData.inspectSkipped!=null){
-        this.$set(this.form,'inspectSkipped',this.subjectData.inspectSkipped)
-      }else{
-        this.$set(this.form,'inspectSkipped',0)
-      }
 
-      if(this.subjectData.inspectSignTime) {
-        this.$set(this.form,'inspectSignTime',this.subjectData.inspectSignTime);
       }
-
-      if(this.subjectData.inspectCheckCount){
-        this.$set(this.form,'inspectCheckCount',this.subjectData.inspectCheckCount)
-      }else{
-        this.$set(this.form,'inspectCheckCount',0)
-      }
-      if(this.subjectData.labHazardList){
-        let list = [];
-        for(let i=0;i<self.subjectData.labHazardList.length;i++){
-          list.push({
-            hazardId:self.subjectData.labHazardList[i].id,
-            xyId:self.subjectData.labHazardList[i].xyId,
-            anotherName:self.subjectData.labHazardList[i].anotherName,
-            anotherCode:self.subjectData.labHazardList[i].anotherCode
-          })
-        }
-        this.$set(this.form,'hazardRelations',list)
-      }
-      this.radioChange();
     },
     methods:{
+      //展示二维码
+      dialogQrCodeOn(row){
+        this.$set(this,'qrCodeDialogData',{
+          download:true,
+          type:'1',                                                     //二维码类型 用于区分二维码功能类型
+          parameter:row.hazardRelId,                                             //二维码参数
+          name:row.anotherName,                                                //二维码名称用于下载时命名
+          codeName:row.anotherName,                                            //二维码图片下名称展示(非必传)
+        });
+        this.$refs['qrCodeDialog'].initialize();
+      },
+      //穿戴检查项和离开检查项
+      getDicts(){
+        getDicts('sub_check_in').then(response => {
+          this.$set(this,'onepcOutcheckIn',response.data);
+        });
+        getDicts('lab_onepc_outcheck').then(response => {
+          this.$set(this,'onepcOutcheck',response.data);
+        });
+      },
+      //危险源选中事件
+      hazardClick(e){
+        this.dialogVisible=true;
+      },
+      //弹窗关闭
+      dialogOff(){
+        this.dialogVisible=false;
+      },
+      //弹框确认按钮
+      dialogSubmit(){
+        let self = this;
+        let list=[];
+        for(let i=0;i<self.selectedData.length;i++){
+         list.push(
+           {
+             hazardId:self.selectedData[i].hazardId,
+             anotherName:self.selectedData[i].chName,
+             anotherCode:self.selectedData[i].hazardCode,
+             smallTypeName:self.selectedData[i].smallTypeName,
+             smallTypeValue:self.selectedData[i].smallTypeValue,
+           }
+         )
+        }
+        this.$set(this.form,'hazardSubRelInnerList',list);
+        this.dialogVisible=false;
+      },
+      /** 搜索按钮操作 */
+      handleQuery() {
+        this.queryParams.page = 1;
+        this.getList();
+      },
+      /** 重置按钮操作 */
+      resetQuery() {
+        this.$set(this,'queryParams',{
+          page: 1,
+          pageSize:20,
+          chName:'',
+        });
+        this.handleQuery();
+      },
+      /** 查询危险源列表 */
+      getList() {
+        this.$set(this,'loading',true);
+        laboratoryHazardList(this.queryParams).then(response => {
+          this.$set(this,'loading',false);
+          this.$set(this,'dataList',response.data.records);
+          this.$set(this,'total',response.data.total);
+        });
+      },
+      getRowKeys(row) {
+        return row.hazardId;   //指定row-key的一个标识
+      },
+      //多选框选中数据
+      handleSelectionChange(selection) {
+        this.selectedNum = selection.length;
+        this.selectedData = selection;
+        this.ids = selection.map(item => item.id)
+        this.multiple = !selection.length
+      },
       //二维码组件开关
       qrCodeDialogButton(id,name){
         this.$set(this,'qrCodeDialogData',{
@@ -342,23 +393,10 @@
       },
       //删除选中危险源
       delHazard(index){
-        this.form.hazardRelations.splice(index, 1);
-        this.$forceUpdate();
-      },
-      //危险源选中事件
-      hazardClick(e){
-        let self = this;
-        for(let i=0;i<self.hazardList.length;i++){
-          if(e == self.hazardList[i].id){
-            this.form.hazardRelations.push({
-              hazardId:self.hazardList[i].id,
-              anotherName:self.hazardList[i].anotherName,
-              anotherCode:self.hazardList[i].anotherCode
-            });
-          }
-        }
+        this.form.hazardSubRelInnerList.splice(index, 1);
         this.$forceUpdate();
       },
+      //穿戴检查可跳过
       radioChange(){
         if(this.form.skipped == 0){
           let obj = {
@@ -380,17 +418,6 @@
             this.$refs['form'].clearValidate();
           }
         }
-        // if(e == 1){
-        //   this.$set(this,'rules',{});
-        //   this.$refs['form'].clearValidate();
-        // }else if(e == 0){
-        //   let obj = {
-        //     checkIn:[
-        //       {required: true, message: '请选择穿戴检查项目', trigger: 'blur'}
-        //     ]
-        //   }
-        //   this.$set(this,'rules',obj);
-        // }
       },
       /**巡检人员  */
       radioChange2(){
@@ -426,13 +453,13 @@
         }
       },
       addNumOne(){
-        if(this.form.signTime<99){
-          this.form.signTime++
+        if(this.form.inspectSignTime<99){
+          this.form.inspectSignTime++
         }
       },
       reduceNumOne(){
-        if(this.form.signTime>2){
-          this.form.signTime--
+        if(this.form.inspectSignTime>2){
+          this.form.inspectSignTime--
         }
       },
       //获取气瓶存放总量
@@ -443,24 +470,12 @@
             if(res.bottleTotal && res.bottleUserTotal){
               this.$set(this.form,'bottleUserTotal',res.bottleUserTotal);
               this.$set(this.form,'bottleTotal',res.bottleTotal);
-              // this.form.bottleUserTotal=res.bottleUserTotal;
-              // this.form.bottleTotal=res.bottleTotal;
             }
-
           }
-
         })
       },
-      //获取危险源列表
-      listHazard(){
-        listHazard({}).then(response=>{
-          for(let i=0;i<response.data.length;i++){
-            response.data[i].text = response.data[i].anotherName+'-'+response.data[i].anotherCode
-          }
-          this.$set(this,'hazardList',response.data);
-        })
-      },
-      upData(){
+      //提交
+      submitForm(){
         let self = this;
         this.$refs["form"].validate(valid => {
           if (valid) {
@@ -472,14 +487,14 @@
               this.msgError('穿戴检查识别上限不能小于2')
               return
             }
-            for(let i=0;i<self.form.hazardRelations.length;i++){
+            for(let i=0;i<self.form.hazardSubRelInnerList.length;i++){
               let num = 0;
-              for(let o=0;o<self.form.hazardRelations.length;o++){
-                if(self.form.hazardRelations[i].anotherName == self.form.hazardRelations[o].anotherName){
+              for(let o=0;o<self.form.hazardSubRelInnerList.length;o++){
+                if(self.form.hazardSubRelInnerList[i].anotherName == self.form.hazardSubRelInnerList[o].anotherName){
                   num++
                 }
                 if(num > 1){
-                  this.msgError('危险源名称重复:'+self.form.hazardRelations[i].anotherName);
+                  this.msgError('危险源名称重复:'+self.form.hazardSubRelInnerList[i].anotherName);
                   return
                 }
               }
@@ -489,17 +504,19 @@
               cancelButtonText: "取消",
               type: "warning"
             }).then(function() {
-              self.updateSubjectEditJoinHazard();
+              self.laboratorySubRelInfoUpdateHazardSubRel();
             }).then(() => {}).catch(() => {});
           }
         })
       },
-      updateSubjectEditJoinHazard(){
+      laboratorySubRelInfoUpdateHazardSubRel(){
         let self = this;
         let obj = {
           id:self.form.id,
           skipped:self.form.skipped,
           inspectSkipped:self.form.inspectSkipped,
+          infoId:self.form.infoId,
+          subId:self.form.subId,
         }
         if(self.form.skipped == 1 && self.form.checkIn[0]){
           obj.checkCount = self.form.checkCount
@@ -527,11 +544,8 @@
         }else{
           obj.inspectSignTime=0;
         }
-
-
-
-        if (self.form.hazardRelations[0]){
-          obj.hazardRelations = self.form.hazardRelations
+        if (self.form.hazardSubRelInnerList[0]){
+          obj.hazardSubRelInnerList = self.form.hazardSubRelInnerList
         }
         if(self.form.bottleUserTotal) {
           obj.bottleUserTotal = self.form.bottleUserTotal;
@@ -539,18 +553,7 @@
         if(self.form.bottleTotal) {
           obj.bottleTotal = self.form.bottleTotal;
         }
-        // if(self.form.hazardRelations) {
-        //   let list = self.form.hazardRelations;
-        //   let newList = [];
-        //   for(let i=0;i<list.length;i++){
-        //     let newObj = {
-        //       hazardId:list[i],
-        //     };
-        //     newList.push(newObj);
-        //   }
-        //   obj.hazardRelations = newList;
-        // }
-        updateSubjectEditJoinHazard(obj).then(response => {
+        laboratorySubRelInfoUpdateHazardSubRel(obj).then(response => {
           this.msgSuccess("修改成功");
           this.$parent.clickPage(1);
         });
@@ -571,6 +574,7 @@
     border-radius:10px!important;
     margin:5px 20px 20px 10px!important;
     box-shadow: 0 0 8px 1px rgba(0, 0, 0, 0.1) !important;
+    overflow-y: auto;
     .title-box{
       display: flex;
       margin:0 20px 30px;
@@ -605,16 +609,18 @@
         color:#FF6666;
       }
     }
-    .bottom-button-box{
-      display: flex;
-      width:400px;
-      margin:10px auto 40px;
-      .null-p{
-        flex:1;
-      }
-      .left-button{
-        margin-right:20px;
-      }
+
+    .hazard-add{
+      width: 250px;
+      height: 40px;
+      border-radius: 4px 4px 4px 4px;
+      border: 1px dashed #0183FA;
+      font-weight: 400;
+      font-size: 14px;
+      color: #0183FA;
+      text-align: center;
+      line-height: 40px;
+      cursor: pointer;
     }
   }
 </style>

+ 16 - 7
src/views/integratedManagement/laboratoryManagement/subject/index.vue

@@ -403,22 +403,24 @@ import {
   startUrl,
   queryHardByTypeList, subjectTriggerModes,
 } from '@/apiDemo/laboratory/subject'
-import { listData} from "@/apiDemo/system/dict/data";
-import { listDepartments } from "@/apiDemo/system/dept";
 import addSubject from "./addSubject.vue";
 import deviceList from "./deviceList.vue";
 import admissionConfiguration from "./admissionConfiguration.vue";
 import associationConfiguration from "./associationConfiguration.vue";
 import infoPage from "./infoPage.vue";
 import { getHxpAlarmRecordNoAuthList,getEnablelist} from "@/apiDemo/medicUniversity-3_1/index";
-import { listClassifiedAll } from "@/apiDemo/laboratory/classified";
-import { listClasstypeAll } from "@/apiDemo/laboratory/classtype";
 import { getToken } from "@/utils/auth";
 import store from '@/store'
 
 /********************** V3 **********************/
 import { getDeptDropList,laboratoryClassTypeGetList,laboratoryClassLevelGetList } from "@/api/commonality/permission";
-import { laboratorySubRelInfoList,laboratorySubRelInfoGetDetailInfo,laboratorySubRelInfoGetDetailDelete } from "@/api/integratedManagement/index";
+import {
+  laboratorySubRelInfoList,
+  laboratorySubRelInfoGetDetailInfo,
+  laboratorySubRelInfoGetDetailDelete,
+  laboratorySubRelInfoGetHazardSubRelInfo
+} from '@/api/integratedManagement/index'
+import { chemicalCabinetGetDoorList } from '@/api/chemicalManage'
 
 export default {
   filters:{
@@ -710,8 +712,15 @@ export default {
           this.pageType = 4;
           this.$set(this,'subjectData',row)
         }else if(type == 6){
-          this.pageType = 5;
-          this.$set(this,'subjectData',row)
+          //关联配置-详情
+          laboratorySubRelInfoGetHazardSubRelInfo({infoId:row.infoId}).then(response => {
+            this.$set(this,'subjectData',response.data);
+            this.pageType = 5;
+          });
+
+
+
+
         }else if(type == 7){
           this.subjectInfoTwo(row);
           // this.$set(this,'subjectData',row)