CD配唱片
2025-04-27 f4bcf01171297bc16db79e543eda36a36957279b
提交标准工序的表格工厂展示字段修正
已修改2个文件
158 ■■■■■ 文件已修改
src/views/basicData/calendar/index.vue 138 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/standardProcess/index.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/calendar/index.vue
@@ -98,22 +98,43 @@
      </template>
      <template #mark="{ row }">
        <div v-if="row.type === '1'">
            <span v-for="(item, index) in JSON.parse(row.content.value).weekdays" :key="index">
              <span v-if="item.work==='y'" status="success" class="mart5">{{item.chineseName}}: 工作日;&nbsp;</span>
              <span v-if="item.work==='n'" status="info" class="mart5">{{item.chineseName}}: 非工作日;&nbsp;</span>
            </span>
            <!-- <div v-for="(item, index) in JSON.parse(row.content.value).weekdays" :key="index">
          <span
            v-for="(item, index) in JSON.parse(row.content.value).weekdays"
            :key="index"
          >
            <span v-if="item.work === 'y'" status="success" class="mart5"
              >{{ item.chineseName }}: 工作日;&nbsp;</span
            >
            <span v-if="item.work === 'n'" status="info" class="mart5"
              >{{ item.chineseName }}: 非工作日;&nbsp;</span
            >
          </span>
          <!-- <div v-for="(item, index) in JSON.parse(row.content.value).weekdays" :key="index">
              <vxe-tag v-if="item.work==='y'" status="success" class="mart5">{{item.chineseName}}: 工作日;&nbsp;</vxe-tag>
              <vxe-tag v-if="item.work==='n'" status="info" class="mart5">{{item.chineseName}}: 非工作日;&nbsp;</vxe-tag>
            </div> -->
        </div>
        <div v-if="row.type === '2'">
            <div>{{JSON.parse(row.content.value).holidays.startdate}}至{{JSON.parse(row.content.value).holidays.enddate}}</div>
          <div>
            {{ JSON.parse(row.content.value).holidays.startdate }}至{{
              JSON.parse(row.content.value).holidays.enddate
            }}
          </div>
        </div>
      </template>
      <template #buttons="{row}">
        <vxe-button mode="text" @click="handleUpdate(row)" v-hasPermi="['aps:calendar:update']" >修改</vxe-button>
        <vxe-button mode="text" @click="handleDelete(row)" v-hasPermi="['aps:calendar:remove']" >删除</vxe-button>
      <template #buttons="{ row }">
        <vxe-button
          mode="text"
          @click="handleUpdate(row)"
          v-hasPermi="['aps:calendar:update']"
          >修改</vxe-button
        >
        <vxe-button
          mode="text"
          @click="handleDelete(row)"
          v-hasPermi="['aps:calendar:remove']"
          >删除</vxe-button
        >
      </template>
    </HxlhTable>
@@ -167,7 +188,7 @@
          >
            <div class="week_flex_item">{{ item.chineseName }}</div>
            <div class="week_flex_item">
              <el-radio-group v-model="item.work" @change="handleSetWorkDays">
              <el-radio-group v-model="item.work">
                <el-radio :label="'y'">工作日</el-radio>
                <el-radio :label="'n'">非工作日</el-radio>
              </el-radio-group>
