|
|
|
@ -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) |
|
|
|
|