|
|
@ -21,7 +21,7 @@
|
|
|
|
<div class="bottom">
|
|
|
|
<div class="bottom">
|
|
|
|
<el-radio v-model="radio" label="1">余量称重</el-radio>
|
|
|
|
<el-radio v-model="radio" label="1">余量称重</el-radio>
|
|
|
|
<el-radio v-model="radio" label="2">用量称重</el-radio>
|
|
|
|
<el-radio v-model="radio" label="2">用量称重</el-radio>
|
|
|
|
<el-button type="primary" @click="doWeigh">开始称重</el-button>
|
|
|
|
<el-button type="primary" @click="updateDrugRemain">更新重量</el-button>
|
|
|
|
<el-button type="primary" plain @click="doTare">去皮(初始化天平)</el-button>
|
|
|
|
<el-button type="primary" plain @click="doTare">去皮(初始化天平)</el-button>
|
|
|
|
<el-input v-model="inputWeigh" placeholder="手动输入" />
|
|
|
|
<el-input v-model="inputWeigh" placeholder="手动输入" />
|
|
|
|
<el-button type="warning">设置为空</el-button>
|
|
|
|
<el-button type="warning">设置为空</el-button>
|
|
|
@ -31,7 +31,10 @@
|
|
|
|
<div class="bottom">
|
|
|
|
<div class="bottom">
|
|
|
|
<div class="title">详情信息</div>
|
|
|
|
<div class="title">详情信息</div>
|
|
|
|
<el-descriptions class="margin-top" :column="2" border>
|
|
|
|
<el-descriptions class="margin-top" :column="2" border>
|
|
|
|
<el-descriptions-item label-style="width:100px" span="2" label="试剂名称">{{ infoData.name }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label-style="width:100px" span="2" label="试剂名称">{{
|
|
|
|
|
|
|
|
infoData.name
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
<el-descriptions-item span="2" label="英文名称">{{ infoData.english_name }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item span="2" label="英文名称">{{ infoData.english_name }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="条码编号">{{ infoData.bar_code }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="条码编号">{{ infoData.bar_code }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label-style="width:100px" label="CAS码">{{ infoData.cas_number }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label-style="width:100px" label="CAS码">{{ infoData.cas_number }}</el-descriptions-item>
|
|
|
@ -85,24 +88,29 @@ export default {
|
|
|
|
// 如果 `barCode` 发生改变,这个函数就会运行
|
|
|
|
// 如果 `barCode` 发生改变,这个函数就会运行
|
|
|
|
// 扫码后提交后台并自动选择下一行
|
|
|
|
// 扫码后提交后台并自动选择下一行
|
|
|
|
barCode: function(newCode, oldCode) {
|
|
|
|
barCode: function(newCode, oldCode) {
|
|
|
|
get_drug_info(stringify({ 'bar_code': newCode })).then(res => {
|
|
|
|
this.getDrugInfo(newCode)
|
|
|
|
this.infoData = res.data
|
|
|
|
|
|
|
|
this.$message.success(res.data.name + ' 试剂领扫描成功!')
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
mounted() {
|
|
|
|
// 自动刷新获取数据(1000*60*60=>毫秒*秒*分钟,此时表示为60分钟)
|
|
|
|
// 自动刷新获取数据(1000*60*60=>毫秒*秒*分钟,此时表示为60分钟)
|
|
|
|
this.timer = setInterval(() => {
|
|
|
|
this.timer = setInterval(() => {
|
|
|
|
this.doWeigh()
|
|
|
|
this.doWeigh()
|
|
|
|
}, 200)
|
|
|
|
}, 500)
|
|
|
|
this.doZero()
|
|
|
|
// this.doZero()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
destroyed() {
|
|
|
|
destroyed() {
|
|
|
|
|
|
|
|
if (this.timer) {
|
|
|
|
clearInterval(this.timer)
|
|
|
|
clearInterval(this.timer)
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
getDrugInfo(code) {
|
|
|
|
|
|
|
|
get_drug_info(stringify({ 'bar_code': code })).then(res => {
|
|
|
|
|
|
|
|
this.infoData = res.data
|
|
|
|
|
|
|
|
this.$message.success(res.data.name + ' 试剂领扫描成功!')
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
checkInputWeigh() {
|
|
|
|
checkInputWeigh() {
|
|
|
|
const w = parseFloat(this.inputWeigh)
|
|
|
|
const w = parseFloat(this.inputWeigh)
|
|
|
|
return !!w
|
|
|
|
return !!w
|
|
|
@ -158,11 +166,12 @@ export default {
|
|
|
|
const w = this.checkInputWeigh()
|
|
|
|
const w = this.checkInputWeigh()
|
|
|
|
const data = {
|
|
|
|
const data = {
|
|
|
|
'medicament_id': this.infoData.medicament_id,
|
|
|
|
'medicament_id': this.infoData.medicament_id,
|
|
|
|
'reain': w ? parseFloat(this.inputWeigh) : this.weight
|
|
|
|
'remain': w ? parseFloat(this.inputWeigh) : this.weight
|
|
|
|
}
|
|
|
|
}
|
|
|
|
update_drug_remain(stringify(data)).then(
|
|
|
|
update_drug_remain(stringify(data)).then(
|
|
|
|
res => {
|
|
|
|
res => {
|
|
|
|
this.$message.success(res.msg)
|
|
|
|
this.$message.success(res.msg)
|
|
|
|
|
|
|
|
this.getDrugInfo(this.infoData.bar_code)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|