|
|
@ -245,7 +245,7 @@ |
|
|
<div v-if="processFlag === 3" class="scan-label-page"> |
|
|
<div v-if="processFlag === 3" class="scan-label-page"> |
|
|
|
|
|
|
|
|
<div class="input-section"> |
|
|
<div class="input-section"> |
|
|
|
|
|
|
|
|
|
|
|
<button @click="confirmScanLabelIssue" class="confirm-btn">确认发料</button> |
|
|
<div class="label-info" v-if="scanLabelData.labelInfo"> |
|
|
<div class="label-info" v-if="scanLabelData.labelInfo"> |
|
|
<div class="info-row"><span class="label">物料编码:</span><span |
|
|
<div class="info-row"><span class="label">物料编码:</span><span |
|
|
class="value">{{ scanLabelData.labelInfo.partNo }}</span></div> |
|
|
class="value">{{ scanLabelData.labelInfo.partNo }}</span></div> |
|
|
@ -254,7 +254,7 @@ |
|
|
<div class="info-row"><span class="label">可用数量:</span><span |
|
|
<div class="info-row"><span class="label">可用数量:</span><span |
|
|
class="value">{{ scanLabelData.labelInfo.availableQty }}</span></div> |
|
|
class="value">{{ scanLabelData.labelInfo.availableQty }}</span></div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="qty-input" v-if="scanLabelData.labelInfo"> |
|
|
|
|
|
|
|
|
<!-- <div class="qty-input" v-if="scanLabelData.labelInfo"> |
|
|
<div class="input-group"> |
|
|
<div class="input-group"> |
|
|
<label>发料数量</label> |
|
|
<label>发料数量</label> |
|
|
<input v-model="scanLabelData.issueQty" type="number" :max="scanLabelData.labelInfo.availableQty" |
|
|
<input v-model="scanLabelData.issueQty" type="number" :max="scanLabelData.labelInfo.availableQty" |
|
|
@ -264,11 +264,33 @@ |
|
|
<label>备注</label> |
|
|
<label>备注</label> |
|
|
<el-input type="textarea" v-model="scanLabelData.remark" placeholder="可选" /> |
|
|
<el-input type="textarea" v-model="scanLabelData.remark" placeholder="可选" /> |
|
|
</div> |
|
|
</div> |
|
|
<button @click="confirmScanLabelIssue" class="confirm-btn" :disabled="!scanLabelData.issueQty">确认发料</button> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div> --> |
|
|
|
|
|
<div class="input-group"> |
|
|
|
|
|
<div class="input-with-scan"> |
|
|
|
|
|
<input v-model="scanTableInput" placeholder="请扫描材料编号" @keyup.enter="handleScanTableInput" /> |
|
|
|
|
|
<button @click="handleScanTableInput" class="scan-btn">添加</button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="input-group"> |
|
|
|
|
|
<el-table :data="scanTableData" border highlight-current-row ref="mainTable" style="width: 100%; "> |
|
|
|
|
|
<el-table-column v-for="(item,index) in columnList" :key="index" :sortable="item.columnSortable" |
|
|
|
|
|
:prop="item.columnProp" :header-align="item.headerAlign" |
|
|
|
|
|
:show-overflow-tooltip="item.showOverflowTooltip" :align="item.align" |
|
|
|
|
|
:fixed="item.fixed==''?false:item.fixed" :min-width="item.columnWidth" :label="item.columnLabel"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span> |
|
|
|
|
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" |
|
|
|
|
|
style="width: 100px; height: 80px" /></span> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
</el-table> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="message" v-if="scanLabelData.message" :class="scanLabelData.messageType"> |
|
|
<div class="message" v-if="scanLabelData.message" :class="scanLabelData.messageType"> |
|
|
{{ scanLabelData.message }}</div> |
|
|
{{ scanLabelData.message }}</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
@ -285,6 +307,7 @@ import { |
|
|
bindUnitsToPallet, |
|
|
bindUnitsToPallet, |
|
|
printPalletLabel, |
|
|
printPalletLabel, |
|
|
getPalletInfo, |
|
|
getPalletInfo, |
|
|
|
|
|
scanMaterialLabel, |
|
|
} from '@/api/production/production-issue' |
|
|
} from '@/api/production/production-issue' |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
@ -345,6 +368,64 @@ export default { |
|
|
showScanLabel: false, |
|
|
showScanLabel: false, |
|
|
scanLabelContext: {}, |
|
|
scanLabelContext: {}, |
|
|
scanLabelData: {}, |
|
|
scanLabelData: {}, |
|
|
|
|
|
scanTableInput: '', |
|
|
|
|
|
scanTableData: [], |
|
|
|
|
|
columnList: [ |
|
|
|
|
|
{ |
|
|
|
|
|
userId: this.$store.state.user.name, |
|
|
|
|
|
functionId: 701002, |
|
|
|
|
|
serialNumber: '701002Table1NotifyNo', |
|
|
|
|
|
tableId: '701002Table1', |
|
|
|
|
|
tableName: '生产入库申请主表', |
|
|
|
|
|
columnProp: 'partNo', |
|
|
|
|
|
headerAlign: 'center', |
|
|
|
|
|
align: 'center', |
|
|
|
|
|
columnLabel: '材料单号', |
|
|
|
|
|
columnHidden: false, |
|
|
|
|
|
columnImage: false, |
|
|
|
|
|
columnSortable: false, |
|
|
|
|
|
sortLv: 0, |
|
|
|
|
|
status: true, |
|
|
|
|
|
fixed: '', |
|
|
|
|
|
columnWidth: 100, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
userId: this.$store.state.user.name, |
|
|
|
|
|
functionId: 701002, |
|
|
|
|
|
serialNumber: '701002Table1WorkShopName', |
|
|
|
|
|
tableId: '701002Table1', |
|
|
|
|
|
tableName: '生产入库申请主表', |
|
|
|
|
|
columnProp: 'desc', |
|
|
|
|
|
headerAlign: 'center', |
|
|
|
|
|
align: 'center', |
|
|
|
|
|
columnLabel: '材料描述', |
|
|
|
|
|
columnHidden: false, |
|
|
|
|
|
columnImage: false, |
|
|
|
|
|
columnSortable: false, |
|
|
|
|
|
sortLv: 0, |
|
|
|
|
|
status: true, |
|
|
|
|
|
fixed: '', |
|
|
|
|
|
columnWidth: 100, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
userId: this.$store.state.user.name, |
|
|
|
|
|
functionId: 701002, |
|
|
|
|
|
serialNumber: '701002Table1WorkShopName', |
|
|
|
|
|
tableId: '701002Table1', |
|
|
|
|
|
tableName: '生产入库申请主表', |
|
|
|
|
|
columnProp: 'qty', |
|
|
|
|
|
headerAlign: 'center', |
|
|
|
|
|
align: 'center', |
|
|
|
|
|
columnLabel: '数量', |
|
|
|
|
|
columnHidden: false, |
|
|
|
|
|
columnImage: false, |
|
|
|
|
|
columnSortable: false, |
|
|
|
|
|
sortLv: 0, |
|
|
|
|
|
status: true, |
|
|
|
|
|
fixed: '', |
|
|
|
|
|
columnWidth: 100, |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
|
@ -783,11 +864,11 @@ export default { |
|
|
selectedMaterials: [ |
|
|
selectedMaterials: [ |
|
|
{ |
|
|
{ |
|
|
...this.scanLabelContext.material, |
|
|
...this.scanLabelContext.material, |
|
|
issueQty: this.scanLabelData.issueQty |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
issueQty: this.scanLabelData.issueQty, |
|
|
|
|
|
}, |
|
|
], |
|
|
], |
|
|
scannedLabel: this.scanLabelData.scannedLabel, |
|
|
scannedLabel: this.scanLabelData.scannedLabel, |
|
|
remark: this.scanLabelData.remark |
|
|
|
|
|
|
|
|
remark: this.scanLabelData.remark, |
|
|
} |
|
|
} |
|
|
const response = await directIssue(issueData) |
|
|
const response = await directIssue(issueData) |
|
|
if (response.data.code === 0) { |
|
|
if (response.data.code === 0) { |
|
|
@ -809,11 +890,11 @@ export default { |
|
|
selectedMaterials: [ |
|
|
selectedMaterials: [ |
|
|
{ |
|
|
{ |
|
|
...this.scanLabelContext.material, |
|
|
...this.scanLabelContext.material, |
|
|
issueQty: this.scanLabelData.issueQty |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
issueQty: this.scanLabelData.issueQty, |
|
|
|
|
|
}, |
|
|
], |
|
|
], |
|
|
scannedLabel: this.scanLabelData.scannedLabel, |
|
|
scannedLabel: this.scanLabelData.scannedLabel, |
|
|
remark: this.scanLabelData.remark |
|
|
|
|
|
|
|
|
remark: this.scanLabelData.remark, |
|
|
} |
|
|
} |
|
|
const response = await requestIssue(issueData) |
|
|
const response = await requestIssue(issueData) |
|
|
if (response.data.code === 0) { |
|
|
if (response.data.code === 0) { |
|
|
@ -836,6 +917,32 @@ export default { |
|
|
this.loading = false |
|
|
this.loading = false |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
handleScanTableInput() { |
|
|
|
|
|
if (!this.scanTableInput) return |
|
|
|
|
|
// 假设扫描内容为材料编号,自动生成描述(实际可根据业务查接口) |
|
|
|
|
|
let params = { |
|
|
|
|
|
scanTableInput: this.scanTableInput, |
|
|
|
|
|
} |
|
|
|
|
|
scanMaterialLabel(params).then(({data}) => { |
|
|
|
|
|
if (data.code === 0) { |
|
|
|
|
|
let material = { |
|
|
|
|
|
partNo: data.labelInfo.partNo , |
|
|
|
|
|
desc: data.labelInfo.partDesc || '材料描述-' + this.scanTableInput, |
|
|
|
|
|
qty: 1, // 默认数量为1 |
|
|
|
|
|
} |
|
|
|
|
|
this.scanTableData.push(material) |
|
|
|
|
|
this.scanTableInput = '' |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error(data.msg || '扫描失败') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
this.$message.error('扫描异常: ' + error.message) |
|
|
|
|
|
return |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
|