1
huangxiaoqiang
17 小时以前 af5847927931d3f491d7be5e0178cff3c37ac6f9
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSClient/src/extension/widesea_wms/stock/Dt_BillGroupStock.jsx
@@ -26,52 +26,119 @@
  methods: {
    //下面这些方法可以保留也可以删除
    onInit() {
      // let OtherOutBoundbtn=this.buttons.find(x=>x.value=='OtherOutBound');
      // if(OtherOutBoundbtn){
      //   OtherOutBoundbtn.onClick=function(){
      // this.detailOptions.buttons.unshift({
      //   name: '其他出库', //按钮名称
      //   icon: 'el-icon-document', //按钮图标vue2版本见iview文档icon,vue3版本见element ui文档icon(注意不是element puls文档)
      //   type: 'primary',
      //   onClick: function () {
      //     this.$confirm('是否其他出库', "警告你正在使用其他出库", {
      //       confirmButtonText: '确定',
      //       cancelButtonText: '取消',
      //       type: 'warning',
      //       center: true
      //     }).then(() => {
      //       this.http.post(`/api/Task/OtherOutBoundTaskAsync`, row, "正在完成任务").then((res) => {
      //         //示例:调用后台接口
      //         if (res.status) {
      //           this.$Message.success('任务完成')
      //         } else {
      //           this.$Message.error(res.message) //错误提示
      //         }
      //       })
      //     })
      //   }
      // });
      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)
              } else {
                this.$Message.error(res.message) //错误提示
              }
            })
          })
        }
      })
      this.boxButtons.push({
        name: '调拨出库', //按钮名称
        icon: 'el-icon-document', //按钮图标:组件示例->图标
        //primary、success、warning、error、info、text、danger
        type: 'danger',
        plain: true,
        onClick: function () {
          this.$confirm('是否调拨出库', "警告你正在使用调拨出库", {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning',
            center: true
          }).then(() => {
            this.http.post(`/api/Task/HandAllocateOutBoundTaskAsync`, this.$refs.detail.rowData, "正在完成任务").then((res) => {
              if (res.status) {
                this.$Message.success(res.message)
              } else {
                this.$Message.error(res.message) //错误提示
              }
            })
          })
        }
      })
      // this.detailOptions.buttons.unshift({
      //   name: '调拨出库',
      //   icon: '',
      //   type: 'primary',
      //   onClick: function (e) {
      //     let row = this.$refs.table.getSelected() //获取选中的行
      //     if (row <= 0) {
      //       //如果没有选中行
      //       this.$Message.error('请选择一行数据')
      //       return;
      //       return
      //     }
      //     let palletCode = row[0].palletCode
      //     this.http.get(`/api/Task/CompleteTaskAsync?taskNum=${taskNum}`, {}, "正在完成任务").then((res) => {
      //     let taskNum = row[0].taskNum
      //     this.http.post(`/api/Task/CompleteTaskAsync?taskNum=${taskNum}`, {}, "正在完成任务").then((res) => {
      //       //示例:调用后台接口
      //       if (res.status) {
      //         this.$Message.success('任务完成');
      //         this.refresh();
      //         this.$Message.success(res.message)
      //       } else {
      //         this.$Message.error(res.message) //错误提示
      //         this.refresh();
      //       }
      //     })
      //   }
      // }
        this.columns.push({
          field: '操作',
          title: '操作',
          width: 90,
          fixed: 'right',
          align: 'center',
          formatter: (row) => {
              return (
                  '<i style="cursor: pointer;color: #2d8cf0;"class="el-icon-view">其他出库</i>'
              );
          },
          click: (row) => {
            console.log(row);
            this.http.post(`/api/Task/OtherOutBoundTaskAsync?palletCode=${row.palletCode}`, {}, "正在生成任务").then((res) => {
                    //示例:调用后台接口
                    if (res.status) {
                      this.$Message.success(row[0].palletCode+"出库成功");
                      this.refresh();
                    } else {
                      this.$Message.error(res.message) //错误提示
                      this.refresh();
                    }
                  })
          }
      // });
      this.columns.push({
        field: '操作',
        title: '操作',
        width: 90,
        fixed: 'right',
        align: 'center',
        formatter: (row) => {
          return (
            '<i style="cursor: pointer;color: #2d8cf0;"class="el-icon-view">盘点出库</i>'
          );
        },
        click: (row) => {
          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: "操作",
@@ -100,7 +167,11 @@
      //示例:设置修改新建、编辑弹出框字段标签的长度
      this.boxOptions.labelWidth = 150
      this.buttons.forEach((btn) => {
        if (btn.name == '编辑') {
          btn.hidden = true;
        }
      });
      this.columns.forEach((column) => {
@@ -125,7 +196,7 @@
            '6': '二楼B5-G5缓存区',
          };
          column.formatter = (row) => {
            return  floorMap[row?.locationInfo?.areaId] || ''
            return floorMap[row?.locationInfo?.areaId] || ''
          }
        }
        if (column.field == 'locationStatus') {
@@ -168,10 +239,41 @@
    },
    rowClick({ row, column, event }) {
      //查询界面点击行事件
      // this.$refs.table.$refs.table.toggleRowSelection(row) //单击行时选中当前行;
      //this.$refs.table.$refs.table.toggleRowSelection(row) //单击行时选中当前行;
    },
    modelOpenAfter(row) {
      const isAdd = this.currentAction == 'Add';//判断是否为新建操作
      //隐藏明细表按钮
      this.detailOptions.buttons.forEach((btn) => {
        if (btn.name == '添加行') {
          btn.hidden = true;
          //或者设置只读
          //btn.readonly=true;
        }
      });
      const isDel = this.currentAction == 'Add';//判断是否为新建操作
      //隐藏明细表按钮
      this.detailOptions.buttons.forEach((btn) => {
        if (btn.name == '删除行') {
          btn.hidden = true;
          //或者设置只读
          //btn.readonly=true;
        }
      });
      this.detailOptions.buttons.forEach((btn) => {
        if (btn.name == '导入') {
          btn.hidden = true;
          //或者设置只读
          //btn.readonly=true;
        }
      });
      this.detailOptions.buttons.forEach((btn) => {
        if (btn.name == '导出') {
          btn.hidden = true;
          //或者设置只读
          //btn.readonly=true;
        }
      });
      //点击编辑、新建按钮弹出框后,可以在此处写逻辑,如,从后台获取数据
      //(1)判断是编辑还是新建操作: this.currentAction=='Add';
      //(2)给弹出框设置默认值