Browse Source

feat: [模板管理] SP0021.vue获取天平

zhangteng
memorylkf 4 days ago
parent
commit
a9d188289d
1 changed files with 17 additions and 1 deletions
  1. +17
    -1
      src/views/business/comps/template/comps/sp/SP0021.vue

+ 17
- 1
src/views/business/comps/template/comps/sp/SP0021.vue View File

@ -31,7 +31,7 @@
@click="onImportAnimal(item, index)">导入动物</el-button>
<CustomTable :ref="`ybsmTableRef${index}`" :columns="ybsmColumns"
:showOperation="fillType === 'actFill'" :showAddRow="fillType === 'actFill'"
:formData="item">
:formData="item" @clickButton="(e, rowIndex,colIndex,ee,data)=>handleClickButton(e, rowIndex,colIndex,ee,data,index)">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns"
@deleteRow="() => deleteTableRow(rowIndex, `ybsmTableRef${index}`)">
@ -64,6 +64,7 @@ import CustomTable from '@/components/Template/CustomTable.vue';
import { uniqeResource ,uniqeYqOne} from "@/utils/calUnitTools";
import { getuuid, justUpdateFilledFormData } from "@/utils/index";
import { getBaseInfoFormConfig, getStorageFormConfig, getRemarkFormConfig, getYbsmFormConfig, getTableColumns } from "../../formConfig/sp/SP0021";
import { getBalance } from '@/utils/tpph.js';
const refConfig = {
baseInfoRef: "baseInfoRef",
remarkRef: "remarkRef",
@ -256,6 +257,21 @@ export default {
console.log(content);
},
//
async handleClickButton(e, rowIndex,colIndex,ee,data,index) {
if(e==='calcCqzl'){
const content = this.getFilledFormData()
let formData = this.formData;
let qy = content.ybsmDataList[index].yqInfo_xztp || formData.ybsmDataList[index].yqInfo_xztp
let dw = 'g'
let x = await getBalance({yq:qy,dw:dw})
if(x && x.success){
this.$refs[`ybsmTableRef${index}`][0]?.updateDataSourceByRowIndex(rowIndex, { cqzl: x.value },{signData:data,updateFields:['cqzl']});
}else{
this.$message.error(x.message || '称量失败')
}
}
},
}
};
</script>

Loading…
Cancel
Save