| | |
| | | </view> |
| | | </wd-collapse-item> |
| | | </wd-collapse> |
| | | <view class="w-full h-[1rpx] bg-base"></view> |
| | | <wd-textarea |
| | | label="特记事项" |
| | | label-width="200rpx" |
| | | type="textarea" |
| | | v-model="inspSt.specialNote" |
| | | auto-height |
| | | :maxlength="200" |
| | | show-word-limit |
| | | placeholder="请输入特记事项" |
| | | clearable |
| | | /> |
| | | </view> |
| | | </z-paging> |
| | | </template> |
| | |
| | | <script setup lang="ts"> |
| | | import { ref } from 'vue' |
| | | import { useUserStore, useAccessStore, useSystemConfigStore } from '@/store' |
| | | import { getInspStRecordList, updateInspRecord, updateInspRecordBatch } from '@/service/inspect' |
| | | import { getInspStRecordList, updateInspectSt, updateInspRecordBatch } from '@/service/inspect' |
| | | import { useToast, useMessage } from 'wot-design-uni' |
| | | import type { CollapseInstance } from 'wot-design-uni/components/wd-collapse/types' |
| | | const message = useMessage() |
| | |
| | | } |
| | | |
| | | interface InspSt { |
| | | id: string |
| | | inspCode: string |
| | | equName: string |
| | | assetNo: string |
| | | planTimeStr?: string |
| | | status: string |
| | | inspUser: number | string |
| | | specialNote: string |
| | | } |
| | | |
| | | const dataChange = ref(false) |
| | |
| | | |
| | | // 点检汇总数据(上个页面传值) |
| | | const inspSt = reactive<InspSt>({ |
| | | id: '', |
| | | inspCode: '', |
| | | equName: '', |
| | | assetNo: '', |
| | | planTimeStr: '', |
| | | status: '', |
| | | inspUser: '', |
| | | specialNote: '', |
| | | }) |
| | | |
| | | const paging = ref(null) |
| | |
| | | } |
| | | |
| | | function inspResultClick(item: any) { |
| | | // userStore?.userInfo?.realName |
| | | // userStore?.userInfo?.userId |
| | | } |
| | | |
| | | const goBack = () => { |
| | |
| | | } |
| | | |
| | | const toggleCollapse = () => { |
| | | isAllExpanded.value = !isAllExpanded.value |
| | | isAllExpanded.value = !isAllExpanded.value |
| | | collapseRef.value.toggleAll(isAllExpanded.value) |
| | | } |
| | | |
| | |
| | | const params = { |
| | | inspRecordList: dataList.value, |
| | | } |
| | | // 更新点检记录 |
| | | updateInspRecordBatch(params) |
| | | .then((res: any) => { |
| | | updateInspSt(resolve) |
| | | }) |
| | | .catch((res) => { |
| | | console.error(res) |
| | | }) |
| | | } |
| | | function updateInspSt(resolve: any) { |
| | | // 更新点检汇总 |
| | | inspSt.status = '1' |
| | | updateInspectSt(inspSt) |
| | | .then((res: any) => { |
| | | paging.value.reload() |
| | | uni.$emit('insp-st-refresh') |
| | | resolve(true) |
| | | }) |
| | | .catch((res) => { |
| | |
| | | { deep: true }, |
| | | ) |
| | | onLoad((options) => { |
| | | inspSt.id = options.id |
| | | inspSt.inspCode = options.inspCode |
| | | inspSt.equName = options.equName |
| | | inspSt.assetNo = options.assetNo |
| | | inspSt.planTimeStr = options.planTimeStr |
| | | inspSt.specialNote = options?.specialNote |
| | | inspSt.inspUser = userStore?.userInfo?.userId |
| | | }) |
| | | |
| | | const dataCount = computed(() => dataList.value.length) |