1
huangxiaoqiang
2025-02-18 31eba6a8c6261adf5bfef4dafad4dc8efc1f66a2
Code Management/WMS/WIDESEA_WMSClient/src/extension/widesea_wms/stock/Dt_BillGroupStock.jsx
@@ -8,12 +8,12 @@
//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码
// import gridHeader from "./demo_Product/Dt_BillGroupStockDetail.vue";
import gridBody from "./extend/SupplementationData.vue"
let extension = {
  components: {
    //查询界面扩展组件
    gridHeader: '',
    gridBody: '',
    gridBody: gridBody,
    gridFooter: '',
    //新建、编辑弹出框扩展组件
    modelHeader: '',
@@ -29,7 +29,7 @@
      let OutBoundBtn = this.buttons.find((x) => x.value == 'OutBound')
      if (OutBoundBtn) {
        OutBoundBtn.onClick = function () {
          this.$Message.success('点击了按钮')
          // this.$Message.success('点击了按钮')
          let row = this.$refs.table.getSelected() //获取选中的行
          if (row <= 0) {
            //如果没有选中行
@@ -48,12 +48,28 @@
              //示例:调用后台接口
              if (res.status) {
                this.$Message.success('创建任务成功')
                this.refresh() //刷新表格
              } else {
                this.$Message.error(res.message) //错误提示
              }
            })
        }
      }
      var btnSupplementationData = this.buttons.find(x => x.value == "SupplementationData");
            if (btnSupplementationData != null) {
                btnSupplementationData.onClick = () => {
                    let rows = this.$refs.table.getSelected();
                        if (rows.length == 0) {
                            return this.$error("请选择数据!");
                        } else if (rows.length > 1) {
                            return this.$error("只能选择单条数据");
                        }
                        this.$refs.gridBody.open(rows[0].palletCode);
                        this.refresh();
                    }
                }
      //示例:在按钮的最前面添加一个按钮
      // this.buttons.unshift({
      //   //也可以用push或者splice方法来修改buttons数组
@@ -111,7 +127,8 @@
        //修改颜色
        if (column.field == 'roadwayNo') {
          column.formatter = (row) => {
            return '<span style="color: #2d8cf0;">' + row.locationInfo.roadwayNo + '</span>'
            // return '<span style="color: #2d8cf0;">' + row?.locationInfo?.roadwayNo + '</span>'
            return  row?.locationInfo?.roadwayNo
          }
        }
        //格式化日期
@@ -129,7 +146,7 @@
          // 定义一个格式化函数,根据 'locationStatus' 的值返回相应的文本
          column.formatter = (row) => {
            // 使用 statusMap 对象来获取对应的文本,如果没有匹配则返回 '未知状态'
            return statusMap[row.locationInfo.locationStatus] || '未知状态';
            return statusMap[row?.locationInfo?.locationStatus] || '未知状态';
          }
        }
      })