| | |
| | | <template> |
| | | <view> |
| | | <view class="form-container"> |
| | | <form :modelValue="formData"> |
| | | <view class="form-group"> |
| | | <label class="form-label">项目名称:</label> |
| | | <input class="form-input" disabled="true" type="text" v-model="formData.projName"/> |
| | | </view> |
| | | <view class="form-group"> |
| | | <label class="form-label">质量要求:</label> |
| | | <input class="form-input" disabled="true" type="text" v-model="formData.itemMod"/> |
| | | </view> |
| | | <view class="form-group"> |
| | | <label class="form-label">检验方法:</label> |
| | | <input class="form-input" disabled="true" type="text" v-model="formData.inspectionMethod"/> |
| | | </view> |
| | | <view class="form-group"> |
| | | <label class="form-label">使用仪表:</label> |
| | | <input class="form-input" disabled="true" type="text" v-model="formData.usingInstruments"/> |
| | | </view> |
| | | <view class="form-group"> |
| | | <label class="form-label">检验数:</label> |
| | | <input class="form-input" disabled="true" type="text" v-model="formData.levelNum"/> |
| | | </view> |
| | | <view class="form-group"> |
| | | <label class="form-label">下限:</label> |
| | | <input class="form-input" disabled="true" type="text" v-model="formData.minValue"/> |
| | | </view> |
| | | <view class="form-group"> |
| | | <label class="form-label">标准值:</label> |
| | | <input class="form-input" disabled="true" type="text" v-model="formData.standardValue"/> |
| | | </view> |
| | | <view class="form-group"> |
| | | <label class="form-label">上限:</label> |
| | | <input class="form-input" disabled="true" type="text" v-model="formData.maxValue"/> |
| | | </view> |
| | | <view class="form-group"> |
| | | <label class="form-label">更新人:</label> |
| | | <input class="form-input" disabled="true" type="text" v-model="formData.updater"/> |
| | | </view> |
| | | <view class="form-group"> |
| | | <label class="form-label">更新时间:</label> |
| | | <input class="form-input" disabled="true" type="text" v-model="formData.updateTime"/> |
| | | </view> |
| | | <view class="form-group"> |
| | | <label class="form-label">预览结果:</label> |
| | | <input class="form-input" disabled="true" type="text" v-model="formData.result"/> |
| | | </view> |
| | | <view class="form-group"> |
| | | <label class="form-label">不合格描述:</label> |
| | | <input class="form-input" disabled="true" type="text" v-model="formData.remarks"/> |
| | | </view> |
| | | <view class="form-group edit"> |
| | | <input class="form-input" style="color: red" disabled="true" type="text" |
| | | value="没有最大值和最小值时填写0(未通过检验)或1(通过检验)"/> |
| | | </view> |
| | | <view class="form-group edit"> |
| | | <label class="form-label">检测结果:</label> |
| | | <input class="form-input" type="number" v-model="formData.fcheckResu"/> |
| | | </view> |
| | | <button type="primary" v-if="tableData.length < formData.levelNum" @click="submit">保存</button> |
| | | </form> |
| | | </view> |
| | | <view> |
| | | <img v-if="isShowImg" :src="base64Image" style="width:100%" @click="previewImage"/> |
| | | </view> |
| | | <view class="list-container"> |
| | | <uni-table ref="table" border emptyText="暂无更多数据"> |
| | | <uni-tr> |
| | | <uni-th align="center" style="color: #FFFFFF;background-color: lightskyblue;">编号</uni-th> |
| | | <uni-th align="center" style="color: #FFFFFF;background-color: lightskyblue;">判定标识</uni-th> |
| | | <uni-th align="center" style="color: #FFFFFF;background-color: lightskyblue;">检验结果</uni-th> |
| | | <uni-th width="150" align="center" |
| | | style="color: #FFFFFF;background-color: lightskyblue;">修改 |
| | | </uni-th> |
| | | </uni-tr> |
| | | <uni-tr v-for="(item, index) in tableData" :key="index"> |
| | | <uni-td align="center"> |
| | | {{ index + 1 }} |
| | | </uni-td> |
| | | <uni-td align="center"> |
| | | <input class="form-input" disabled="true" type="text" v-model="item.fstand"/> |
| | | </uni-td> |
| | | <uni-td align="center"> |
| | | <input class="form-input" disabled="true" type="text" v-model="item.fcheckResu"/> |
| | | </uni-td> |
| | | <uni-td> |
| | | <view class="uni-group"> |
| | | <button type="warn" v-if="isNumber" @click="toDetail(item)">修改</button> |
| | | <button type="warn" v-if="!isNumber" @click="numberEdit(item)">{{ editResult(item.fcheckResu) }}</button> |
| | | </view> |
| | | </uni-td> |
| | | </uni-tr> |
| | | </uni-table> |
| | | <view class="container"> |
| | | <!-- 头部 --> |
| | | <view class="header"> |
| | | <view class="title">巡检项目明细</view> |
| | | <view class="order-number">巡检单号: {{billNo}}</view> |
| | | </view> |
| | | |
| | | <view class="plus-button"> |
| | | <button type="warn" @click="saveRemarks">添加不合格描述</button> |
| | | <!-- 基本信息 --> |
| | | <view class="section"> |
| | | <view class="section-header">基本信息</view> |
| | | <view class="section-body"> |
| | | <view class="info-grid"> |
| | | <view class="info-item"> |
| | | <view class="info-label">项目名称</view> |
| | | <view class="info-value">{{ formData.projName }}</view> |
| | | </view> |
| | | <view class="info-item" v-if="formData.itemMod"> |
| | | <view class="info-label">质量要求</view> |
| | | <view class="info-value">{{ formData.itemMod }}</view> |
| | | </view> |
| | | <view class="info-item" v-if="formData.inspectionMethod"> |
| | | <view class="info-label">检验方法</view> |
| | | <view class="info-value">{{ formData.inspectionMethod }}</view> |
| | | </view> |
| | | <view class="info-item" v-if="formData.usingInstruments"> |
| | | <view class="info-label">使用仪表</view> |
| | | <view class="info-value">{{ formData.usingInstruments }}</view> |
| | | </view> |
| | | <view class="info-item"> |
| | | <view class="info-label">检验数</view> |
| | | <view class="info-value">{{ formData.levelNum }}</view> |
| | | </view> |
| | | <view class="info-item" v-if="formData.minValue"> |
| | | <view class="info-label">下限</view> |
| | | <view class="info-value">{{ formData.minValue }}</view> |
| | | </view> |
| | | <view class="info-item" v-if="formData.standardValue"> |
| | | <view class="info-label">标准值</view> |
| | | <view class="info-value">{{ formData.standardValue }}</view> |
| | | </view> |
| | | <view class="info-item" v-if="formData.maxValue"> |
| | | <view class="info-label">上限</view> |
| | | <view class="info-value">{{ formData.maxValue }}</view> |
| | | </view> |
| | | <view class="info-item" v-if="formData.updater"> |
| | | <view class="info-label">更新人</view> |
| | | <view class="info-value">{{ formData.updater }}</view> |
| | | </view> |
| | | <view class="info-item" v-if="formData.updateTime"> |
| | | <view class="info-label">更新时间</view> |
| | | <view class="info-value">{{ formData.updateTime }}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- 检验结果 --> |
| | | <view class="section"> |
| | | <view class="section-header">检验结果</view> |
| | | <view class="section-body"> |
| | | <view class="info-grid"> |
| | | <view class="info-item" v-if="formData.result"> |
| | | <view class="info-label">预览结果</view> |
| | | <view class="info-value">{{formData.result}}</view> |
| | | </view> |
| | | </view> |
| | | |
| | | <view v-if="formData.result != null" class="result-preview"> |
| | | <view class="info-label">预览结果</view> |
| | | <view class="info-value">{{formData.result}}</view> |
| | | </view> |
| | | |
| | | <view v-if="formData.remarks != null" class="result-ng"> |
| | | <view class="info-label">不合格描述</view> |
| | | <view class="info-value danger">{{formData.remarks}}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- 结果录入 --> |
| | | <view class="section"> |
| | | <view class="section-header">检验结果录入</view> |
| | | <view class="section-body"> |
| | | <view class="inspection-hint"> |
| | | <view class="hint-text">没有最大值和最小值时填写0(未通过检验)或1(通过检验)</view> |
| | | </view> |
| | | <view class="input-group"> |
| | | <view class="input-wrapper"> |
| | | <input v-if="tableData.length < formData.levelNum" |
| | | v-model="formData.fcheckResu" |
| | | type="number" |
| | | class="result-input" |
| | | placeholder="请输入检验结果" |
| | | placeholder-class="placeholder" /> |
| | | <button v-if="(tableData.length < formData.levelNum)" |
| | | style="margin: 0px;background-color: #3498db;color:#ffffff ;" class="btn primary-btn" |
| | | @click="submit">保存结果</button> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- 图片预览 --> |
| | | <view v-if="isShowImg" class="section"> |
| | | <view class="section-header">相关图片</view> |
| | | <view class="section-body"> |
| | | <view class="image-preview" @click="previewImage"> |
| | | <image :src="base64Image" mode="aspectFit" class="preview-image"/> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <!-- 结果表格 --> |
| | | <view v-if="tableData.length > 0" class="table-container"> |
| | | <view class="table-header"> |
| | | <view class="th">编号</view> |
| | | <view class="th">检验结果<i style="color: rgb(0 212 68);" |
| | | v-if="!(tableData.length < formData.levelNum)">(输入已完成)</i></view> |
| | | <view class="th">操作</view> |
| | | </view> |
| | | |
| | | <view v-for="(item, index) in tableData" :key="index" class="table-row"> |
| | | <view class="td">{{ index + 1 }}</view> |
| | | <view class="td"> |
| | | <view :class="['result-badge', item.fstand === '√' ? 'OK' : 'NG']"> |
| | | {{ item.fcheckResu }} |
| | | </view> |
| | | </view> |
| | | <view class="td"> |
| | | <button v-if="!isNumber" class="btn danger-btn" @click="numberEdit(item)"> |
| | | {{ editResult(item.fcheckResu) }} |
| | | </button> |
| | | <button v-if="isNumber" class="btn danger-btn" @click="toDetail(item)"> |
| | | 修改 |
| | | </button> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- 操作按钮 --> |
| | | <view class="action-buttons"> |
| | | <button class="action-btn warning" @click="saveRemarks">添加不合格描述</button> |
| | | </view> |
| | | |
| | | <!-- 修改不合格描述弹出框 --> |
| | | <view v-if="remarksPopup" class="overlay"> |
| | | <view class="popup"> |
| | | <view class="popup-header"> |
| | | <h3>修改不合格描述</h3> |
| | | <form> |
| | | <view class="form-group"> |
| | | <label class="form-label">不合格描述:</label> |
| | | <input class="form-input" type="text" v-model="remarks"/> |
| | | </view> |
| | | <button type="warn" @click="editRemarks">修改</button> |
| | | <button @click="remarksPopup = !remarksPopup">取消</button> |
| | | </form> |
| | | <view class="popup-content"> |
| | | <view class="input-group"> |
| | | <view class="input-label">不合格描述:</view> |
| | | <input class="input-field" type="text" v-model="remarks" placeholder="请输入不合格描述"/> |
| | | </view> |
| | | </view> |
| | | <view class="popup-actions"> |
| | | <button class="action-btn primary" @click="editRemarks">修改</button> |
| | | <button class="action-btn secondary" @click="remarksPopup = !remarksPopup">取消</button> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- 修改检验结果弹出框 --> |
| | | <view v-if="showPopup" class="overlay"> |
| | | <view class="popup"> |
| | | <view class="popup-header"> |
| | | <h3>修改检验结果</h3> |
| | | <form :modelValue="editData"> |
| | | <view class="form-group"> |
| | | <label class="form-label">检验结果:</label> |
| | | <input class="form-input" type="text" v-model="editData.fcheckResu"/> |
| | | </view> |
| | | <button type="warn" @click="eidt">修改</button> |
| | | <button @click="showPopup = !showPopup">取消</button> |
| | | </form> |
| | | <view class="popup-content"> |
| | | <view class="input-group"> |
| | | <view class="input-label">检验结果:</view> |
| | | <input class="input-field" type="text" v-model="editData.fcheckResu" placeholder="请输入检验结果"/> |
| | | </view> |
| | | </view> |
| | | <view class="popup-actions"> |
| | | <button class="action-btn primary" @click="eidt">修改</button> |
| | | <button class="action-btn secondary" @click="showPopup = !showPopup">取消</button> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | getResultClass(result) { |
| | | if (result === '合格') return 'result-pass'; |
| | | if (result === '不合格') return 'result-fail'; |
| | | return 'result-pending'; |
| | | }, |
| | | |
| | | |
| | | previewImage() { |
| | | uni.previewImage({ |
| | |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | .form-group { |
| | | <style scoped> |
| | | /* 基础样式 */ |
| | | .container { |
| | | padding: 10px; |
| | | background-color: #f5f7fa; |
| | | min-height: 100vh; |
| | | } |
| | | |
| | | /* 头部样式 */ |
| | | .header { |
| | | background-color: white; |
| | | padding: 20px; |
| | | border-radius: 8px; |
| | | box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | .title { |
| | | font-size: 20px; |
| | | font-weight: 600; |
| | | color: #2c3e50; |
| | | margin-bottom: 8px; |
| | | } |
| | | |
| | | .order-number { |
| | | font-size: 14px; |
| | | color: #3498db; |
| | | font-weight: 500; |
| | | } |
| | | |
| | | /* 区域样式 */ |
| | | .section { |
| | | background-color: white; |
| | | border-radius: 8px; |
| | | box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); |
| | | margin-bottom: 20px; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .section-header { |
| | | background-color: #f8f9fa; |
| | | padding: 15px 20px; |
| | | border-bottom: 1px solid #eee; |
| | | font-size: 16px; |
| | | font-weight: 600; |
| | | color: #2c3e50; |
| | | } |
| | | |
| | | .section-body { |
| | | padding: 20px; |
| | | } |
| | | |
| | | /* 信息网格 */ |
| | | .info-grid { |
| | | display: grid; |
| | | grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); |
| | | gap: 15px; |
| | | } |
| | | |
| | | .info-item { |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 5px; |
| | | } |
| | | |
| | | .info-label { |
| | | font-size: 12px; |
| | | color: #7f8c8d; |
| | | font-weight: 500; |
| | | } |
| | | |
| | | .info-value { |
| | | font-size: 14px; |
| | | color: #2c3e50; |
| | | } |
| | | |
| | | .info-value.danger { |
| | | color: #e74c3c; |
| | | font-weight: 500; |
| | | } |
| | | |
| | | /* 结果忽章 */ |
| | | .result-badge { |
| | | padding: 4px 8px; |
| | | border-radius: 4px; |
| | | font-size: 12px; |
| | | font-weight: 500; |
| | | display: inline-block; |
| | | width: fit-content; |
| | | } |
| | | |
| | | .result-badge.OK { |
| | | background-color: #d4edda; |
| | | color: #155724; |
| | | } |
| | | |
| | | .result-badge.NG { |
| | | background-color: #f8d7da; |
| | | color: #721c24; |
| | | } |
| | | |
| | | /* 检验输入区 */ |
| | | .inspection-hint { |
| | | background-color: #fff3cd; |
| | | padding: 10px; |
| | | border-radius: 4px; |
| | | margin-bottom: 15px; |
| | | } |
| | | |
| | | .hint-text { |
| | | font-size: 12px; |
| | | color: #856404; |
| | | } |
| | | |
| | | .input-group { |
| | | display: flex; |
| | | align-items: center; |
| | | border: 1px solid #c9c9c9; |
| | | background-color: #d4d4d4; |
| | | margin-bottom: 15px; |
| | | } |
| | | |
| | | .form-label { |
| | | margin-bottom: 0; |
| | | padding: 5px; |
| | | .input-wrapper { |
| | | display: flex; |
| | | gap: 12px; |
| | | width: 100%; |
| | | } |
| | | |
| | | .form-input { |
| | | .result-input { |
| | | flex: 1; |
| | | margin-bottom: 0; |
| | | padding: 5px; |
| | | padding: 8px 12px; |
| | | border: 1px solid #ddd; |
| | | border-radius: 4px; |
| | | font-size: 14px; |
| | | background-color: white; |
| | | } |
| | | |
| | | /* 默认样式 */ |
| | | .list-container { |
| | | height: calc(100vh - 750px); |
| | | /* 设置列表容器的高度为剩余空间,并减去表单容器的高度 */ |
| | | overflow-y: auto; |
| | | /* 允许列表容器垂直滚动 */ |
| | | padding: 10px; |
| | | /* 可选:添加一些内边距,使列表内容更美观 */ |
| | | .btn { |
| | | padding: 8px 16px; |
| | | border: none; |
| | | border-radius: 4px; |
| | | font-size: 14px; |
| | | cursor: pointer; |
| | | transition: all 0.2s; |
| | | } |
| | | |
| | | /* 在小屏幕设备上,重置高度为适应屏幕 */ |
| | | @media (max-width: 768px) { |
| | | .list-container { |
| | | height: calc(100vh - 485px); |
| | | /* 适当调整高度 */ |
| | | } |
| | | .btn.primary-btn { |
| | | background-color: #3498db; |
| | | color: white; |
| | | } |
| | | |
| | | .form-container { |
| | | /* 设置表单容器的高度,使其可以滚动 */ |
| | | overflow-y: auto; |
| | | /* 允许表单容器垂直滚动 */ |
| | | padding: 10px; |
| | | /* 可选:添加一些内边距,使表单内容更美观 */ |
| | | .btn.danger-btn { |
| | | background-color: #e74c3c; |
| | | color: white; |
| | | } |
| | | |
| | | /* 图片预览 */ |
| | | .image-preview { |
| | | text-align: center; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .preview-image { |
| | | max-width: 100%; |
| | | max-height: 300px; |
| | | border-radius: 4px; |
| | | border: 1px solid #ddd; |
| | | } |
| | | |
| | | /* 结果预览 */ |
| | | .result-preview { |
| | | margin: 16px 0; |
| | | padding: 12px; |
| | | background-color: #f8f9fa; |
| | | border-radius: 4px; |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 12px; |
| | | } |
| | | |
| | | .result-ng { |
| | | margin: 16px 0; |
| | | padding: 12px; |
| | | background-color: #f8d7da; |
| | | border-radius: 4px; |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 12px; |
| | | } |
| | | |
| | | /* 表格容器 */ |
| | | .table-container { |
| | | border: 1px solid #ddd; |
| | | border-radius: 4px; |
| | | margin-top: 20px; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .table-header { |
| | | display: flex; |
| | | background-color: #3498db; |
| | | color: white; |
| | | } |
| | | |
| | | .th { |
| | | flex: 1; |
| | | padding: 12px; |
| | | font-weight: bold; |
| | | text-align: center; |
| | | } |
| | | |
| | | .table-row { |
| | | display: flex; |
| | | border-bottom: 1px solid #eee; |
| | | padding: 12px; |
| | | } |
| | | |
| | | .table-row:last-child { |
| | | border-bottom: none; |
| | | } |
| | | |
| | | .td { |
| | | flex: 1; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | |
| | | /* 操作按钮 */ |
| | | .action-buttons { |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 10px; |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | .action-btn { |
| | | padding: 12px 20px; |
| | | border: none; |
| | | border-radius: 6px; |
| | | font-size: 14px; |
| | | font-weight: 500; |
| | | cursor: pointer; |
| | | transition: all 0.2s; |
| | | } |
| | | |
| | | .action-btn.primary { |
| | | background-color: #3498db; |
| | | color: white; |
| | | } |
| | | |
| | | .action-btn.secondary { |
| | | background-color: #95a5a6; |
| | | color: white; |
| | | } |
| | | |
| | | .action-btn.warning { |
| | | background-color: #f39c12; |
| | | color: white; |
| | | } |
| | | |
| | | /* 弹出框样式 */ |
| | | .overlay { |
| | | position: fixed; |
| | | top: 0; |
| | |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | z-index: 1000; |
| | | } |
| | | |
| | | .popup { |
| | | background-color: #fff; |
| | | padding: 20px; |
| | | border: 1px solid #ccc; |
| | | box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); |
| | | width: 68vw; |
| | | /* 设置宽度为视口宽度的80% */ |
| | | height: 25vh; |
| | | /* 设置高度为视口高度的80% */ |
| | | background-color: white; |
| | | border-radius: 8px; |
| | | box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); |
| | | width: 90%; |
| | | max-width: 400px; |
| | | max-height: 80vh; |
| | | overflow-y: auto; |
| | | } |
| | | |
| | | .edit { |
| | | .popup-header { |
| | | padding: 20px; |
| | | border-bottom: 1px solid #eee; |
| | | } |
| | | |
| | | .popup-header h3 { |
| | | font-size: 18px; |
| | | font-weight: 600; |
| | | color: #2c3e50; |
| | | margin: 0; |
| | | } |
| | | |
| | | .popup-content { |
| | | padding: 20px; |
| | | } |
| | | |
| | | .input-group { |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 8px; |
| | | } |
| | | |
| | | .input-label { |
| | | font-size: 14px; |
| | | color: #7f8c8d; |
| | | font-weight: 500; |
| | | } |
| | | |
| | | .input-field { |
| | | padding: 8px 12px; |
| | | border: 1px solid #ddd; |
| | | border-radius: 4px; |
| | | font-size: 14px; |
| | | background-color: white; |
| | | } |
| | | |
| | | .popup-actions { |
| | | padding: 20px; |
| | | border-top: 1px solid #eee; |
| | | display: flex; |
| | | gap: 10px; |
| | | justify-content: flex-end; |
| | | } |
| | | |
| | | /* 响应式设计 */ |
| | | @media (max-width: 768px) { |
| | | .info-grid { |
| | | grid-template-columns: 1fr; |
| | | } |
| | | |
| | | .input-wrapper { |
| | | flex-direction: column; |
| | | } |
| | | |
| | | .table-row { |
| | | flex-direction: column; |
| | | text-align: center; |
| | | } |
| | | |
| | | .td { |
| | | justify-content: center; |
| | | margin-bottom: 8px; |
| | | } |
| | | } |
| | | </style> |