Commit 2bc50d8a authored by jingnan's avatar jingnan 👀

物料确认物料配套发放增加历史扫码录入功能

parent b43a439b
...@@ -83,6 +83,74 @@ ...@@ -83,6 +83,74 @@
</el-popover> </el-popover>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="flag" :width="120" label="历史扫码录入" align="center">
<template slot-scope="scope">
<el-popover
v-if="scope.row.materialType === '标准件' "
v-model="scope.row.popoverVisibleHistory"
placement="right"
width="260"
trigger="manual"
popper-class="scan-popper"
>
<div class="content">
<el-form
:ref="'ruleForm' + scope.row.uuid"
:model="typing"
:rules="rules"
label-width="100px"
>
<el-form-item
v-show="scanIdShow"
label="扫码编码:"
prop="scanId"
>
<el-input
:ref="scope.row.uuid"
v-model="typing.scanId"
placeholder="请使用扫码枪录入"
@change="getScanNameHistory"
/>
</el-form-item>
<el-form-item v-show="!scanIdShow" label="型号/件号:">
<el-input
v-model="typing.scanName"
placeholder="型号/件号 加载中..."
/>
</el-form-item>
<el-form-item label="数量:" prop="count">
<el-input v-model="typing.count" placeholder="请填写数量" />
</el-form-item>
</el-form>
<div class="footer">
<el-button
size="mini"
type="text"
@click="resetForm('ruleForm' + scope.row.uuid, scope.row,'history')"
>取消</el-button>
<el-button
type="primary"
size="mini"
@click="submitForm('ruleForm' + scope.row.uuid, scope.row,'history')"
>确定</el-button>
</div>
</div>
<div slot="reference">
<span
class="qiang"
title="扫码枪录入"
@click="codeScanBar(scope.row,'history')"
/>
<span
class="scan"
title="扫码录入"
@click="clickScan(scope.row,'history')"
/>
</div>
</el-popover>
</template>
</el-table-column>
<!-- <el-table-column <!-- <el-table-column
v-if="flag" v-if="flag"
prop="extMaterial.isRecord" prop="extMaterial.isRecord"
...@@ -113,6 +181,7 @@ ...@@ -113,6 +181,7 @@
align="center" align="center"
label="型号/件号" label="型号/件号"
sortable sortable
:width="140"
show-overflow-tooltip show-overflow-tooltip
/> />
<el-table-column <el-table-column
...@@ -337,7 +406,8 @@ export default { ...@@ -337,7 +406,8 @@ export default {
}, },
stateList: [], stateList: [],
flag: false, flag: false,
oriData: [] // 本地row做了处理,需记录返回原数据,扫码时传给后端 oriData: [], // 本地row做了处理,需记录返回原数据,扫码时传给后端
scanType: null
} }
}, },
created() {}, created() {},
...@@ -393,6 +463,7 @@ export default { ...@@ -393,6 +463,7 @@ export default {
arr.push({ arr.push({
// weigthObj: null, // weigthObj: null,
popoverVisible: false, popoverVisible: false,
popoverVisibleHistory: false,
uuid: uuidv4(), uuid: uuidv4(),
...p, ...p,
actualWeightSelect: false, actualWeightSelect: false,
...@@ -531,54 +602,96 @@ export default { ...@@ -531,54 +602,96 @@ export default {
return 'scan-code' return 'scan-code'
} }
}, },
resetForm(formName, row) { resetForm(formName, row, type) {
row.popoverVisible = false if (type === 'history') {
row.popoverVisibleHistory = false
} else {
row.popoverVisible = false
}
this.scanIdShow = true this.scanIdShow = true
this.$refs[formName].resetFields() this.$refs[formName].resetFields()
}, },
clickScan(row) { clickScan(row, type) {
if (row.affirm === '已确认') { if (type === 'history') {
this.$message({ if (row.stateName === '已出库') {
showClose: true, this.$message({
message: '已确认 不可扫码录入!', showClose: true,
type: 'warning' message: '已出库 不可扫码录入!',
}) type: 'warning'
return })
return
}
} else {
if (row.affirm === '已确认') {
this.$message({
showClose: true,
message: '已确认 不可扫码录入!',
type: 'warning'
})
return
}
} }
this.rowId = row.id this.rowId = row.extSupportingItemId
$('#' + this.onlyUuid).click() $('#' + this.onlyUuid).click()
row.popoverVisible = true this.scanType = type
if (type === 'history') {
row.popoverVisibleHistory = true
} else {
row.popoverVisible = true
}
}, },
codeScanBar(row) { codeScanBar(row, type) {
if (row.affirm === '已确认') { if (type === 'history') {
this.$message({ if (row.stateName === '已出库') {
showClose: true, this.$message({
message: '已确认 不可扫码录入', showClose: true,
type: 'warning' message: '已出库 不可扫码录入',
type: 'warning'
})
return
}
this.tableData.forEach(item => {
if (item.id === row.id) {
row.popoverVisibleHistory = true
} else {
row.popoverVisibleHistory = false
}
}) })
return } else {
} if (row.affirm === '已确认') {
this.tableData.forEach(item => { this.$message({
if (item.id === row.id) { showClose: true,
row.popoverVisible = true message: '已确认 不可扫码录入',
} else { type: 'warning'
item.popoverVisible = false })
return
} }
}) this.tableData.forEach(item => {
this.rowId = row.id if (item.id === row.id) {
row.popoverVisible = true
} else {
item.popoverVisible = false
}
})
}
this.rowId = row.extSupportingItemId
this.$nextTick(() => { this.$nextTick(() => {
this.$refs[row.uuid].focus() this.$refs[row.uuid].focus()
}) })
}, },
getScanBar(info) { getScanBar(info) {
this.typing.scanId = info this.typing.scanId = info
this.getScanName(info) if (this.scanType === 'history') {
this.getScanNameHistory(info)
} else {
this.getScanName(info)
}
}, },
submitForm(formName, row) { submitForm(formName, row, type) {
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
this.scanIdShow = true this.scanIdShow = true
this.getQRcode(row) this.getQRcode(row, type)
this.$refs[formName].resetFields() this.$refs[formName].resetFields()
} else { } else {
return false return false
...@@ -588,33 +701,31 @@ export default { ...@@ -588,33 +701,31 @@ export default {
/** /**
* **扫描胶漆合格证二维码记实** * **扫描胶漆合格证二维码记实**
*/ */
getQRcode(row) { getQRcode(row, type) {
// 发送请求 // 发送请求
// const id = this.rowId const id = row.extSupportingItemId
const scanId = this.typing.scanId const scanId = this.typing.scanId
// const count = this.typing.count const count = this.typing.count
const currentRow = this.oriData.find(item => item.jobOutId === row.jobOutId) || {} const currentRow = this.oriData.find(item => item.jobOutId === row.jobOutId) || {}
delete currentRow.stateName delete currentRow.stateName
row.popoverVisible = false row.popoverVisible = false
row.stateName = '已出库' row.stateName = '已出库'
post( let requestUrl = ''
`/ExtScanCodeRecord/scanErpSorting?erpJobId=${scanId}`, let param = {}
currentRow, if (type === 'history') {
) requestUrl = `/ExtScanCodeRecord/saveMaterialConfirmationHead?suppId=${id}&jbOutId=${scanId}&amount=${count}`
param = {}
} else {
requestUrl = `/ExtScanCodeRecord/scanErpSorting?erpJobId=${scanId}`
param = currentRow
}
post(requestUrl, param)
.then((res) => { .then((res) => {
if (res.message.includes('成功')) { this.$message({
this.$message({ showClose: true,
showClose: true, message: '添加成功!',
message: '添加成功!', type: 'success'
type: 'success' })
})
} else {
this.$message({
showClose: true,
message: '添加失败',
type: 'error'
})
}
}) })
.catch((err) => console.log(err)) .catch((err) => console.log(err))
.finally(() => { .finally(() => {
...@@ -673,7 +784,23 @@ export default { ...@@ -673,7 +784,23 @@ export default {
}) })
.catch((err) => console.log(err)) .catch((err) => console.log(err))
.finally(() => {}) .finally(() => {})
},
async getScanNameHistory(value) {
this.scanIdShow = false
post(
`/JobResponseOutStorage/getModelNo?id=${value}`,
{}
)
.then((res) => {
this.$set(this.typing, 'scanName', res.items)
})
.catch((err) => {
this.scanIdShow = true
console.log(err)
})
.finally(() => {})
} }
} }
} }
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment