|  |  | 
 |  |  |         :rules="rules" | 
 |  |  |         :inline="true" | 
 |  |  |         v-show="showSearch" | 
 |  |  |         :label-width="locale === 'zh' ? '90px' : '120px'" | 
 |  |  |         :label-width="locale === 'zh' ? '90px' : '160px'" | 
 |  |  |       > | 
 |  |  |         <el-row :gutter="20"> | 
 |  |  |           <el-col :span="6"> | 
 |  |  |           <el-col :span="9"> | 
 |  |  |             <el-form-item :label="$t('plan.query.itemNumber')" prop="itemCode"> | 
 |  |  |               <el-input | 
 |  |  |                 style="width: 240px" | 
 |  |  | 
 |  |  |               /> | 
 |  |  |             </el-form-item> | 
 |  |  |           </el-col> | 
 |  |  |           <el-col :span="18" style="text-align: right"> | 
 |  |  |           <el-col :span="9"> | 
 |  |  |             <el-form-item | 
 |  |  |               :label="$t('plan.table.applicableFactories')" | 
 |  |  |               prop="orgCode" | 
 |  |  |             > | 
 |  |  |               <el-select | 
 |  |  |                 clearable | 
 |  |  |                 v-model="queryParams.orgCode" | 
 |  |  |                 :style="{ width: locale == 'zh' ? '160px' : '250px' }" | 
 |  |  |                 :placeholder="`${$t('common.common.placeholder')}${$t( | 
 |  |  |                   'plan.table.applicableFactories' | 
 |  |  |                 )}`" | 
 |  |  |               > | 
 |  |  |                 <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">{{ | 
 |  |  |                 $t("common.common.query") | 
 |  |  | 
 |  |  |     <HxlhTable | 
 |  |  |       style="width: 100%" | 
 |  |  |       :columns="columns" | 
 |  |  |       :data="planList" | 
 |  |  |       :data="processRouteList" | 
 |  |  |       :loading="loading" | 
 |  |  |       :height="height" | 
 |  |  |       @on-checkbox="handleCheckboxChange" | 
 |  |  | 
 |  |  |           link | 
 |  |  |           @click="handleCheckView(row)" | 
 |  |  |           v-hasPermi="['aps:calendar:update']" | 
 |  |  |           >查看</el-button | 
 |  |  |           >{{ $t("common.common.view") }}</el-button | 
 |  |  |         > | 
 |  |  |       </template> | 
 |  |  |     </HxlhTable> | 
 |  |  |     <el-dialog :title="title" v-model="openDialog" width="900px" append-to-body> | 
 |  |  |     <el-dialog | 
 |  |  |       :title="$t('common.common.viewDetails')" | 
 |  |  |       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> | 
 |  |  |       <template #footer> | 
 |  |  |         <span class="dialog-footer"> | 
 |  |  |           <el-button @click="openDialog = false">{{ | 
 |  |  |             $t("common.common.cancel") | 
 |  |  |           }}</el-button> | 
 |  |  |         </span> | 
 |  |  |       </template> | 
 |  |  |     </el-dialog> | 
 |  |  |   </div> | 
 |  |  | </template> | 
 |  |  |  | 
 |  |  | <script setup name="ApsPlatePlan"> | 
 |  |  | import { listAll_plant } from "@/api/basicData/plant"; | 
 |  |  | import { | 
 |  |  |   listPlan, | 
 |  |  |   examplePlan, | 
 |  |  |   confirmPart, | 
 |  |  | } from "@/api/mainPlan/apsPlatePlan.js"; | 
 |  |  | import { listProcessRoute } from "@/api/basicData/processRoute.js"; | 
 |  |  |   apsStandardProcessRouteHeaderList, | 
 |  |  |   apsStandardProcessRouteLineList, | 
 |  |  | } from "@/api/basicData/processRoute.js"; | 
 |  |  | import { listAll_shop } from "@/api/basicData/shop"; | 
 |  |  | import HxlhTable from "@/components/HxlhTable/index.vue"; | 
 |  |  | import { ref } from "vue"; | 
 |  |  | import { getToken } from "@/utils/auth.js"; | 
 |  |  | import { ElMessage } from "element-plus"; | 
 |  |  | // import { ElMessage } from "element-plus"; | 
 |  |  | import { useI18n } from "vue-i18n"; //要在js中使用国际化 | 
 |  |  | const { t, locale } = useI18n(); | 
 |  |  | const { proxy } = getCurrentInstance(); | 
 |  |  | 
 |  |  |   current: 1, | 
 |  |  |   size: 10, | 
 |  |  | }); | 
 |  |  | const { | 
 |  |  |   aps_is_suspended, | 
 |  |  |   aps_document_status, | 
 |  |  |   aps_account, | 
 |  |  |   aps_business_type, | 
 |  |  | } = proxy.useDict( | 
 |  |  |   "aps_is_suspended", | 
 |  |  |   "aps_document_status", | 
 |  |  |   "aps_account", | 
 |  |  |   "aps_business_type" | 
 |  |  | ); | 
 |  |  |  | 
 |  |  | const planList = ref([]); | 
 |  |  | const plantList = ref([]); | 
 |  |  | const shopList = ref([]); | 
 |  |  | const processRouteList = ref([]); | 
 |  |  | const subGridOptions = ref([]); | 
 |  |  | const subList = ref([]); | 
 |  |  | const loading = ref(true); | 
 |  |  | const loading = ref(false); | 
 |  |  | const showSearch = ref(true); | 
 |  |  | const single = ref(true); | 
 |  |  | const total = ref(0); | 
 |  |  |  | 
 |  |  | const height = ref(document.documentElement.clientHeight - 270 + "px;"); | 
 |  |  | const height = ref(document.documentElement.clientHeight - 210 + "px;"); | 
 |  |  | const heightSub = ref(document.documentElement.clientHeight - 320 + "px;"); | 
 |  |  | // 表格配置 | 
 |  |  | const columns = ref([]); | 
 |  |  | 
 |  |  |   queryParams: { | 
 |  |  |     pageNum: 1, | 
 |  |  |     pageSize: 10, | 
 |  |  |     customer: null, | 
 |  |  |     documentNumber: null, | 
 |  |  |     itemCode: null, | 
 |  |  |   }, | 
 |  |  |   rules: { | 
 |  |  |     itemCode: [ | 
 |  |  |       { | 
 |  |  |         required: true, | 
 |  |  |         message: `${t("common.common.placeholder")}${t( | 
 |  |  |           "plan.query.itemNumber" | 
 |  |  |         )}`, | 
 |  |  |         trigger: "blur", | 
 |  |  |       }, | 
 |  |  |     ], | 
 |  |  |     itemCode: [], | 
 |  |  |   }, | 
 |  |  | }); | 
 |  |  |  | 
 |  |  | 
 |  |  | watch( | 
 |  |  |   locale, | 
 |  |  |   (newLocale) => { | 
 |  |  |     rules.value = { | 
 |  |  |       itemCode: [ | 
 |  |  |         { | 
 |  |  |           required: true, | 
 |  |  |           message: `${t("common.common.placeholder")}${t( | 
 |  |  |             "plan.query.itemNumber" | 
 |  |  |           )}`, | 
 |  |  |           trigger: "blur", | 
 |  |  |         }, | 
 |  |  |       ], | 
 |  |  |     }; | 
 |  |  |     columns.value = [ | 
 |  |  |       // { | 
 |  |  |       //   field: "expand", | 
 |  |  | 
 |  |  |       // }, | 
 |  |  |       // { type: "checkbox", width: 60, align: "center" }, | 
 |  |  |       { | 
 |  |  |         title: t("basic.table.processRouteVersion"), | 
 |  |  |         field: "mainPartNumber", | 
 |  |  |         title: t("basic.table.processRouteID"), | 
 |  |  |         field: "routeId", | 
 |  |  |       }, | 
 |  |  |       { | 
 |  |  |         title: t("basic.table.processRouteVersion"), | 
 |  |  |         field: "businessType", | 
 |  |  |         field: "version", | 
 |  |  |       }, | 
 |  |  |       { | 
 |  |  |         title: t("plan.table.itemNumber"), | 
 |  |  |         field: "documentNumber", | 
 |  |  |         field: "itemCode", | 
 |  |  |       }, | 
 |  |  |       { | 
 |  |  |         title: t("basic.table.effectiveDate"), | 
 |  |  |         field: "requirementType", | 
 |  |  |         field: "startDate", | 
 |  |  |       }, | 
 |  |  |       { | 
 |  |  |         title: t("basic.table.expiringDate"), | 
 |  |  |         field: "documentStatus", | 
 |  |  |         field: "endDate", | 
 |  |  |       }, | 
 |  |  |       { | 
 |  |  |         title: t("basic.table.integrationDate"), | 
 |  |  |         field: "itemNumber", | 
 |  |  |         field: "createTime", | 
 |  |  |       }, | 
 |  |  |       { | 
 |  |  |         title: t("basic.table.applicableFactories"), | 
 |  |  |         field: "drawingNo", | 
 |  |  |         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; | 
 |  |  |               } | 
 |  |  |             } | 
 |  |  |           } | 
 |  |  |         }, | 
 |  |  |       }, | 
 |  |  |       { | 
 |  |  |         title: "操作", | 
 |  |  |         width: 100, | 
 |  |  |         fixed: "right", | 
 |  |  |         slots: { default: "buttons" }, | 
 |  |  |         align: "center", | 
 |  |  |       }, | 
 |  |  |     ]; | 
 |  |  |     subGridOptions.value = [ | 
 |  |  |       { | 
 |  |  |         title: t("basic.table.processRouteID"), | 
 |  |  |         field: "routeId", | 
 |  |  |         width: 150, | 
 |  |  |         align: "center", | 
 |  |  |       }, | 
 |  |  |       { | 
 |  |  |         title: t("basic.table.operationSequence"), | 
 |  |  |         field: "routeNum", | 
 |  |  |         width: 150, | 
 |  |  |         align: "center", | 
 |  |  |       }, | 
 |  |  |       { | 
 |  |  |         title: t("plan.table.processName"), | 
 |  |  |         field: "routeName", | 
 |  |  |         width: 150, | 
 |  |  |         align: "center", | 
 |  |  |       }, | 
 |  |  |       { | 
 |  |  |         title: t("basic.table.effectiveDate"), | 
 |  |  |         field: "startDate", | 
 |  |  |         width: 200, | 
 |  |  |         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; | 
 |  |  |               } | 
 |  |  |             } | 
 |  |  |           } | 
 |  |  |         }, | 
 |  |  |       }, | 
 |  |  |       { | 
 |  |  |         title: t("basic.table.applicableWorkshop"), | 
 |  |  |         field: "shopCode", | 
 |  |  |         width: 90, | 
 |  |  |         align: "center", | 
 |  |  |         formatter: ({ cellValue, row, column }) => { | 
 |  |  |           if (cellValue) { | 
 |  |  |             for (let i = 0; i < shopList.value.length; i++) { | 
 |  |  |               if (cellValue === shopList.value[i].id) { | 
 |  |  |                 return shopList.value[i].shopName; | 
 |  |  |               } | 
 |  |  |             } | 
 |  |  |           } | 
 |  |  |           return ""; | 
 |  |  |         }, | 
 |  |  |       }, | 
 |  |  |       { | 
 |  |  |         title: t("basic.table.productivityModel"), | 
 |  |  |         field: "productivityModel", | 
 |  |  |         width: 160, | 
 |  |  |         align: "center", | 
 |  |  |       }, | 
 |  |  |       { | 
 |  |  |         title: t("basic.table.designCapacity"), | 
 |  |  |         field: "designCapacity", | 
 |  |  |         width: 160, | 
 |  |  |         align: "center", | 
 |  |  |       }, | 
 |  |  |     ]; | 
 |  |  | 
 |  |  | function getList() { | 
 |  |  |   loading.value = true; | 
 |  |  |   queryParams.value.params = {}; | 
 |  |  |   listPlan(queryParams.value).then((response) => { | 
 |  |  |     planList.value = response.rows; | 
 |  |  |     loading.value = false; | 
 |  |  |   }); | 
 |  |  |   apsStandardProcessRouteHeaderList(queryParams.value) | 
 |  |  |     .then((response) => { | 
 |  |  |       processRouteList.value = response.rows; | 
 |  |  |       loading.value = false; | 
 |  |  |     }) | 
 |  |  |     .catch(() => { | 
 |  |  |       loading.value = false; | 
 |  |  |     }); | 
 |  |  | } | 
 |  |  |  | 
 |  |  | /** 搜索按钮操作 */ | 
 |  |  | 
 |  |  |  | 
 |  |  | /** 重置按钮操作 */ | 
 |  |  | function resetQuery() { | 
 |  |  |   page.value.current = 1; | 
 |  |  |   page.value.total = 0; | 
 |  |  |   queryParams.value.pageNum = 1; | 
 |  |  |   proxy.resetForm("queryRef"); | 
 |  |  |   handleQuery(); | 
 |  |  |   processRouteList.value = []; | 
 |  |  |   subList.value = []; | 
 |  |  | } | 
 |  |  |  | 
 |  |  | function handleCheckView(row) { | 
 |  |  |   openDialog.value = true; | 
 |  |  |   listProcessRoute({ workOrderNo: row.documentNumber }).then( | 
 |  |  |       (data) => { | 
 |  |  |         subList.value = data.rows; | 
 |  |  |       }) | 
 |  |  |   apsStandardProcessRouteLineList({ | 
 |  |  |     routeId: row.routeId, | 
 |  |  |   }).then((data) => { | 
 |  |  |     subList.value = data.rows; | 
 |  |  |   }); | 
 |  |  | } | 
 |  |  |  | 
 |  |  | // /*定义下拉二级表*/ | 
 |  |  |  | 
 |  |  | const subGridOptions = ref([ | 
 |  |  |     { | 
 |  |  |       title: "工艺路线ID", | 
 |  |  |       field: "itemNo", | 
 |  |  |       width: 150, | 
 |  |  |       align: "center", | 
 |  |  |     }, | 
 |  |  |     { | 
 |  |  |       title: "工序序号", | 
 |  |  |       field: "workOrderNo", | 
 |  |  |       width: 150, | 
 |  |  |       align: "center", | 
 |  |  |     }, | 
 |  |  |     { | 
 |  |  |       title: "工序名称", | 
 |  |  |       field: "processNumber", | 
 |  |  |       width: 100, | 
 |  |  |       align: "center", | 
 |  |  |     }, | 
 |  |  |     { | 
 |  |  |       title: "生效日期", | 
 |  |  |       field: "processName", | 
 |  |  |       width: 150, | 
 |  |  |       align: "center", | 
 |  |  |     }, | 
 |  |  |     { | 
 |  |  |       title: "失效日期", | 
 |  |  |       field: "processPlanStartDay", | 
 |  |  |       width: 200, | 
 |  |  |       align: "center", | 
 |  |  |     }, | 
 |  |  |     { | 
 |  |  |       title: "集成日期", | 
 |  |  |       field: "processPlanEndDay", | 
 |  |  |       width: 200, | 
 |  |  |       align: "center", | 
 |  |  |     }, | 
 |  |  |     { | 
 |  |  |       title: "适用工厂", | 
 |  |  |       field: "standardTime", | 
 |  |  |       width: 90, | 
 |  |  |       align: "center", | 
 |  |  |     }, | 
 |  |  |     { | 
 |  |  |       title: "适用车间", | 
 |  |  |       field: "processOrder", | 
 |  |  |       width: 90, | 
 |  |  |       align: "center", | 
 |  |  |     }, | 
 |  |  |     { | 
 |  |  |       title: "产能模型", | 
 |  |  |       field: "integrationDay", | 
 |  |  |       width: 160, | 
 |  |  |       align: "center", | 
 |  |  |     }, | 
 |  |  |     { | 
 |  |  |       title: "设计产能", | 
 |  |  |       field: "integrationDay", | 
 |  |  |       width: 160, | 
 |  |  |       align: "center", | 
 |  |  |     }, | 
 |  |  |   ]) | 
 |  |  | // const expandConfig = ref({ | 
 |  |  | //   lazy: true, | 
 |  |  | //   loadMethod({ row }) { | 
 |  |  | 
 |  |  | //   }, | 
 |  |  | // }); | 
 |  |  |  | 
 |  |  | getList(); | 
 |  |  | // getList(); | 
 |  |  | onMounted(async () => { | 
 |  |  |   const res = await listAll_plant({}); | 
 |  |  |   plantList.value = res.data; | 
 |  |  |   const shopres = await listAll_shop({}); | 
 |  |  |   shopList.value = shopres.data; | 
 |  |  | }); | 
 |  |  | </script> | 
 |  |  | <style lang="css" scoped> | 
 |  |  | h4 { |