| | |
| | | > |
| | | <el-row type="flex" justify="left"> |
| | | <el-col :span="locale === 'zh' ? 5 : 10"> |
| | | <el-form-item |
| | | :label="$t('plan.query.requireTraceID')" |
| | | prop="description" |
| | | > |
| | | <el-form-item :label="$t('plan.query.itemNumber')" prop="itemNumber"> |
| | | <el-input |
| | | :style="{ width: locale === 'zh' ? '140px' : '300px' }" |
| | | v-model="queryParams.description" |
| | | v-model="queryParams.itemNumber" |
| | | :placeholder="`${$t('plan.placeholder.requireTraceID')}`" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="locale === 'zh' ? 8 : 9"> |
| | | <el-form-item :label="$t('plan.query.itemNumber')" prop="description"> |
| | | <el-form-item |
| | | :label="$t('plan.query.workOrderNo')" |
| | | prop="documentNumber" |
| | | > |
| | | <el-input |
| | | :style="{ width: locale === 'zh' ? '140px' : '210px' }" |
| | | v-model="queryParams.description" |
| | | v-model="queryParams.documentNumber" |
| | | :placeholder="`${$t('common.common.placeholder')}${$t( |
| | | 'plan.query.itemNumber' |
| | | )}`" |
| | |
| | | plain |
| | | icon="Download" |
| | | @click="handleExport" |
| | | v-hasPermi="['core:calendar:export']" |
| | | v-hasPermi="['Aps:apsPlatePlan:redundantOrderListExport']" |
| | | >{{ $t("common.common.export") }}</el-button |
| | | > |
| | | </el-col> |
| | |
| | | <HxlhTable |
| | | style="width: 100%" |
| | | :columns="columns" |
| | | :data="calendarList" |
| | | :data="orderList" |
| | | :loading="loading" |
| | | :height="height" |
| | | ref="tableRef" |
| | |
| | | addCalendar, |
| | | updateCalendar, |
| | | } from "@/api/basicData/calendar"; |
| | | import { redundantOrderList } from "@/api/basicData/sheetMetalConfig/sheetMetalConfig"; |
| | | import axios from "axios"; |
| | | import { listAll_plant } from "@/api/basicData/plant"; |
| | | import { listAll_shop, listAps_shop } from "@/api/basicData/shop"; |
| | |
| | | const { t, locale } = useI18n(); |
| | | const { proxy } = getCurrentInstance(); |
| | | const tableRef = ref(); |
| | | const calendarList = ref([]); |
| | | const orderList = ref([]); |
| | | const loading = ref(true); |
| | | const showSearch = ref(true); |
| | | const ids = ref([]); |
| | |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | description: null, |
| | | type: null, |
| | | effectiveDate: null, |
| | | expiringDate: null, |
| | | content: null, |
| | | applicableFactory: null, |
| | | applicableWorkshop: null, |
| | | applicableProcess: null, |
| | | documentNumber: null, |
| | | itemNumber: null, |
| | | }, |
| | | }); |
| | | const { queryParams, form, rules } = toRefs(data); |
| | |
| | | columns.value = [ |
| | | { |
| | | title: t("plan.table.workOrderNo"), |
| | | field: "description", |
| | | field: "documentNumber", |
| | | width: 150, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.subItemPartNumber"), |
| | | field: "type", |
| | | field: "itemNumber", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.productionQuantity"), |
| | | field: "effectiveDate", |
| | | field: "productionQuantity", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.mismatchedProductionQuantity"), |
| | | field: "expiringDate", |
| | | field: "unmatchedQuantity", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.applicableFactories"), |
| | | field: "applicableFactory", |
| | | field: "plant", |
| | | width: 200, |
| | | align: "center", |
| | | formatter: ({ cellValue, row, column }) => { |
| | |
| | | }, |
| | | { |
| | | title: t("plan.table.productionBase"), |
| | | field: "expiringDate", |
| | | field: "productionBase", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.planStartDay"), |
| | | field: "createTime", |
| | | field: "planStartDay", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.planEndDayDate"), |
| | | field: "updateTime", |
| | | field: "planEndDay", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: t("plan.table.workorderCreationTime"), |
| | | field: "updateTime", |
| | | field: "orderCreateTime", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | |
| | | /** 查询日历管理列表 */ |
| | | function getList() { |
| | | loading.value = true; |
| | | listCalendar(queryParams.value).then((response) => { |
| | | calendarList.value = response.rows; |
| | | redundantOrderList(queryParams.value).then((response) => { |
| | | orderList.value = response.rows; |
| | | page.value.total = response.total; |
| | | loading.value = false; |
| | | }).catch(()=>{ |
| | | 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); |
| | | }); |
| | | } |
| | | |
| | | // 取消按钮 |
| | | function cancel() { |
| | | open.value = false; |
| | | reset(); |
| | | } |
| | | |
| | | // 表单重置 |
| | | function reset() { |
| | | form.value = { |
| | | id: null, |
| | | description: null, |
| | | type: "1", |
| | | effectiveDate: null, |
| | | expiringDate: null, |
| | | content: null, |
| | | applicableFactory: null, |
| | | applicableWorkshop: null, |
| | | applicableProcess: null, |
| | | createBy: null, |
| | | createTime: null, |
| | | updateBy: null, |
| | | updateTime: null, |
| | | }; |
| | | proxy.resetForm("calendarRef"); |
| | | proxy.resetForm("queryRef"); |
| | | } |
| | | |
| | | /** 搜索按钮操作 */ |
| | | function handleQuery() { |
| | | queryParams.value.pageNum = 1; |
| | | page.value.current = 1; |
| | | getList(); |
| | | } |
| | | |
| | |
| | | handleQuery(); |
| | | } |
| | | |
| | | // 多选框选中数据 |
| | | function handleSelectionChange(selection) { |
| | | ids.value = selection.map((item) => item.id); |
| | | single.value = selection.length != 1; |
| | | multiple.value = !selection.length; |
| | | } |
| | | |
| | | /** 新增按钮操作 */ |
| | | async function handleAdd() { |
| | | reset(); |
| | | open.value = true; |
| | | title.value = "添加日历管理"; |
| | | } |
| | | /** 选择工厂后事件 加载车间 和 工序 **/ |
| | | function changePlant(plant) { |
| | | listAps_shop({ plantCode: plant }).then((response) => { |
| | | shopList.value = response.rows; |
| | | }); |
| | | selectProcessNameList({ orgCode: plant }).then((response) => { |
| | | processList.value = response.rows; |
| | | }); |
| | | } |
| | | /** 修改按钮操作 */ |
| | | function handleUpdate(row) { |
| | | reset(); |
| | | const _id = row.id || ids.value; |
| | | getCalendar(_id).then((response) => { |
| | | form.value = response.data; |
| | | // form.value.content = JSON.parse(response.data.content.value); |
| | | if (form.value.type === "1") { |
| | | weekDaysSettingList.value = JSON.parse( |
| | | response.data.content.value |
| | | ).weekdays; |
| | | } else if (form.value.type === "2") { |
| | | holidays.value = JSON.parse(response.data.content.value).holidays; |
| | | } |
| | | |
| | | open.value = true; |
| | | title.value = "修改日历管理"; |
| | | }); |
| | | } |
| | | |
| | | /** 提交按钮 */ |
| | | function submitForm() { |
| | | 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(); |
| | | }); |
| | | } |
| | | } 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(); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** 删除按钮操作 */ |
| | | function handleDelete(row) { |
| | | const _ids = row.id || ids.value; |
| | | proxy.$modal |
| | | .confirm('是否确认删除日历管理编号为"' + _ids + '"的数据项?') |
| | | .then(function () { |
| | | return delCalendar(_ids); |
| | | }) |
| | | .then(() => { |
| | | getList(); |
| | | proxy.$modal.msgSuccess("删除成功"); |
| | | }) |
| | | .catch(() => {}); |
| | | } |
| | | |
| | | /** 导出按钮操作 */ |
| | | function handleExport() { |
| | | proxy.download( |
| | | "core/calendar/export", |
| | | "aps/apsPlatePlan/redundantOrderListExport", |
| | | { |
| | | ...queryParams.value, |
| | | }, |
| | | `calendar_${new Date().getTime()}.xlsx` |
| | | `redundantOrderList_${new Date().getTime()}.xlsx` |
| | | ); |
| | | } |
| | | function handleSwitchType(e) { |
| | | typeRadioNumber.value = e; |
| | | form.value.type = e; |
| | | form.value.effectiveDate = null; |
| | | form.value.expiringDate = null; |
| | | form.value.content = null; |
| | | form.value.applicableFactory = null; |
| | | form.value.applicableWorkshop = null; |
| | | form.value.applicableProcess = null; |
| | | } |
| | | function changePageNo(currentPage) { |
| | | queryParams.value.pageNum = currentPage; |
| | |
| | | queryParams.value.pageSize = pageSize; |
| | | getList(); |
| | | } |
| | | // 多选框选中数据 |
| | | const handleCheckboxChange = (data) => { |
| | | ids.value = data.records.map((item) => item.id); |
| | | single.value = data.records.length !== 1; |
| | | multiple.value = !data.records.length; |
| | | }; |
| | | onMounted(() => { |
| | | getList(); |
| | | /** 查询工厂列表 */ |
| | | listAll_plant({}) |
| | | .then((response) => { |
| | | plantList.value = response.data; |
| | | }) |
| | | .catch((error) => { |
| | | console.error("请求出错:", error); |
| | | }); |
| | | }); |
| | | </script> |
| | | <style lang="scss" scoped> |