|
|
|
@ -23,11 +23,14 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 主体滚动区域 --> |
|
|
|
<div class="scrollable-content"> |
|
|
|
<!-- MR信息卡片 --> |
|
|
|
<div class="work-order-list" v-if="mrInfo.orderNo"> |
|
|
|
<div class="material-card"> |
|
|
|
<div class="card-title"> |
|
|
|
<span class="title-label">MR号:{{ mrInfo.orderNo }} 行号:{{ mrInfo.lineNo }} lineItemNo:{{ mrInfo.lineItemNo }}</span> |
|
|
|
<span class="title-label">MR号:{{ mrInfo.orderNo }} 行号:{{ mrInfo.lineNo }} |
|
|
|
lineItemNo:{{ mrInfo.lineItemNo }}</span> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 物料描述单独一行 --> |
|
|
|
@ -72,8 +75,9 @@ |
|
|
|
<div class="col-qty">标签数量</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="list-body"> |
|
|
|
<div v-for="(label, index) in labelList" :key="label.id" class="list-item"> |
|
|
|
<div class="col-no">{{ labelList.length - index }}</div> |
|
|
|
<div class="col-no">{{ index+1 }}</div> |
|
|
|
<div class="col-label">{{ label.labelCode }}</div> |
|
|
|
<div class="col-batch">{{ label.batchNo }}</div> |
|
|
|
<div class="col-qty" @click="openEditDialog(label, index)"> |
|
|
|
@ -87,6 +91,8 @@ |
|
|
|
<p>暂无扫描标签</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 发料汇总 --> |
|
|
|
<!-- <div class="issue-summary" v-if="labelList.length > 0"> |
|
|
|
@ -102,12 +108,12 @@ |
|
|
|
|
|
|
|
<!-- 底部操作按钮 --> |
|
|
|
<div class="bottom-actions"> |
|
|
|
<button class="action-btn primary" @click="confirmIssue"> |
|
|
|
<el-button class="action-btn primary" @click="confirmIssue" :loading="issueloading"> |
|
|
|
确认发料 |
|
|
|
</button> |
|
|
|
<button class="action-btn secondary" style="margin-left: 10px;" @click="cancelIssue"> |
|
|
|
</el-button> |
|
|
|
<el-button class="action-btn secondary" style="margin-left: 10px;" @click="cancelIssue"> |
|
|
|
取消 |
|
|
|
</button> |
|
|
|
</el-button> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 编辑标签弹框 --> |
|
|
|
@ -121,40 +127,22 @@ |
|
|
|
<div class="modal-body"> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="form-label">物料标签</label> |
|
|
|
<el-input |
|
|
|
v-model="editForm.labelCode" |
|
|
|
disabled |
|
|
|
class="form-input" |
|
|
|
/> |
|
|
|
<el-input v-model="editForm.labelCode" disabled class="form-input" /> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="form-group"> |
|
|
|
<label class="form-label">批次号</label> |
|
|
|
<el-input |
|
|
|
v-model="editForm.batchNo" |
|
|
|
disabled |
|
|
|
class="form-input" |
|
|
|
/> |
|
|
|
<el-input v-model="editForm.batchNo" disabled class="form-input" /> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="form-group"> |
|
|
|
<label class="form-label">库位 <span class="required">*</span></label> |
|
|
|
<el-input |
|
|
|
v-model="editForm.locationId" |
|
|
|
placeholder="请输入库位" |
|
|
|
class="form-input" |
|
|
|
/> |
|
|
|
<el-input v-model="editForm.locationId" placeholder="请输入库位" class="form-input" /> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="form-group"> |
|
|
|
<label class="form-label">发料数量 <span class="required">*</span></label> |
|
|
|
<el-input |
|
|
|
v-model="editForm.quantity" |
|
|
|
type="number" |
|
|
|
:min="0" |
|
|
|
placeholder="请输入发料数量" |
|
|
|
class="form-input" |
|
|
|
/> |
|
|
|
<el-input v-model="editForm.quantity" type="number" :min="0" placeholder="请输入发料数量" class="form-input" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
@ -168,7 +156,12 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { scanMaterialLabel, confirmMrIssue } from '@/api/mr/mr' |
|
|
|
import { |
|
|
|
scanMaterialLabel, |
|
|
|
confirmMrIssue, |
|
|
|
printLabelCommon, |
|
|
|
} from '@/api/mr/mr' |
|
|
|
import { Loading } from 'element-ui' |
|
|
|
import moment from 'moment' |
|
|
|
|
|
|
|
export default { |
|
|
|
@ -188,9 +181,10 @@ export default { |
|
|
|
labelCode: '', |
|
|
|
batchNo: '', |
|
|
|
locationId: '', |
|
|
|
quantity: 0 |
|
|
|
quantity: 0, |
|
|
|
}, |
|
|
|
editIndex: -1, // 当前编辑的标签索引 |
|
|
|
issueloading: false, |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
@ -325,20 +319,19 @@ export default { |
|
|
|
engChgLevel: label.engChgLevel || '1', |
|
|
|
})), |
|
|
|
} |
|
|
|
|
|
|
|
this.$confirm( |
|
|
|
`确认发料 ${this.totalIssueQty} ${this.mrInfo.unitMeas || 'pcs'}?`, |
|
|
|
'确认发料', |
|
|
|
{ |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning', |
|
|
|
} |
|
|
|
) |
|
|
|
.then(() => { |
|
|
|
this.issueloading = true |
|
|
|
confirmMrIssue(params) |
|
|
|
.then(({ data }) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
if (data.unitIds && data.unitIds.length > 0) { |
|
|
|
let printLabelType |
|
|
|
if (this.mrInfo.partNo && this.mrInfo.partNo.startsWith('80')) { |
|
|
|
printLabelType = '库存成品标签' |
|
|
|
} else { |
|
|
|
printLabelType = 'BIL标签' |
|
|
|
} |
|
|
|
this.printViaServer(data.unitIds, printLabelType) |
|
|
|
} |
|
|
|
this.$message.success('发料成功') |
|
|
|
sessionStorage.setItem('mrPicking_shouldRestore', 'true') |
|
|
|
this.$router.back() |
|
|
|
@ -350,11 +343,43 @@ export default { |
|
|
|
console.error('发料确认失败:', error) |
|
|
|
this.$message.error('发料失败') |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
// 用户取消 |
|
|
|
.finally(() => { |
|
|
|
this.issueloading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
async printViaServer(unitIds, printLabelType) { |
|
|
|
if (!unitIds || unitIds.length === 0) { |
|
|
|
console.warn('没有可打印的标签') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
this.printLoading = true |
|
|
|
|
|
|
|
try { |
|
|
|
const printRequest = { |
|
|
|
userId: localStorage.getItem('userName'), |
|
|
|
username: localStorage.getItem('userName'), |
|
|
|
site: localStorage.getItem('site'), |
|
|
|
unitIds: unitIds, |
|
|
|
labelType: printLabelType, |
|
|
|
} |
|
|
|
console.log('打印请求:', printRequest) |
|
|
|
|
|
|
|
const { data } = await printLabelCommon(printRequest) |
|
|
|
|
|
|
|
if (data.code === 200 || data.code === 0) { |
|
|
|
this.$message.success(`打印任务已发送!`) |
|
|
|
this.clearData() |
|
|
|
} else { |
|
|
|
this.$message.error(data.msg || '打印失败') |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
console.error('服务器打印失败:', error) |
|
|
|
this.$message.error(`打印失败: ${error.message || error}`) |
|
|
|
} finally { |
|
|
|
this.printLoading = false |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 取消发料 |
|
|
|
cancelIssue() { |
|
|
|
@ -401,7 +426,7 @@ export default { |
|
|
|
labelCode: label.labelCode, |
|
|
|
batchNo: label.batchNo, |
|
|
|
locationId: label.locationId || '', |
|
|
|
quantity: label.quantity || label.availableQty |
|
|
|
quantity: label.quantity || label.availableQty, |
|
|
|
} |
|
|
|
this.editIndex = index |
|
|
|
this.showEditDialog = true |
|
|
|
@ -414,7 +439,7 @@ export default { |
|
|
|
labelCode: '', |
|
|
|
batchNo: '', |
|
|
|
locationId: '', |
|
|
|
quantity: 0 |
|
|
|
quantity: 0, |
|
|
|
} |
|
|
|
this.editIndex = -1 |
|
|
|
}, |
|
|
|
@ -601,9 +626,13 @@ export default { |
|
|
|
|
|
|
|
/* 内容区域 */ |
|
|
|
.content-area { |
|
|
|
padding: 12px 16px; |
|
|
|
} |
|
|
|
|
|
|
|
.scrollable-content { |
|
|
|
flex: 1; |
|
|
|
overflow-y: auto; |
|
|
|
padding: 12px 16px; |
|
|
|
min-height: 0; |
|
|
|
} |
|
|
|
|
|
|
|
/* 材料卡片 */ |
|
|
|
@ -747,6 +776,8 @@ export default { |
|
|
|
margin: 0 16px 12px; |
|
|
|
border-radius: 0 0 8px 8px; |
|
|
|
overflow: hidden; |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
} |
|
|
|
|
|
|
|
.list-header { |
|
|
|
@ -757,6 +788,12 @@ export default { |
|
|
|
font-size: 12px; |
|
|
|
color: #666; |
|
|
|
font-weight: 500; |
|
|
|
flex-shrink: 0; |
|
|
|
} |
|
|
|
|
|
|
|
.list-body { |
|
|
|
flex: 1; |
|
|
|
min-height: 0; |
|
|
|
} |
|
|
|
|
|
|
|
.list-item { |
|
|
|
@ -841,7 +878,6 @@ export default { |
|
|
|
|
|
|
|
/* 工单列表 */ |
|
|
|
.work-order-list { |
|
|
|
overflow-y: auto; |
|
|
|
padding: 12px 16px; |
|
|
|
} |
|
|
|
.work-order-list { |
|
|
|
|