车间能级提升-智能设备管理系统
zhuguifei
2025-04-22 7a6dc6d28d36e4c3558391bac52d188d5075543f
eims-ui-mobile/src/pages/inspect/insp-record.vue
@@ -109,6 +109,18 @@
          </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>
@@ -116,7 +128,7 @@
<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()
@@ -134,10 +146,14 @@
}
interface InspSt {
  id: string
  inspCode: string
  equName: string
  assetNo: string
  planTimeStr?: string
  status: string
  inspUser: number | string
  specialNote: string
}
const dataChange = ref(false)
@@ -148,10 +164,14 @@
// 点检汇总数据(上个页面传值)
const inspSt = reactive<InspSt>({
  id: '',
  inspCode: '',
  equName: '',
  assetNo: '',
  planTimeStr: '',
  status: '',
  inspUser: '',
  specialNote: '',
})
const paging = ref(null)
@@ -180,7 +200,7 @@
}
function inspResultClick(item: any) {
  // userStore?.userInfo?.realName
  // userStore?.userInfo?.userId
}
const goBack = () => {
@@ -191,7 +211,7 @@
}
const toggleCollapse = () => {
  isAllExpanded.value = !isAllExpanded.value
  isAllExpanded.value = !isAllExpanded.value
  collapseRef.value.toggleAll(isAllExpanded.value)
}
@@ -218,9 +238,22 @@
  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) => {
@@ -244,10 +277,13 @@
  { 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)