Commit f50b43c6 authored by 旭艳's avatar 旭艳

代码录入接口调试

parent 72d85956
......@@ -4,7 +4,7 @@
<span class="title">物料领用发放:</span>
<span v-show="false">提示:当类型非(密封剂/涂料/胶粘剂)才可扫码录入!</span>
</p>
<!-- <scan v-show="false" :id="onlyUuid" @getQrCode="getQRcode">扫码录入</scan> -->
<scan v-show="false" :id="onlyUuid" @getQrCode="getQRcode">扫码录入</scan>
<!-- 表格 -->
<div>
<el-table
......@@ -70,7 +70,7 @@
<el-table-column :width="80" label="操作" align="center">
<template slot-scope="scope">
<el-button
:disabled="!scope.row.extScanCodeRecords[0].id"
:disabled="scope.row.extScanCodeRecords[0].status==='未确认'"
size="mini"
type="danger"
@click="deleteRow(scope.row)"
......@@ -97,11 +97,11 @@ import { v4 as uuidv4 } from 'uuid'
import { post } from '@/utils/http'
// 电子签名
import '@/api/jq-signature'
// import scan from '@/components/scanCode/scanCode'
import scan from '@/components/scanCode/scanCode'
export default {
// components: {
// scan
// },
components: {
scan
},
data() {
return {
// 加载中
......@@ -144,7 +144,7 @@ export default {
{
title: '类型',
show: true,
key: 'extMaterial.resTypeName',
key: 'extMaterial.resType2.typeName',
align: 'center',
sortable: true,
minWidth: 120
......@@ -152,7 +152,7 @@ export default {
{
title: '单位',
show: true,
key: 'extUnit.unitName',
key: 'extMaterial.extUnit.unitName',
align: 'center',
sortable: true,
minWidth: 80
......@@ -275,10 +275,15 @@ export default {
'name': 'extScanCodeRecords'
},
{
'name': 'extMaterial'
},
{
'name': 'extUnit'
'name': 'extMaterial',
'openProps': [
{
'name': 'resType2'
},
{
'name': 'extUnit'
}
]
}
],
'sortItem': [
......@@ -310,6 +315,14 @@ export default {
})
},
clickScan(row) {
if (row.extScanCodeRecords[0].status === '已确认') {
this.$message({
showClose: true,
message: '已确认 不可扫码录入!',
type: 'warning'
})
return
}
this.rowId = row.id
// if (['密封剂', '涂料', '胶粘剂'].includes(row.resTypeName)) {
// this.$message({
......@@ -330,6 +343,14 @@ export default {
// })
// return
// }
if (row.extScanCodeRecords[0].status === '已确认') {
this.$message({
showClose: true,
message: '已确认 不可扫码录入!',
type: 'warning'
})
return
}
this.tableData.forEach(item => {
if (item.id === row.id) {
row.popoverVisible = true
......@@ -407,7 +428,7 @@ export default {
// operator: 'REMOVE'
// }
// 发送请求
post(`ExtScanCodeRecord/removeScanCode?id=${row.id}&reqName=${row.extMaterial.resName}`, {})
post(`ExtScanCodeRecord/removeScanCode?id=${row.extScanCodeRecords[0].id}&reqName=${row.extMaterial.resType2.typeName}`, {})
.then((res) => {
if (res.message.includes('成功')) {
this.init()
......
......@@ -289,7 +289,15 @@ export default {
components: {
scan
},
filters: {
filterState: value => {
this.stateList.forEach(element => {
if (element.dictKey === value) {
return element.dictValue
}
})
}
},
data() {
return {
onlyUuid: null,
......@@ -315,11 +323,15 @@ export default {
rules: {
scanId: [{ required: true, message: '请扫码录入' }],
count: [{ required: true, message: '请输入数量' }]
}
},
stateList: []
}
},
created() {},
mounted() {
this.$utils.getDicListByCode('StorageReqStatus').then(res => {
this.stateList = res
})
this.onlyUuid = uuidv4()
},
methods: {
......@@ -335,6 +347,11 @@ export default {
)
.then((res) => {
this.tableData = res.items.map((p) => {
this.stateList.forEach(element => {
if (element.value === p.reqStatus) {
p.stateName = element.label
}
})
return {
popoverVisible: false,
uuid: uuidv4(),
......
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