|
|
@@ -108,20 +108,27 @@
|
|
|
<text class="select-all-text">全选</text>
|
|
|
</view>
|
|
|
<view class="btn-group">
|
|
|
- <button class="operate-btn blue-btn" @click="showMoreOperate = true">更多操作</button>
|
|
|
- <!-- <button
|
|
|
- class="operate-btn white-btn"
|
|
|
- @click="showBatchClaimPopup({ text: '是否取消认领已选择的设备?', isClaim: true })"
|
|
|
+ <button
|
|
|
+ class="operate-btn blue-btn"
|
|
|
+ :style="!selectedEquipments.length ? { opacity: 0.5 } : {}"
|
|
|
+ @click="selectedEquipments.length && (showMoreOperate = true)"
|
|
|
>
|
|
|
- 取消认领
|
|
|
- </button> -->
|
|
|
+ 更多操作
|
|
|
+ </button>
|
|
|
<button
|
|
|
class="operate-btn white-btn"
|
|
|
- @click="showBatchClaimPopup({ text: '是否认领已选择的设备?', isClaim: false })"
|
|
|
+ :style="!selectedEquipments.length ? { opacity: 0.5 } : {}"
|
|
|
+ @click="selectedEquipments.length && showBatchClaimPopup({ text: '是否认领已选择的设备?', isClaim: false })"
|
|
|
>
|
|
|
批量认领
|
|
|
</button>
|
|
|
- <button class="operate-btn blue-btn" @click="showCheckProjectPopup">添加项目</button>
|
|
|
+ <button
|
|
|
+ class="operate-btn blue-btn"
|
|
|
+ :style="!selectedEquipments.length ? { opacity: 0.5 } : {}"
|
|
|
+ @click="selectedEquipments.length && showCheckProjectPopup()"
|
|
|
+ >
|
|
|
+ 添加项目
|
|
|
+ </button>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
@@ -137,17 +144,6 @@
|
|
|
|
|
|
<view v-if="showMoreOperate" class="more-operate-overlay" @click="showMoreOperate = false">
|
|
|
<view class="more-operate-panel" :class="{ 'more-panel-show': showMoreOperate }">
|
|
|
- <view
|
|
|
- class="more-btn-item"
|
|
|
- :class="{ disabled: !canInform }"
|
|
|
- @click="canInform && showAddSpacePopup()"
|
|
|
- >
|
|
|
- <view class="more-btn-inner">
|
|
|
- <text class="more-btn-text" :style="{ color: canInform ? 'rgb(51,51,51)' : '#ccc' }">
|
|
|
- 添加有限空间记录
|
|
|
- </text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
<view
|
|
|
class="more-btn-item"
|
|
|
:class="{ disabled: !canInform }"
|
|
|
@@ -155,7 +151,7 @@
|
|
|
>
|
|
|
<view class="more-btn-inner more-btn-border">
|
|
|
<text class="more-btn-text" :style="{ color: canInform ? 'rgb(51,51,51)' : '#ccc' }">
|
|
|
- 重大问题线索告知
|
|
|
+ 重大问题线索
|
|
|
</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -186,13 +182,13 @@
|
|
|
</view>
|
|
|
<view
|
|
|
class="more-btn-item"
|
|
|
- :class="{ disabled: !canAddInspectionplan }"
|
|
|
- @click="canAddInspectionplan && handleUpdateContact()"
|
|
|
+ :class="{ disabled: !canUpdateContact }"
|
|
|
+ @click="canUpdateContact && handleUpdateContact()"
|
|
|
>
|
|
|
<view class="more-btn-inner more-btn-border">
|
|
|
<text
|
|
|
class="more-btn-text"
|
|
|
- :style="{ color: canAddInspectionplan ? 'rgb(51,51,51)' : '#ccc' }"
|
|
|
+ :style="{ color: canUpdateContact ? 'rgb(51,51,51)' : '#ccc' }"
|
|
|
>
|
|
|
修改安全管理员
|
|
|
</text>
|
|
|
@@ -224,7 +220,7 @@
|
|
|
<wd-picker
|
|
|
v-model="selectedTemplateId"
|
|
|
:columns="templateListColumn"
|
|
|
- @change="onTemplateChange"
|
|
|
+ @confirm="onTemplateChange"
|
|
|
/>
|
|
|
</view>
|
|
|
<view class="form-item">
|
|
|
@@ -238,59 +234,20 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
- <view v-if="showUpdateContactPopup" class="popup-mask" @click="showUpdateContactPopup = false">
|
|
|
- <view class="popup-content" @click.stop>
|
|
|
- <UpdateContactPopup
|
|
|
- :ids="selectedEquipIds"
|
|
|
- :safe-manager="currentItem?.safeManager || ''"
|
|
|
- :safe-manager-phone="currentItem?.safeManagerPhone || ''"
|
|
|
- :safe-manager-id-number="currentItem?.safeManagerIdNumber || ''"
|
|
|
- :operator-id-number="currentItem?.operatorIdNumber || ''"
|
|
|
- @hide="showUpdateContactPopup = false"
|
|
|
- @refresh="refreshList"
|
|
|
- />
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <view v-if="showSpaceTemplatePopup" class="popup-mask" @click="showSpaceTemplatePopup = false">
|
|
|
- <view class="popup-content" @click.stop>
|
|
|
- <text class="popup-title">选择模板</text>
|
|
|
- <scroll-view scroll-y class="template-scroll">
|
|
|
- <view
|
|
|
- v-for="tpl in spaceTemplateList"
|
|
|
- :key="tpl.id"
|
|
|
- class="template-item"
|
|
|
- :class="{ active: selectedSpaceTemplateId === tpl.id }"
|
|
|
- @click="selectedSpaceTemplateId = tpl.id"
|
|
|
- >
|
|
|
- <text>{{ tpl.name }}</text>
|
|
|
- </view>
|
|
|
- </scroll-view>
|
|
|
- <view class="popup-actions">
|
|
|
- <button class="action-btn cancel-btn" @click="showSpaceTemplatePopup = false">
|
|
|
- 取消
|
|
|
- </button>
|
|
|
- <button class="action-btn confirm-btn" @click="confirmSpaceTemplate">确定</button>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
+ <UpdateSafetyManagerPopup
|
|
|
+ v-if="showUpdateContactPopup"
|
|
|
+ :safe-manager="currentSafeManager.name"
|
|
|
+ :safe-manager-phone="currentSafeManager.phone"
|
|
|
+ @hide="showUpdateContactPopup = false"
|
|
|
+ @confirm="handleUpdateSafetyManagerConfirm"
|
|
|
+ />
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
import { ref, computed } from 'vue'
|
|
|
import { onLoad, onShow } from '@dcloudio/uni-app'
|
|
|
-import {
|
|
|
- getTaskEquipmentList,
|
|
|
- cancelClaim,
|
|
|
- confirmTaskClaim,
|
|
|
- batchClaim,
|
|
|
- orderItemMajorCheck,
|
|
|
- getEquipmentsTemplateJSONData,
|
|
|
- taskOrderItemSuspendApi,
|
|
|
- notVerifyPageApi,
|
|
|
- addMajorIssuesApi,
|
|
|
-} from '@/api/task'
|
|
|
+import { batchClaim, pressure2NotVerifyPageApi } from '@/api/task'
|
|
|
import { useUserStore } from '@/store/user'
|
|
|
import { useConfigStore } from '@/store/config'
|
|
|
import {
|
|
|
@@ -298,13 +255,11 @@ import {
|
|
|
PressureCheckerMyTaskStatusMap,
|
|
|
EquipmentType,
|
|
|
} from '@/utils/dictMap'
|
|
|
-// import { createBusinessConfig } from '@/pages/webview/common/config/businessEditorConfig'
|
|
|
-import { setSpreadsheetEditParams } from '@/common/global'
|
|
|
-import { formatDate } from '@/utils/index'
|
|
|
import dayjs from 'dayjs'
|
|
|
-import UpdateContactPopup from '@/pages/unClaim/components/UpdateContactPopup.vue'
|
|
|
-import * as signApis from '@/api/sign'
|
|
|
+import UpdateSafetyManagerPopup from '@/pages/unClaim/components/UpdateSafetyManagerPopup.vue'
|
|
|
import { TaskOrderFuncName, requestFunc } from '@/api/ApiRouter/taskOrder'
|
|
|
+import { getBoilerTaskItemListByOrderId } from '@/api/boiler/boilerTaskOrder'
|
|
|
+import { updateEquipBoilerSecurityManager } from '@/api/boiler/boilerEquip'
|
|
|
import NavBar from '@/components/NavBar/NavBar.vue'
|
|
|
|
|
|
interface PopupData {
|
|
|
@@ -330,6 +285,7 @@ const selectedMap = ref<Record<string, boolean>>({})
|
|
|
const canInform = ref(false)
|
|
|
const canSuspend = ref(false)
|
|
|
const canAddInspectionplan = ref(false)
|
|
|
+const canUpdateContact = ref(false)
|
|
|
|
|
|
const showTipsPopup = ref(false)
|
|
|
const tipsPopupData = ref<PopupData>({ text: '', isClaim: false })
|
|
|
@@ -344,15 +300,24 @@ const selectedTemplate = ref<any>(null)
|
|
|
const selectedTemplateId = ref('')
|
|
|
const templateList = ref<any[]>([])
|
|
|
const templateListColumn = computed(() => [
|
|
|
- templateList.value.map((item) => ({ label: item.name, value: item.id })),
|
|
|
+ templateList.value.map((item) => ({ label: item.tbName, value: item.id })),
|
|
|
])
|
|
|
|
|
|
const showUpdateContactPopup = ref(false)
|
|
|
const currentItem = ref<any>({})
|
|
|
|
|
|
-const showSpaceTemplatePopup = ref(false)
|
|
|
-const spaceTemplateList = ref<any[]>([])
|
|
|
-const selectedSpaceTemplateId = ref('')
|
|
|
+const fieldKeyMap: Record<string, { name: string; phone: string }> = {
|
|
|
+ [EquipmentType.BOILER]: { name: 'safery', phone: 'saferydh' },
|
|
|
+ [EquipmentType.CONTAINER]: { name: 'safery', phone: 'saferydh' },
|
|
|
+}
|
|
|
+
|
|
|
+const currentSafeManager = computed(() => {
|
|
|
+ const keys = fieldKeyMap[equipType] || fieldKeyMap[EquipmentType.BOILER]
|
|
|
+ return {
|
|
|
+ name: currentItem.value?.[keys.name] || '',
|
|
|
+ phone: currentItem.value?.[keys.phone] || '',
|
|
|
+ }
|
|
|
+})
|
|
|
|
|
|
onLoad((options: any) => {
|
|
|
orderId.value = options?.orderId || ''
|
|
|
@@ -367,19 +332,9 @@ const selectedEquipIds = computed(() => selectedEquipments.value.map((item) => i
|
|
|
|
|
|
const fetchCheckerOnlineEquipmentList = async () => {
|
|
|
loading.value = true
|
|
|
- const apiParams: any = {
|
|
|
- orderId: orderId.value,
|
|
|
- pageSize: 999,
|
|
|
- pageNo: 1,
|
|
|
- taskStatusList: [400, 500, 510],
|
|
|
- }
|
|
|
try {
|
|
|
- const equipmentListData = await requestFunc(
|
|
|
- TaskOrderFuncName.TaskEquipList,
|
|
|
- equipType,
|
|
|
- apiParams,
|
|
|
- )
|
|
|
- equipmentList.value = equipmentListData?.data?.list || []
|
|
|
+ const res = await getBoilerTaskItemListByOrderId({ id: orderId.value })
|
|
|
+ equipmentList.value = res?.data?.orderItems || []
|
|
|
} catch (error) {
|
|
|
console.error('获取设备列表失败:', error)
|
|
|
} finally {
|
|
|
@@ -427,12 +382,9 @@ const handleSelectAll = () => {
|
|
|
|
|
|
const updateOperateStatus = () => {
|
|
|
canInform.value = selectedEquipments.value.length === 1
|
|
|
- canAddInspectionplan.value = selectedEquipments.value.length > 0
|
|
|
- const hasUnClaim =
|
|
|
- selectedEquipments.value.length > 0
|
|
|
- ? selectedEquipments.value.some((equipments) => !equipments.isClaim)
|
|
|
- : true
|
|
|
- canSuspend.value = !hasUnClaim
|
|
|
+ canAddInspectionplan.value = selectedEquipments.value.length >= 1
|
|
|
+ canUpdateContact.value = selectedEquipments.value.length === 1
|
|
|
+ canSuspend.value = selectedEquipments.value.length >= 1
|
|
|
}
|
|
|
|
|
|
const initSelect = () => {
|
|
|
@@ -488,9 +440,13 @@ const fetchClaimEquipments = async (equipmentId: string, isClaim: boolean) => {
|
|
|
try {
|
|
|
let result: any
|
|
|
if (isClaim) {
|
|
|
- result = await requestFunc(TaskOrderFuncName.EquipmentConfirmClaim, equipType, { id: equipmentId })
|
|
|
+ result = await requestFunc(TaskOrderFuncName.EquipmentConfirmClaim, equipType, {
|
|
|
+ id: equipmentId,
|
|
|
+ })
|
|
|
} else {
|
|
|
- result = await requestFunc(TaskOrderFuncName.EquipmentCancelClaim, equipType, { id: equipmentId })
|
|
|
+ result = await requestFunc(TaskOrderFuncName.EquipmentCancelClaim, equipType, {
|
|
|
+ id: equipmentId,
|
|
|
+ })
|
|
|
}
|
|
|
updateClaim(result, [equipmentId], !isClaim)
|
|
|
} catch (error) {
|
|
|
@@ -544,7 +500,8 @@ const suspendCheck = async () => {
|
|
|
uni.showLoading({ title: '加载中' })
|
|
|
const ids = selectedEquipments.value.map((item: any) => item.id)
|
|
|
try {
|
|
|
- const result = await taskOrderItemSuspendApi({ orderItemIds: ids, reason: suspendReason.value })
|
|
|
+ const reqData = { orderItemIds: ids, reason: suspendReason.value, flag: 1 }
|
|
|
+ const result = await requestFunc(TaskOrderFuncName.BatchSuspendEquip, equipType, reqData)
|
|
|
uni.hideLoading()
|
|
|
if (result?.code === 0) {
|
|
|
initSelect()
|
|
|
@@ -567,150 +524,47 @@ const createInform = async () => {
|
|
|
return uni.showToast({ title: '无网络连接,请联网重试' })
|
|
|
}
|
|
|
if (!orderId.value) return
|
|
|
- try {
|
|
|
- showMoreOperate.value = false
|
|
|
- const equipment = selectedEquipments.value[0]
|
|
|
- const majorcheckres = await orderItemMajorCheck({ orderItemIds: [equipment?.id] })
|
|
|
- const equipmentReportId =
|
|
|
- (equipment.reportDOList || []).find((item: any) => item.reportType === 500)?.id || ''
|
|
|
- if (majorcheckres.data[equipment?.id]) {
|
|
|
- const item = majorcheckres.data[equipment?.id]
|
|
|
- if (item.isSignature === '1') {
|
|
|
- uni.redirectTo({
|
|
|
- url: `/pages/sign-detail/index?orderId=${orderId.value}&type=ZXXX&orderItemId=${equipment?.id}&reportId=${equipmentReportId}`,
|
|
|
- })
|
|
|
- } else {
|
|
|
- uni.redirectTo({
|
|
|
- url: `/pages/sign/index?orderId=${orderId.value}&type=ZXXX&orderItemId=${equipment?.id}&reportId=${equipmentReportId}`,
|
|
|
- })
|
|
|
- }
|
|
|
- return
|
|
|
- }
|
|
|
- const configRes = await signApis.getGcConfig(
|
|
|
- {
|
|
|
- orderId: orderId.value,
|
|
|
- businessType: 400,
|
|
|
- orderItemId: equipment.id,
|
|
|
- },
|
|
|
- userInfo.value,
|
|
|
- )
|
|
|
- if (configRes?.code === 0) {
|
|
|
- const initJSONResult = await getEquipmentsTemplateJSONData({
|
|
|
- taskOrderNo: orderNo.value,
|
|
|
- templateId: configRes.data?.templateId,
|
|
|
- equipCode: equipment?.equipCode,
|
|
|
- })
|
|
|
- const dataStr = initJSONResult?.data ? JSON.parse(initJSONResult.data) : {}
|
|
|
- const { id, nickname, mobile } = userInfo.value || {}
|
|
|
- const params = {
|
|
|
- dataStr: JSON.stringify({
|
|
|
- ...dataStr,
|
|
|
- notifierSignName: nickname,
|
|
|
- notifierSignDate: dayjs().format('YYYY年MM月DD日'),
|
|
|
- notifierPhone: mobile,
|
|
|
- }),
|
|
|
- standardInitData: configRes.data?.standardInitData,
|
|
|
- templateUrl: configRes.data?.templateUrl,
|
|
|
- templateId: configRes.data?.templateId,
|
|
|
- orderItemId: equipment.id,
|
|
|
- prepareId: id || '',
|
|
|
- prepareName: nickname || '',
|
|
|
- translateInitData: '{}',
|
|
|
- reportId: equipmentReportId,
|
|
|
- }
|
|
|
- const businessConfig = createBusinessConfig('ZXXX')
|
|
|
- setSpreadsheetEditParams({
|
|
|
- routeType: 'ZXXX',
|
|
|
- orderId: orderId.value,
|
|
|
- gcConfig: params,
|
|
|
- businessConfig,
|
|
|
- })
|
|
|
- uni.navigateTo({
|
|
|
- url: `/pages/webview/generic-webview?businessType=ZXXX&orderId=${orderId.value}&templateId=${configRes.data?.id}&useOnline=1`,
|
|
|
- })
|
|
|
- } else {
|
|
|
- uni.showToast({ title: '获取配置信息失败' })
|
|
|
- }
|
|
|
- } catch (configError) {
|
|
|
- console.error('获取葡萄城配置信息失败:', configError)
|
|
|
- uni.showToast({ title: '获取配置信息失败,请重试' })
|
|
|
+
|
|
|
+ if(selectedEquipments.value.length !== 1) {
|
|
|
+ return uni.showToast({ title: '只能选择一个设备添加重大问题线索', icon: 'error' })
|
|
|
}
|
|
|
-}
|
|
|
|
|
|
-const showAddSpacePopup = async () => {
|
|
|
- if (!selectedEquipments.value.length) {
|
|
|
- return uni.showToast({ title: '请先选择设备', icon: 'error' })
|
|
|
+ const selectedEquipment = selectedEquipments.value[0]
|
|
|
+ const majorIssue = selectedEquipment.reportDOList.find((item: any) => item.reportType == 500)
|
|
|
+ if (majorIssue) {
|
|
|
+ return uni.showToast({ title: '该设备已添加了重大问题线索', icon: 'error' })
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ uni.showLoading({ title: '提交中...', mask: true })
|
|
|
try {
|
|
|
- const result = await notVerifyPageApi({ type: '10', status: 200, pageNo: 1, pageSize: 9999 })
|
|
|
- const list = (result?.data?.list || []).map((item: any) => {
|
|
|
- return { ...item, label: item.name || '', value: item.id || '' }
|
|
|
+ const orderFormResp = await requestFunc(TaskOrderFuncName.GetOrderForm, equipType, {
|
|
|
+ orderId: orderId.value,
|
|
|
+ businessType: 400,
|
|
|
+ orderItemId: selectedEquipment.id,
|
|
|
+ })
|
|
|
+ const templateId = orderFormResp?.data?.templateId || ''
|
|
|
+ const addMajorIssueResp = await requestFunc(TaskOrderFuncName.AddMajorIssues, equipType, {
|
|
|
+ orderFormEnterReqVO: {
|
|
|
+ businessType: 400,
|
|
|
+ modifiedReason: "",
|
|
|
+ orderId: orderId.value,
|
|
|
+ orderItemId: selectedEquipment.id,
|
|
|
+ },
|
|
|
+ orderId: orderId.value,
|
|
|
+ orderItemId: selectedEquipment.id,
|
|
|
+ prepareId: userInfo.value?.id || '',
|
|
|
+ prepareName: userInfo.value?.nickname || '',
|
|
|
+ templateId: templateId,
|
|
|
+ })
|
|
|
+ const refId = addMajorIssueResp?.data || ''
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pages/importanceEditor/importanceEditor?templateId=${templateId}&refId=${refId}`,
|
|
|
})
|
|
|
- if (!list.length) {
|
|
|
- return uni.showToast({ title: '暂无有限空间记录模板', icon: 'error' })
|
|
|
- }
|
|
|
- spaceTemplateList.value = list
|
|
|
- selectedSpaceTemplateId.value = ''
|
|
|
- showMoreOperate.value = false
|
|
|
- showSpaceTemplatePopup.value = true
|
|
|
} catch (error) {
|
|
|
- uni.showToast({ title: '获取有限空间记录模板失败' })
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-const confirmSpaceTemplate = () => {
|
|
|
- if (!selectedSpaceTemplateId.value) {
|
|
|
- return uni.showToast({ title: '请选择一个模板', icon: 'error' })
|
|
|
- }
|
|
|
- const currentTemplate = spaceTemplateList.value.find(
|
|
|
- (item) => item.id === selectedSpaceTemplateId.value,
|
|
|
- )
|
|
|
- if (!currentTemplate) {
|
|
|
- return uni.showToast({ title: '模板不存在', icon: 'error' })
|
|
|
- }
|
|
|
- const currentRow = selectedEquipments.value[0]
|
|
|
- const defaultDataSource: Record<string, any> = {
|
|
|
- reportNo: currentTemplate.name,
|
|
|
- jyName: userInfo.value?.nickname || '',
|
|
|
- signName: userInfo.value?.nickname || '',
|
|
|
- signDate: formatDate(new Date(), 'YYYY年MM月DD日'),
|
|
|
- }
|
|
|
- const reportRespVOList = currentRow?.reportDOList || []
|
|
|
- const unitName = currentRow?.unitName || ''
|
|
|
- defaultDataSource.reportNo = reportRespVOList[0]?.reportNo || ''
|
|
|
- defaultDataSource.unitName = unitName
|
|
|
- const params = {
|
|
|
- dataStr: JSON.stringify({ ...defaultDataSource }),
|
|
|
- standardInitData: currentTemplate?.bindingPathSchema,
|
|
|
- templateUrl: currentTemplate?.recordTemplateUrl || '',
|
|
|
- templateId: currentTemplate?.id,
|
|
|
- orderId: orderId.value,
|
|
|
- orderItemId: currentRow.id,
|
|
|
- prepareId: userInfo.value?.id || '',
|
|
|
- prepareName: userInfo.value?.nickname || '',
|
|
|
- reportName: currentTemplate.name || '',
|
|
|
- translateInitData: '{}',
|
|
|
- cacheParams: {
|
|
|
- objId: `${currentRow.id}_${currentTemplate.id}`,
|
|
|
- type: 8,
|
|
|
- cachTime: currentRow.updateTime || currentRow.createTime,
|
|
|
- },
|
|
|
+ uni.hideLoading()
|
|
|
+ uni.showToast({ title: '操作失败', icon: 'error' })
|
|
|
}
|
|
|
- const businessConfig = createBusinessConfig('YXKJ')
|
|
|
- setSpreadsheetEditParams({
|
|
|
- routeType: 'YXKJ',
|
|
|
- orderId: orderId.value,
|
|
|
- gcConfig: params,
|
|
|
- businessConfig,
|
|
|
- })
|
|
|
- showSpaceTemplatePopup.value = false
|
|
|
- uni.navigateTo({
|
|
|
- url: `/pages/webview/generic-webview?businessType=YXKJ&orderId=${orderId.value}&templateId=${currentTemplate.id}&useOnline=1`,
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-const createBusinessConfig = (name) => {
|
|
|
-
|
|
|
}
|
|
|
|
|
|
const showAddInspectionplanPopup = async () => {
|
|
|
@@ -722,8 +576,14 @@ const showAddInspectionplanPopup = async () => {
|
|
|
inspectionplanName.value = ''
|
|
|
selectedTemplate.value = null
|
|
|
try {
|
|
|
- const result = await notVerifyPageApi({ type: '1', status: 200, pageNo: 1, pageSize: 9999 })
|
|
|
- templateList.value = result?.data?.list || []
|
|
|
+ const result = await pressure2NotVerifyPageApi({
|
|
|
+ type: '6',
|
|
|
+ reportType: 600,
|
|
|
+ status: 200,
|
|
|
+ pageNo: 1,
|
|
|
+ pageSize: 9999,
|
|
|
+ })
|
|
|
+ templateList.value = result?.data || []
|
|
|
} catch (error) {
|
|
|
console.error('获取模板列表失败:', error)
|
|
|
}
|
|
|
@@ -733,61 +593,40 @@ const closeInspectionplanPopup = () => {
|
|
|
showInspectionplanPopup.value = false
|
|
|
}
|
|
|
|
|
|
-const onTemplateChange = ({ selected }) => {
|
|
|
- const index = selected[0]
|
|
|
- selectedTemplate.value = templateList.value[index]
|
|
|
- selectedTemplateId.value = selectedTemplate.value?.id || ''
|
|
|
+const onTemplateChange = (selected) => {
|
|
|
+ selectedTemplate.value = selected.selectedItems.label
|
|
|
+ selectedTemplateId.value = selected.selectedItems.value
|
|
|
}
|
|
|
|
|
|
const addInspectionplanConfirm = async () => {
|
|
|
- const templateId = selectedTemplate.value?.id
|
|
|
- if (!templateId) {
|
|
|
+ if (!selectedTemplate.value) {
|
|
|
return uni.showToast({ title: '请选择模板封面', icon: 'error' })
|
|
|
}
|
|
|
if (!inspectionplanName.value.trim()) {
|
|
|
return uni.showToast({ title: '请输入检验方案名称', icon: 'error' })
|
|
|
}
|
|
|
closeInspectionplanPopup()
|
|
|
- await handleSuccessInspectionplan({ templateId, reportName: inspectionplanName.value.trim() })
|
|
|
-}
|
|
|
-
|
|
|
-const handleSuccessInspectionplan = async (info: any) => {
|
|
|
+ uni.showLoading({ title: '提交中...', mask: true })
|
|
|
try {
|
|
|
- uni.showLoading({ title: '添加中' })
|
|
|
- const resultData = await getEquipmentsTemplateJSONData({
|
|
|
- taskOrderNo: orderNo.value,
|
|
|
- templateId: info.templateId,
|
|
|
- equipCode: selectedEquipments.value[0].equipCode,
|
|
|
- })
|
|
|
- const defaultUser: Record<string, any> = {
|
|
|
- prepareName: userInfo.value?.nickname || '',
|
|
|
- prepareDate: dayjs().format('YYYY年MM月DD日'),
|
|
|
- }
|
|
|
- const initJSONResult = resultData?.data || ''
|
|
|
- const prepareJson = initJSONResult
|
|
|
- ? { ...JSON.parse(initJSONResult), ...defaultUser }
|
|
|
- : defaultUser
|
|
|
- const addParams = {
|
|
|
+ const reqData = {
|
|
|
orderId: orderId.value,
|
|
|
- templateId: info.templateId,
|
|
|
- prepareJson: JSON.stringify(prepareJson),
|
|
|
- prepareId: userInfo.value?.id,
|
|
|
- prepareName: userInfo.value?.nickname,
|
|
|
orderItemIds: selectedEquipments.value.map((item) => item.id),
|
|
|
- reportName: info.reportName,
|
|
|
- }
|
|
|
- const result = await addMajorIssuesApi(addParams)
|
|
|
- const newReportId = result?.data || ''
|
|
|
- if (!newReportId) {
|
|
|
- uni.hideLoading()
|
|
|
- return uni.showToast({ title: '添加失败', icon: 'error' })
|
|
|
+ prepareId: userInfo.value?.id || '',
|
|
|
+ prepareJson: JSON.stringify({
|
|
|
+ prepareName: userInfo.value?.nickname || '',
|
|
|
+ prepareDate: dayjs().format('YYYY年MM月DD日'),
|
|
|
+ }),
|
|
|
+ prepareName: userInfo.value?.nickname || '',
|
|
|
+ reportName: inspectionplanName.value.trim(),
|
|
|
+ templateId: selectedTemplateId.value,
|
|
|
}
|
|
|
- const url = `/pages/inspectionplanDetail/inspectionplanDetail?reportId=${newReportId}&reportName=${info.reportName}&orderId=${orderId.value}&templateId=${info.templateId}&prepareJson=${encodeURIComponent(JSON.stringify(prepareJson))}`
|
|
|
- uni.navigateTo({ url })
|
|
|
+ const res = await requestFunc(TaskOrderFuncName.AddMajorIssues, equipType, reqData)
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pages/inspectionPlanAudit/inspectionPlanEditor?templateId=${selectedTemplateId.value}&refId=${res?.data || ''}`,
|
|
|
+ })
|
|
|
} catch (error) {
|
|
|
- uni.showToast({ title: '添加检验方案失败', icon: 'error' })
|
|
|
- } finally {
|
|
|
uni.hideLoading()
|
|
|
+ uni.showToast({ title: '操作失败', icon: 'error' })
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -798,6 +637,41 @@ const handleUpdateContact = () => {
|
|
|
showUpdateContactPopup.value = true
|
|
|
}
|
|
|
|
|
|
+const handleUpdateSafetyManagerConfirm = async (params: { name: string; phone: string }) => {
|
|
|
+ if (selectedEquipIds.value.length < 1) {
|
|
|
+ return uni.showToast({ title: '请选择设备', icon: 'error' })
|
|
|
+ }
|
|
|
+
|
|
|
+ const keys = fieldKeyMap[equipType] || fieldKeyMap[EquipmentType.BOILER]
|
|
|
+ try {
|
|
|
+ uni.showLoading({ title: '提交中...' })
|
|
|
+
|
|
|
+ const updatePromises = selectedEquipments.value.map((item) => {
|
|
|
+ return updateEquipBoilerSecurityManager({
|
|
|
+ id: item.equipId,
|
|
|
+ [keys.name]: params.name,
|
|
|
+ [keys.phone]: params.phone,
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ const results = await Promise.all(updatePromises)
|
|
|
+ uni.hideLoading()
|
|
|
+
|
|
|
+ const allSuccess = results.every((res: any) => res?.code === 0)
|
|
|
+ if (allSuccess) {
|
|
|
+ uni.showToast({ title: '修改成功', icon: 'success' })
|
|
|
+ showUpdateContactPopup.value = false
|
|
|
+ refreshList()
|
|
|
+ } else {
|
|
|
+ uni.showToast({ title: '部分修改失败', icon: 'none' })
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ uni.hideLoading()
|
|
|
+ console.error('修改安全管理员失败:', error)
|
|
|
+ uni.showToast({ title: '修改失败', icon: 'none' })
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
const handleRouteToEquipmentDetail = (item: any, pageType: string) => {
|
|
|
uni.navigateTo({
|
|
|
url: `/pages/equipment/detail/equipmentDetail?orderId=${orderId.value}&orderItemId=${item.id}&equipId=${item.equipId}&pageType=${pageType}&useOnline=1&canEdit=${true}`,
|
|
|
@@ -810,10 +684,6 @@ const handleCalcTotalFee = (reportDOList: any) => {
|
|
|
.filter((x: any) => x.fee && !isNaN(x.fee) && typeof x.fee === 'number')
|
|
|
.reduce((sum: number, item: any) => sum + item.fee, 0)
|
|
|
}
|
|
|
-
|
|
|
-const goBack = () => {
|
|
|
- uni.navigateBack()
|
|
|
-}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
@@ -1250,7 +1120,7 @@ const goBack = () => {
|
|
|
}
|
|
|
|
|
|
.form-input {
|
|
|
- padding: 8px;
|
|
|
+ padding: 0px;
|
|
|
font-size: 14px;
|
|
|
background-color: #f5f5f5;
|
|
|
border-radius: 4px;
|