Преглед на файлове

新增获取单据表格已选数据

ymy преди 2 години
родител
ревизия
751a323107
променени са 2 файла, в които са добавени 40 реда и са изтрити 3 реда
  1. 22 0
      src/benyun/components/byBill/byBill.vue
  2. 18 3
      src/views/demo/bill.vue

+ 22 - 0
src/benyun/components/byBill/byBill.vue

@@ -256,6 +256,28 @@ export default class ByBill extends VueViews {
     }  
     return d;
   }
+
+  //获取单据数据
+  getBillFormValue(){
+    let v = (this.$refs.billForm as any).getValue();
+    return v;
+  }
+
+  //获取单据表格已选数据
+  /**
+   * 
+   * @param n 表示第几个单据表格,用下标表示
+   */
+  getBillTableSelect(n:any){
+    let d:Array<any>=[];
+    const code = 'billTable_'+n;
+    if(this.$refs[code]){
+      d = (this.$refs[code] as any)[0].getSelectData();
+    }
+    return d;
+  }
+
+
   //设置单据表单数据
   setBillFormValue(value:any){
     if(this.$refs['billForm']){

+ 18 - 3
src/views/demo/bill.vue

@@ -9,7 +9,9 @@
       <el-button type="primary" plain @click="setSourcePage">设置引单1分页</el-button><br/>
       <el-button type="primary" plain @click="setSmtValue">设置已提交数据</el-button><br/>
       <el-button type="primary" plain @click="setSmtPage">设置已提交分页</el-button><br/>
-      <el-button type="primary" plain @click="setdraftsBoxValue">设置草稿箱数据</el-button>
+      <el-button type="primary" plain @click="setdraftsBoxValue">设置草稿箱数据</el-button><br/>
+      <el-button type="primary" plain @click="setBillTableData">设置单据表格1数据</el-button><br/>
+      <el-button type="primary" plain @click="getBillTableSelectData">获取单据表格1数据</el-button><br/>
     </div>
     
   </div>
@@ -21,7 +23,7 @@ import { Component, Prop, Vue, Watch } from "vue-property-decorator";
 export default class BillDemo extends Vue {
   config:any={
     attr:{
-      activeName:'smt'
+      // activeName:'smt'
     },
     source:[{
       title:'引单1',
@@ -337,7 +339,20 @@ export default class BillDemo extends Vue {
   mounted(){
 
   }
-
+  setBillTableData(){
+    let data:Array<any>=[{
+      id:1,
+      name:'张三11111',
+    },{
+      id:2,
+      name:'李四',
+    }];
+    (this.$refs.bill as any).setBillTableValue(data,0);
+  }
+  getBillTableSelectData(){
+    const d = (this.$refs.bill as any).getBillTableSelect(0);
+    console.log('单据表格1已选数据:',d);
+  }
   search(parames:any){
     console.log('搜索回传参数',parames);
   }