Commit 66d5ba9e by lichengming

修改数据录入填写结果

parent 96944537
...@@ -98,10 +98,13 @@ ...@@ -98,10 +98,13 @@
<span v-else-if="item.key==='sampleQuantity'" @click.stop="_handleRow(scope)"> <span v-else-if="item.key==='sampleQuantity'" @click.stop="_handleRow(scope)">
<el-input <el-input
v-model="scope.row.sampleQuantity" v-model="scope.row.sampleQuantity"
type="number"
size="medium" size="medium"
placeholder="请输入样品量" placeholder="请输入样品量"
@keydown.native="channelInputLimit"
@blur="_handleSampleQuantityEdit(scope.row.id,scope.row.sampleQuantity)" @blur="_handleSampleQuantityEdit(scope.row.id,scope.row.sampleQuantity)"
/> />
</span> </span>
...@@ -120,6 +123,22 @@ ...@@ -120,6 +123,22 @@
<span v-else-if="item.key==='recordWriiten'"> <span v-else-if="item.key==='recordWriiten'">
{{ scope.row[item.key]==='t'?'是':'否' }} {{ scope.row[item.key]==='t'?'是':'否' }}
</span> </span>
<span v-else-if="item.key==='failQuantity'">
<el-input
v-model="scope.row.failQuantity"
type="number"
@keydown.native="channelInputLimit"
@blur="_handleFailQuantityEdit(scope.row.id,scope.row.failQuantity)"
/>
</span>
<span v-else-if="item.key==='deviation'">
<el-input
v-model="scope.row.deviation"
size="medium"
placeholder="请输入检测结果"
@blur="_handleDeviationEdit(scope.row.id,scope.row.deviation)"
/>
</span>
<span v-else>{{ scope.row[item.key] }}</span> <span v-else>{{ scope.row[item.key] }}</span>
</template> </template>
</el-table-column> </el-table-column>
...@@ -277,6 +296,15 @@ export default { ...@@ -277,6 +296,15 @@ export default {
} }
}, },
methods: { methods: {
channelInputLimit(e) {
const key = e.key
// 不允许输入'e'和'.'
if (key === 'e' || key === '.') {
e.returnValue = false
return false
}
return true
},
// 分配时间 // 分配时间
_assignDateChange(data) { _assignDateChange(data) {
this.formObj.assignDateBegin = data[0] this.formObj.assignDateBegin = data[0]
...@@ -578,14 +606,41 @@ export default { ...@@ -578,14 +606,41 @@ export default {
} }
}, },
_handleDeviationEdit: async function(id, deviation) {
if (deviation !== '' && undefined !== deviation) {
const data = {}
data.id = id
data.deviation = deviation
const result = await drugItem.edit(data)
if (result) {
// await this._page()
} else {
this.$Message.error('保存失败')
}
}
},
_handleFailQuantityEdit: async function(id, failQuantity) {
if (failQuantity !== '' && undefined !== failQuantity) {
const data = {}
data.id = id
data.failQuantity = failQuantity
const result = await drugItem.edit(data)
if (result) {
// await this._page()
} else {
this.$Message.error('保存失败')
}
}
},
_handleSampleQuantityEdit: async function(id, sampleQuantity) { _handleSampleQuantityEdit: async function(id, sampleQuantity) {
if (sampleQuantity !== '' && undefined !== sampleQuantity) { if (sampleQuantity !== '' && undefined !== sampleQuantity) {
const data = {} const data = {}
data.itemIds = id data.id = id
data.sampleQuantity = sampleQuantity data.sampleQuantity = sampleQuantity
const result = await drugItem.edit(data) const result = await drugItem.edit(data)
if (result) { if (result) {
await this._page() // await this._page()
} else { } else {
this.$Message.error('保存失败') this.$Message.error('保存失败')
} }
......
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