Commit 66d5ba9e by lichengming

修改数据录入填写结果

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