|
|
@ -90,9 +90,19 @@
|
|
|
|
<!-- <el-radio v-model="radio" label="2">用量称重</el-radio> -->
|
|
|
|
<!-- <el-radio v-model="radio" label="2">用量称重</el-radio> -->
|
|
|
|
<el-button type="primary" @click="updateDrugRemain">开始称重</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-button type="warning" @click="handleSetEmpty">设置为空</el-button>
|
|
|
|
<el-button type="warning" @click="handleSetEmpty">设置为空</el-button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
|
|
<el-input v-model="inputWeigh" placeholder="手动输入" slot="append" style="width: 50%">
|
|
|
|
|
|
|
|
<template slot="append">
|
|
|
|
|
|
|
|
<el-select style="width: 50px" v-model="select_unit" slot="prepend" placeholder="请选择单位" >
|
|
|
|
|
|
|
|
<el-option label="g" value="g"></el-option>
|
|
|
|
|
|
|
|
<el-option label="ml" value="ml"></el-option>
|
|
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
</el-input>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="bottom">
|
|
|
|
<div class="bottom">
|
|
|
@ -149,7 +159,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import Scannner from '@/components/Scannner/index'
|
|
|
|
import Scannner from '@/components/Scannner/index'
|
|
|
|
import { use, drug_return, use_or_return_list } from '@/api/reagent/receivingReturn'
|
|
|
|
import { use, drug_return, use_or_return_list, calculate_volume_weight } from '@/api/reagent/receivingReturn'
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
get_check_last_drug,
|
|
|
|
get_check_last_drug,
|
|
|
|
} from '@/api/reagent/createapply'
|
|
|
|
} from '@/api/reagent/createapply'
|
|
|
@ -180,7 +190,8 @@ export default {
|
|
|
|
surplusWeigh: '',
|
|
|
|
surplusWeigh: '',
|
|
|
|
dialogVisible: false,
|
|
|
|
dialogVisible: false,
|
|
|
|
place: null,
|
|
|
|
place: null,
|
|
|
|
is_wait:true
|
|
|
|
is_wait:true,
|
|
|
|
|
|
|
|
select_unit: ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
computed: {
|
|
|
@ -387,14 +398,15 @@ export default {
|
|
|
|
this.$message.warning('请选择试剂!')
|
|
|
|
this.$message.warning('请选择试剂!')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
updateDrugRemain() {
|
|
|
|
async updateDrugRemain() {
|
|
|
|
if (this.infoData.medicament_id) {
|
|
|
|
if (this.infoData.medicament_id) {
|
|
|
|
const w = this.checkInputWeigh()
|
|
|
|
var weight = await this.check_volume_weight()
|
|
|
|
const data = {
|
|
|
|
const data = {
|
|
|
|
'bar_code': this.infoData.bar_code,
|
|
|
|
'bar_code': this.infoData.bar_code,
|
|
|
|
'medicament_id': this.infoData.medicament_id,
|
|
|
|
'medicament_id': this.infoData.medicament_id,
|
|
|
|
'remain': w ? parseFloat(this.inputWeigh).toFixed(2) : this.surplusWeigh
|
|
|
|
'remain': weight
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 领用只需更新余量重量
|
|
|
|
// 领用只需更新余量重量
|
|
|
|
if (this.$route.name == "standardReceiving"){
|
|
|
|
if (this.$route.name == "standardReceiving"){
|
|
|
|
update_drug_remain(stringify(data)).then(res => {
|
|
|
|
update_drug_remain(stringify(data)).then(res => {
|
|
|
@ -410,7 +422,7 @@ export default {
|
|
|
|
const h = this.$createElement;
|
|
|
|
const h = this.$createElement;
|
|
|
|
var msg = ""
|
|
|
|
var msg = ""
|
|
|
|
if (res.data.is_liquid){
|
|
|
|
if (res.data.is_liquid){
|
|
|
|
msg += `用量:${res.data.use_quality}, 液体 体积用量:${res.data.use_volum} ${res.data.net_weight_unit}`
|
|
|
|
msg += `用量:${res.data.use_quality}, 液体 体积用量:${res.data.use_volume} ${res.data.net_weight_unit}`
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
msg += `当次用量:${res.data.use_quality} ${res.data.net_weight_unit}`
|
|
|
|
msg += `当次用量:${res.data.use_quality} ${res.data.net_weight_unit}`
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -420,13 +432,39 @@ export default {
|
|
|
|
message: h('i', { style: 'color: teal'}, msg)
|
|
|
|
message: h('i', { style: 'color: teal'}, msg)
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.$message.warning('请选择试剂!')
|
|
|
|
this.$message.warning('请选择试剂!')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 体积转化为质量
|
|
|
|
|
|
|
|
check_volume_weight(){
|
|
|
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
|
|
|
const w = this.checkInputWeigh()
|
|
|
|
|
|
|
|
if (this.inputWeigh && this.select_unit == "ml") {
|
|
|
|
|
|
|
|
const data = {
|
|
|
|
|
|
|
|
"variety_id": this.infoData.variety_id,
|
|
|
|
|
|
|
|
'input_volume': parseFloat(this.inputWeigh).toFixed(2)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
calculate_volume_weight(stringify(data)).then(res => {
|
|
|
|
|
|
|
|
if (res.status == 0){
|
|
|
|
|
|
|
|
resolve(res.data.weight)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.$message.error(res.msg)
|
|
|
|
|
|
|
|
reject(res.msg)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
resolve(w ? parseFloat(this.inputWeigh).toFixed(2) : this.surplusWeigh)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|