cq-panda / Vue.NetCore

(已支持sqlsugar).NetCore、.Net6、Vue2、Vue3、Vite、TypeScript、Element plus+uniapp前后端分离,全自动生成代码;支持移动端(ios/android/h5/微信小程序。http://www.volcore.xyz/
MIT License
3.83k stars 1.27k forks source link

this.detailOptions.columnIndex = true; 可以让子档序号出现,要如何让这个序号存在table中??? #254

Open Jay413191 opened 2 years ago

Jay413191 commented 2 years ago

this.detailOptions.columnIndex = true; 可以让子档序号出现,要如何让这个序号存在table中???

cq-panda commented 2 years ago

this.columnIndex =true

Jay413191 commented 2 years ago

您可能误会了, 我的意思是数据库的table中, this.columnIndex =true只会存在画面中

cq-panda commented 2 years ago

不懂

Jay413191 commented 2 years ago

如图, 新增SNo栏位, 已找到方法让序号产生. 因为出货单要去验证是那一笔订单明细出货(同料号订单可能有多笔), 所以订单的序号会KEEP在数据库

image

detailSelectClick() { let rows = this.$refs.detailTable.getSelected(); if (!rows.length) { return this.$message.error("請選擇貨品!!"); }

  let i = 0;

  this.$emit("parentCall", ($parent) => {
    if($parent.$refs.detail.rowData.length >0 )
    {
      JSON.stringify($parent.$refs.detail.rowData.forEach(item => {
      if(item.SNo > i)
        i = item.SNo;
      }))
    };
    i++;
    let _rows = rows.map((row) => {
      return {
        SNo : i++,
        GoodsId: row.GoodsId,
        GoodsName: row.GoodsName,
        Spec: row.Spec,
        Unit: row.Unit,
      };
    });

    $parent.$refs.detail.rowData.push(..._rows);

    //this.detailModel = false; 選完後關窗
  });
},