feat: 添加AGV任务管理和托盘组功能
feat(task): 新增AGV任务页面和路由配置
feat(stock): 添加托盘组管理页面及进站出站操作
feat(task): 在任务历史页面添加操作类型列
refactor: 优化AGV任务查询条件及过滤逻辑
已添加6个文件
已修改4个文件
1267 ■■■■■ 文件已修改
Code/WCS/WIDESEAWCS_Client/src/extension/taskinfo/agvTask.jsx 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Client/src/router/viewGird.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Client/src/views/taskinfo/agvTask.vue 236 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WMS/WIDESEA_WMSClient/src/extension/stock/groupPalle.jsx 133 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WMS/WIDESEA_WMSClient/src/extension/stock/stockInfo.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WMS/WIDESEA_WMSClient/src/extension/taskinfo/agvTask.jsx 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WMS/WIDESEA_WMSClient/src/router/viewGird.js 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WMS/WIDESEA_WMSClient/src/views/stock/groupPalle.vue 487 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WMS/WIDESEA_WMSClient/src/views/taskinfo/task_agv.vue 231 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WMS/WIDESEA_WMSClient/src/views/taskinfo/task_hty.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WCS/WIDESEAWCS_Client/src/extension/taskinfo/agvTask.jsx
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,78 @@
//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码
let extension = {
  components: {
    //查询界面扩展组件
    gridHeader: "",
    gridBody: "",
    gridFooter: "",
    //新建、编辑弹出框扩展组件
    modelHeader: "",
    modelBody: "",
    modelFooter: "",
  },
  tableAction: "", //指定某张表的权限(这里填写表名,默认不用填写)
  buttons: { view: [], box: [], detail: [] }, //扩展的按钮
  methods: {
    //下面这些方法可以保留也可以删除
    onInit() {},
    onInited() {
      //框架初始化配置后
      //如果要配置明细表,在此方法操作
      //this.detailOptions.columns.forEach(column=>{ });
    },
searchBefore(param) {
  //界面查询前,可以给param.wheres添加查询参数
  //返回false,则不会执行查询
  // ç¬¬ä¸€ä¸ªè¿‡æ»¤æ¡ä»¶
  const roadwayFilter1 = {
    name: "roadway",
    value: "ZJ1",
    displayType: "like",
  };
  // ç¬¬äºŒä¸ªè¿‡æ»¤æ¡ä»¶
  const roadwayFilter2 = {
    name: "roadway",
    value: "FJ1",
    displayType: "like",
  };
  if (!param.wheres) {
    param.wheres = [];
  }
  // å°†ä¸¤ä¸ªè¿‡æ»¤æ¡ä»¶æ·»åŠ åˆ°æŸ¥è¯¢å‚æ•°ä¸­
  param.wheres.push(roadwayFilter1);
  param.wheres.push(roadwayFilter2);
  return true;
},
    searchAfter(result) {
      //查询后,result返回的查询数据,可以在显示到表格前处理表格的值
      return true;
    },
    addBefore(formData) {
      //新建保存前formData为对象,包括明细表,可以给给表单设置值,自己输出看formData的值
      return true;
    },
    updateBefore(formData) {
      //编辑保存前formData为对象,包括明细表、删除行的Id
      return true;
    },
    rowClick({ row, column, event }) {
      //查询界面点击行事件
      this.$refs.table.$refs.table.toggleRowSelection(row); //单击行时选中当前行;
    },
    modelOpenAfter(row) {
      //点击编辑、新建按钮弹出框后,可以在此处写逻辑,如,从后台获取数据
      //(1)判断是编辑还是新建操作: this.currentAction=='Add';
      //(2)给弹出框设置默认值
      //(3)this.editFormFields.字段='xxx';
      //如果需要给下拉框设置默认值,请遍历this.editFormOptions找到字段配置对应data属性的key值
      //看不懂就把输出看:console.log(this.editFormOptions)
    },
  },
};
export default extension;
Code/WCS/WIDESEAWCS_Client/src/router/viewGird.js
@@ -77,6 +77,10 @@
    path: '/task',
    name: 'task',
    component: () => import('@/views/taskinfo/task.vue')
  },{
    path: '/agvTask',
    name: 'agvTask',
    component: () => import('@/views/taskinfo/agvTask.vue')
  },
  {
    path: '/taskHty',
Code/WCS/WIDESEAWCS_Client/src/views/taskinfo/agvTask.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,236 @@
<template>
  <view-grid
    ref="grid"
    :columns="columns"
    :detail="detail"
    :editFormFields="editFormFields"
    :editFormOptions="editFormOptions"
    :searchFormFields="searchFormFields"
    :searchFormOptions="searchFormOptions"
    :table="table"
    :extend="extend"
  >
  </view-grid>
</template>
  <script>
import extend from "@/extension/taskinfo/agvTask.jsx";
import { ref, defineComponent } from "vue";
export default defineComponent({
  setup() {
    const table = ref({
      key: "taskId",
      footer: "Foots",
      cnName: "任务信息",
      name: "task",
      url: "/Task/",
      sortName: "CreateDate",
    });
    const editFormFields = ref({});
    const editFormOptions = ref([]);
    const searchFormFields = ref({
      taskNum: "",
      palletCode: "",
      roadway: "",
      sourceAddress: "",
      targetAddress: "",
      currentAddress: "",
      nextAddress: "",
      creater: "",
      createDate: "",
    });
    const searchFormOptions = ref([
      [
        { title: "任务号", field: "taskNum", type: "int" },
        { title: "托盘编号", field: "palletCode", type: "like" },
        {
          title: "任务类型",
          field: "taskType",
          type: "selectList",
          dataKey: "taskType",
          data: [],
        },
        {
          title: "任务状态",
          field: "taskStatus",
          type: "selectList",
          dataKey: "taskState",
          data: [],
        },
      ],
      [
        { title: "起始地址", field: "sourceAddress", type: "like" },
        { title: "目标地址", field: "targetAddress", type: "like" },
        { title: "当前位置", field: "currentAddress", type: "like" },
        { title: "下一位置", field: "nextAddress", type: "like" },
      ],
      [
        { title: "巷道号", field: "roadway", type: "like" },
        { title: "创建人", field: "creater", type: "like" },
        { title: "创建时间", field: "createDate", type: "datetime" },
      ],
    ]);
    const columns = ref([
      {
        field: "taskId",
        title: "TaskId",
        type: "int",
        width: 90,
        hidden: true,
        readonly: true,
        require: true,
        align: "left",
      },
      {
        field: "taskNum",
        title: "任务号",
        type: "int",
        width: 90,
        align: "left",
      },
      {
        field: "palletCode",
        title: "托盘编号",
        type: "string",
        width: 200,
        align: "left",
      },
      {
        field: "roadway",
        title: "巷道号",
        type: "string",
        width: 90,
        align: "left",
      },
      {
        field: "taskType",
        title: "任务类型",
        type: "int",
        width: 90,
        align: "left",
        bind: { key: "taskType", data: [] },
      },
      {
        field: "taskStatus",
        title: "任务状态",
        type: "int",
        width: 150,
        align: "left",
        bind: { key: "taskState", data: [] },
      },
      {
        field: "sourceAddress",
        title: "起始地址",
        type: "int",
        width: 120,
        align: "left",
      },
      {
        field: "targetAddress",
        title: "目标地址",
        type: "string",
        width: 120,
        align: "left",
      },
      {
        field: "currentAddress",
        title: "当前位置",
        type: "string",
        width: 120,
        align: "left",
      },
      {
        field: "nextAddress",
        title: "下一位置",
        type: "string",
        width: 120,
        align: "left",
      },
      {
        field: "exceptionMessage",
        title: "异常信息",
        type: "string",
        width: 90,
        align: "left",
        hidden: true,
      },
      {
        field: "grade",
        title: "优先级",
        type: "int",
        width: 80,
        align: "left",
      },
      {
        field: "dispatchertime",
        title: "任务下发时间",
        type: "datetime",
        width: 150,
        align: "left",
      },
      {
        field: "wMSId",
        title: "WMS任务主键",
        type: "int",
        width: 120,
        align: "left",
        hidden: true,
      },
      {
        field: "creater",
        title: "创建人",
        type: "string",
        width: 90,
        align: "left",
      },
      {
        field: "createDate",
        title: "创建时间",
        type: "datetime",
        width: 150,
        align: "left",
      },
      {
        field: "modifier",
        title: "修改人",
        type: "string",
        width: 100,
        align: "left",
      },
      {
        field: "modifyDate",
        title: "修改时间",
        type: "datetime",
        width: 160,
        align: "left",
      },
      {
        field: "remark",
        title: "备注",
        type: "string",
        width: 100,
        align: "left",
        hidden: true,
      },
    ]);
    const detail = ref({
      cnName: "",
      table: "",
      columns: [],
      sortName: "",
      key: "",
    });
    return {
      table,
      extend,
      editFormFields,
      editFormOptions,
      searchFormFields,
      searchFormOptions,
      columns,
      detail,
    };
  },
});
</script>
Code/WMS/WIDESEA_WMSClient/src/extension/stock/groupPalle.jsx
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,133 @@
//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码
let extension = {
  components: {
    //查询界面扩展组件
    gridHeader: '',
    gridBody: '',
    gridFooter: '',
    //新建、编辑弹出框扩展组件
    modelHeader: '',
    modelBody: '',
    modelFooter: ''
  },
  tableAction: '',
  buttons: { view: [], box: [], detail: [] },
  methods: {
    onInit() {
      // æ·»åŠ MES操作列
      this.columns.push({
        title: '操作',
        field: '操作',
        align: 'center',
        width: 200,
        fixed: 'right',
        render: (h, { row, column, index }) => {
          return (
            <div>
              <el-button
                type="primary"
                size="small"
                onClick={($e) => { this.handleInbound(row); }}
              >进站</el-button>
              <el-button
                type="success"
                size="small"
                style="margin-left: 8px"
                onClick={($e) => { this.handleOutbound(row); }}
              >出站</el-button>
            </div>
          );
        }
      });
    },
    // æ‰˜ç›˜è¿›ç«™æ“ä½œ
    async handleInbound(row) {
      try {
        await this.$confirm(`确认执行托盘进站操作?\n托盘编号:${row.palletCode}`, "进站确认", {
          confirmButtonText: "确认",
          cancelButtonText: "取消",
          type: "warning"
        });
        const result = await this.http.post("/api/StockInfo/inboundInContainer", {
          palletCode: row.palletCode,
          stockId: row.id
        }, "正在调用MES接口...");
        if (result.status) {
          this.$Message.success(result.message || "托盘进站成功");
          this.$refs.table.load();
        } else {
          this.$error(result.message || "托盘进站失败");
        }
      } catch (error) {
        if (error !== "cancel") {
          this.$error(error.message || "网络错误,请稍后重试");
        }
      }
    },
    // æ‰˜ç›˜å‡ºç«™æ“ä½œ
    async handleOutbound(row) {
      try {
        await this.$confirm(`确认执行托盘出站操作?\n托盘编号:${row.palletCode}`, "出站确认", {
          confirmButtonText: "确认",
          cancelButtonText: "取消",
          type: "warning"
        });
        const result = await this.http.post("/api/StockInfo/outboundInContainer", {
          palletCode: row.palletCode,
          stockId: row.id
        }, "正在调用MES接口...");
        if (result.status) {
          this.$Message.success(result.message || "托盘出站成功");
          this.$refs.table.load();
        } else {
          this.$error(result.message || "托盘出站失败");
        }
      } catch (error) {
        if (error !== "cancel") {
          this.$error(error.message || "网络错误,请稍后重试");
        }
      }
    },
    onInited() {
      // æ¡†æž¶åˆå§‹åŒ–配置后
    },
    searchBefore(param) {
      const locationCodeFilter = {
        name: "stockStatus",
        value: "1",
        displayType: "int"
      };
      if (!param.wheres) {
        param.wheres = [];
      }
      // å°†è¿‡æ»¤æ¡ä»¶æ·»åŠ åˆ°æŸ¥è¯¢å‚æ•°ä¸­
      param.wheres.push(locationCodeFilter);
      return true;
    },
    searchAfter(result) {
      return true;
    },
    addBefore(formData) {
      return true;
    },
    updateBefore(formData) {
      return true;
    },
    rowClick({ row, column, event }) {
      this.$refs.table.$refs.table.toggleRowSelection(row);
    },
    modelOpenAfter(row) {
      // ç‚¹å‡»ç¼–辑、新建按钮弹出框后
    }
  }
};
export default extension;
Code/WMS/WIDESEA_WMSClient/src/extension/stock/stockInfo.jsx
@@ -103,7 +103,7 @@
      return true;
    },
    searchAfter(result) {
      return true;
      return result;
    },
    addBefore(formData) {
      return true;
Code/WMS/WIDESEA_WMSClient/src/extension/taskinfo/agvTask.jsx
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,78 @@
//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码
let extension = {
  components: {
    //查询界面扩展组件
    gridHeader: "",
    gridBody: "",
    gridFooter: "",
    //新建、编辑弹出框扩展组件
    modelHeader: "",
    modelBody: "",
    modelFooter: "",
  },
  tableAction: "", //指定某张表的权限(这里填写表名,默认不用填写)
  buttons: { view: [], box: [], detail: [] }, //扩展的按钮
  methods: {
    //下面这些方法可以保留也可以删除
    onInit() {},
    onInited() {
      //框架初始化配置后
      //如果要配置明细表,在此方法操作
      //this.detailOptions.columns.forEach(column=>{ });
    },
searchBefore(param) {
  //界面查询前,可以给param.wheres添加查询参数
  //返回false,则不会执行查询
  // ç¬¬ä¸€ä¸ªè¿‡æ»¤æ¡ä»¶
  const roadwayFilter1 = {
    name: "roadway",
    value: "ZJ1",
    displayType: "like",
  };
  // ç¬¬äºŒä¸ªè¿‡æ»¤æ¡ä»¶
  const roadwayFilter2 = {
    name: "roadway",
    value: "FJ1",
    displayType: "like",
  };
  if (!param.wheres) {
    param.wheres = [];
  }
  // å°†ä¸¤ä¸ªè¿‡æ»¤æ¡ä»¶æ·»åŠ åˆ°æŸ¥è¯¢å‚æ•°ä¸­
  param.wheres.push(roadwayFilter1);
  param.wheres.push(roadwayFilter2);
  return true;
},
    searchAfter(result) {
      //查询后,result返回的查询数据,可以在显示到表格前处理表格的值
      return true;
    },
    addBefore(formData) {
      //新建保存前formData为对象,包括明细表,可以给给表单设置值,自己输出看formData的值
      return true;
    },
    updateBefore(formData) {
      //编辑保存前formData为对象,包括明细表、删除行的Id
      return true;
    },
    rowClick({ row, column, event }) {
      //查询界面点击行事件
      this.$refs.table.$refs.table.toggleRowSelection(row); //单击行时选中当前行;
    },
    modelOpenAfter(row) {
      //点击编辑、新建按钮弹出框后,可以在此处写逻辑,如,从后台获取数据
      //(1)判断是编辑还是新建操作: this.currentAction=='Add';
      //(2)给弹出框设置默认值
      //(3)this.editFormFields.字段='xxx';
      //如果需要给下拉框设置默认值,请遍历this.editFormOptions找到字段配置对应data属性的key值
      //看不懂就把输出看:console.log(this.editFormOptions)
    },
  },
};
export default extension;
Code/WMS/WIDESEA_WMSClient/src/router/viewGird.js
@@ -95,7 +95,17 @@
    path: '/task_hty',
    name: 'task_hty',
    component: () => import('@/views/taskinfo/task_hty.vue')
  }, {
  },{
    path: '/task_agv',
    name: 'task_agv',
    component: () => import('@/views/taskinfo/task_agv.vue')
  },
  {
    path: '/groupPalle',
    name: 'groupPalle',
    component: () => import('@/views/stock/groupPalle.vue')
  },
  {
    path: '/stockView',
    name: 'stockView',
    component: () => import('@/views/stock/stockView.vue')
Code/WMS/WIDESEA_WMSClient/src/views/stock/groupPalle.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,487 @@
<template>
  <view-grid
    ref="grid"
    :columns="columns"
    :detail="detail"
    :editFormFields="editFormFields"
    :editFormOptions="editFormOptions"
    :searchFormFields="searchFormFields"
    :searchFormOptions="searchFormOptions"
    :table="table"
    :tableExpand="tableExpand"
    :extend="extend"
  >
  </view-grid>
</template>
<script>
import extend from "@/extension/stock/groupPalle.jsx";
import {
  defineComponent,
  getCurrentInstance,
  h,
  reactive,
  ref,
  resolveComponent,
} from "vue";
const TEXT = {
  pageName: "库存信息",
  palletCode: "托盘编号",
  stockStatus: "库存状态",
  locationCode: "货位编号",
  warehouse: "仓库",
  creator: "创建人",
  createDate: "创建时间",
  modifier: "修改人",
  modifyDate: "修改时间",
  detailName: "库存明细",
  materielName: "物料名称",
  serialNumber: "电芯码",
  stockQuantity: "库存数量",
  status: "状态",
  inboundOrderRowNo: "通道号",
  detailLoading: "库存明细加载中...",
  detailLoadFailed: "库存明细加载失败",
  detailEmpty: "当前库存头暂无明细数据",
  expandPrefix: "托盘:",
  expandMiddle: " / ",
  expandLocation: "货位:",
};
export default defineComponent({
  setup() {
    const { proxy } = getCurrentInstance();
    const ElTable = resolveComponent("el-table");
    const ElTableColumn = resolveComponent("el-table-column");
    const table = ref({
      key: "id",
      footer: "Foots",
      cnName: TEXT.pageName,
      name: "stockInfo",
      url: "/StockInfo/",
      sortName: "id",
    });
    const editFormFields = ref({
      palletCode: "",
      locationCode: "",
    });
    const editFormOptions = ref([
      [
        { field: "palletCode", title: TEXT.palletCode, type: "string" },
        { field: "locationCode", title: TEXT.locationCode, type: "string" },
      ],
    ]);
    const searchFormFields = ref({
      palletCode: "",
      locationCode: "",
    });
    const searchFormOptions = ref([
      [
        { title: TEXT.palletCode, field: "palletCode", type: "like" },
        { title: TEXT.locationCode, field: "locationCode", type: "like" },
      ],
    ]);
    const columns = ref([
      {
        field: "id",
        title: "Id",
        type: "int",
        width: 90,
        hidden: true,
        readonly: true,
        require: true,
        align: "left",
      },
      {
        field: "palletCode",
        title: TEXT.palletCode,
        type: "string",
        width: 120,
        align: "left",
      },
      {
        field: "stockStatus",
        title: TEXT.stockStatus,
        type: "int",
        width: 120,
        align: "left",
        bind: { key: "stockStatusEmun", data: [] },
      },
    //   {
    //     field: "locationCode",
    //     title: TEXT.locationCode,
    //     type: "string",
    //     width: 150,
    //     align: "left",
    //   },
      {
        field: "warehouseId",
        title: TEXT.warehouse,
        type: "select",
        width: 100,
        align: "left",
        bind: { key: "warehouseEnum", data: [] },
      },
      {
        field: "creater",
        title: TEXT.creator,
        type: "string",
        width: 90,
        align: "left",
      },
      {
        field: "createDate",
        title: TEXT.createDate,
        type: "datetime",
        width: 160,
        align: "left",
      },
      {
        field: "modifier",
        title: TEXT.modifier,
        type: "string",
        width: 100,
        align: "left",
        hidden: true,
      },
      {
        field: "modifyDate",
        title: TEXT.modifyDate,
        type: "datetime",
        width: 160,
        align: "left",
        hidden: true,
      },
    ]);
    const detail = ref({
      cnName: "#detailCnName",
      table: "",
      columns: [],
      sortName: "",
    });
    const detailState = reactive({
      rowsMap: {},
      loadingMap: {},
      errorMap: {},
    });
    const stockStatusOptions = ref([]);
    const detailColumns = [
      { field: "materielName", title: TEXT.materielName, minWidth: 160 },
      { field: "serialNumber", title: TEXT.serialNumber, minWidth: 160 },
      { field: "stockQuantity", title: TEXT.stockQuantity, minWidth: 120 },
      { field: "status", title: TEXT.status, minWidth: 120 },
      { field: "inboundOrderRowNo", title: TEXT.inboundOrderRowNo, minWidth: 120 },
    ];
    const normalizeValue = (value) => {
      return value === null || value === undefined || value === "" ? "--" : value;
    };
    const formatStatusText = (value) => {
      const matched = stockStatusOptions.value.find((item) => `${item.key}` === `${value}`);
      return matched ? matched.value || matched.label : normalizeValue(value);
    };
    const getDetailRows = (stockId) => {
      return detailState.rowsMap[stockId] || [];
    };
    const loadDetailRows = async (row) => {
      if (!row || !row.id || detailState.loadingMap[row.id]) {
        return;
      }
      if (detailState.rowsMap[row.id]) {
        return;
      }
      detailState.loadingMap[row.id] = true;
      detailState.errorMap[row.id] = "";
      try {
        const result = await proxy.http.post("/api/StockInfoDetail/getPageData", {
          page: 1,
          rows: 200,
          sort: "id",
          order: "asc",
          wheres: JSON.stringify([
            {
              name: "stockId",
              value: String(row.id),
              displayType: "int",
            },
          ]),
        });
        detailState.rowsMap[row.id] = (result && result.rows) || [];
      } catch (error) {
        detailState.rowsMap[row.id] = null;
        detailState.errorMap[row.id] = error?.message || TEXT.detailLoadFailed;
      } finally {
        detailState.loadingMap[row.id] = false;
      }
    };
    const loadStockStatusOptions = async () => {
      try {
        const result = await proxy.http.post("/api/Sys_Dictionary/GetVueDictionary", ["stockStatusEmun"]);
        const matched = (result || []).find((item) => item.dicNo === "stockStatusEmun");
        stockStatusOptions.value = matched ? matched.data || [] : [];
      } catch (error) {
        stockStatusOptions.value = [];
      }
    };
    loadStockStatusOptions();
    const renderStatus = (row) => {
      if (detailState.loadingMap[row.id]) {
        return h("div", { class: "stock-detail-status" }, TEXT.detailLoading);
      }
      if (detailState.errorMap[row.id]) {
        return h(
          "div",
          { class: "stock-detail-status stock-detail-status--error" },
          detailState.errorMap[row.id]
        );
      }
      return null;
    };
    const renderDetailTable = (row) => {
      const statusNode = renderStatus(row);
      if (statusNode) {
        return statusNode;
      }
      const rows = getDetailRows(row.id);
      if (!rows.length) {
        return h("div", { class: "stock-detail-status" }, TEXT.detailEmpty);
      }
      return h("div", { class: "stock-detail-table-wrapper" }, [
        h("div", { class: "stock-detail-toolbar" }, [
          h("div", { class: "stock-detail-toolbar__left" }, TEXT.detailName),
          h("div", { class: "stock-detail-toolbar__right" }, [
            h("span", { class: "stock-detail-count" }, `${rows.length} æ¡`),
          ]),
        ]),
        h(
          ElTable,
          {
            data: rows,
            border: true,
            stripe: true,
            size: "small",
            class: "stock-detail-el-table",
            maxHeight: 420,
            emptyText: TEXT.detailEmpty,
          },
          () =>
            detailColumns.map((column) =>
              h(ElTableColumn, {
                key: column.field,
                prop: column.field,
                label: column.title,
                minWidth: column.minWidth,
                showOverflowTooltip: true,
                formatter: (detailRow) =>
                  column.field === "status"
                    ? formatStatusText(detailRow[column.field])
                    : normalizeValue(detailRow[column.field]),
              })
            )
        ),
      ]);
    };
    const tableExpand = ref({
      width: 55,
      onChange(row, expandedRows) {
        const isExpanded = expandedRows.some((item) => item.id === row.id);
        if (isExpanded) {
          loadDetailRows(row);
        }
      },
      render(render, { row }) {
        return render("div", { class: "stock-detail-panel" }, [
          render("div", { class: "stock-detail-header" }, [
            render("div", { class: "stock-detail-header__main" }, [
              render("div", { class: "stock-detail-title" }, TEXT.detailName),
              render(
                "div",
                { class: "stock-detail-subtitle" },
                `${TEXT.expandPrefix}${normalizeValue(row.palletCode)}${TEXT.expandMiddle}${TEXT.expandLocation}${normalizeValue(row.locationCode)}`
              ),
            ]),
            // render("div", { class: "stock-detail-tags" }, [
            //   render("span", { class: "stock-detail-tag" }, normalizeValue(row.palletCode)),
            //   render(
            //     "span",
            //     { class: "stock-detail-tag stock-detail-tag--muted" },
            //     normalizeValue(row.locationCode)
            //   ),
            // ]),
          ]),
          renderDetailTable(row),
        ]);
      },
    });
    return {
      table,
      extend,
      editFormFields,
      editFormOptions,
      searchFormFields,
      searchFormOptions,
      columns,
      detail,
      tableExpand,
    };
  },
});
</script>
<style scoped>
.stock-detail-panel {
  margin: 4px 8px 12px;
  padding: 14px 16px 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
  border: 1px solid #e8edf3;
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.stock-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf1f5;
}
.stock-detail-header__main {
  min-width: 0;
}
.stock-detail-title {
  margin-bottom: 4px;
  font-size: 15px;
  font-weight: 700;
  color: #303133;
}
.stock-detail-subtitle {
  font-size: 13px;
  color: #606266;
  line-height: 1.6;
}
.stock-detail-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.stock-detail-tag {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  color: #1f5eff;
  background: #edf4ff;
  border: 1px solid #d8e6ff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.stock-detail-tag--muted {
  color: #4e5969;
  background: #f4f6f8;
  border-color: #e5e9ef;
}
.stock-detail-status {
  padding: 14px 12px;
  color: #606266;
  background: #f8fafc;
  border: 1px dashed #d9e2ec;
  border-radius: 8px;
}
.stock-detail-status--error {
  color: #f56c6c;
  background: #fef0f0;
  border-color: #fde2e2;
}
.stock-detail-table-wrapper {
  overflow-x: auto;
  border: 1px solid #ebeef5;
  border-radius: 8px;
  background: #fff;
}
.stock-detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #edf1f5;
}
.stock-detail-toolbar__left {
  font-size: 13px;
  font-weight: 600;
  color: #303133;
}
.stock-detail-count {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  color: #606266;
  background: #fff;
  border: 1px solid #e5e9ef;
  border-radius: 999px;
  font-size: 12px;
}
:deep(.stock-detail-el-table) {
  border-top: none;
}
:deep(.stock-detail-el-table .el-table__inner-wrapper::before) {
  display: none;
}
:deep(.stock-detail-el-table th.el-table__cell) {
  background: #f5f7fa;
  color: #303133;
  font-weight: 600;
}
:deep(.stock-detail-el-table td.el-table__cell) {
  color: #606266;
}
:deep(.stock-detail-el-table .el-table__body tr:hover > td.el-table__cell) {
  background: #f0f7ff;
}
</style>
Code/WMS/WIDESEA_WMSClient/src/views/taskinfo/task_agv.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,231 @@
<template>
  <view-grid
    ref="grid"
    :columns="columns"
    :detail="detail"
    :editFormFields="editFormFields"
    :editFormOptions="editFormOptions"
    :searchFormFields="searchFormFields"
    :searchFormOptions="searchFormOptions"
    :table="table"
    :extend="extend"
  >
  </view-grid>
