| | |
| | | <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.releaseNo"/> |
| | | <view class="container"> |
| | | <!-- 头部 --> |
| | | <view class="header"> |
| | | <view class="title">入库检验</view> |
| | | <view class="order-number">检验单号: {{formData.releaseNo}}</view> |
| | | </view> |
| | | |
| | | <!-- 基本信息 --> |
| | | <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.releaseNo }}</view> |
| | | </view> |
| | | <view class="form-group"> |
| | | <label class="form-label">创建人:</label> |
| | | <input class="form-input" disabled="true" type="text" v-model="formData.createBy"/> |
| | | <view class="info-item"> |
| | | <view class="info-label">创建人</view> |
| | | <view class="info-value">{{ formData.createBy }}</view> |
| | | </view> |
| | | <view class="form-group"> |
| | | <label class="form-label">创建时间:</label> |
| | | <input class="form-input" disabled="true" type="text" v-model="formData.createDate"/> |
| | | <view class="info-item"> |
| | | <view class="info-label">创建时间</view> |
| | | <view class="info-value">{{ formData.createDate }}</view> |
| | | </view> |
| | | <view class="uni-form-item uni-column form-item edit"> |
| | | <text class="form-label">生产线别:</text> |
| | | <view class="info-item"> |
| | | <view class="info-label">生产线别</view> |
| | | <superwei-combox v-if="isUpdate" :candidates="DAA020List" placeholder="请选择或输入" |
| | | v-model="formData.lineName" |
| | | @select="onDaa020Change" |
| | | class="picker form-input" |
| | | style="border: none;"></superwei-combox> |
| | | <input v-else class="form-input" disabled="true" type="text" v-model="formData.daa015"/> |
| | | class="picker-input"></superwei-combox> |
| | | <view v-else class="info-value">{{ formData.daa015 }}</view> |
| | | </view> |
| | | |
| | | <view class="uni-form-item uni-column form-item edit"> |
| | | <text class="form-label">工单号:</text> |
| | | <view class="info-item"> |
| | | <view class="info-label">工单号</view> |
| | | <superwei-combox v-if="isUpdate" :candidates="DAA001List" placeholder="请选择或输入" |
| | | v-model="formData.billNo" |
| | | @select="onDaa001Change" |
| | | class="picker form-input" |
| | | style="border: none;"></superwei-combox> |
| | | <input v-else class="form-input" disabled="true" type="text" v-model="formData.billNo"/> |
| | | class="picker-input"></superwei-combox> |
| | | <view v-else class="info-value">{{ formData.billNo }}</view> |
| | | </view> |
| | | <view class="form-group"> |
| | | <label class="form-label">送检批次:</label> |
| | | <input class="form-input" type="text" v-model="formData.rbillNo" :readonly="true" /> |
| | | <view class="info-item"> |
| | | <view class="info-label">送检批次</view> |
| | | <input class="info-input" type="text" v-model="formData.rbillNo" :readonly="true" /> |
| | | </view> |
| | | <view class="form-group"> |
| | | <label class="form-label">物料编码:</label> |
| | | <input class="form-input" disabled="true" type="text" v-model="formData.itemNo"/> |
| | | <view class="info-item"> |
| | | <view class="info-label">物料编码</view> |
| | | <view class="info-value">{{ formData.itemNo }}</view> |
| | | </view> |
| | | <view class="uni-title-sub uni-ellipsis-2"> |
| | | <view class="form-group"> |
| | | <label class="form-label">产品名称:</label> |
| | | <input class="form-input" disabled="true" type="text" v-model="formData.itemName"/> |
| | | </view> |
| | | <view class="info-item"> |
| | | <view class="info-label">产品名称</view> |
| | | <view class="info-value">{{ formData.itemName }}</view> |
| | | </view> |
| | | <view class="form-group"> |
| | | <label class="form-label">规格型号:</label> |
| | | <input class="form-input" disabled="true" type="text" v-model="formData.itemModel"/> |
| | | <view class="info-item"> |
| | | <view class="info-label">规格型号</view> |
| | | <view class="info-value">{{ formData.itemModel }}</view> |
| | | </view> |
| | | <view class="form-group"> |
| | | <label class="form-label">送检数量:</label> |
| | | <input class="form-input" disabled="true" type="text" v-model="formData.quantity"/> |
| | | <view class="info-item"> |
| | | <view class="info-label">送检数量</view> |
| | | <view class="info-value highlight">{{ formData.quantity }}</view> |
| | | </view> |
| | | <view class="form-group"> |
| | | <label class="form-label">报工人:</label> |
| | | <input class="form-input" disabled="true" type="text" v-model="formData.bgr"/> |
| | | <view class="info-item"> |
| | | <view class="info-label">报工人</view> |
| | | <view class="info-value">{{ formData.bgr }}</view> |
| | | </view> |
| | | <view class="form-group"> |
| | | <label class="form-label">检验结果:</label> |
| | | <input class="form-input" disabled="true" type="text" v-model="formData.fcheckResu"/> |
| | | <view class="info-item"> |
| | | <view class="info-label">检验结果</view> |
| | | <view class="info-value">{{ formData.fcheckResu }}</view> |
| | | </view> |
| | | <view class="form-group"> |
| | | <label class="form-label">不合格描述:</label> |
| | | <input class="form-input" disabled="true" type="text" v-model="formData.remarks"/> |
| | | <view class="info-item" v-if="formData.remarks"> |
| | | <view class="info-label">不合格描述</view> |
| | | <view class="info-value danger">{{ formData.remarks }}</view> |
| | | </view> |
| | | </form> |
| | | </view> |
| | | |
| | | <view class="list-container"> |
| | | <uni-table ref="table" border emptyText="暂无更多数据"> |
| | | <uni-tr> |
| | | <uni-th align="center" class="th" style="color: #FFFFFF;">检验项目</uni-th> |
| | | <uni-th align="center" class="th" style="color: #FFFFFF">是否合格</uni-th> |
| | | <uni-th align="center" class="th" style="color: #FFFFFF">记录(点击)</uni-th> |
| | | </uni-tr> |
| | | <uni-tr v-for="(item, index) in tableData" :key="index"> |
| | | <uni-td align="center"> |
| | | <input class="form-input" disabled="true" type="text" v-model="item.projName"/> |
| | | </uni-td> |
| | | <uni-td align="center"> |
| | | <input class="form-input" disabled="true" type="text" v-model="item.result"/> |
| | | </uni-td> |
| | | <uni-td> |
| | | <view class="uni-group"> |
| | | <button v-if="item.isCheck >=item.levelNum" type="default" @click="toDetail(item)"> |
| | | {{ item.levelNum + '/' + item.isCheck }} |
| | | </button> |
| | | <button v-else type="warn" @click="toDetail(item)"> |
| | | {{ item.levelNum + '/' + item.isCheck }} |
| | | </button> |
| | | </view> |
| | | </uni-td> |
| | | </uni-tr> |
| | | </uni-table> |
| | | </view> |
| | | |
| | | <view class="plus-button"> |
| | | <button type="warn" v-if="isUpdate && !isShowTable" @click="getItem">生成检验单</button> |
| | | </view> |
| | | |
| | | <view class="plus-button"> |
| | | <button type="warn" v-if="!isUpdate && !isShowTable" @click="toImage">上传/查看图片</button> |
| | | </view> |
| | | |
| | | <view class="plus-button"> |
| | | <button type="warn" v-if="!isUpdate && !isShowTable" @click="saveRemarks">添加不合格描述</button> |
| | | </view> |
| | | |
| | | <view class="plus-button"> |
| | | <button type="warn" v-if="!isUpdate && !isShowTable && this.formData.fsubmit != 1" @click="cleanResult">清除检验结果</button> |
| | | </view> |
| | | |
| | | <!-- <view class="plus-button"> |
| | | <button type="warn" v-if="!isUpdate && !formData.fcheckResu && !isShowTable" @click="removeXJ">删除单据</button> |
| | | </view> --> |
| | | |
| | | <view class="plus-button"> |
| | | <button type="warn" v-if="isShowTable" @click="getTable">获取检验项目</button> |
| | | </view> |
| | | |
| | | <view class="plus-button"> |
| | | <button type="warn" v-if="isShowTable && isUpdate" @click="saveTable">生成检验项目</button> |
| | | </view> |
| | | |
| | | |
| | | <view v-if="showPopup" class="overlay"> |
| | | <view class="popup"> |
| | | <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="edit">修改</button> |
| | | <button @click="showPopup = !showPopup">取消</button> |
| | | </form> |
| | | </view> |
| | | </view> |
| | | |
| | | </view> |
| | | </template> |
| | | |
| | | <!-- 检验项目 --> |
| | | <view class="section" v-if="tableData.length > 0"> |
| | | <view class="section-header">检验项目</view> |
| | | <view class="section-body"> |
| | | <view class="inspection-table"> |
| | | <table> |
| | | <thead> |
| | | <tr> |
| | | <th width="20%" style="text-align: center;">检验项目</th> |
| | | <th width="50%" style="text-align: center;">检验描述</th> |
| | | <th width="15%" style="text-align: center;">记录(点击)</th> |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | <tr v-for="(item, index) in tableData" :key="index"> |
| | | <td>{{ item.projName }}</td> |
| | | <td> |
| | | <view v-if="item.result=='合格'" class="watermark approved"> |
| | | {{ getStatusText(item.result) }} |
| | | </view> |
| | | <view v-if="item.result=='不合格'" class="watermark rejected"> |
| | | {{ getStatusText(item.result) }} |
| | | </view> |
| | | <view v-if="item.result==null || item.result=='未完成'" class="watermark pending"> |
| | | {{ getStatusText(item.result) }} |
| | | </view> |
| | | <view class="description-text">{{ item.projName }}</view> |
| | | </td> |
| | | <td> |
| | | <button v-if="item.isCheck >= item.levelNum" class="record-btn" @click="toDetail(item)">查看</button> |
| | | <button v-else class="record-btn" @click="toDetail(item)">填写</button> |
| | | </td> |
| | | </tr> |
| | | </tbody> |
| | | </table> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- 操作按钮 --> |
| | | <view class="action-buttons"> |
| | | <button class="action-btn primary" v-if="isUpdate && !isShowTable" @click="getItem">生成检验单</button> |
| | | <button class="action-btn secondary" v-if="!isUpdate && !isShowTable" @click="toImage">上传/查看图片</button> |
| | | <button class="action-btn warning" v-if="!isUpdate && !isShowTable" @click="saveRemarks">添加不合格描述</button> |
| | | <button class="action-btn danger" v-if="!isUpdate && !isShowTable && this.formData.fsubmit != 1" @click="cleanResult">清除检验结果</button> |
| | | <button class="action-btn primary" v-if="isShowTable" @click="getTable">获取检验项目</button> |
| | | <button class="action-btn primary" v-if="isShowTable && isUpdate" @click="saveTable">生成检验项目</button> |
| | | </view> |
| | | |
| | | |
| | | <!-- 修改不合格描述弹出框 --> |
| | | <view v-if="showPopup" class="overlay"> |
| | | <view class="popup"> |
| | | <view class="popup-header"> |
| | | <h3>修改不合格描述</h3> |
| | | </view> |
| | | <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="edit">修改</button> |
| | | <button class="action-btn secondary" @click="showPopup = !showPopup">取消</button> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | getStatusClass(result) { |
| | | if (result === '合格') return 'status-pass'; |
| | | if (result === '不合格') return 'status-fail'; |
| | | return 'status-pending'; |
| | | }, |
| | | |
| | | getStatusText(status) { |
| | | const statusMap = { |
| | | approved: '合格', |
| | | rejected: '不合格', |
| | | pending: '待确认' |
| | | } |
| | | if (status == null || status == '未完成') { |
| | | return statusMap['pending'] || '待确认'; |
| | | } else if (status == '合格') { |
| | | return statusMap['approved'] || '合格'; |
| | | } else { |
| | | return statusMap['rejected'] || '不合格'; |
| | | } |
| | | }, |
| | | |
| | | removeXJ() { |
| | | if (this.formData.id) { |
| | | this.$post({ |
| | |
| | | }; |
| | | </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; |
| | | align-items: center; |
| | | border-bottom: 1px solid #c9c9c9; |
| | | flex-direction: column; |
| | | gap: 5px; |
| | | } |
| | | |
| | | .form-label { |
| | | margin-bottom: 0; |
| | | padding: 5px; |
| | | } |
| | | |
| | | .form-input { |
| | | flex: 1; |
| | | margin-bottom: 0; |
| | | padding: 5px; |
| | | } |
| | | |
| | | |
| | | .picker { |
| | | flex: 1; |
| | | margin-bottom: 0; |
| | | padding: 5px; |
| | | .info-label { |
| | | font-size: 12px; |
| | | color: #7f8c8d; |
| | | font-weight: 500; |
| | | } |
| | | |
| | | .uni-form-item { |
| | | display: flex; |
| | | border-bottom: 1px solid #c9c9c9; |
| | | .info-value { |
| | | font-size: 14px; |
| | | color: #2c3e50; |
| | | } |
| | | |
| | | .edit { |
| | | .info-value.highlight { |
| | | font-weight: 600; |
| | | color: #3498db; |
| | | font-size: 16px; |
| | | } |
| | | |
| | | .info-value.danger { |
| | | color: #e74c3c; |
| | | font-weight: 500; |
| | | } |
| | | |
| | | /* 输入框样式 */ |
| | | .info-input { |
| | | padding: 8px 12px; |
| | | border: 1px solid #ddd; |
| | | border-radius: 4px; |
| | | font-size: 14px; |
| | | background-color: white; |
| | | } |
| | | |
| | | /* 默认样式 */ |
| | | .list-container { |
| | | height: 60vh; |
| | | /* 设置列表容器的高度为剩余空间,并减去表单容器的高度 */ |
| | | overflow-y: auto; |
| | | /* 允许列表容器垂直滚动 */ |
| | | padding: 10px; |
| | | /* 可选:添加一些内边距,使列表内容更美观 */ |
| | | } |
| | | |
| | | /* 在小屏幕设备上,重置高度为适应屏幕 */ |
| | | @media (max-width: 768px) { |
| | | .list-container { |
| | | height: calc(100vh - 500px); |
| | | /* 适当调整高度 */ |
| | | } |
| | | } |
| | | |
| | | |
| | | .form-container { |
| | | padding: 10px; |
| | | /* 可选:添加一些内边距,使表单内容更美观 */ |
| | | } |
| | | |
| | | .th { |
| | | background-color: lightskyblue; |
| | | color: #FFFFFF; |
| | | } |
| | | |
| | | |
| | | .plus-button { |
| | | line-height: 59px; |
| | | font-size: 24px; |
| | | /* 选择器样式 */ |
| | | .picker-input { |
| | | border: 1px solid #ddd; |
| | | border-radius: 4px; |
| | | padding: 8px 12px; |
| | | background-color: white; |
| | | cursor: pointer; |
| | | z-index: 1000; |
| | | margin-bottom: 10px; |
| | | font-size: 14px; |
| | | color: #2c3e50; |
| | | } |
| | | |
| | | /* 检验项目表格 */ |
| | | .inspection-table { |
| | | width: 100%; |
| | | border-radius: 8px; |
| | | overflow: hidden; |
| | | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); |
| | | margin: 25px 0; |
| | | } |
| | | |
| | | .inspection-table table { |
| | | width: 100%; |
| | | border-collapse: collapse; |
| | | } |
| | | |
| | | .inspection-table th { |
| | | background-color: #f8f9fa; |
| | | color: #34495e; |
| | | padding: 12px 15px; |
| | | font-weight: bold; |
| | | text-align: left; |
| | | border: 1px solid #ddd; |
| | | } |
| | | |
| | | .inspection-table td { |
| | | padding: 12px 15px; |
| | | text-align: left; |
| | | border: 1px solid #ddd; |
| | | } |
| | | |
| | | .inspection-table tr:nth-child(even) { |
| | | background-color: #f9f9f9; |
| | | } |
| | | |
| | | .inspection-table tr:hover { |
| | | background-color: #f1f5f9; |
| | | } |
| | | |
| | | /* 水印样式 */ |
| | | .watermark { |
| | | position: absolute; |
| | | font-size: 40px; |
| | | font-weight: bold; |
| | | opacity: 1; |
| | | z-index: 1; |
| | | pointer-events: none; |
| | | transform: rotate(-15deg); |
| | | width: 100%; |
| | | text-align: center; |
| | | top: 50%; |
| | | left: 50%; |
| | | transform: translate(-50%, -50%) rotate(-15deg); |
| | | } |
| | | |
| | | .watermark.approved { |
| | | color: #2ecc71; |
| | | } |
| | | |
| | | .watermark.rejected { |
| | | color: #e74c3c; |
| | | } |
| | | |
| | | .watermark.pending { |
| | | color: #f39c12; |
| | | } |
| | | |
| | | /* 描述文本容器 */ |
| | | .description-text { |
| | | position: relative; |
| | | z-index: 2; |
| | | padding: 25px; |
| | | background-color: rgba(255, 255, 255, 0.7); |
| | | } |
| | | |
| | | /* 调整表格单元格 */ |
| | | .inspection-table td:nth-child(2) { |
| | | position: relative; |
| | | overflow: hidden; |
| | | padding: 0; |
| | | } |
| | | |
| | | .record-btn { |
| | | padding: 6px 12px; |
| | | background-color: #f8f9fa; |
| | | border: 1px solid #ddd; |
| | | border-radius: 3px; |
| | | cursor: pointer; |
| | | transition: all 0.2s; |
| | | font-size: 14px; |
| | | color: #333; |
| | | } |
| | | |
| | | .record-btn:hover { |
| | | background-color: #e9ecef; |
| | | } |
| | | |
| | | |
| | | /* 操作按钮 */ |
| | | .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.danger { |
| | | background-color: #e74c3c; |
| | | 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; |
| | | 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; |
| | | } |
| | | |
| | | .popup-header { |
| | | padding: 20px; |
| | | border: 1px solid #ccc; |
| | | box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); |
| | | width: 68vw; |
| | | /* 设置宽度为视口宽度的80% */ |
| | | height: 25vh; |
| | | /* 设置高度为视口高度的80% */ |
| | | 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; |
| | | } |
| | | |
| | | .action-buttons { |
| | | flex-direction: column; |
| | | } |
| | | } |
| | | </style> |