diff --git a/components/da-tree/index.vue b/components/da-tree/index.vue index a4bc692..06f4235 100644 --- a/components/da-tree/index.vue +++ b/components/da-tree/index.vue @@ -1017,7 +1017,7 @@ export default defineComponent({ height: 0; padding: 0; overflow: hidden; - font-size: 14px; + font-size: 16px; line-height: 1; visibility: hidden; opacity: 0; @@ -1034,8 +1034,8 @@ export default defineComponent({ display: flex; align-items: center; justify-content: center; - width: 20px; - height: 20px; + width: 23px; + height: 23px; overflow: hidden; &--arr { @@ -1163,8 +1163,9 @@ export default defineComponent({ } &--append { - font-size: 60%; - opacity: 0.6; + font-size: 80%; + opacity: 0.7; + padding-top: 5px; } } } diff --git a/components/n-upload/n-upload.vue b/components/n-upload/n-upload.vue index fcd253c..2b56151 100644 --- a/components/n-upload/n-upload.vue +++ b/components/n-upload/n-upload.vue @@ -41,7 +41,7 @@ const imgs = ref([]) const uploadConfig = reactive({ baseURL: getBaseUrl(), imgBaseURL: getImgBaseUrl(), - header: { 'X-Access-Token': uni.getStorageSync('token') } + header: { Authorization: 'Bearer ' + uni.getStorageSync('token') } }) // 同步外部值到组件 @@ -50,10 +50,12 @@ watch( newVal => { if (!newVal) return (fileList.value = []) const urls = Array.isArray(newVal) ? newVal : newVal.split(',') - imgs.value = urls + imgs.value = urls.map(url => url.previewUrl) fileList.value = urls.map(url => ({ - url: uploadConfig.imgBaseURL + url, + url: url.url, status: 'success', + name: url.name, + id: url.id, message: '' })) }, @@ -82,10 +84,13 @@ const afterRead = async event => { for (let i = 0; i < files.length; i++) { const result = await uploadFile(files[i]) const index = initialLength + i + console.log(files[i]) + fileList.value[index] = { - ...files[i], status: 'success', - url: uploadConfig.imgBaseURL + result.message + url: result.url, + name: result.name, + id: result.id } } } catch (error) { @@ -100,14 +105,19 @@ const afterRead = async event => { const uploadFile = file => { return new Promise((resolve, reject) => { uni.uploadFile({ - url: `${uploadConfig.baseURL}/sys/common/upload`, + url: `${uploadConfig.baseURL}/infra/file/upload-with-return`, filePath: file.url, name: 'file', header: uploadConfig.header, - formData: { biz: 'lims-device' }, + formData: { encrypt: false }, success: res => { if (res.statusCode === 200) { - resolve(JSON.parse(res.data)) + let result = JSON.parse(res.data) + if (result.code === 0) { + resolve(result.data) + } else { + reject(new Error(result.msg)) + } } else { reject(new Error(res.data)) } @@ -125,7 +135,7 @@ const formatValue = fileList => { : fileList.map(item => item.url.slice(baseUrlLength)) } const updateParent = fileList => { - emit('update:modelValue', formatValue(fileList)) + emit('update:modelValue', fileList) } diff --git a/nx/hooks/usePageListData.js b/nx/hooks/usePageListData.js index 33346d7..dda7e84 100644 --- a/nx/hooks/usePageListData.js +++ b/nx/hooks/usePageListData.js @@ -7,7 +7,7 @@ export function useListData({ searchParams, api, needInitListData = false, proce const loadingData = ref(true) const pageParams = reactive({ pageNo: 1, - pageSize: 15 + pageSize: 20 }) const total = ref(0) const loadStatus = ref('loadmore') diff --git a/pages.json b/pages.json index ebc3dbb..df485ae 100644 --- a/pages.json +++ b/pages.json @@ -344,6 +344,13 @@ "navigationStyle": "custom" } }, + { + "path": "pages/material/openMark/index", + "style": { + "navigationBarTitleText": "试剂开封", + "navigationStyle": "custom" + } + }, { "path": "pages/setting/UrlConfig", "style": { diff --git a/pages/device/deviceBusDailyCheck/dailyCheck.data.js b/pages/device/deviceBusDailyCheck/dailyCheck.data.js index 58c6c10..18f0e78 100644 --- a/pages/device/deviceBusDailyCheck/dailyCheck.data.js +++ b/pages/device/deviceBusDailyCheck/dailyCheck.data.js @@ -1,4 +1,5 @@ import { ref, reactive } from 'vue' +import nx from '@/nx' export const detailSchema = [ { label: '设备名称', value: 'deviceName' }, { label: '别名', value: 'alias' }, @@ -11,12 +12,13 @@ export const column = reactive([ { label: '点检人', name: 'checkUserName', - width: 160 + width: 200 }, { label: '点检日期', name: 'checkDate', - width: 180 + width: 200, + formatter: true }, { label: '备注', @@ -30,3 +32,11 @@ export const column = reactive([ renders: [{ name: '详情', func: 'detail' }] } ]) +export function columnFormatter(row, column, rowIndex, columnIndex) { + // 判断是哪一列需要格式化 + if (column.name === 'checkDate') { + return nx.$helper.formateToDateTime(row.checkDate) + } + // 对于不需要特殊格式化的列,返回原始值 + return row[column.name] +} diff --git a/pages/device/deviceBusDailyCheck/detail.vue b/pages/device/deviceBusDailyCheck/detail.vue index 18291e0..dce0b6f 100644 --- a/pages/device/deviceBusDailyCheck/detail.vue +++ b/pages/device/deviceBusDailyCheck/detail.vue @@ -6,13 +6,13 @@ {{ item.label }}:{{ detailInfo[item.value] }}{{ item.label }}:{{ deviceInfo[item.value] }} - - + 备注: {{ detailInfo.content }} @@ -20,16 +20,16 @@ - 点检人: {{ detailInfo.checkUserName }} - 点检日期: - {{ detailInfo.checkDate }} + {{ nx.$helper.formateToDateTime(detailInfo.checkDate) }} @@ -39,15 +39,15 @@ - - 点检项目 - 检查标准 + + 点检项目 + 检查标准 频次 是否正常 - + {{ item.itemName }} @@ -55,7 +55,7 @@ - {{ item.standard }} + {{ item.standard }} {{ item.frequencyRemark }} @@ -72,11 +72,12 @@ @@ -135,4 +142,7 @@ function handleOpen() { :deep(.uicon-close) { font-size: 22px !important; } +:deep(.u-popup__content__close--top-right) { + top: 30px; +} diff --git a/pages/device/deviceBusDailyCheck/index.vue b/pages/device/deviceBusDailyCheck/index.vue index 722e7cc..a37dc17 100644 --- a/pages/device/deviceBusDailyCheck/index.vue +++ b/pages/device/deviceBusDailyCheck/index.vue @@ -18,7 +18,7 @@ v-if="!detailInfo.id" title="请扫描设备条码进行巡检" icon="dailyCheck" - @deviceId="id => getDailyCheckRecord(id)" + @deviceId="id => handleSearchRecord(id)" @scanResult="result => handleScanResult(result)" /> @@ -36,7 +36,7 @@ {{ item.label }}:{{ detailInfo[item.value] }}{{ item.label }}:{{ deviceInfo[item.value] }} @@ -44,14 +44,14 @@ - 巡检项目 - 检查标准 + 巡检项目 + 检查标准 频次 - 是否正常 + 是否正常 - + @@ -60,9 +60,9 @@ - {{ item.standard }} + {{ item.standard }} {{ item.frequencyRemark }} - + @@ -73,15 +73,10 @@ - + 附件照片: - - 巡检人: - - - 巡检日期: - - + + 巡检人:{{ detailInfo.checkUserName }} import { ref, reactive, onMounted, onUnmounted, watch, toRefs, computed } from 'vue' import { onShow, onLoad } from '@dcloudio/uni-app' +import { getDeviceBusInfoById } from '@/nx/api/deviceInfo' import dailyCheckApi from '@/nx/api/dailyCheck' import { detailSchema } from './dailyCheck.data' import { useScreenOrientation } from '@/nx/hooks/useScreenOrientation' @@ -134,32 +130,18 @@ function handleScanResult(result) { const codeObj = JSON.parse(result) if (!pageLoading.value) { getDailyCheckRecord(codeObj.id) + getDeviceInfo(codeObj.id) } } -// const { scanQRInfo } = toRefs(nx.$store('biz')) -// watch(scanQRInfo, newVal => { -// if (newVal && nx.$router.getCurrentPage().route == 'pages/device/deviceBusDailyCheck/index') { -// try { -// const codeObj = JSON.parse(newVal) -// if (!pageLoading.value) { -// getDailyCheckRecord(codeObj.id) -// } -// scanQRInfo.value = '' -// } catch (error) { -// scanQRInfo.value = '' -// uni.showToast({ -// title: '请扫描设备码', -// icon: 'none' -// }) -// } -// } -// }) + +function handleSearchRecord(id) { + getDailyCheckRecord(id) + getDeviceInfo(id) +} const modalText = computed(() => { return `确定${modalType.value == '0' ? '暂存' : '提交'}吗?${modalType.value == '0' ? '' : '提交后不能修改'} ` }) -// onShow(() => { -// scanQRInfo.value = '' -// }) + let goBack = ref(false) //设备使用前进行点检操作标记 onLoad(options => { if (options.deviceId) { @@ -170,6 +152,7 @@ onLoad(options => { async function getDailyCheckRecord(id) { pageLoading.value = true + const res = await dailyCheckApi .getCheckRecord({ deviceId: id, @@ -179,15 +162,20 @@ async function getDailyCheckRecord(id) { pageLoading.value = false }) if (!res.checkUserName) { - res.checkUserName = nx.$store('user').userInfo.realname - res.checkUserId = nx.$store('user').userInfo.id + res.checkUserName = nx.$store('user').userInfo.nickname } detailInfo.value = res modalType.value = res.submitFlag lockOrientation('landscape') } - +const deviceInfo = ref({}) +async function getDeviceInfo(id) { + const res = await getDeviceBusInfoById(id).finally(() => { + pageLoading.value = false + }) + deviceInfo.value = res +} const modalShow = ref(false) const modalType = ref('') // 是否有异常项 @@ -215,13 +203,6 @@ function handleSubmit(type) { } } } - if (!detailInfo.value.checkUserName) { - return uni.showToast({ - title: '请输入巡检人', - icon: 'none' - }) - } - detailInfo.value.checkDate = nx.$dayjs().format('YYYY-MM-DD HH:mm:ss') modalType.value = type modalShow.value = true console.log(detailInfo.value) @@ -263,9 +244,7 @@ function handleCreateDailyCheck() { deviceId: detailInfo.value.deviceId, dataType: 'dailyCheck' }) - res.checkUserName = nx.$store('user').userInfo.realname - res.checkUserId = nx.$store('user').userInfo.id - res.checkDate = nx.$dayjs().format('YYYY-MM-DD HH:mm:ss') + res.checkUserName = nx.$store('user').userInfo.nickname detailInfo.value = res } else if (res.cancel) { console.log('用户点击取消') diff --git a/pages/device/deviceBusDailyCheck/list.vue b/pages/device/deviceBusDailyCheck/list.vue index 8da3d56..7125405 100644 --- a/pages/device/deviceBusDailyCheck/list.vue +++ b/pages/device/deviceBusDailyCheck/list.vue @@ -1,7 +1,7 @@