</template>
    <script>
import extend from "@/extension/taskinfo/agvTask.jsx";
import { ref, defineComponent } from "vue";
export default defineComponent({
  setup() {
    const table = ref({
      key: "taskId",
      footer: "Foots",
      cnName: "任务信息",
      name: "task",
      url: "/Task/",
      sortName: "CreateDate",
    });
    const editFormFields = ref({});
    const editFormOptions = ref([]);
    const searchFormFields = ref({
      taskNum: "",
      palletCode: "",
      roadway: "",
      taskStatus: "",
      taskType: "",
      sourceAddress: "",
      targetAddress: "",
      currentAddress: "",
      nextAddress: "",
      creater: "",
      createDate: "",
    });
    const searchFormOptions = ref([
      [
        { title: "任务号", field: "taskNum", type: "int" },
        { title: "托盘编号", field: "palletCode", type: "like" },
        { title: "创建人", field: "creater", type: "like" },
      ],
      [
        { title: "任务类型",field: "taskType",type: "selectList",dataKey: "taskTypeEnum",data: [],},
        { title: "任务状态",field: "taskStatus",type: "selectList",dataKey: "taskStatusEnum",data: [],},
        { title: "巷道号", field: "roadway", type: "like" },
      ],
      [
        { title: "起始地址", field: "sourceAddress", type: "like" },
        { title: "目标地址", field: "targetAddress", type: "like" },
        { title: "创建时间", field: "createDate", type: "datetime" },
      ],
    ]);
    const columns = ref([
      {
        field: "taskId",
        title: "taskId",
        type: "int",
        width: 90,
        hidden: true,
        readonly: true,
        require: true,
        align: "left",
      },
      {
        field: "taskNum",
        title: "任务号",
        type: "int",
        width: 120,
        align: "left",
      },
      {
        field: "palletCode",
        title: "托盘编号",
        type: "string",
        width: 160,
        align: "left",
      },
      {
        field: "roadway",
        title: "巷道号",
        type: "string",
        width: 120,
        align: "left",
      },
      {
        field: "taskType",
        title: "任务类型",
        type: "int",
        width: 120,
        align: "left",
        bind: { key: "taskTypeEnum", data: [] },
      },
      {
        field: "taskStatus",
        title: "任务状态",
        type: "int",
        width: 150,
        align: "left",
        bind: { key: "taskStatusEnum", data: [] },
      },
      {
        field: "sourceAddress",
        title: "起始地址",
        type: "int",
        width: 120,
        align: "left",
      },
      {
        field: "targetAddress",
        title: "目标地址",
        type: "string",
        width: 120,
        align: "left",
      },
      {
        field: "currentAddress",
        title: "当前位置",
        type: "string",
        width: 120,
        align: "left",
      },
      {
        field: "nextAddress",
        title: "下一位置",
        type: "string",
        width: 120,
        align: "left",
      },
      {
        field: "exceptionMessage",
        title: "异常信息",
        type: "string",
        width: 90,
        align: "left",
      },
      // {
      //   field: "grade",
      //   title: "优先级",
      //   type: "int",
      //   width: 80,
      //   align: "left",
      // },
      {
        field: "depth",
        title: "深度",
        type: "int",
        width: 80,
        align: "left",
        bind: { key: "locationDepth", data: [] },
      },
      {
        field: "dispatchertime",
        title: "任务下发时间",
        type: "datetime",
        width: 160,
        align: "left",
        // hidden:true,
      },
      {
        field: "wMSId",
        title: "WMS任务主键",
        type: "int",
        width: 120,
        align: "left",
        hidden: true,
      },
      {
        field: "creater",
        title: "创建人",
        type: "string",
        width: 90,
        align: "left",
      },
      {
        field: "createDate",
        title: "创建时间",
        type: "datetime",
        width: 160,
        align: "left",
      },
      {
        field: "modifier",
        title: "修改人",
        type: "string",
        width: 100,
        align: "left",
      },
      {
        field: "modifyDate",
        title: "修改时间",
        type: "datetime",
        width: 160,
        align: "left",
      },
      {
        field: "remark",
        title: "备注",
        type: "string",
        width: 100,
        align: "left",
        hidden: true,
      },
    ]);
    const detail = ref({
      cnName: "#detailCnName",
      table: "",
      columns: [],
      sortName: "",
    });
    return {
      table,
      extend,
      editFormFields,
      editFormOptions,
      searchFormFields,
      searchFormOptions,
      columns,
      detail,
    };
  },
});
</script>
Code/WMS/WIDESEA_WMSClient/src/views/taskinfo/task_hty.vue
@@ -89,6 +89,12 @@
        type: "string",
        width: 120,
        align: "left",
      },{
        field: "operateType",
        title: "操作类型",
        type: "string",
        width: 120,
        align: "left"
      },
      {
        field: "taskType",