chengxiangling
2025-05-13 840e04c3878e27d0bc9784bb79e3559a8cbfbf32
提交钣金计划工单修改
已修改4个文件
315 ■■■■■ 文件已修改
src/api/basicData/plant.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/i18n/locales/plan/index.js 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/calendar/index.vue 270 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mainPlan/sheetMetalOrderManage/index.vue 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/basicData/plant.js
@@ -51,4 +51,12 @@
    method: 'get',
    params: query
  })
}
export function listByWorkShop(query) {
  return request({
    url: '/aps/standardProcess/listByWorkShop',
    method: 'get',
    params: query
  })
}
src/utils/i18n/locales/plan/index.js
@@ -5,7 +5,8 @@
    viewAssociatedRequirements:"查看关联需求",
    setMode:"设置模式",
    CustomizePlannedCompletionDate:"自定义计划完工日",
    tipsBugSheetMetal:"将生成的钣金需求的计划开工日和计划完工日赋值给工单",
    tipsBugSheetMetal:"将自定义的日期赋值给工单的计划完工日",
    tipsBugSheetMetal2:"将自定义的日期赋值给工单的计划完工日",
    metalWeldWork:"焊缝工单数据",
    parseUpload:"已成功上传和解析",
    weld:"焊缝"
@@ -218,6 +219,7 @@
    setMode:"Set Mode",
    CustomizePlannedCompletionDate:"Customize the planned completion date",
    tipsBugSheetMetal:"Assign the planned start date and planned completion date of the generated sheet metal requirements to the work order",
    tipsBugSheetMetal2:"Assign custom dates to the planned completion date of the work order",
    weld:"weld seam",
  },
  options: {
src/views/basicData/calendar/index.vue
@@ -20,7 +20,24 @@
            />
          </el-form-item>
        </el-col>
        <el-col :span="18" style="text-align: right">
        <el-col :span="6">
          <el-form-item label="适用工厂" prop="plant">
            <el-select
              style="width: 140px"
              clearable
              v-model="queryParams.plant"
              placeholder="适用工厂"
            >
              <el-option
                v-for="item in aps_factory"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12" style="text-align: right">
          <el-form-item class="column-with-margin">
            <el-button type="primary" icon="Search" @click="handleQuery"
              >查询</el-button
@@ -139,7 +156,7 @@
    </HxlhTable>
    <!-- 添加或修改日历管理对话框 -->
    <el-dialog :title="title" v-model="open" width="500px" append-to-body>
    <el-dialog :title="title" v-model="open" width="80%" append-to-body>
      <el-form
        ref="calendarRef"
        :model="form"
@@ -150,10 +167,11 @@
          <el-input v-model="form.description" placeholder="请输入描述" />
        </el-form-item>
        <el-form-item label="日历类型" prop="type">
          <el-radio-group v-model="form.type" @change="handleSwitchType">
          <!-- <el-radio-group v-model="form.type" @change="handleSwitchType">
            <el-radio :label="'1'">周工作</el-radio>
            <el-radio :label="'2'">节假日</el-radio>
          </el-radio-group>
          </el-radio-group> -->
          <el-tag type="primary">周工作</el-tag>
        </el-form-item>
        <el-form-item label="生效时间" prop="effectiveDate">
          <el-date-picker
@@ -228,37 +246,44 @@
            </div>
          </div>
        </div>
        <el-form-item
        <!-- <el-form-item
          label="适用工厂"
          prop="applicableFactory"
          class="factory_use_item"
        > -->
        <div class="select_factory">适用工厂/车间/工序</div>
        <!-- <el-row :gutter="20" class="select_factory"> -->
        <div
          class="select_factory"
          v-for="(item, index) in applicableSettingList"
          :key="index"
        >
          <!-- <el-col :span="7"> -->
          <el-select
            class="select_content"
            clearable
            v-model="form.applicableFactory"
            v-model="item.factory"
            style="width: 160px"
            placeholder="请输入适用工厂"
            @change="changePlant($event)"
          >
            <el-option
              v-for="plant in plantList"
              :key="plant.id"
              :label="plant.plantName"
              :value="plant.plantCode"
              v-for="plant in aps_factory"
              :key="plant.value"
              :label="plant.label"
              :value="plant.value"
            >
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item
          label="适用车间"
          prop="applicableWorkshop"
          class="factory_use_item"
        >
          <!-- </el-col>
              <el-col :span="7"> -->
          <el-select
            class="select_content"
            clearable
            v-model="form.applicableWorkshop"
            v-model="item.workshop"
            style="width: 160px"
            placeholder="请输入适用车间"
            @change="changeWorkshop($event)"
          >
            <el-option
              v-for="shop in shopList"
@@ -268,15 +293,12 @@
            >
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item
          label="适用工序"
          prop="applicableProcess"
          class="factory_use_item"
        >
          <!-- </el-col>
              <el-col :span="7"> -->
          <el-select
            class="select_content"
            clearable
            v-model="form.applicableProcess"
            v-model="item.process"
            style="width: 160px"
            placeholder="请输入适用工序"
          >
@@ -288,7 +310,32 @@
            >
            </el-option>
          </el-select>
          <!-- </el-col>
              <el-col :span="3"> -->
          <el-button
            class="select_content"
            type="primary"
            :icon="Plus"
            @click="handleAddFactory(item)"
            circle
            size="small"
          />
          <!-- </el-col> -->
        </div>
        <!-- </el-row> -->
        <!-- </el-form-item> -->
        <!-- <el-form-item
          label="适用车间"
          prop="applicableWorkshop"
          class="factory_use_item"
        >
        </el-form-item>
        <el-form-item
          label="适用工序"
          prop="applicableProcess"
          class="factory_use_item"
        >
        </el-form-item> -->
      </el-form>
      <template #footer>
        <div class="dialog-footer">
@@ -301,6 +348,7 @@
</template>
<script setup name="Calendar">
import { Plus } from "@element-plus/icons-vue";
import HxlhTable from "@/components/HxlhTable";
import {
  listCalendar,
@@ -310,10 +358,11 @@
  updateCalendar,
} from "@/api/basicData/calendar";
import axios from "axios";
import { listAll_plant } from "@/api/basicData/plant";
import { listAll_plant, listByWorkShop } from "@/api/basicData/plant";
import { listAll_shop, listAps_shop } from "@/api/basicData/shop";
import { selectProcessNameList } from "@/api/basicData/processRoute.js";
const { proxy } = getCurrentInstance();
const { aps_factory } = proxy.useDict("aps_factory");
const tableRef = ref();
const calendarList = ref([]);
const open = ref(false);
@@ -327,11 +376,19 @@
const data = reactive({
  form: {
    type: "1",
    applicable: [
      {
        factory: "",
        workshop: "",
        process: "",
      },
    ],
  },
  queryParams: {
    pageNum: 1,
    pageSize: 10,
    description: null,
    plant: null,
    type: null,
    effectiveDate: null,
    expiringDate: null,
@@ -348,13 +405,13 @@
        trigger: "blur",
      },
    ],
    type: [
      {
        required: true,
        message: "请选择日历类型",
        trigger: "blur",
      },
    ],
    // type: [
    //   {
    //     required: true,
    //     message: "请选择日历类型",
    //     trigger: "blur",
    //   },
    // ],
    effectiveDate: [
      {
        required: true,
@@ -391,6 +448,9 @@
  },
]);
const typeRadioNumber = ref(1);
const applicableSettingList = ref([
  { factory: "", workshop: "", process: "" },
]);
const weekDaysSettingList = ref([
  {
    day: "Monday",
@@ -585,6 +645,13 @@
    createTime: null,
    updateBy: null,
    updateTime: null,
    applicable: [
      {
        factory: "",
        workshop: "",
        process: "",
      },
    ],
  };
  proxy.resetForm("calendarRef");
}
@@ -612,16 +679,35 @@
async function handleAdd() {
  reset();
  open.value = true;
  form.value = {
    applicable: [
      {
        factory: "",
        workshop: "",
        process: "",
      },
    ],
  };
  title.value = "添加日历管理";
}
/** 选择工厂后事件 加载车间 和 工序 **/
function changePlant(plant) {
  console.log(plant);
  listAps_shop({ plantCode: plant }).then((response) => {
    shopList.value = response.rows;
  });
  selectProcessNameList({ orgCode: plant }).then((response) => {
    processList.value = response.rows;
  // selectProcessNameList({ orgCode: plant }).then((response) => {
  //   processList.value = response.rows;
  // });
}
function changeWorkshop(workShop) {
  listByWorkShop({ workShop: "气柜" }).then((res) => {
    console.log(res, "workShop");
    processList.value = res.rows;
  });
}
function handleAddFactory(row) {
  applicableSettingList.value.push(row);
}
/** 修改按钮操作 */
function handleUpdate(row) {
@@ -648,57 +734,60 @@
  proxy.$refs["calendarRef"].validate((valid) => {
    if (valid) {
      if (form.value.id != null) {
        if (form.value.type === "1") {
          updateCalendar({
            ...form.value,
            content: {
              weekdays: weekDaysSettingList.value,
            },
            applicableWorkshop: form.value.applicableWorkshop,
            applicableProcess: form.value.applicableProcess,
          }).then((response) => {
            proxy.$modal.msgSuccess("修改成功");
            open.value = false;
            getList();
          });
        } else if (form.value.type === "2") {
          updateCalendar({
            ...form.value,
            content: {
              holidays: holidays.value,
            },
            applicableWorkshop: form.value.applicableWorkshop,
            applicableProcess: form.value.applicableProcess,
          }).then((response) => {
            proxy.$modal.msgSuccess("修改成功");
            open.value = false;
            getList();
          });
        }
        // if (form.value.type === "1") {
        //   updateCalendar({
        //     ...form.value,
        //     content: {
        //       weekdays: weekDaysSettingList.value,
        //     },
        //     applicableWorkshop: form.value.applicableWorkshop,
        //     applicableProcess: form.value.applicableProcess,
        //   }).then((response) => {
        //     proxy.$modal.msgSuccess("修改成功");
        //     open.value = false;
        //     getList();
        //   });
        // } else if (form.value.type === "2") {
        updateCalendar({
          ...form.value,
          content: {
            holidays: holidays.value,
          },
          applicableWorkshop: form.value.applicableWorkshop,
          applicableProcess: form.value.applicableProcess,
        }).then((response) => {
          proxy.$modal.msgSuccess("修改成功");
          open.value = false;
          getList();
        });
        // }
      } else {
        if (form.value.type === "1") {
          addCalendar({
            ...form.value,
            content: {
              weekdays: weekDaysSettingList.value,
            },
          }).then((response) => {
            proxy.$modal.msgSuccess("新增成功");
            open.value = false;
            getList();
          });
        } else if (form.value.type === "2") {
          addCalendar({
            ...form.value,
            content: {
              holidays: holidays.value,
            },
          }).then((response) => {
            proxy.$modal.msgSuccess("新增成功");
            open.value = false;
            getList();
          });
        }
        // if (form.value.type === "1") {
        //   addCalendar({
        //     ...form.value,
        //     content: {
        //       weekdays: weekDaysSettingList.value,
        //     },
        //   }).then((response) => {
        //     proxy.$modal.msgSuccess("新增成功");
        //     open.value = false;
        //     getList();
        //   });
        // } else if (form.value.type === "2") {
        addCalendar({
          ...form.value,
          content: {
            weekdays: weekDaysSettingList.value,
          },
          holidays: holidays.value,
          applicable: applicableSettingList.value,
          //},
        }).then((response) => {
          proxy.$modal.msgSuccess("新增成功");
          open.value = false;
          getList();
        });
        // }
      }
    }
  });
@@ -806,6 +895,19 @@
.factory_use_item {
  margin-top: 10px;
}
.select_factory {
  margin-left: 34px;
  font-weight: 800;
  font-size: 14px;
  color: #606266;
}
.select_content {
  margin-right: 10px;
  margin-top: 20px;
  // &:nth-child(1) {
  //   margin-left:34px;
  // }
}
.mart5 {
  margin-top: 5px;
}
src/views/mainPlan/sheetMetalOrderManage/index.vue
@@ -119,7 +119,7 @@
        <el-button
          type="primary"
          plain
          icon="Plus"
          icon="Refresh"
          :disabled="multiple"
          @click="handleBatchUpdatePlanDate"
          v-hasPermi="['ApsPlatOrderPlanManager:requirement:list']"
@@ -200,12 +200,13 @@
          <el-radio :label="1">{{
            $t("plan.btns.batchUpdateOrderDate")
          }}</el-radio>
          <el-radio :label="2">{{
          <!-- <el-radio :label="2">{{
            $t("plan.title.CustomizePlannedCompletionDate")
          }}</el-radio>
          }}</el-radio> -->
        </el-radio-group>
      </div>
      <div class="red_color">{{ $t("plan.title.tipsBugSheetMetal") }}</div>
      <div class="red_color" v-if="radio === 1">{{ $t("plan.title.tipsBugSheetMetal") }}</div>
      <div class="red_color" v-if="radio === 2">{{ $t("plan.title.tipsBugSheetMetal2") }}</div>
      <div class="mode_box" v-if="radio === 2">
        <span>{{ $t("plan.title.CustomizePlannedCompletionDate") }}</span>
        <!-- <el-date-picker
@@ -504,18 +505,18 @@
        width: 200,
        align: "center",
      },
      {
        title: t("basic.table.processRouteID"),
        field: "processRouteId",
        width: 200,
        align: "center",
      },
      {
        title: t("plan.table.processRouteWorkingHours"),
        field: "processRouteHours",
        width: 100,
        align: "center",
      },
      // {
      //   title: t("basic.table.processRouteID"),
      //   field: "processRouteId",
      //   width: 200,
      //   align: "center",
      // },
      // {
      //   title: t("plan.table.processRouteWorkingHours"),
      //   field: "processRouteHours",
      //   width: 100,
      //   align: "center",
      // },
      {
        title: t("plan.table.demandQuantity"),
        field: "requireAmount",