wangxinhui
2 天以前 9ce6731460179c71f0f2c636b2a1598324d5194e
ÏîÄ¿´úÂë/WMS/WMSClient/src/extension/outbound/extend/outOrderDetail.vue
@@ -14,13 +14,13 @@
              <span>已选中 {{ selection.length }} é¡¹</span>
            </el-col>
            <el-col :span="8">
              <el-link
              <!-- <el-link
                type="primary"
                size="small"
                style="float: right; height: 20px"
                @click="lockstocks"
                >锁定库存</el-link
              >
              > -->
              <el-link
                type="primary"
                size="small"
@@ -124,14 +124,20 @@
          hidden: true,
        },
        {
          prop: "orderId",
          prop: "outBSTOrderId",
          title: "出库单主键",
          type: "string",
          width: 90,
          hidden: true,
        },
        {
          prop: "materielCode",
          prop: "materialId",
          title: "上游物料ID",
          type: "string",
          width: 120,
        },
        {
          prop: "materialNo",
          title: "物料编号",
          type: "string",
          width: 150,
@@ -141,51 +147,52 @@
          title: "物料名称",
          type: "string",
          width: 150,
          hidden: true,
        },
        {
          prop: "batchNo",
          title: "批次号",
          prop: "width",
          title: "幅宽",
          type: "string",
          width: 90,
          width: 100,
        },
        {
          prop: "orderQuantity",
          title: "单据数量",
          prop: "xqLen",
          title: "需求长度",
          type: "string",
          width: 90,
          width: 130,
        },
        {
          prop: "lockQuantity",
          title: "锁定数量",
          prop: "totalUsage",
          title: "总用重量",
          type: "int",
          width: 90,
          width: 130,
        },
        {
          prop: "overOutQuantity",
          title: "已出数量",
          prop: "assignTotalUsage",
          title: "已分配长度",
          type: "string",
          width: 90,
          width: 130,
        },
        {
          prop: "unit",
          title: "单位",
          prop: "outTotalUsage",
          title: "已出长度",
          type: "string",
          width: 90,
          width: 130,
        },
        {
          prop: "orderDetailStatus",
          prop: "outBSTOrderDetailStatus",
          title: "订单明细状态",
          type: "tag",
          width: 180,
          bindKey: "orderDetailStatusEnum",
          bindKey: "outboundStatusEnum",
        },
        {
          prop: "assignStock",
          title: "指定库存",
          type: "icon",
          width: 90,
          icon: "el-icon-s-grid",
        },
        // {
        //   prop: "assignStock",
        //   title: "指定库存",
        //   type: "icon",
        //   width: 90,
        //   icon: "el-icon-s-grid",
        // },
        {
          prop: "viewDetail",
          title: "出库详细",
@@ -194,33 +201,16 @@
          icon: "el-icon-s-operation",
        },
        {
          prop: "creater",
          title: "创建人",
          type: "string",
          width: 90,
        },
        {
          prop: "createDate",
          title: "创建时间",
          type: "datetime",
          width: 160,
        },
        {
          prop: "modifier",
          title: "修改人",
          type: "string",
          width: 100,
          width: 170,
        },
        {
          prop: "modifyDate",
          title: "修改时间",
          type: "datetime",
          width: 160,
        },
        {
          prop: "remark",
          title: "备注",
          type: "string",
          width: 170,
        },
      ],
      paginations: {
@@ -284,14 +274,15 @@
        }
        
        // ä»…对数值列求和
        // ä»…对某一列求和
        if (column.property === 'lockQuantity' || column.property === 'overOutQuantity' || column.property === 'orderQuantity') {
        if (column.property === 'xqLen' || column.property === 'assignTotalUsage' || column.property === 'outTotalUsage' || column.property === 'totalUsage') {
          const values = data.map(item => Number(item[column.property]))
        console.log(values);
        if (!values.every(value => isNaN(value))) {
          sums[index] = values.reduce((prev, curr) => {
            return prev + (isNaN(curr) ? 0 : curr)
          }, 0)
          }, 0);
          //保留两位小数
          sums[index] = sums[index].toFixed(4)
        } else {
          sums[index] = '-'
        }
@@ -302,7 +293,7 @@
      return sums
    },
    getData() {
      var wheres = [{ name: "orderId", value: this.row.id }];
      var wheres = [{ name: "outBSTOrderId", value: this.row.id }];
      var param = {
        page: this.paginations.page,
        rows: this.paginations.rows,
@@ -311,7 +302,7 @@
        wheres: JSON.stringify(wheres), // æŸ¥è¯¢æ¡ä»¶ï¼Œæ ¼å¼ä¸º[{ name: "字段", value: "xx" }]
      };
      this.http
        .post("api/OutboundOrderDetail/GetPageData", param, "查询中")
        .post("api/OutBSTOrderDetail/GetPageData", param, "查询中")
        .then((x) => {
          this.tableData = x.rows;
        });
@@ -321,25 +312,25 @@
        this.$refs.child.open(row);
      } else {
        //点击打开出库详情
        this.$refs.selectedStock.open(row);
        this.$refs.selectedStock.open(row,this.row.outBSTOrderNo);
      }
    },
    lockstocks() {
      if (this.selection.length === 0) {
        return this.$message.error("请选择单据明细");
      }
      var keys = this.selection.map((item) => item.id); // èŽ·å–é€‰ä¸­è¡Œçš„id
      this.http
        .post("api/OutboundOrderDetail/LockOutboundStocks", keys, "数据处理中")
        .then((x) => {
          if (!x.status) return this.$message.error(x.message);
          this.$message.success("操作成功");
          this.showDetialBox = false;
          this.$emit("parentCall", ($vue) => {
            $vue.getData();
          });
        });
    },
    // lockstocks() {
    //   if (this.selection.length === 0) {
    //     return this.$message.error("请选择单据明细");
    //   }
    //   var keys = this.selection.map((item) => item.id); // èŽ·å–é€‰ä¸­è¡Œçš„id
    //   this.http
    //     .post("api/OutboundOrderDetail/LockOutboundStocks", keys, "数据处理中")
    //     .then((x) => {
    //       if (!x.status) return this.$message.error(x.message);
    //       this.$message.success("操作成功");
    //       this.showDetialBox = false;
    //       this.$emit("parentCall", ($vue) => {
    //         $vue.getData();
    //       });
    //     });
    // },
    outbound() {
      if (this.selection.length === 0) {
        return this.$message.error("请选择单据明细");
@@ -347,7 +338,7 @@
      var keys = this.selection.map((item) => item.id); // èŽ·å–é€‰ä¸­è¡Œçš„id
      this.http
        .post("api/Task/GenerateOutboundTasks", keys, "数据处理中")
        .post("api/Task/CreateBSTOutboundTasks", keys, "数据处理中")
        .then((x) => {
          if (!x.status) return this.$message.error(x.message);
          this.$message.success("操作成功");