forked from integrated_whb/integrated_whb_vue
				
			Merge remote-tracking branch 'origin/dev' into dev
						commit
						f96eb0701c
					
				|  | @ -88,7 +88,7 @@ | ||||||
|               </tr> |               </tr> | ||||||
|               <tr> |               <tr> | ||||||
|                 <td class="title">检查照片</td> |                 <td class="title">检查照片</td> | ||||||
|                 <td colspan="3"> |                 <td colspan="1"> | ||||||
|                   <div> |                   <div> | ||||||
|                     <template |                     <template | ||||||
|                       v-for="(item3, index3) in item1.IMG_PATH.split(',')" |                       v-for="(item3, index3) in item1.IMG_PATH.split(',')" | ||||||
|  | @ -105,7 +105,25 @@ | ||||||
|                     </template> |                     </template> | ||||||
|                   </div> |                   </div> | ||||||
|                 </td> |                 </td> | ||||||
|  |                 <td v-if="item.CHECKTYPE_NAME === '出车前'" class="title"> | ||||||
|  |                   是否合格 | ||||||
|  |                 </td> | ||||||
|  |                 <td v-if="item.CHECKTYPE_NAME === '出车前'" colspan="3"> | ||||||
|  |                   <el-tag v-if="item1.pd2Children[0].STATUS === '0'" | ||||||
|  |                     >合格</el-tag | ||||||
|  |                   > | ||||||
|  |                   <el-tag v-else>不合格</el-tag> | ||||||
|  |                 </td> | ||||||
|               </tr> |               </tr> | ||||||
|  |               <!--              <tr v-if="item.CHECKTYPE_NAME === '出车前'">--> | ||||||
|  |               <!--                <td class="title">是否合格</td>--> | ||||||
|  |               <!--                <td colspan="7">--> | ||||||
|  |               <!--                  <el-tag v-if="item1.pd2Children[0].STATUS === '0'"--> | ||||||
|  |               <!--                    >合格</el-tag--> | ||||||
|  |               <!--                  >--> | ||||||
|  |               <!--                  <el-tag v-else>不合格</el-tag>--> | ||||||
|  |               <!--                </td>--> | ||||||
|  |               <!--              </tr>--> | ||||||
|             </table> |             </table> | ||||||
|           </td> |           </td> | ||||||
|         </tr> |         </tr> | ||||||
|  | @ -128,6 +146,7 @@ const data = reactive({ | ||||||
| }); | }); | ||||||
| const fnGetData = async () => { | const fnGetData = async () => { | ||||||
|   const resData = await getSafetyDrivingLogView({ WAYBILLREGISTRATION_ID }); |   const resData = await getSafetyDrivingLogView({ WAYBILLREGISTRATION_ID }); | ||||||
|  |   console.log(resData, "11111111111"); | ||||||
|   data.info = resData.pd; |   data.info = resData.pd; | ||||||
|   data.commitmentList = resData.commitmentList; |   data.commitmentList = resData.commitmentList; | ||||||
| }; | }; | ||||||
|  |  | ||||||
|  | @ -74,32 +74,51 @@ const currentLatitude = ref(""); | ||||||
| const fnMapInit = async () => { | const fnMapInit = async () => { | ||||||
|   loading.value = true; |   loading.value = true; | ||||||
|   await nextTick(); |   await nextTick(); | ||||||
|  | 
 | ||||||
|  |   // 定义默认的经纬度 | ||||||
|  |   const defaultLongitude = "116.3972282409668"; | ||||||
|  |   const defaultLatitude = "39.90960456049752"; | ||||||
|  | 
 | ||||||
|  |   // 创建地图实例 | ||||||
|   mapInstance = new window.BMapGL.Map("map_container"); |   mapInstance = new window.BMapGL.Map("map_container"); | ||||||
|   mapInstance.centerAndZoom( | 
 | ||||||
|     new window.BMapGL.Point( |   // 设置地图的中心点为传入的props值或者默认值 | ||||||
|       props.longitude || "116.3972282409668", |   const centerPoint = new window.BMapGL.Point( | ||||||
|       props.latitude || "39.90960456049752" |     props.longitude || defaultLongitude, | ||||||
|     ) |     props.latitude || defaultLatitude | ||||||
|   ); |   ); | ||||||
|  | 
 | ||||||
|  |   // 初始化地图的中心点和缩放级别 | ||||||
|  |   mapInstance.centerAndZoom(centerPoint, 15); // 你可以根据需要设置缩放级别 | ||||||
|  | 
 | ||||||
|  |   // 其他地图初始化设置 | ||||||
|   mapInstance.enableScrollWheelZoom(true); |   mapInstance.enableScrollWheelZoom(true); | ||||||
|   mapInstance.setMapStyleV2({ |   mapInstance.setMapStyleV2({ | ||||||
|     styleId: "6f501abeb2a0cc0d961d110b9407b127", |     styleId: "6f501abeb2a0cc0d961d110b9407b127", | ||||||
|   }); |   }); | ||||||
|  | 
 | ||||||
|  |   // 添加默认的标记 | ||||||
|  |   const marker = new window.BMapGL.Marker(centerPoint); | ||||||
|  |   mapInstance.addOverlay(marker); | ||||||
|  |   currentLongitude.value = centerPoint.lng; | ||||||
|  |   currentLatitude.value = centerPoint.lat; | ||||||
|  | 
 | ||||||
|   loading.value = false; |   loading.value = false; | ||||||
|   if (props.longitude && props.latitude) { | 
 | ||||||
|     const point = new window.BMapGL.Point(props.longitude, props.latitude); |   // 添加地图点击事件监听器 | ||||||
|     const marker = new window.BMapGL.Marker(point); |  | ||||||
|     mapInstance.addOverlay(marker); |  | ||||||
|   } |  | ||||||
|   mapInstance.addEventListener("click", function (event) { |   mapInstance.addEventListener("click", function (event) { | ||||||
|     mapInstance.clearOverlays(); |     mapInstance.clearOverlays(); | ||||||
|     const point = new window.BMapGL.Point(event.latlng.lng, event.latlng.lat); |     const clickPoint = new window.BMapGL.Point( | ||||||
|     const marker = new window.BMapGL.Marker(point); |       event.latlng.lng, | ||||||
|     mapInstance.addOverlay(marker); |       event.latlng.lat | ||||||
|  |     ); | ||||||
|  |     const clickMarker = new window.BMapGL.Marker(clickPoint); | ||||||
|  |     mapInstance.addOverlay(clickMarker); | ||||||
|     currentLatitude.value = event.latlng.lat; |     currentLatitude.value = event.latlng.lat; | ||||||
|     currentLongitude.value = event.latlng.lng; |     currentLongitude.value = event.latlng.lng; | ||||||
|   }); |   }); | ||||||
| }; | }; | ||||||
|  | 
 | ||||||
