Browse Source

feat: [资源管理] [给药制剂] [麻精药] 发放获取天平值

luojie
memorylkf 1 week ago
parent
commit
1537bb9c9f
2 changed files with 21 additions and 6 deletions
  1. +2
    -2
      src/utils/tpph.js
  2. +19
    -4
      src/views/business/comps/select/SelectBalanceValue.vue

+ 2
- 2
src/utils/tpph.js View File

@ -5,7 +5,7 @@ import axios from 'axios'
import { Message } from 'element-ui' import { Message } from 'element-ui'
export async function getBalance(obj) { export async function getBalance(obj) {
alert('入参:' + JSON.stringify(obj))
// alert('入参:' + JSON.stringify(obj))
debugger debugger
return { return {
success: true, success: true,
@ -231,7 +231,7 @@ export function convertUnit(num, originalUnit, targetUnit) {
kg: 1000000000000000 kg: 1000000000000000
} }
const originalCoeff = unitToGram[originalUnit] || 1 const originalCoeff = unitToGram[originalUnit] || 1
const targetCoeff = unitToGram[targetUnit] || 1
const targetCoeff = unitToGram[targetUnit] || originalCoeff
return (num * originalCoeff) / targetCoeff return (num * originalCoeff) / targetCoeff
} }

+ 19
- 4
src/views/business/comps/select/SelectBalanceValue.vue View File

@ -21,6 +21,7 @@
<script> <script>
import SelectInstrumentDialog from '@/views/business/comps/select/SelectInstrumentDialog'; import SelectInstrumentDialog from '@/views/business/comps/select/SelectInstrumentDialog';
import { getBalance } from "@/utils/tpph";
export default { export default {
name: "SelectBalanceValue", name: "SelectBalanceValue",
components: {SelectInstrumentDialog}, components: {SelectInstrumentDialog},
@ -45,7 +46,9 @@ export default {
data() { data() {
return { return {
tpName: '', tpName: '',
tpz: ''
tpz: '',
yq:{}
}; };
}, },
mounted() { mounted() {
@ -55,10 +58,22 @@ export default {
this.$refs.selectInstrumentDialog.show() this.$refs.selectInstrumentDialog.show()
}, },
selectInstrumentChange(val,row){ selectInstrumentChange(val,row){
this.tpName=row.mc
this.tpName=row.mc
this.yq = row
}, },
getBalanceValue() {
alert('todo')
async getBalanceValue() {
if(!this.yq || !this.yq.bh){
this.$message.error('请选择仪器')
return
}
this.tpz = ''
let x = await getBalance({yq:this.yq,dw:this.dw})
if(x && x.success){
this.tpz = x.value
}else{
this.$message.error(x.message || '获取值失败')
}
this.tpzChange()
}, },
tpzChange() { tpzChange() {
this.$emit('change', this.tpz) this.$emit('change', this.tpz)

Loading…
Cancel
Save