huangxiaoqiang
2025-11-29 f9e8a2d52fe52fb2389892a46c12d4d262ee9aaf
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSClient/src/extension/widesea_wms/stock/Dt_BillGroupStock.jsx
@@ -48,55 +48,106 @@
      //     })
      //   }
      // });
      this.boxButtons.push({
        name: '其他出库', //按钮名称
        icon: 'el-icon-document', //按钮图标:组件示例->图标
        //primary、success、warning、error、info、text、danger
        type: 'primary',
        plain: true,
        onClick: function () {
          this.$confirm('是否其他出库', '警告', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning',
            center: true
          }).then(() => {
            this.http
              .post(
                `/api/Task/OtherOutBoundTaskAsync`,
                this.$refs.detail.rowData,
                '正在生成出库任务'
              )
              .then((res) => {
                if (res.status) {
                  this.$Message.success(res.message)
                  this.boxModel = false
                  this.refresh()
                } else {
                  this.$Message.error(res.message) //错误提示
                }
              })
          })
      var DoubleTrayBtn = this.buttons.find(x => x.value == "DoubleTray");
        if (DoubleTrayBtn != null) {
          DoubleTrayBtn.onClick = () => {
                let rows = this.$refs.table.getSelected();
                if (rows.length == 0) return this.$error("请选择数据!");
                if (rows.length >1) return this.$error("请选择数据!");
                this.http.post(`/api/Task/OutBoundTaskAsync?palletCode=${rows[0].palletCode}&remark=${""}&doubleTray=${1}`, {}, '数据处理中...')
                    .then((x) => {
                        if (x.status) {
                            this.$Message.success('成功.');
                            this.refresh();
                        } else {
                            return this.$error(x.message);
                        }
                    });
            }
        }
      })
      this.boxButtons.push({
        name: '调拨出库', //按钮名称
        icon: 'el-icon-document', //按钮图标:组件示例->图标
        //primary、success、warning、error、info、text、danger
        name: '确定出库', //按钮名称
        type: 'danger',
        icon: 'el-icon-check',
        disabled: false,
        plain: true,
        onClick: function () {
          this.$confirm('是否调拨出库', '警告', {
          if (this.editFormFields.remark == '其他出库') {
            this.$confirm('是否其他出库', '警告', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning',
              center: true,
              customClass: 'large-text-confirm'
            }).then(() => {
              this.http
                .post(
                  `/api/Task/OtherOutBoundTaskAsync`,
                  this.$refs.detail.rowData,
                  '正在生成出库任务'
                )
                .then((res) => {
                  if (res.status) {
                    this.$Message.success(res.message)
                    this.boxModel = false
                    this.refresh()
                  } else {
                    this.$Message.error(res.message) //错误提示
                  }
                })
            })
          } else {
            this.$confirm('是否调拨出库', '警告', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning',
              center: true,
              customClass: 'large-text-confirm'
            }).then(() => {
              this.http
                .post(
                  `/api/Task/HandAllocateOutBoundTaskAsync`,
                  this.$refs.detail.rowData,
                  '正在生成出库任务'
                )
                .then((res) => {
                  if (res.status) {
                    this.$Message.success(res.message)
                    this.boxModel = false
                    this.refresh()
                  } else {
                    this.$Message.error(res.message) //错误提示
                  }
                })
            })
          }
        }
      })
      this.boxButtons.push({
        name: '打印二维码', //按钮名称
        type: 'primary',
        icon: 'el-icon-check',
        disabled: false,
        plain: true,
        onClick: function () {
          let rows = this.$refs.detail.getSelected()
          if (rows.length == 0) return this.$error("请选择数据!");
          let orderNos  = rows.map(x => {
            return x.orderNo
        })
          this.$confirm('是否打印单据', '警告', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning',
            center: true
            center: true,
            customClass: 'large-text-confirm'
          }).then(() => {
            this.http
              .post(
                `/api/Task/HandAllocateOutBoundTaskAsync`,
                this.$refs.detail.rowData,
                '正在生成出库任务'
                `/api/StockInfo/PrintOrder`,
                orderNos,
                '正在打印'
              )
              .then((res) => {
                if (res.status) {
@@ -110,61 +161,6 @@
          })
        }
      })
      // this.detailOptions.buttons.unshift({
      //   name: '调拨出库',
      //   icon: '',
      //   type: 'primary',
      //   onClick: function (e) {
      //     let row = this.$refs.table.getSelected() //获取选中的行
      //     if (row <= 0) {
      //       //如果没有选中行
      //       this.$Message.error('请选择一行数据')
      //       return
      //     }
      //     let taskNum = row[0].taskNum
      //     this.http.post(`/api/Task/CompleteTaskAsync?taskNum=${taskNum}`, {}, "正在完成任务").then((res) => {
      //       //示例:调用后台接口
      //       if (res.status) {
      //         this.$Message.success(res.message)
      //       } else {
      //         this.$Message.error(res.message) //错误提示
      //       }
      //     })
      //   }
      // });
      // this.columns.push({
      //   field: '操作',
      //   title: '操作',
      //   width: 90,
      //   fixed: 'right',
      //   align: 'center',
      //   type:'jsx',
      //   formatter: (row) => {
      //     //return '<i style="cursor: pointer;color: #2d8cf0;"class="el-icon-view">盘点出库</i>'
      //     return [{
      //       name:"btn1",
      //       type:"primary"
      //     },{
      //       name:"btn1",
      //       type:"success"
      //     }]
      //   },
      //   click: (row,formatter) => {
      //     console.log(formatter);
      //     this.http
      //       .post(`/api/Task/OutBoundTaskAsync?palletCode=${row.palletCode}`, {}, '正在生成任务')
      //       .then((res) => {
      //         //示例:调用后台接口
      //         if (res.status) {
      //           this.$Message.success(row.palletCode + '出库成功')
      //           this.refresh()
      //         } else {
      //           this.$Message.error(res.message) //错误提示
      //           this.refresh()
      //         }
      //       })
      //   }
      // })
      this.columns.push({
        title: '操作',
        field: '操作',
@@ -173,62 +169,36 @@
        render: (h, { row, column, index }) => {
          return (
            <div>
              <el-button onClick={($e) => { }} type="primary">
              <el-button
                onClick={($e) => {
                  ;(row.remark = '其他出库'), this.linkDataNew(row, '其他出库')
                }}
                type="primary"
              >
                å…¶ä»–出库
              </el-button>
              <el-button onClick={($e) => {
               }} type="success" >
              <el-button
                onClick={($e) => {
                  ;(row.remark = '调拨出库'), this.linkDataNew(row, '调拨出库')
                }}
                type="success"
              >
                è°ƒæ‹¨å‡ºåº“
              </el-button>
              <el-button onClick={($e) => {
                    // this.http
                    //   .post(`/api/Task/OutBoundTaskAsync?palletCode=${row.palletCode}`, {}, '正在生成任务')
                    //   .then((res) => {
                    //     //示例:调用后台接口
                    //     if (res.status) {
                    //       this.$Message.success(row.palletCode + '出库成功')
                    //       this.refresh()
                    //     } else {
                    //       this.$Message.error(res.message) //错误提示
                    //       this.refresh()
                    //     }
                    //   })
                    this.$refs.gridBody.open(row.palletCode);
                }} type="warning">
              <el-button
                onClick={($e) => {
                  this.$refs.gridBody.open(row.palletCode)
                }}
                type="warning"
              >
                ç›˜ç‚¹å‡ºåº“
              </el-button>
            </div>
          )
        }
      })
      // this.columns.push({
      //   title: "操作",
      //   field: "操作",
      //   width: 150,
      //   align: "left", // 'center',
      //   render: (h, { row, column, index }) => {
      //     return (
      //       <div>
      //         <el-button
      //           onClick={($e) => {
      //             // this.$refs.table.load();
      //             // console.log(this.$refs.table);
      //             this.$refs.gridHeader.open(row);
      //           }}
      //           type="primary"
      //           plain
      //           style="height:26px; padding: 10px !important;"
      //         >
      //           æ‰“印
      //         </el-button>
      //       </div>
      //     );
      //   },
      // });
      //示例:设置修改新建、编辑弹出框字段标签的长度
      this.boxOptions.labelWidth = 150
      this.buttons.forEach((btn) => {
@@ -236,7 +206,11 @@
          btn.hidden = true
        }
      })
      this.boxButtons.forEach((btn) => {
        if (btn.name == '保 å­˜') {
          btn.hidden = true
        }
      })
      this.columns.forEach((column) => {
        if (column.field == 'floor') {
          const floorMap = {
@@ -302,6 +276,7 @@
    modelOpenAfter(row) {
      const isAdd = this.currentAction == 'Add' //判断是否为新建操作
      //隐藏明细表按钮
      // boxButtons
      this.detailOptions.buttons.forEach((btn) => {
        if (btn.name == '添加行') {
          btn.hidden = true
@@ -309,6 +284,7 @@
          //btn.readonly=true;
        }
      })
      const isDel = this.currentAction == 'Add' //判断是否为新建操作
      //隐藏明细表按钮
      this.detailOptions.buttons.forEach((btn) => {