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'
export async function getBalance(obj) {
alert('入参:' + JSON.stringify(obj))
// alert('入参:' + JSON.stringify(obj))
debugger
return {
success: true,
@ -231,7 +231,7 @@ export function convertUnit(num, originalUnit, targetUnit) {
kg: 1000000000000000
}
const originalCoeff = unitToGram[originalUnit] || 1
const targetCoeff = unitToGram[targetUnit] || 1
const targetCoeff = unitToGram[targetUnit] || originalCoeff
return (num * originalCoeff) / targetCoeff
}

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

@ -21,6 +21,7 @@
<script>
import SelectInstrumentDialog from '@/views/business/comps/select/SelectInstrumentDialog';
import { getBalance } from "@/utils/tpph";
export default {
name: "SelectBalanceValue",
components: {SelectInstrumentDialog},
@ -45,7 +46,9 @@ export default {
data() {
return {
tpName: '',
tpz: ''
tpz: '',
yq:{}
};
},
mounted() {
@ -55,10 +58,22 @@ export default {
this.$refs.selectInstrumentDialog.show()
},
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() {
this.$emit('change', this.tpz)

Loading…
Cancel
Save