From 3ecc4bea7a5b99b9adbd48f66b441d034586fd48 Mon Sep 17 00:00:00 2001 From: qiuhongwu Date: Tue, 9 Jul 2024 15:26:21 +0800 Subject: [PATCH] =?UTF-8?q?app=E5=93=81=E8=B4=A8=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=8D=95=E6=96=B0=E5=A2=9E=E6=A3=80=E9=AA=8C?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/dataItem.vue | 22 +-- .../components/detailPanel.vue | 127 +++++++++--------- 2 files changed, 78 insertions(+), 71 deletions(-) diff --git a/mes-ui/uni-app/src/pages/unqualifiedNotification/components/dataItem.vue b/mes-ui/uni-app/src/pages/unqualifiedNotification/components/dataItem.vue index 4d93b4f4..2dac094f 100644 --- a/mes-ui/uni-app/src/pages/unqualifiedNotification/components/dataItem.vue +++ b/mes-ui/uni-app/src/pages/unqualifiedNotification/components/dataItem.vue @@ -44,11 +44,11 @@ const getListData = async () => { const data = await getNotificationPageAPI(queryParams) isLoading.value = false data.list.forEach(async (e) => { - console.log(e,'eeeeeeeeeeeeeeeee'); + // console.log(e, 'eeeeeeeeeeeeeeeee') //附件信息 // e.attachments = (await getFileAPI({ pageNo: 1, pageSize: 99, businessId: e.id, businessType: 'errorOrderPhoto' })).list // console.log(e.attachments,'eeeeeeeeeeeeeeeee'); - e.attachments= e.fileUrl.split(',') + e.attachments = e.fileUrl.split(',') const obj = userStore.dictInfo.find((q) => q.value == e.property) || {} e.property = obj?.label e.createTime = formatDate(e.createTime, 'YYYY-MM-DD') @@ -89,8 +89,8 @@ onMounted(async () => { await getListData() }) -const previewImage = (url: any,index:any) => { - console.log(url,index,'url图片预览功能') +const previewImage = (url: any, index: any) => { + console.log(url, index, 'url图片预览功能') // 使用 uni-api 的图片预览功能 uni.previewImage({ @@ -169,15 +169,21 @@ defineExpose({ updateData }) > - + + + 检验数量:{{ item.checkAmount }} + + 异常情况描述及原因分析: {{ item.remark }} 照片: - - + + @@ -335,6 +341,6 @@ defineExpose({ updateData }) .image { width: 70rpx; height: 70rpx; - margin-right:10rpx; + margin-right: 10rpx; } diff --git a/mes-ui/uni-app/src/pages/unqualifiedNotification/components/detailPanel.vue b/mes-ui/uni-app/src/pages/unqualifiedNotification/components/detailPanel.vue index 25978ea9..48b712e0 100644 --- a/mes-ui/uni-app/src/pages/unqualifiedNotification/components/detailPanel.vue +++ b/mes-ui/uni-app/src/pages/unqualifiedNotification/components/detailPanel.vue @@ -20,10 +20,10 @@ let isLoading = ref(false) // 获取质检类型枚举 let typeDictData = [] const getTypeDictData = () => { - const arr = dictData.filter(e => e.dictType == 'biz_inspection_type') || [] - arr.forEach(e => { + const arr = dictData.filter((e) => e.dictType == 'biz_inspection_type') || [] + arr.forEach((e) => { const obj = { - value: e.value, + value: e.value, text: e.label } typeDictData.push(obj) @@ -36,17 +36,17 @@ const getProjectData = async () => { pageNo: 1, pageSize: 99, orderStatus: '8', - isSnapshot: 0, + isSnapshot: 0 } const res = await getApproveOrderAPI(params) const arr = [] - res.list.forEach(e => { + res.list.forEach((e) => { const obj = { text: e.code, value: e.id } arr.push(obj) - }) + }) console.log('projectData', res.list, arr) projectData.value = arr } @@ -56,18 +56,18 @@ const getProjectChildData = async (projectOrderId) => { return } const params = { - projectOrderId, + projectOrderId } const data = await getChildProductAPI(params) const arr = [] - data.forEach(e => { + data.forEach((e) => { const obj = { text: e.projectSubName, value: e.id, spec: e.spec } arr.push(obj) - }) + }) projectChildData.value = arr } // 获取车间分页 @@ -85,13 +85,13 @@ const getWorkshopsData = async (projectOrderId) => { } const data = await getWorkshopsPageAPI(params) const arr = [] - data.forEach(e => { + data.forEach((e) => { const obj = { text: e.name, value: e.id } arr.push(obj) - }) + }) workshopsData.value = arr } // 获取工序分页 @@ -99,17 +99,17 @@ const procedureData = ref([]) const getProcedurePage = async (projectOrderId) => { const params = { pageNo: 1, - pageSize: 99, + pageSize: 99 } const data = await getProcedurePageAPI(params) const arr = [] - data.list.forEach(e => { + data.list.forEach((e) => { const obj = { text: e.name, value: e.id } arr.push(obj) - }) + }) procedureData.value = arr } // 获取工序分页 @@ -118,17 +118,17 @@ let ownerDataDefault = [] const getOwnerDataData = async (projectOrderId) => { const params = { pageNo: 1, - pageSize: 99, + pageSize: 99 } const data = await getUserPageAPI(params) const arr = [] - data.list.forEach(e => { + data.list.forEach((e) => { const obj = { text: e.nickname, value: e.id } arr.push(obj) - }) + }) ownerData.value = arr ownerDataDefault = arr } @@ -153,6 +153,7 @@ const valiFormData = ref({ procedureId: '', //工序id spec: '', //规格型号 amount: '', + checkAmount: '', owner: '', remark: '', status: 1, // 状态,1表示正常,2表示禁用,示例值(1) @@ -162,30 +163,33 @@ const valiFormData = ref({ // 定义校验规则 const rules: UniHelper.UniFormsRules = { type: { - rules: [{ required: true, errorMessage: '请选择质检类型' }], + rules: [{ required: true, errorMessage: '请选择质检类型' }] }, projectId: { - rules: [{ required: true, errorMessage: '请选择项目名称' }], + rules: [{ required: true, errorMessage: '请选择项目名称' }] }, projectSubId: { - rules: [{ required: true, errorMessage: '请选择子项目名称' }], + rules: [{ required: true, errorMessage: '请选择子项目名称' }] }, procedureId: { - rules: [{ required: true, errorMessage: '请选择子责任工序' }], + rules: [{ required: true, errorMessage: '请选择子责任工序' }] }, workshopId: { - rules: [{ required: true, errorMessage: '请选择子生产车间' }], + rules: [{ required: true, errorMessage: '请选择子生产车间' }] + }, + checkAmount: { + rules: [{ required: true, errorMessage: '请输入检验常量' }] }, amount: { - rules: [{ required: true, errorMessage: '请输入异常常量' }], + rules: [{ required: true, errorMessage: '请输入异常常量' }] }, owner: { - rules: [{ required: true, errorMessage: '请输入责任人' }], + rules: [{ required: true, errorMessage: '请输入责任人' }] }, remark: { - rules: [{ required: true, errorMessage: '请输入情况描述' }], - }, + rules: [{ required: true, errorMessage: '请输入情况描述' }] + } } // 质检类型改变 const handleChangeType = (val) => { @@ -212,7 +216,7 @@ const handleChangeProjectChild = (val) => { valiFormData.value.projectSubId = val valiFormData.value.workshopId = '' workshopsData.value = [] - const targetObj = projectChildData.value.find((e)=> { + const targetObj = projectChildData.value.find((e) => { if (e.value == val) { return e } @@ -249,7 +253,7 @@ const handleSubmit = async () => { emit('close', true) } // 选择责任人 -const selectOne = (val: string)=>{ +const selectOne = (val: string) => { if (val) { ownerData.value = ownerDataDefault.filter((e) => { if (e.text.indexOf(val) != -1) { @@ -261,22 +265,22 @@ const selectOne = (val: string)=>{ } } // 选中责任人 -const selectConfirm = (val: string)=>{ +const selectConfirm = (val: string) => { valiFormData.value.owner = val } const handleMediaAdd = () => { uni.chooseImage({ - count: 5, - mediaType: ['image','video'], - sourceType: ['album', 'camera'], - maxDuration: 30, - camera: 'back', - success: (res)=> { - console.log('chooseImage', res) - const tempFilePath = res.tempFilePaths[0] - handleUploadFile(tempFilePath) - } - }); + count: 5, + mediaType: ['image', 'video'], + sourceType: ['album', 'camera'], + maxDuration: 30, + camera: 'back', + success: (res) => { + console.log('chooseImage', res) + const tempFilePath = res.tempFilePaths[0] + handleUploadFile(tempFilePath) + } + }) } // 调用上传接口,把我们拍的照片,或者手机相册选择的相册发送给对应的服务器,然后服务器会返回一个在线的图片地址 const handleUploadFile = (e) => { @@ -285,12 +289,12 @@ const handleUploadFile = (e) => { const businessId = e.tempFiles[0].uuid uni.uploadFile({ url: '/infra/file/uploadWatch', //服务器地址 - filePath: tempFilePath,//这个就是我们上面拍照返回或者先中照片返回的数组 + filePath: tempFilePath, //这个就是我们上面拍照返回或者先中照片返回的数组 name: 'files', formData: { businessType: 'errorOrderPhoto', businessId: businessId, - businessFileType: 'errorOrderPhoto', + businessFileType: 'errorOrderPhoto' }, success: (res) => { const url = JSON.parse(res.data).data @@ -300,7 +304,7 @@ const handleUploadFile = (e) => { } mediaList.value.push(obj) } - }); + }) } const mediaValue = ref([]) const mediaList = ref([]) @@ -311,11 +315,10 @@ const select = (e: any) => { } // 删除图片 const deleteImage = (e: any) => { - const idx = mediaList.value.findIndex(q => q.k == e.tempFile.uuid) - mediaList.value.splice(idx,1) + const idx = mediaList.value.findIndex((q) => q.k == e.tempFile.uuid) + mediaList.value.splice(idx, 1) console.log('删除图片', mediaList.value, e.tempFile.uuid) } - - + @@ -392,12 +394,12 @@ const deleteImage = (e: any) => { padding: 20rpx 0; } .uni-section { - display: flex!important; - align-items: center!important; + display: flex !important; + align-items: center !important; } .media-add { - width: 140rpx; - height: 140rpx; + width: 140rpx; + height: 140rpx; } .action { display: flex; @@ -405,7 +407,7 @@ const deleteImage = (e: any) => { align-items: center; .cancle { color: #356899; - background-color: #F9FCFF; + background-color: #f9fcff; padding: 0rpx 100rpx; margin-right: 20rpx; } @@ -413,9 +415,8 @@ const deleteImage = (e: any) => { // background-color: #F9FCFF; padding: 0rpx 100rpx; color: #fff; - background: linear-gradient(170deg, #2DACE6 -128%, #356899 141%); + background: linear-gradient(170deg, #2dace6 -128%, #356899 141%); } } } -