| const searchLocation = () => { | const searchLocation = () => { | ||||||
|   if (searchKeyword.value.trim() === "") { |   if (searchKeyword.value.trim() === "") { | ||||||
|     alert("请输入搜索关键字"); |     alert("请输入搜索关键字"); | ||||||
|  |  | ||||||
|  | @ -21,7 +21,7 @@ | ||||||
|         label="经营企业" |         label="经营企业" | ||||||
|         prop="OPERATINGCOMPANY" |         prop="OPERATINGCOMPANY" | ||||||
|       > |       > | ||||||
|         <span>{{ operatingCompany }}</span> |         <span>{{ form.OPERATINGCOMPANY }}</span> | ||||||
|       </el-form-item> |       </el-form-item> | ||||||
|       <el-form-item label="会议附件" prop="file"> |       <el-form-item label="会议附件" prop="file"> | ||||||
|         <layout-upload |         <layout-upload | ||||||
|  | @ -30,6 +30,7 @@ | ||||||
|           :limit="9" |           :limit="9" | ||||||
|           :size="100" |           :size="100" | ||||||
|         /> |         /> | ||||||
|  |         <!--        <span>{{ form.ATTACHMENT_NAME }}</span>--> | ||||||
|       </el-form-item> |       </el-form-item> | ||||||
|       <el-form-item label="到期时间" prop="EXPIRYDATE"> |       <el-form-item label="到期时间" prop="EXPIRYDATE"> | ||||||
|         <el-date-picker |         <el-date-picker | ||||||
|  | @ -49,14 +50,13 @@ | ||||||
| </template> | </template> | ||||||
| 
 | 
 | ||||||
| <script setup> | <script setup> | ||||||
| import { onMounted, ref, toRaw } from "vue"; | import { ref, toRaw } from "vue"; | ||||||
| import { useVModels } from "@vueuse/core"; | import { useVModels } from "@vueuse/core"; | ||||||
| import { ElMessage } from "element-plus"; | import { ElMessage } from "element-plus"; | ||||||
| import LayoutUpload from "@/components/upload/index.vue"; | import LayoutUpload from "@/components/upload/index.vue"; | ||||||
| import { | import { | ||||||
|   addManagementAgreementView, |   addManagementAgreementView, | ||||||
|   editManagementAgreementView, |   editManagementAgreementView, | ||||||
|   getManagementAgreementList, |  | ||||||
| } from "@/request/management_agreement.js"; | } from "@/request/management_agreement.js"; | ||||||
| 
 | 
 | ||||||
| const props = defineProps({ | const props = defineProps({ | ||||||
|  | @ -98,15 +98,6 @@ const rules = { | ||||||
|   ], |   ], | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| const operatingCompany = ref(""); |  | ||||||
| const operationType = ref(""); |  | ||||||
| onMounted(async () => { |  | ||||||
|   const resData = await getManagementAgreementList(); |  | ||||||
|   if (resData && resData.varList && resData.varList.length > 0) { |  | ||||||
|     operatingCompany.value = resData.varList[0].CORP_NAME; |  | ||||||
|     operationType.value = resData.varList[0].OPERATIONTYPE; |  | ||||||
|   } |  | ||||||
| }); |  | ||||||
| const formRef = ref(null); | const formRef = ref(null); | ||||||
| const fnClose = () => { | const fnClose = () => { | ||||||
|   formRef.value.resetFields(); |   formRef.value.resetFields(); | ||||||
|  |  | ||||||
|  | @ -150,17 +150,29 @@ const data = reactive({ | ||||||
|     info: {}, |     info: {}, | ||||||
|   }, |   }, | ||||||
| }); | }); | ||||||
|  | 
 | ||||||
| const fnAddOrEdit = async (MANAGEMENTAGREEMENT_ID = "", type = "add") => { | const fnAddOrEdit = async (MANAGEMENTAGREEMENT_ID = "", type = "add") => { | ||||||
|   data.addOrEditDialog.visible = true; |   data.addOrEditDialog.visible = true; | ||||||
|   data.addOrEditDialog.type = type; |   data.addOrEditDialog.type = type; | ||||||
|   if (type === "edit" && MANAGEMENTAGREEMENT_ID) { |   if (type === "edit" && MANAGEMENTAGREEMENT_ID) { | ||||||
|     data.addOrEditDialog.form.MANAGEMENTAGREEMENT_ID = MANAGEMENTAGREEMENT_ID; |     const resData = await infoManagementAgreementView({ | ||||||
|  |       MANAGEMENTAGREEMENT_ID, | ||||||
|  |     }); | ||||||
|  |     if (resData && resData.result === "success") { | ||||||
|  |       const detail = resData.pd; | ||||||
|  |       const attachmentName = detail.ATTACHMENT_ROUTE.split("/").pop(); | ||||||
|  |       data.addOrEditDialog.form = { | ||||||
|  |         ...detail, | ||||||
|  |         OPERATINGCOMPANY: detail.CORP_NAME, | ||||||
|  |         ATTACHMENT_NAME: attachmentName, | ||||||
|  |       }; | ||||||
|  |     } | ||||||
|   } else { |   } else { | ||||||
|     data.addOrEditDialog.form = {}; |     data.addOrEditDialog.form = {}; // 新增时清空表单 | ||||||
|   } |   } | ||||||
| 
 |  | ||||||
|   await nextTick(); |   await nextTick(); | ||||||
| }; | }; | ||||||
|  | 
 | ||||||
| // 删除事件 | // 删除事件 | ||||||
| const deleteItem = async (value) => { | const deleteItem = async (value) => { | ||||||
|   await ElMessageBox.confirm(`确定要删除吗?`, { |   await ElMessageBox.confirm(`确定要删除吗?`, { | ||||||
|  |  | ||||||
|  | @ -27,17 +27,17 @@ | ||||||
|           :limit="99" |           :limit="99" | ||||||
|         /> |         /> | ||||||
|       </el-form-item> |       </el-form-item> | ||||||
|       <el-form-item label="电子围栏" prop="ELECTRONIC_FENCE_NAME"> |       <!--      <el-form-item label="电子围栏" prop="ELECTRONIC_FENCE_NAME">--> | ||||||
|         <div style="flex: 1; display: flex"> |       <!--        <div style="flex: 1; display: flex">--> | ||||||
|           <el-input v-model="form.ELECTRONIC_FENCE_NAME" disabled /> |       <!--          <el-input v-model="form.ELECTRONIC_FENCE_NAME" disabled />--> | ||||||
|           <el-button type="primary" class="ml-10" @click="data.drawer = true"> |       <!--          <el-button type="primary" class="ml-10" @click="data.drawer = true">--> | ||||||
|             添加 |       <!--            添加--> | ||||||
|           </el-button> |       <!--          </el-button>--> | ||||||
|           <el-button type="danger" class="ml-10" @click="fnRemoveRegName"> |       <!--          <el-button type="danger" class="ml-10" @click="fnRemoveRegName">--> | ||||||
|             移除 |       <!--            移除--> | ||||||
|           </el-button> |       <!--          </el-button>--> | ||||||
|         </div> |       <!--        </div>--> | ||||||
|       </el-form-item> |       <!--      </el-form-item>--> | ||||||
|     </el-form> |     </el-form> | ||||||
|     <template #footer> |     <template #footer> | ||||||
|       <el-button @click="fnClose">取消</el-button> |       <el-button @click="fnClose">取消</el-button> | ||||||
|  | @ -113,14 +113,14 @@ const fnClose = () => { | ||||||
|   visible.value = false; |   visible.value = false; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| const fnRemoveRegName = debounce( | // const fnRemoveRegName = debounce( | ||||||
|   1000, | //   1000, | ||||||
|   async () => { | //   async () => { | ||||||
|     form.value.ELECTRONIC_FENCE_NAME = ""; | //     form.value.ELECTRONIC_FENCE_NAME = ""; | ||||||
|     form.value.ELECTRONIC_FENCE_ID = ""; | //     form.value.ELECTRONIC_FENCE_ID = ""; | ||||||
|   }, | //   }, | ||||||
|   { atBegin: true } | //   { atBegin: true } | ||||||
| ); | // ); | ||||||
| 
 | 
 | ||||||
| const fnSubmit = debounce( | const fnSubmit = debounce( | ||||||
|   1000, |   1000, | ||||||
|  |  | ||||||
|  | @ -74,9 +74,9 @@ | ||||||
|             /> |             /> | ||||||
|           </el-form-item> |           </el-form-item> | ||||||
|         </el-col> |         </el-col> | ||||||
|         <el-col :span="8"> |         <el-col :span="24"> | ||||||
|           <el-form-item label="人员选择" prop="PERSON"> |           <el-form-item label="人员选择" prop="PERSON"> | ||||||
|             <div class="flexBox"> |             <div style="flex: 1; display: flex"> | ||||||
|               <el-input |               <el-input | ||||||
|                 v-model="data.form.PERSON" |                 v-model="data.form.PERSON" | ||||||
|                 type="textarea" |                 type="textarea" | ||||||
|  | @ -84,7 +84,7 @@ | ||||||
|                 disabled |                 disabled | ||||||
|               ></el-input> |               ></el-input> | ||||||
|               <el-button |               <el-button | ||||||
|                 class="addBtn" |                 class="ml-10" | ||||||
|                 type="primary" |                 type="primary" | ||||||
|                 @click="data.SelectPersonDialogVisible = true" |                 @click="data.SelectPersonDialogVisible = true" | ||||||
|               > |               > | ||||||
|  | @ -167,6 +167,13 @@ const rules = { | ||||||
|   RECORDER: [{ required: true, message: "请输入记录人", trigger: "blur" }], |   RECORDER: [{ required: true, message: "请输入记录人", trigger: "blur" }], | ||||||
|   MEETING_CONTENT: [ |   MEETING_CONTENT: [ | ||||||
|     { required: true, message: "请输入会议记要", trigger: "blur" }, |     { required: true, message: "请输入会议记要", trigger: "blur" }, | ||||||
|  |     { | ||||||
|  |       validator: (rule, value, callback) => { | ||||||
|  |         if (value === "<p><br></p>") callback(new Error("请输入会议记要")); | ||||||
|  |         else callback(); | ||||||
|  |       }, | ||||||
|  |       trigger: "blur", | ||||||
|  |     }, | ||||||
|   ], |   ], | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -43,7 +43,7 @@ | ||||||
|       ref="tableRef" |       ref="tableRef" | ||||||
|       v-model:pagination="pagination" |       v-model:pagination="pagination" | ||||||
|       :data="list" |       :data="list" | ||||||
|       row-key="RISKCHECKITEM_ID" |       row-key="USER_ID" | ||||||
|       @get-data="fnGetData" |       @get-data="fnGetData" | ||||||
|     > |     > | ||||||
|       <el-table-column reserve-selection type="selection" width="55" /> |       <el-table-column reserve-selection type="selection" width="55" /> | ||||||
|  | @ -94,7 +94,6 @@ const { list, searchForm, pagination, fnGetData, fnResetPagination, tableRef } = | ||||||
|   useListData(getUserListAll, { |   useListData(getUserListAll, { | ||||||
|     key: "userList", |     key: "userList", | ||||||
|     immediate: false, |     immediate: false, | ||||||
|     clearSelection: false, |  | ||||||
|   }); |   }); | ||||||
| 
 | 
 | ||||||
| const stop = watch( | const stop = watch( | ||||||
|  |  | ||||||
|  | @ -39,6 +39,20 @@ | ||||||
|             detailItems.realPersonNum |             detailItems.realPersonNum | ||||||
|           }}/人 |           }}/人 | ||||||
|         </el-descriptions-item> |         </el-descriptions-item> | ||||||
|  |         <el-descriptions-item label="会议附件"> | ||||||
|  |           <a | ||||||
|  |             :href="VITE_FILE_URL + detailItems.CONFIRM_MESSAGE_SIGN_ROUTE" | ||||||
|  |             target="_blank" | ||||||
|  |             rel="noopener noreferrer" | ||||||
|  |             >查看会议附件</a | ||||||
|  |           > | ||||||
|  |         </el-descriptions-item> | ||||||
|  |         <el-descriptions-item label="会议视频"> | ||||||
|  |           <video | ||||||
|  |             :src="VITE_FILE_URL + detailItems.VIDEO_SIGN_ROUTE" | ||||||
|  |             controls | ||||||
|  |           ></video> | ||||||
|  |         </el-descriptions-item> | ||||||
|       </el-descriptions> |       </el-descriptions> | ||||||
|       <el-table |       <el-table | ||||||
|         :border="true" |         :border="true" | ||||||
|  | @ -117,6 +131,7 @@ const detailItems = ref({ | ||||||
| 
 | 
 | ||||||
| const fnGetData = async () => { | const fnGetData = async () => { | ||||||
|   const response = await getSafetyMeetingView({ SAFETY_MEETING_ID }); |   const response = await getSafetyMeetingView({ SAFETY_MEETING_ID }); | ||||||
|  |   console.log(response, "1111111111111111111111111"); | ||||||
|   detailItems.value = response.pd; |   detailItems.value = response.pd; | ||||||
| }; | }; | ||||||
| fnGetData(); | fnGetData(); | ||||||
|  |  | ||||||
|  | @ -8,7 +8,7 @@ | ||||||
|     > |     > | ||||||
|       <el-divider content-position="left">添加</el-divider> |       <el-divider content-position="left">添加</el-divider> | ||||||
|       <el-row> |       <el-row> | ||||||
|         <el-col :span="8"> |         <el-col :span="12"> | ||||||
|           <el-form-item label="通知标题" prop="TITLE"> |           <el-form-item label="通知标题" prop="TITLE"> | ||||||
|             <el-input |             <el-input | ||||||
|               v-model="data.form.TITLE" |               v-model="data.form.TITLE" | ||||||
|  | @ -17,7 +17,7 @@ | ||||||
|             /> |             /> | ||||||
|           </el-form-item> |           </el-form-item> | ||||||
|         </el-col> |         </el-col> | ||||||
|         <el-col :span="5"> |         <el-col :span="12"> | ||||||
|           <el-form-item label="通知等级" prop="LEVEL"> |           <el-form-item label="通知等级" prop="LEVEL"> | ||||||
|             <el-select |             <el-select | ||||||
|               v-model="data.form.LEVEL" |               v-model="data.form.LEVEL" | ||||||
|  | @ -33,9 +33,9 @@ | ||||||
|             </el-select> |             </el-select> | ||||||
|           </el-form-item> |           </el-form-item> | ||||||
|         </el-col> |         </el-col> | ||||||
|         <el-col :span="8"> |         <el-col :span="24"> | ||||||
|           <el-form-item label="人员选择" prop="PERSON"> |           <el-form-item label="人员选择" prop="PERSON"> | ||||||
|             <div class="flexBox"> |             <div style="flex: 1; display: flex"> | ||||||
|               <el-input |               <el-input | ||||||
|                 v-model="data.form.PERSON" |                 v-model="data.form.PERSON" | ||||||
|                 type="textarea" |                 type="textarea" | ||||||
|  | @ -43,7 +43,7 @@ | ||||||
|                 disabled |                 disabled | ||||||
|               ></el-input> |               ></el-input> | ||||||
|               <el-button |               <el-button | ||||||
|                 class="addBtn" |                 class="ml-10" | ||||||
|                 type="primary" |                 type="primary" | ||||||
|                 @click="data.SelectPersonDialogVisible = true" |                 @click="data.SelectPersonDialogVisible = true" | ||||||
|               > |               > | ||||||
|  | @ -125,6 +125,13 @@ const rules = { | ||||||
|   PERSON: [{ required: true, message: "请选择通知人员", trigger: "blur" }], |   PERSON: [{ required: true, message: "请选择通知人员", trigger: "blur" }], | ||||||
|   NOTIFICATIONCONTENT: [ |   NOTIFICATIONCONTENT: [ | ||||||
|     { required: true, message: "请输入通知内容", trigger: "blur" }, |     { required: true, message: "请输入通知内容", trigger: "blur" }, | ||||||
|  |     { | ||||||
|  |       validator: (rule, value, callback) => { | ||||||
|  |         if (value === "<p><br></p>") callback(new Error("请输入通知内容")); | ||||||
|  |         else callback(); | ||||||
|  |       }, | ||||||
|  |       trigger: "blur", | ||||||
|  |     }, | ||||||
|   ], |   ], | ||||||
| }; | }; | ||||||
| const relatedClassificationTempList = | const relatedClassificationTempList = | ||||||
|  | @ -214,13 +221,4 @@ const fnSelectAllRiskSubmit = (allData) => { | ||||||
| }; | }; | ||||||
| </script> | </script> | ||||||
| 
 | 
 | ||||||
| <style scoped lang="scss"> | <style scoped lang="scss"></style> | ||||||
| .flexBox { |  | ||||||
|   display: flex; |  | ||||||
|   align-items: flex-end; |  | ||||||
| 
 |  | ||||||
|   .addBtn { |  | ||||||
|     margin-left: 12px; |  | ||||||
|   } |  | ||||||
| } |  | ||||||
| </style> |  | ||||||
|  |  | ||||||
|  | @ -43,10 +43,10 @@ | ||||||
|       ref="tableRef" |       ref="tableRef" | ||||||
|       v-model:pagination="pagination" |       v-model:pagination="pagination" | ||||||
|       :data="list" |       :data="list" | ||||||
|       row-key="RISKCHECKITEM_ID" |       row-key="USER_ID" | ||||||
|       @get-data="fnGetData" |       @get-data="fnGetData" | ||||||
|     > |     > | ||||||
|       <el-table-column type="selection" width="55" /> |       <el-table-column reserve-selection type="selection" width="55" /> | ||||||
|       <el-table-column label="序号" width="70"> |       <el-table-column label="序号" width="70"> | ||||||
|         <template #default="{ $index }"> |         <template #default="{ $index }"> | ||||||
|           {{ serialNumber(pagination, $index) }} |           {{ serialNumber(pagination, $index) }} | ||||||
|  | @ -71,7 +71,6 @@ import { debounce } from "throttle-debounce"; | ||||||
| import useListData from "@/assets/js/useListData.js"; | import useListData from "@/assets/js/useListData.js"; | ||||||
| import { watch } from "vue"; | import { watch } from "vue"; | ||||||
| import { serialNumber } from "@/assets/js/utils.js"; | import { serialNumber } from "@/assets/js/utils.js"; | ||||||
| import { differenceWith } from "lodash-es"; |  | ||||||
| import { getUserListAll } from "@/request/safety_production_related.js"; | import { getUserListAll } from "@/request/safety_production_related.js"; | ||||||
| import { PERSONTYPEMENU } from "@/assets/js/constant.js"; | import { PERSONTYPEMENU } from "@/assets/js/constant.js"; | ||||||
| 
 | 
 | ||||||
|  | @ -94,32 +93,27 @@ const { list, searchForm, pagination, fnGetData, fnResetPagination, tableRef } = | ||||||
|   useListData(getUserListAll, { |   useListData(getUserListAll, { | ||||||
|     key: "userList", |     key: "userList", | ||||||
|     immediate: false, |     immediate: false, | ||||||
|     clearSelection: false, |  | ||||||
|   }); |   }); | ||||||
| 
 | 
 | ||||||
| const stop = watch( | const stop = watch( | ||||||
|   () => props.visible, |   () => props.visible, | ||||||
|   (value) => { |   (value) => { | ||||||
|     if (value) { |     if (value) { | ||||||
|       fnGetData(); |       fnResetPagination(); | ||||||
|       stop && stop(); |       stop && stop(); | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| ); | ); | ||||||
| const fnClose = () => { | const fnClose = () => { | ||||||
|  |   tableRef.value.clearSelection(); | ||||||
|   visible.value = false; |   visible.value = false; | ||||||
| }; | }; | ||||||
| const fnSubmit = debounce( | const fnSubmit = debounce( | ||||||
|   1000, |   1000, | ||||||
|   () => { |   () => { | ||||||
|     const selectionData = tableRef.value.getSelectionRows(); |     const selectionData = tableRef.value.getSelectionRows(); | ||||||
|     const listData = differenceWith( |     emits("submit", selectionData); | ||||||
|       selectionData, |  | ||||||
|       props.listData, |  | ||||||
|       (a, b) => a.RISKCHECKITEM_ID === b.RISKCHECKITEM_ID |  | ||||||
|     ); |  | ||||||
|     fnClose(); |     fnClose(); | ||||||
|     emits("submit", listData); |  | ||||||
|   }, |   }, | ||||||
|   { atBegin: true } |   { atBegin: true } | ||||||
| ); | ); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue