CD配唱片
2025-05-07 4079d1c5a3efb6b31879d9f80dd067cc01b11e91
对接bom静态页及联调接口
已修改8个文件
已添加1个文件
1323 ■■■■■ 文件已修改
.env.development 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/basicData/bom/bom.js 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/i18n/locales/basic/index.js 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/i18n/locales/common/index.js 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/bom/index copy.vue 210 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/bom/index.vue 411 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/processRouteDataPreparate/index.vue 511 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mainPlan/sheetMetalOrderManage/index.vue 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vite.config.js 88 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.env.development
@@ -10,4 +10,4 @@
# é…åˆåŽç«¯æœåŠ¡
# VITE_APP_LOCAL = 'int'
# VITE_APP_LOCAL = 'zhl'
VITE_APP_LOCAL = 'cxl'
VITE_APP_LOCAL = 'hjy'
src/api/basicData/bom/bom.js
@@ -1,5 +1,20 @@
import request from '@/utils/request'
// /ApsBomHeader/list
export function listApsBomHeaderList(query) {
  return request({
    url: '/aps/ApsBomHeader/list',
    method: 'get',
    params: query
  })
}
// /ApsBom/list
export function listApsBomLineList(query) {
  return request({
    url: '/aps/ApsBom/list',
    method: 'get',
    params: query
  })
}
// æŸ¥è¯¢BOM数据管理列表
export function listApsBom(query) {
  return request({
src/utils/i18n/locales/basic/index.js
@@ -1,13 +1,33 @@
export const zh = {
  query: {},
  upload: {},
  table: {},
  table: {},
  table: {
    processRouteID:"工艺路线ID",
    processRouteVersion:"工艺路线版本",
    effectiveDate:"生效日期",
    expiringDate:"失效日期",
    integrationDate:"集成日期",
    applicableFactories:"适用工厂",
    parentPartNumber:"父级料号",
    parentMaterialDescription:"父级物料描述",
    materialDescription:"物料描述",
    usage:"用量"
  }
};
export const en = {
  query: {},
  upload: {},
  table: {},
  table: {},
  table: {
    processRouteID:"Process route ID",
    processRouteVersion:"Process route version",
    effectiveDate:"effective date",
    expiringDate:"expiring date",
    integrationDate:"Integration date",
    applicableFactories:"Applicable factories",
    parentPartNumber:"Parent part number",
    parentMaterialDescription:"Parent material description",
    materialDescription:"Material Description",
    usage:"usage"
  }
};
src/utils/i18n/locales/common/index.js
@@ -18,7 +18,8 @@
    edit: "编辑",
    save: "保存",
    cancel: "取消",
    placeholder:"请输入"
    placeholder:"请输入",
    view:"查看"
  },
};
export const en = {
@@ -41,6 +42,7 @@
    edit: "Edit",
    save: "Save",
    cancel: "Cancel",
    placeholder:"Please enter the "
    placeholder:"Please enter the ",
    view:"View"
  },
};
src/views/basicData/bom/index copy.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,210 @@
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryRef" :rules="rules" :inline="true" v-show="showSearch" label-width="68px">
      <el-row :gutter="20">
        <el-col :span="6">
          <el-form-item label="料号" prop="itemCode">
            <el-input
              v-model="queryParams.itemCode"
              placeholder="请输入料号"
              clearable
              @keyup.enter="handleQuery"
            />
          </el-form-item>
        </el-col>
        <el-col :span="18" style="text-align: right;">
          <el-form-item>
              <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
              <el-button icon="Refresh" @click="resetQuery">重置</el-button>
            </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <HxlhTable
        style="width: 100%"
        :columns="columns"
        :data="bomList"
        :loading="loading"
        :height="height"
        :treeConfig="treeConfig"
        :row-style="getRowStyle"
    >
    </HxlhTable>
  </div>
</template>
<script setup name="ApsBom">
import { listApsBom } from "@/api/basicData/bom/bom";
import { listAll_plant } from "@/api/basicData/plant";
import axios from 'axios';
import HxlhTable from '@/components/HxlhTable'
const { proxy } = getCurrentInstance();
const bomList = ref([]);
const open = ref(false);
const loading = ref(false);
const showSearch = ref(true);
const treeConfig= {
  transform: true,
  rowField: 'bomId',
  parentField: 'parentBomId'
}
const data = reactive({
  form: {},
  queryParams: {
    itemCode: null,
  },
  rules: {
    itemCode: [
      { required: true, message: "料号不能为空", trigger: "blur" }
    ],
  }
});
// è¡¨æ ¼é…ç½®
const columns = ref([
  {
    title: 'bomId',
    field: 'bomId',
    minWidth: 20, treeNode: true
  },
  {
    title: 'parentBomId',
    field: 'parentBomId',
  },
  {
    title: '料号',
    field: 'itemCode',
  },
  {
    title: '物料描述',
    field: 'itemName',
  },
  {
    title: '生效日期',
    field: 'startDate',
  },
  {
    title: '失效日期',
    field: 'endDate',
  },
  {
    title: '适用工厂',
    field: 'orgCode',
    formatter: (({ cellValue, row, column }) => {
      if (cellValue) {
        for(let i=0;i<plantList.value.length;i++){
          if(cellValue===plantList.value[i].plantCode){
            return plantList.value[i].plantName
          }
        }
      }
      return '';
    })
  },
  {
    title: '创建时间',
    field: 'createTime',
  },
]);
// å®šä¹‰ä¸€ä¸ªå‡½æ•°æ¥èŽ·å–è¡Œçš„å±‚çº§
const getRowLevel = (row, dataMap) => {
  let level = 0
  let parentBomId = row.parentBomId
  while (parentBomId!== null) {
    const parentRow = dataMap.get(parentBomId)
    if (parentRow) {
      level++
      parentBomId = parentRow.parentBomId
    } else {
      break
    }
  }
  return level
}
// å®šä¹‰ä¸€ä¸ªå‡½æ•°æ¥è®¾ç½®è¡Œçš„æ ·å¼
const getRowStyle = (row, rowIndex) => {
  if (!Array.isArray(bomList.value)) {
    console.error('bomList ä¸æ˜¯ä¸€ä¸ªæ•°ç»„类型');
    return {};
  }
  const dataMap = new Map(bomList.value.map(item => [item.bomId, item]))
  const level = getRowLevel(row.row, dataMap)
  const colors = ['#f0f9ff', '#e6f7ff', '#bae7ff', '#91d5ff', '#69c0ff']
  return {
    backgroundColor: colors[level % colors.length]
  }
}
const { queryParams, form, rules } = toRefs(data);
const queryPlants = ref({status: 1});
const plantList = ref([]);
const height = ref(document.documentElement.clientHeight - 180 + "px;")
/** æŸ¥è¯¢BOM数据管理列表 */
function getList() {
  loading.value = true;
  axios.all([
      listAll_plant(queryPlants.value),
      listApsBom(queryParams.value)
    ])
    .then(axios.spread((response1, response2) => {
      plantList.value = response1.data;
      bomList.value = response2.rows;
      loading.value = false;
    }))
    .catch(error => {
      console.error('请求出错:', error);
    });
}
// å–消按钮
function cancel() {
  open.value = false;
  reset();
}
// è¡¨å•重置
function reset() {
  form.value = {
    id: null,
    bomId: null,
    parentBomId: null,
    itemCode: null,
    itemName: null,
    startDate: null,
    endDate: null,
    orgCode: null,
    delFlag: null,
    createBy: null,
    createTime: null,
    updateBy: null,
    updateTime: null
  };
  proxy.resetForm("ApsBomRef");
}
/** æœç´¢æŒ‰é’®æ“ä½œ */
function handleQuery() {
  proxy.$refs["queryRef"].validate(valid => {
    if (valid) {
        getList();
      }
  });
}
/** é‡ç½®æŒ‰é’®æ“ä½œ */
function resetQuery() {
  proxy.resetForm("queryRef");
  bomList.value = null;
}
console.log("123");
</script>
src/views/basicData/bom/index.vue
@@ -1,25 +1,78 @@
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryRef" :rules="rules" :inline="true" v-show="showSearch" label-width="68px">
      <el-row :gutter="20">
        <el-col :span="6">
          <el-form-item label="料号" prop="itemCode">
      <el-form
        :model="queryParams"
        ref="queryRef"
        :rules="rules"
        :inline="true"
        v-show="showSearch"
        :label-width="locale === 'zh' ? '90px' : '120px'"
      >
        <el-row :gutter="20">
          <el-col :span="10">
            <el-form-item :label="$t('plan.query.itemNumber')" prop="itemCode">
            <el-input
                style="width: 240px"
              v-model="queryParams.itemCode"
              placeholder="请输入料号"
                :placeholder="`${$t('common.common.placeholder')}${$t(
                  'plan.query.itemNumber'
                )}`"
              clearable
              @keyup.enter="handleQuery"
            />
          </el-form-item>
        </el-col>
        <el-col :span="18" style="text-align: right;">
          <el-col :span="8">
            <el-form-item
              label="适用工厂"
              prop="orgCode"
            >
              <el-select
                clearable
                v-model="queryParams.orgCode"
                style="width: 160px"
                placeholder="请输入适用工厂"
              >
                <el-option
                  v-for="plant in plantList"
                  :key="plant.id"
                  :label="plant.plantName"
                  :value="plant.plantCode"
                >
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6" style="text-align: right">
          <el-form-item>
              <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
              <el-button icon="Refresh" @click="resetQuery">重置</el-button>
              <el-button type="primary" icon="Search" @click="handleQuery">{{
                $t("common.common.query")
              }}</el-button>
              <el-button icon="Refresh" @click="resetQuery">{{
                $t("common.common.reset")
              }}</el-button>
            </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    </el-row>
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="Refresh"
          @click="handleRefresh"
          v-hasPermi="['apsPartRouteStat:edit']"
          >{{ $t("common.common.update") }}</el-button
        >
      </el-col>
      <right-toolbar
        v-model:showSearch="showSearch"
        @queryTable="getList"
      ></right-toolbar>
    </el-row>
    <HxlhTable
        style="width: 100%"
@@ -27,173 +80,246 @@
        :data="bomList"
        :loading="loading"
        :height="height"
        :treeConfig="treeConfig"
        :row-style="getRowStyle"
      @on-checkbox="handleCheckboxChange"
      :page="page"
      @changePageNo="changePageNo"
      @changePageSize="changePageSize"
    >
      <!--       :expand-config="expandConfig"
      :subGridOptions="subGridOptions" -->
      <template #buttons="{ row }">
        <el-button
          type="primary"
          link
          @click="handleCheckView(row)"
          v-hasPermi="['aps:calendar:update']"
          >查看</el-button
        >
      </template>
    </HxlhTable>
    <el-dialog :title="title" v-model="openDialog" width="900px" append-to-body>
      <HxlhTable
        style="width: 100%"
        :columns="subGridOptions"
        :data="subList"
        :loading="loadingSub"
        :height="heightSub"
    >
    </HxlhTable>
    </el-dialog>
  </div>
</template>
<script setup name="ApsBom">
import { listApsBom } from "@/api/basicData/bom/bom";
<script setup name="ApsPlatePlan">
import {
  listApsBomHeaderList,
  listApsBomLineList,
} from "@/api/basicData/bom/bom.js";
import { listAll_plant } from "@/api/basicData/plant";
import axios from 'axios';
import HxlhTable from '@/components/HxlhTable'
import HxlhTable from "@/components/HxlhTable/index.vue";
import { ElMessage } from "element-plus";
import { useI18n } from "vue-i18n"; //要在js中使用国际化
const { t, locale } = useI18n();
const { proxy } = getCurrentInstance();
// åˆ†é¡µå±žæ€§
const page = ref({
  total: 0,
  current: 1,
  size: 10,
});
const plantList = ref([]);
const bomList = ref([]);
const open = ref(false);
const subList = ref([]);
const loading = ref(false);
const loadingSub = ref(false);
const showSearch = ref(true);
const treeConfig= {
  transform: true,
  rowField: 'bomId',
  parentField: 'parentBomId'
}
const total = ref(0);
const height = ref(document.documentElement.clientHeight - 270 + "px;");
const heightSub = ref(document.documentElement.clientHeight - 320 + "px;");
// è¡¨æ ¼é…ç½®
const columns = ref([]);
const subGridOptions = ref([]);
const openDialog = ref(false);
const data = reactive({
  form: {},
  queryParams: {
    pageNum: 1,
    pageSize: 10,
    itemCode: null,
    orgCode:""
  },
  rules: {
    itemCode: [
      { required: true, message: "料号不能为空", trigger: "blur" }
    ],
  }
  rules: {},
});
// è¡¨æ ¼é…ç½®
const columns = ref([
const { queryParams, rules } = toRefs(data);
watch(
  locale,
  (newLocale) => {
    rules.value = {
      itemCode: [
  {
    title: 'bomId',
    field: 'bomId',
    minWidth: 20, treeNode: true
          required: true,
          message: `${t("common.common.placeholder")}${t(
            "plan.query.itemNumber"
          )}`,
          trigger: "blur",
        },
      ],
    };
    columns.value = [
      // {
      //   field: "expand",
      //   type: "expand",
      //   width: 60,
      //   align: "center",
      //   slots: { content: "expandContent" },
      // },
      // { type: "checkbox", width: 60, align: "center" },
      {
        title: "BOM_Header_ID",
        field: "bomHeaderId",
  },
  {
    title: 'parentBomId',
    field: 'parentBomId',
        title: t("basic.table.parentPartNumber"),
        field: "itemCode",
  },
  {
    title: '料号',
    field: 'itemCode',
        title: t("basic.table.parentMaterialDescription"),
        field: "itemName",
  },
  {
    title: '物料描述',
    field: 'itemName',
        title: t("basic.table.effectiveDate"),
        field: "startDate",
  },
  {
    title: '生效日期',
    field: 'startDate',
        title: t("basic.table.expiringDate"),
        field: "endDate",
  },
  {
    title: '失效日期',
    field: 'endDate',
        title: t("basic.table.integrationDate"),
        field: "createTime",
  },
  {
    title: '适用工厂',
    field: 'orgCode',
    formatter: (({ cellValue, row, column }) => {
        title: t("basic.table.applicableFactories"),
        field: "orgCode",
        formatter: ({ cellValue, row, column }) => {
      if (cellValue) {
        for(let i=0;i<plantList.value.length;i++){
          if(cellValue===plantList.value[i].plantCode){
            return plantList.value[i].plantName
                return plantList.value[i].plantName;
          }
        }
      }
      return '';
    })
        },
  },
  {
    title: '创建时间',
    field: 'createTime',
        title: "操作",
        width: 100,
        fixed: "right",
        slots: { default: "buttons" },
        align: "center",
  },
]);
    ];
    subGridOptions.value = [
      {
        title: "BOM_Line_ID",
        field: "bomLineId",
        width: 150,
        align: "center",
      },
      {
        title: "BOM_Header_ID",
        field: "bomHeaderId",
        width: 150,
        align: "center",
      },
      {
        title: t("plan.table.itemNumber"),
        field: "itemCode",
        width: 100,
        align: "center",
      },
      {
        title: t("basic.table.materialDescription"),
        field: "itemName",
        width: 100,
        align: "center",
      },
      {
        title: t("basic.table.usage"),
        field: "num",
        width: 100,
        align: "center",
      },
      {
        title: t("basic.table.effectiveDate"),
        field: "startDate",
        width: 150,
        align: "center",
      },
      {
        title: t("basic.table.expiringDate"),
        field: "endDate",
        width: 200,
        align: "center",
      },
      {
        title: t("basic.table.integrationDate"),
        field: "createTime",
        width: 200,
        align: "center",
      },
      {
        title: t("basic.table.applicableFactories"),
        field: "orgCode",
        width: 90,
        align: "center",
        formatter: ({ cellValue, row, column }) => {
          if (cellValue) {
            for (let i = 0; i < plantList.value.length; i++) {
              if (cellValue === plantList.value[i].plantCode) {
                return plantList.value[i].plantName;
              }
            }
          }
        },
      },
    ];
  },
  { immediate: true, deep: true }
);
// å®šä¹‰ä¸€ä¸ªå‡½æ•°æ¥èŽ·å–è¡Œçš„å±‚çº§
const getRowLevel = (row, dataMap) => {
  let level = 0
  let parentBomId = row.parentBomId
  while (parentBomId!== null) {
    const parentRow = dataMap.get(parentBomId)
    if (parentRow) {
      level++
      parentBomId = parentRow.parentBomId
    } else {
      break
function changePageNo(currentPage) {
  queryParams.value.pageNum = currentPage;
  page.value.current = currentPage;
  getList();
    }
  }
  return level
function changePageSize(pageSize) {
  page.value.current = 1;
  queryParams.value.pageNum = 1;
  queryParams.value.pageSize = pageSize;
  getList();
}
// å®šä¹‰ä¸€ä¸ªå‡½æ•°æ¥è®¾ç½®è¡Œçš„æ ·å¼
const getRowStyle = (row, rowIndex) => {
  if (!Array.isArray(bomList.value)) {
    console.error('bomList ä¸æ˜¯ä¸€ä¸ªæ•°ç»„类型');
    return {};
  }
  const dataMap = new Map(bomList.value.map(item => [item.bomId, item]))
  const level = getRowLevel(row.row, dataMap)
  const colors = ['#f0f9ff', '#e6f7ff', '#bae7ff', '#91d5ff', '#69c0ff']
  return {
    backgroundColor: colors[level % colors.length]
  }
}
const { queryParams, form, rules } = toRefs(data);
const queryPlants = ref({status: 1});
const plantList = ref([]);
const height = ref(document.documentElement.clientHeight - 180 + "px;")
/** æŸ¥è¯¢BOM数据管理列表 */
/** æŸ¥è¯¢é›¶ä»¶è®¡åˆ’管理列表 */
function getList() {
  page.value.current = 1;
  queryParams.value.pageNum = 1;
  loading.value = true;
  axios.all([
      listAll_plant(queryPlants.value),
      listApsBom(queryParams.value)
    ])
    .then(axios.spread((response1, response2) => {
      plantList.value = response1.data;
      bomList.value = response2.rows;
  listApsBomHeaderList(queryParams.value)
    .then((response) => {
      console.log(response, "listApsBomHeaderList");
      bomList.value = response.rows;
      page.value.total = response.total;
      loading.value = false;
    }))
    .catch(error => {
      console.error('请求出错:', error);
    })
    .catch(() => {
      loading.value = false;
    });
}
// å–消按钮
function cancel() {
  open.value = false;
  reset();
}
// è¡¨å•重置
function reset() {
  form.value = {
    id: null,
    bomId: null,
    parentBomId: null,
    itemCode: null,
    itemName: null,
    startDate: null,
    endDate: null,
    orgCode: null,
    delFlag: null,
    createBy: null,
    createTime: null,
    updateBy: null,
    updateTime: null
  };
  proxy.resetForm("ApsBomRef");
}
/** æœç´¢æŒ‰é’®æ“ä½œ */
function handleQuery() {
  proxy.$refs["queryRef"].validate(valid => {
  proxy.$refs["queryRef"].validate((valid) => {
    if (valid) {
        getList();
      }
@@ -202,9 +328,42 @@
/** é‡ç½®æŒ‰é’®æ“ä½œ */
function resetQuery() {
  page.value.current = 1;
  page.value.total = 0;
  queryParams.value.pageNum = 1;
  proxy.resetForm("queryRef");
  bomList.value = null;
  bomList.value = [];
  subList.value = [];
}
console.log("123");
function handleCheckView(row) {
  openDialog.value = true;
  listApsBomLineList({ bomHeaderId: row.bomHeaderId }).then((data) => {
    console.log(data, "listApsBomLineList");
    subList.value = data.rows;
  });
}
// /*定义下拉二级表*/
// const expandConfig = ref({
//   lazy: true,
//   loadMethod({ row }) {
//     // è°ƒç”¨æŽ¥å£
//     return listProcessRoute({ workOrderNo: row.documentNumber }).then(
//       (data) => {
//         row.subList = data.rows;
//       }
//     );
//   },
// });
onMounted(async () => {
  const res = await listAll_plant({});
  plantList.value = res.data;
});
</script>
<style lang="css" scoped>
h4 {
  font-weight: bold;
}
</style>
src/views/basicData/processRouteDataPreparate/index.vue
@@ -25,11 +25,9 @@
          </el-col>
          <el-col :span="18" style="text-align: right">
            <el-form-item>
              <el-button type="primary" icon="Search" @click="handleQuery"
                >{{
              <el-button type="primary" icon="Search" @click="handleQuery">{{
              $t("common.common.query")
            }}</el-button
              >
              }}</el-button>
              <el-button icon="Refresh" @click="resetQuery">{{
              $t("common.common.reset")
            }}</el-button>
@@ -65,10 +63,33 @@
      :page="page"
      @changePageNo="changePageNo"
      @changePageSize="changePageSize"
      :expand-config="expandConfig"
      :subGridOptions="subGridOptions"
    >
      <!--       :expand-config="expandConfig"
      :subGridOptions="subGridOptions" -->
      <template #buttons="{ row }">
        <el-button
          type="primary"
          link
          @click="handleCheckView(row)"
          v-hasPermi="['aps:calendar:update']"
          >查看</el-button
        >
      </template>
    </HxlhTable>
    <el-dialog :title="title" v-model="openDialog" width="900px" append-to-body>
      <HxlhTable
        style="width: 100%"
        :columns="subGridOptions"
        :data="subList"
        :loading="loading"
        :height="heightSub"
        @on-checkbox="handleCheckboxChange"
        :page="page"
        @changePageNo="changePageNo"
        @changePageSize="changePageSize"
    >
    </HxlhTable>
    </el-dialog>
  </div>
</template>
@@ -83,13 +104,14 @@
import { ref } from "vue";
import { getToken } from "@/utils/auth.js";
import { ElMessage } from "element-plus";
import { useI18n } from "vue-i18n"; //要在js中使用国际化
const { t, locale } = useI18n();
const { proxy } = getCurrentInstance();
// åˆ†é¡µå±žæ€§
const page = ref({
  total: 0,
  current: 1,
  size: 10
  size: 10,
});
const {
  aps_is_suspended,
@@ -103,264 +125,18 @@
  "aps_business_type"
);
const exampleList = ref([]);
const planList = ref([]);
const subList = ref([]);
const loading = ref(true);
const showSearch = ref(true);
const single = ref(true);
const total = ref(0);
const daterangePlanStartDay = ref([]);
const daterangePlanEndDay = ref([]);
const height = ref(document.documentElement.clientHeight - 270 + "px;");
const isVisible = ref(false);
const isError = ref(false);
const planned = ref(true);
const batchNumber = ref(null);
const exampleHeight = ref("500px");
const uploadRef = ref();
/*** ç”¨æˆ·å¯¼å…¥å‚æ•° */
const upload = reactive({
  // æ˜¯å¦æ˜¾ç¤ºå¼¹å‡ºå±‚(用户导入)
  open: false,
  // å¼¹å‡ºå±‚标题(用户导入)
  title: "",
  // æ˜¯å¦ç¦ç”¨ä¸Šä¼ 
  isUploading: false,
  // æ˜¯å¦æ›´æ–°å·²ç»å­˜åœ¨çš„用户数据
  updateSupport: 0,
  // è®¾ç½®ä¸Šä¼ çš„请求头部
  headers: { Authorization: "Bearer " + getToken(), local: "zhl" },
  // ä¸Šä¼ çš„地址
  url: import.meta.env.VITE_APP_BASE_API + "/aps/apsPlatePlan/importData",
});
const heightSub = ref(document.documentElement.clientHeight - 320 + "px;");
// è¡¨æ ¼é…ç½®
const exampleColumns = ref([
  { type: "seq", title: "序号", width: 60 },
  {
    title: "主计划员",
    field: "masterPlanner",
    width: 100,
  },
  {
    title: "周日",
    field: "weekDay",
    width: 100,
    formatter: ({ cellValue, row, column }) => {
      if (cellValue) {
        const weekDay = new Date(cellValue);
        const year = weekDay.getFullYear();
        const month = String(weekDay.getMonth() + 1).padStart(2, "0");
        const day = String(weekDay.getDate()).padStart(2, "0");
        return `${month}-${day}`;
      }
      return "";
    },
  },
  {
    title: "周度",
    field: "weekCycle",
    width: 80,
  },
  {
    title: "主件料号",
    field: "mainPartNumber",
    width: 150,
  },
  {
    title: "主件图号",
    field: "mainPartDrawingNumber",
    width: 150,
  },
  {
    title: "客户名称",
    field: "customer",
    width: 200,
  },
  {
    title: "业务类型",
    field: "businessType",
    width: 150,
  },
  {
    title: "单据号",
    field: "documentNumber",
    width: 150,
  },
  {
    title: "需求分类",
    field: "requirementType",
    width: 150,
  },
  {
    title: "单据状态",
    field: "documentStatus",
    width: 100,
  },
  {
    title: "料号",
    field: "itemNumber",
    width: 150,
  },
  {
    title: "图号",
    field: "drawingNo",
    width: 150,
  },
  {
    title: "版本号",
    field: "versionNumber",
    width: 100,
  },
  {
    title: "生产数量",
    field: "productionQuantity",
    width: 100,
  },
  {
    title: "良品数量",
    field: "goodProductsQuantity",
    width: 100,
  },
  {
    title: "工序号",
    field: "processNumber",
    width: 150,
  },
  {
    title: "工作中心",
    field: "workCenter",
    width: 150,
  },
  {
    title: "所属部门",
    field: "department",
    width: 100,
  },
  {
    title: "计划开工日",
    field: "planStartDay",
    width: 100,
  },
  {
    title: "计划完工日",
    field: "planEndDay",
    width: 100,
  },
  {
    title: "备料料号",
    field: "standbyNumber",
    width: 100,
  },
  {
    title: "备料名称",
    field: "standbyName",
    width: 200,
  },
  {
    title: "备料库存",
    field: "standbyStock",
    width: 100,
  },
  {
    title: "下道工序所属部门",
    field: "nextProcessDeparment",
    width: 180,
  },
  {
    title: "是否挂起",
    field: "isSuspended",
    width: 100,
  },
  {
    title: "外协标识",
    field: "isOutsourcing",
    width: 100,
  },
  {
    title: "账套",
    field: "account",
    width: 100,
  },
  // {
  //   title: '上阶物料',
  //   field: 'advancedMaterials',
  //   width: 100,
  // },
  // {
  //   title: '上阶单据号',
  //   field: 'advancedDocumentNumber',
  //   width: 100,
  // },
  // {
  //   title: '上阶需求日期',
  //   field: 'advancedRequirementDay',
  //   width: 150,
  // },
  // {
  //   title: '计划齐套',
  //   field: 'isPlanComplete',
  //   width: 100,
  // },
  // {
  //   title: '库存齐套',
  //   field: 'isStockComplete',
  //   width: 100,
  // },
  // {
  //   title: '是否有折返工序',
  //   field: 'hasTurnback',
  //   width: 150,
  // },
  // {
  //   title: '风险标识',
  //   field: 'hasRisk',
  //   width: 100,
  // },
]);
// è¡¨æ ¼é…ç½®
const columns = ref([
  {
    field: "expand",
    type: "expand",
    width: 60,
    align: "center",
    slots: { content: "expandContent" },
  },
  { type: "checkbox", width: 60, align: "center" },
  {
    title: "工艺路线ID",
    field: "mainPartNumber",
  },
  {
    title: "工艺路线版本",
    field: "businessType",
  },
  {
    title: "料号",
    field: "documentNumber",
  },
  {
    title: "生效日期",
    field: "requirementType",
  },
  {
    title: "失效日期",
    field: "documentStatus",
  },
  {
    title: "集成日期",
    field: "itemNumber",
  },
  {
    title: "适用工厂",
    field: "drawingNo",
  },
]);
const columns = ref([]);
const openDialog = ref(false);
const data = reactive({
  form: {},
  queryParams: {
@@ -371,11 +147,70 @@
    itemCode: null,
  },
  rules: {
    itemCode: [{ required: true, message: "请输入料号", trigger: "blur" }],
    itemCode: [
      {
        required: true,
        message: `${t("common.common.placeholder")}${t(
          "plan.query.itemNumber"
        )}`,
        trigger: "blur",
      },
    ],
  },
});
const { queryParams, form, rules } = toRefs(data);
watch(
  locale,
  (newLocale) => {
    columns.value = [
      // {
      //   field: "expand",
      //   type: "expand",
      //   width: 60,
      //   align: "center",
      //   slots: { content: "expandContent" },
      // },
      // { type: "checkbox", width: 60, align: "center" },
      {
        title: t("basic.table.processRouteVersion"),
        field: "mainPartNumber",
      },
      {
        title: t("basic.table.processRouteVersion"),
        field: "businessType",
      },
      {
        title: t("plan.table.itemNumber"),
        field: "documentNumber",
      },
      {
        title: t("basic.table.effectiveDate"),
        field: "requirementType",
      },
      {
        title: t("basic.table.expiringDate"),
        field: "documentStatus",
      },
      {
        title: t("basic.table.integrationDate"),
        field: "itemNumber",
      },
      {
        title: t("basic.table.applicableFactories"),
        field: "drawingNo",
      },
      {
        title: "操作",
        width: 100,
        fixed: "right",
        slots: { default: "buttons" },
        align: "center",
      },
    ];
  },
  { immediate: true, deep: true }
);
function changePageNo(currentPage) {
  queryParams.value.pageNum = currentPage;
  page.value.current = currentPage;
@@ -387,32 +222,11 @@
  queryParams.value.pageSize = pageSize;
  getList();
}
/** æŸ¥è¯¢é’£é‡‘计划临时管理列表 */
function getExampleList() {
  loading.value = true;
  queryParams.value = {};
  queryParams.value.batchNumber = batchNumber.value;
  examplePlan(queryParams.value).then((response) => {
    exampleList.value = response.rows;
    total.value = response.total;
    loading.value = false;
  });
}
/** æŸ¥è¯¢é›¶ä»¶è®¡åˆ’管理列表 */
function getList() {
  loading.value = true;
  queryParams.value.params = {};
  if (null != daterangePlanStartDay && "" !== daterangePlanStartDay) {
    queryParams.value.params["beginPlanStartDay"] =
      daterangePlanStartDay.value[0];
    queryParams.value.params["endPlanStartDay"] =
      daterangePlanStartDay.value[1];
  }
  if (null != daterangePlanEndDay && "" !== daterangePlanEndDay) {
    queryParams.value.params["beginPlanEndDay"] = daterangePlanEndDay.value[0];
    queryParams.value.params["endPlanEndDay"] = daterangePlanEndDay.value[1];
  }
  listPlan(queryParams.value).then((response) => {
    planList.value = response.rows;
    loading.value = false;
@@ -430,117 +244,21 @@
/** é‡ç½®æŒ‰é’®æ“ä½œ */
function resetQuery() {
  daterangePlanStartDay.value = [];
  daterangePlanEndDay.value = [];
  proxy.resetForm("queryRef");
  handleQuery();
}
// å¤šé€‰æ¡†é€‰ä¸­æ•°æ®
const handleCheckboxChange = (data) => {
  console.log(data);
};
/** æ‰¹é‡ä¿®æ”¹è®¡åˆ’开工日按钮操作 */
function plannedStart() {}
/** æ‰¹é‡ä¿®æ”¹è®¡åˆ’完工日按钮操作 */
function plannedEnd() {}
/** å¯¼å…¥æŒ‰é’®æ“ä½œ */
function handleImport() {
  upload.title = "钣金计划数据上传";
  upload.open = true;
function handleCheckView(row) {
  openDialog.value = true;
  listProcessRoute({ workOrderNo: row.documentNumber }).then(
      (data) => {
        subList.value = data.rows;
      })
}
/** å¯¼å‡ºæŒ‰é’®æ“ä½œ */
function handleExport() {
  proxy.download(
    "aps/apsPlatePlan/export",
    {
      ...queryParams.value,
    },
    `plan_${new Date().getTime()}.xlsx`
  );
}
// /*定义下拉二级表*/
/** ä¸‹è½½æ¨¡æ¿æ“ä½œ */
function importTemplate() {
  proxy.download(
    "system/user/importTemplate",
    {},
    `user_template_${new Date().getTime()}.xlsx`
  );
}
/** buildEexample */
function buildEexample() {
  proxy.$refs["uploadRef"].submit();
}
/**文件上传中处理 */
const handleFileUploadProgress = (event, file, fileList) => {
  upload.isUploading = true;
};
/** æ–‡ä»¶ä¸Šä¼ æˆåŠŸå¤„ç† */
const handleFileSuccess = (response, file, fileList) => {
  if (response.code == "200") {
    batchNumber.value = response.data;
    isVisible.value = true;
    planned.value = false;
    isError.value = false;
    getExampleList();
  } else {
    isError.value = true;
    proxy.$alert(
      "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
        response.msg +
        "</div>",
      "导入结果",
      { dangerouslyUseHTMLString: true }
    );
  }
  proxy.$refs["uploadRef"].handleRemove(file);
  upload.isUploading = false;
};
/** ä¸Šä¼ å¹¶è§£æžæŒ‰é’®æ“ä½œ */
function uploadParse() {
  queryParams.value.params = {};
  queryParams.value.params["batchNumber"] = batchNumber.value;
  confirmPart(queryParams.value).then((response) => {
    exampleList.value = response.rows;
    loading.value = false;
    isVisible.value = false;
    isError.value = false;
    planned.value = true;
    upload.open = false;
    ElMessage({
      message: "气体管路计划数据已成功上传和解析",
      type: "success",
    });
    getList();
  });
}
/** dialog取消 */
function dialogCancel() {
  if (uploadRef.value) {
    uploadRef.value.clearFiles();
  }
  isVisible.value = false;
  isError.value = false;
  planned.value = true;
  upload.open = false;
  upload.isUploading = false;
}
/*定义下拉二级表*/
const subGridOptions = reactive({
  border: true,
  showOverflow: true,
  columns: [
const subGridOptions = ref([
    {
      title: "工艺路线ID",
      field: "itemNo",
@@ -601,19 +319,18 @@
      width: 160,
      align: "center",
    },
  ],
});
const expandConfig = ref({
  lazy: true,
  loadMethod({ row }) {
    // è°ƒç”¨æŽ¥å£
    return listProcessRoute({ workOrderNo: row.documentNumber }).then(
      (data) => {
        row.subList = data.rows;
      }
    );
  },
});
  ])
// const expandConfig = ref({
//   lazy: true,
//   loadMethod({ row }) {
//     // è°ƒç”¨æŽ¥å£
//     return listProcessRoute({ workOrderNo: row.documentNumber }).then(
//       (data) => {
//         row.subList = data.rows;
//       }
//     );
//   },
// });
getList();
</script>
src/views/mainPlan/sheetMetalOrderManage/index.vue
@@ -69,7 +69,8 @@
            :disabled="single"
            @click="handleUpdate"
            v-hasPermi="['apsPlatePlan:edit']"
        >批量更新工单计划日期</el-button>
          >批量更新工单计划日期</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
@@ -79,9 +80,13 @@
            :disabled="single"
            @click="handleUpdate"
            v-hasPermi="['apsPlatePlan:edit']"
        >生成钣金计划工单</el-button>
          >生成钣金计划工单</el-button
        >
      </el-col>
      <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
      <right-toolbar
        v-model:showSearch="showSearch"
        @queryTable="getList"
      ></right-toolbar>
    </el-row>
    <HxlhTable
      style="width: 100%"
@@ -96,7 +101,30 @@
      @on-checkbox="handleCheckboxChange"
      class="auto-height-grid"
    >
      <template #buttons="{ row }">
        <el-button
          type="primary"
          link
          @click="handleCheckView(row)"
          v-hasPermi="['aps:calendar:update']"
          >查看需求</el-button
        >
      </template>
    </HxlhTable>
    <el-dialog :title="title" v-model="openDialog" width="900px" append-to-body>
      <HxlhTable
        style="width: 100%"
        :columns="subGridOptions"
        :data="subList"
        :loading="loading"
        :height="heightSub"
        @on-checkbox="handleCheckboxChange"
        :page="page"
        @changePageNo="changePageNo"
        @changePageSize="changePageSize"
      >
      </HxlhTable>
    </el-dialog>
  </div>
</template>
@@ -114,6 +142,8 @@
import { listAll_shop, listAps_shop } from "@/api/basicData/shop";
import { selectProcessNameList } from "@/api/basicData/processRoute.js";
const { proxy } = getCurrentInstance();
const openDialog = ref(false);
const subGridOptions = ref([]);
const tableRef = ref();
const calendarList = ref([]);
const loading = ref(true);
@@ -231,6 +261,13 @@
    width: 100,
    align: "center",
  },
  {
    title: "操作",
    width: 100,
    fixed: "right",
    slots: { default: "buttons" },
    align: "center",
  },
]);
// åˆ†é¡µå±žæ€§
const page = ref({
@@ -238,7 +275,12 @@
  current: 1,
  size: 10,
});
function handleCheckView(row) {
  openDialog.value = true;
  // listProcessRoute({ workOrderNo: row.documentNumber }).then((data) => {
  //   subList.value = data.rows;
  // });
}
/** æŸ¥è¯¢æ—¥åŽ†ç®¡ç†åˆ—è¡¨ */
function getList() {
  loading.value = true;
vite.config.js
@@ -14,49 +14,49 @@
  const { VITE_APP_ENV, VITE_APP_BASE_API } = env;
  console.log(VITE_APP_BASE_API, VITE_APP_ENV);
  // æ ¹æ®çŽ¯å¢ƒå˜é‡åŠ¨æ€è®¾ç½®ä»£ç†
  const proxyConfig = () => {
    const personProxy = {
      "/prod-api": {
        target: "http://192.168.50.160:8080",//"http://192.168.50.13:8080", // å¼€å‘环境的后端地址
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/prod-api/, ""),
      },
    };
    const devProxy = {
      "/prod-api": {
        target: "http://192.168.50.160:8080", // å¼€å‘环境的后端地址
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/prod-api/, ""),
      },
    };
  // const proxyConfig = () => {
  //   const personProxy = {
  //     "/prod-api": {
  //       target: "http://192.168.50.160:8080",//"http://192.168.50.13:8080", // å¼€å‘环境的后端地址
  //       changeOrigin: true,
  //       rewrite: (path) => path.replace(/^\/prod-api/, ""),
  //     },
  //   };
  //   const devProxy = {
  //     "/prod-api": {
  //       target: "http://192.168.50.160:8080", // å¼€å‘环境的后端地址
  //       changeOrigin: true,
  //       rewrite: (path) => path.replace(/^\/prod-api/, ""),
  //     },
  //   };
    const testProxy = {
      "/prod-api": {
        target: "http://192.168.50.160:8080", // æµ‹è¯•环境的后端地址
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/prod-api/, ""),
      },
    };
  //   const testProxy = {
  //     "/prod-api": {
  //       target: "http://192.168.50.160:8080", // æµ‹è¯•环境的后端地址
  //       changeOrigin: true,
  //       rewrite: (path) => path.replace(/^\/prod-api/, ""),
  //     },
  //   };
    const prodProxy = {
      "/prod-api": {
        target: "http://192.168.50.160:8080", // æµ‹è¯•环境的后端地址
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/prod-api/, ""),
      },
    };
  //   const prodProxy = {
  //     "/prod-api": {
  //       target: "http://192.168.50.160:8080", // æµ‹è¯•环境的后端地址
  //       changeOrigin: true,
  //       rewrite: (path) => path.replace(/^\/prod-api/, ""),
  //     },
  //   };
    switch (VITE_APP_ENV) {
      case "development":
        return personProxy;
      case "int":
        return devProxy;
      case "uat":
        return testProxy;
      default: // é»˜è®¤å¼€å‘环境
        return prodProxy;
    }
  };
  //   switch (VITE_APP_ENV) {
  //     case "development":
  //       return personProxy;
  //     case "int":
  //       return devProxy;
  //     case "uat":
  //       return testProxy;
  //     default: // é»˜è®¤å¼€å‘环境
  //       return prodProxy;
  //   }
  // };
  return {
    // éƒ¨ç½²ç”Ÿäº§çŽ¯å¢ƒå’Œå¼€å‘çŽ¯å¢ƒä¸‹çš„URL。
    // é»˜è®¤æƒ…况下,vite ä¼šå‡è®¾ä½ çš„应用是被部署在一个域名的根路径上
@@ -79,7 +79,13 @@
      port: 80,
      host: true,
      open: true,
      proxy: proxyConfig(),
      proxy: {
        "/prod-api": {
          target: "http://192.168.50.160:8080", // æµ‹è¯•环境的后端地址
          changeOrigin: true,
          rewrite: (path) => path.replace(/^\/prod-api/, ""),
        },
      },
    },
    //fix:error:stdin>:7356:1: warning: "@charset" must be the first rule in the file
    css: {