| | |
| | | // 工序 |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="search_form"> |
| | | <el-form :model="searchForm" |
| | | :inline="true"> |
| | | <el-form-item label="部件:"> |
| | | <el-form-item label="产品名称:"> |
| | | <el-input v-model="searchForm.name" |
| | | placeholder="请输入" |
| | | placeholder="请输入产品名称" |
| | | clearable |
| | | prefix-icon="Search" |
| | | style="width: 200px;" |
| | | @change="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="部件类型:"> |
| | | <el-select v-model="searchForm.type" |
| | | placeholder="请选择" |
| | | clearable |
| | | style="width: 200px;" |
| | | @change="handleQuery"> |
| | | <el-option label="加工" |
| | | :value="1" /> |
| | | <el-option label="刮板冷芯制作" |
| | | :value="2" /> |
| | | <el-option label="管路组对" |
| | | :value="3" /> |
| | | <el-option label="罐体连接及调试" |
| | | :value="4" /> |
| | | <el-option label="测试打压" |
| | | :value="5" /> |
| | | <el-option label="其他" |
| | | :value="6" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="部件编号:"> |
| | | <el-input v-model="searchForm.no" |
| | |
| | | title="导入部件" |
| | | :action="importAction" |
| | | :headers="importHeaders" |
| | | :loading="importLoading" |
| | | :disabled="importLoading" |
| | | :auto-upload="false" |
| | | :on-progress="handleImportProgress" |
| | | :on-success="handleImportSuccess" |
| | | :on-error="handleImportError" |
| | | @confirm="handleImportConfirm" |
| | |
| | | const data = reactive({ |
| | | searchForm: { |
| | | name: "", |
| | | type: undefined, |
| | | no: "", |
| | | }, |
| | | }); |
| | | const { searchForm } = toRefs(data); |
| | | const tableColumn = ref([ |
| | | |
| | | { |
| | | label: "产品名称", |
| | | prop: "name", |
| | | }, |
| | | { |
| | | label: "产品规格", |
| | | prop: "productModel", |
| | | }, |
| | | { |
| | | label: "部件编号", |
| | | prop: "no", |
| | | }, |
| | | { |
| | | label: "部件", |
| | | prop: "name", |
| | | }, |
| | | { |
| | | label: "部件类型", |
| | | prop: "typeText", |
| | | }, |
| | | { |
| | | label: "工资定额", |
| | | label: "计划工时(小时)", |
| | | prop: "salaryQuota", |
| | | }, |
| | | { |
| | | label: "计划人员", |
| | | prop: "plannerName", |
| | | }, |
| | | { |
| | | label: "是否质检", |
| | |
| | | const isShowEditModal = ref(false); |
| | | const record = ref({}); |
| | | const importDialogVisible = ref(false); |
| | | const importLoading = ref(false); |
| | | const importDialogRef = ref(null); |
| | | const page = reactive({ |
| | | current: 1, |
| | |
| | | total: 0, |
| | | }); |
| | | const { proxy } = getCurrentInstance(); |
| | | |
| | | |
| | | // 导入相关配置 |
| | | const importAction = |
| | |
| | | tableLoading.value = false; |
| | | tableData.value = res.data.records.map(item => ({ |
| | | ...item, |
| | | typeText: item.type !== undefined && item.type !== null ? (item.type === 0 ? "计时" : "计件") : "", |
| | | typeText: item.type !== undefined && item.type !== null ? (item.type === 1 ? "加工" : item.type === 2 ? "刮板冷芯制作" : item.type === 3 ? "管路组对" : item.type === 4 ? "罐体连接及调试" : item.type === 5 ? "测试打压" : "其他") : "", |
| | | })); |
| | | page.total = res.data.total; |
| | | }) |
| | |
| | | } |
| | | }; |
| | | |
| | | // 导入中 |
| | | const handleImportProgress = () => { |
| | | importLoading.value = true; |
| | | }; |
| | | |
| | | // 导入成功 |
| | | const handleImportSuccess = response => { |
| | | importLoading.value = false; |
| | | if (response.code === 200) { |
| | | proxy.$modal.msgSuccess("导入成功"); |
| | | importDialogVisible.value = false; |
| | |
| | | |
| | | // 导入失败 |
| | | const handleImportError = error => { |
| | | importLoading.value = false; |
| | | proxy.$modal.msgError("导入失败:" + (error.message || "未知错误")); |
| | | }; |
| | | |
| | | // 关闭导入弹窗 |
| | | const handleImportClose = () => { |
| | | importLoading.value = false; |
| | | if (importDialogRef.value) { |
| | | importDialogRef.value.clearFiles(); |
| | | } |