@@ -293,7 +314,7 @@
import { listAll_shop, listAps_shop } from "@/api/basicData/shop";
import { selectProcessNameList } from "@/api/basicData/processRoute.js";
const { proxy } = getCurrentInstance();
const tableRef = ref()
const tableRef = ref();
const calendarList = ref([]);
const open = ref(false);
const loading = ref(true);
@@ -457,37 +478,30 @@
    width: 200,
    align: "center",
    formatter: ({ cellValue, row, column }) => {
      console.log(cellValue, "000hsudhwhuwhuhwu");
      for (let i = 0; i < plantList.value.length; i++) {
        console.log(
          cellValue,
          plantList.value[i].plantCode,
          plantList.value[i].plantName,
          "111hsudhwhuwhuhwu"
        );
        if (cellValue === plantList.value[i].plantCode) {
          return plantList.value[i].plantName;
      if (cellValue) {
        for (let i = 0; i < plantList.value.length; i++) {
          if (cellValue === plantList.value[i].plantCode) {
            return plantList.value[i].plantName;
          }
        }
      }
    },
  },
  {
    title: '适用车间',
    field: 'applicableWorkshop',
    title: "适用车间",
    field: "applicableWorkshop",
    width: 200,
    align: 'center',
    formatter: (({ cellValue, row, column }) => {
    align: "center",
    formatter: ({ cellValue, row, column }) => {
      if (cellValue) {
        for(let i=0;i<shopList.value.length;i++){
          if(cellValue===shopList.value[i].id){
             console.log(cellValue,'cellValue')
            return shopList.value[i].shopName
        for (let i = 0; i < shopList.value.length; i++) {
          if (cellValue === shopList.value[i].id) {
            return shopList.value[i].shopName;
          }
        }
      }
      return '';
    })
      return "";
    },
  },
  {
    title: "适用工序",
@@ -507,7 +521,13 @@
    width: 200,
    align: "center",
  },
  { title: '操作', width: 100, fixed:"right", slots: { default: 'buttons' }, align: 'center' }
  {
    title: "操作",
    width: 100,
    fixed: "right",
    slots: { default: "buttons" },
    align: "center",
  },
]);
// 分页属性
const page = ref({
@@ -524,21 +544,23 @@
    page.value.total = response.total;
    loading.value = false;
  });
  axios.all([
    /** 查询工厂列表 */
    listAll_plant({}),
    /** 查询车间列表 */
    listAll_shop({}),
  ])
  .then(axios.spread((response1, response2) => {
    plantList.value = response1.data;
    shopList.value = response2.data;
    loading.value = false;
  }))
  .catch(error => {
    console.error('请求出错:', error);
  });
  axios
    .all([
      /** 查询工厂列表 */
      listAll_plant({}),
      /** 查询车间列表 */
      listAll_shop({}),
    ])
    .then(
      axios.spread((response1, response2) => {
        plantList.value = response1.data;
        shopList.value = response2.data;
        loading.value = false;
      })
    )
    .catch((error) => {
      console.error("请求出错:", error);
    });
}
// 取消按钮
@@ -591,15 +613,10 @@
  reset();
  open.value = true;
  title.value = "添加日历管理";
  // const res = await listAll_plant({});
  // plantList.value = res.data;
  console.log(res, "sjchhscwhciwhcwi");
}
/** 选择工厂后事件 加载车间 和 工序 **/
function changePlant(plant) {
  listAps_shop({ plantCode: plant }).then((response) => {
    console.log(response, "sbcsuhcuhscschsc");
    shopList.value = response.rows;
  });
  selectProcessNameList({ orgCode: plant }).then((response) => {
@@ -612,11 +629,6 @@
  const _id = row.id || ids.value;
  getCalendar(_id).then((response) => {
    form.value = response.data;
    console.log(
      form.value,
      JSON.parse(response.data.content.value),
      "hushchsuch"
    );
    // form.value.content = JSON.parse(response.data.content.value);
    if (form.value.type === "1") {
      weekDaysSettingList.value = JSON.parse(
@@ -636,7 +648,6 @@
  proxy.$refs["calendarRef"].validate((valid) => {
    if (valid) {
      if (form.value.id != null) {
        console.log(form.value, "修改日历===");
        if (form.value.type === "1") {
          updateCalendar({
            ...form.value,
@@ -719,7 +730,6 @@
  );
}
function handleSwitchType(e) {
  console.log(e, "日期类型切换");
  typeRadioNumber.value = e;
  form.value.type = e;
  form.value.effectiveDate = null;
@@ -728,10 +738,6 @@
  form.value.applicableFactory = null;
  form.value.applicableWorkshop = null;
  form.value.applicableProcess = null;
}
// 设置周工作日
function handleSetWorkDays(e) {
  console.log(weekDaysSettingList.value, "设置周工作日");
}
function changePageNo(currentPage) {
  queryParams.value.pageNum = currentPage;
@@ -800,8 +806,8 @@
.factory_use_item {
  margin-top: 10px;
}
.mart5{
  margin-top:5px;
.mart5 {
  margin-top: 5px;
}
.custom-height {
  height: 200px; /* 或者使用 min-height */
src/views/basicData/standardProcess/index.vue
@@ -299,6 +299,7 @@
  addStandardProcess,
  updateStandardProcess,
} from "@/api/basicData/standardProcess";
import { listAll_plant } from "@/api/basicData/plant";
import HxlhTable from "@/components/HxlhTable/index.vue";
import { getToken } from "@/utils/auth.js";
import { ref } from "vue";
@@ -309,8 +310,9 @@
const page = ref({
  total: 0,
  current: 1,
  size: 10
  size: 10,
});
const plantList = ref([]);
const standardProcessList = ref([]);
const open = ref(false);
const loading = ref(true);
@@ -385,6 +387,15 @@
    field: "plant",
    width: 150,
    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;
          }
        }
      }
    },
  },
  {
    title: "车间",
@@ -621,6 +632,11 @@
const handleFileUploadProgress = (event, file, fileList) => {
  upload.isUploading = true;
};
onMounted(async () => {
  /** 查询工厂列表 */
  const response = await listAll_plant({});
  plantList.value = response.data;
  loading.value = false;
});
getList();
</script>