|
|
@@ -30,6 +30,7 @@
|
|
|
<el-button type="primary" @click="loadList">查询</el-button>
|
|
|
<el-button @click="resetQuery">重置</el-button>
|
|
|
<el-button type="success" @click="openCreate">新增</el-button>
|
|
|
+ <el-button @click="configDialogVisible = true">配置维护</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
|
|
|
@@ -95,9 +96,45 @@
|
|
|
</el-col>
|
|
|
<el-col :span="12"><el-form-item label="生产线" prop="line"><el-input v-model="form.line" maxlength="100" /></el-form-item></el-col>
|
|
|
<el-col :span="12"><el-form-item label="描述"><el-input v-model="form.describe" maxlength="255" /></el-form-item></el-col>
|
|
|
- <el-col :span="12"><el-form-item label="产线类型"><el-input v-model="form.lineType" maxlength="50" clearable /></el-form-item></el-col>
|
|
|
- <el-col :span="12"><el-form-item label="产线类别"><el-input v-model="form.lineCategory" maxlength="50" clearable /></el-form-item></el-col>
|
|
|
- <el-col :span="12"><el-form-item label="主库位"><el-input v-model="form.location" maxlength="50" clearable /></el-form-item></el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="产线类型">
|
|
|
+ <el-select v-model="form.lineType" clearable filterable placeholder="请选择产线类型" style="width: 100%">
|
|
|
+ <el-option v-for="item in lineTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
+ <el-option
|
|
|
+ v-if="form.lineType && !lineTypeOptions.some((o) => o.value === form.lineType)"
|
|
|
+ :key="`__compat_${form.lineType}`"
|
|
|
+ :label="form.lineType"
|
|
|
+ :value="form.lineType"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="产线类别">
|
|
|
+ <el-select v-model="form.lineCategory" clearable filterable placeholder="请选择产线类别" style="width: 100%">
|
|
|
+ <el-option v-for="item in lineCategoryOptions" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
+ <el-option
|
|
|
+ v-if="form.lineCategory && !lineCategoryOptions.some((o) => o.value === form.lineCategory)"
|
|
|
+ :key="`__compat_${form.lineCategory}`"
|
|
|
+ :label="form.lineCategory"
|
|
|
+ :value="form.lineCategory"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="主库位">
|
|
|
+ <el-select v-model="form.location" clearable filterable placeholder="请选择主库位" style="width: 100%">
|
|
|
+ <el-option v-for="item in lineLocationOptions" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
+ <el-option
|
|
|
+ v-if="form.location && !lineLocationOptions.some((o) => o.value === form.location)"
|
|
|
+ :key="`__compat_${form.location}`"
|
|
|
+ :label="form.location"
|
|
|
+ :value="form.location"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
<el-col :span="12"><el-form-item label="车间编码"><el-input v-model="form.workshop" maxlength="50" clearable /></el-form-item></el-col>
|
|
|
<el-col :span="12"><el-form-item label="虚拟库位"><el-input v-model="form.vLocation" maxlength="50" clearable /></el-form-item></el-col>
|
|
|
<el-col :span="12"><el-form-item label="库位2"><el-input v-model="form.location2" maxlength="50" clearable /></el-form-item></el-col>
|
|
|
@@ -112,6 +149,25 @@
|
|
|
<el-button type="primary" :loading="saving" @click="submitForm">保存</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ v-model="configDialogVisible"
|
|
|
+ title="生产线编码清单配置维护"
|
|
|
+ width="860px"
|
|
|
+ destroy-on-close
|
|
|
+ >
|
|
|
+ <el-tabs v-model="configActiveTab">
|
|
|
+ <el-tab-pane label="产线类型" name="lineType">
|
|
|
+ <DictDataMaintainPanel dict-code="s0_line_type" @changed="onDictChanged" />
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="产线类别" name="lineCategory">
|
|
|
+ <DictDataMaintainPanel dict-code="s0_line_category" @changed="onDictChanged" />
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="主库位" name="lineLocation">
|
|
|
+ <DictDataMaintainPanel dict-code="s0_line_location" @changed="onDictChanged" />
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ </el-dialog>
|
|
|
</AidopDemoShell>
|
|
|
</template>
|
|
|
|
|
|
@@ -122,9 +178,11 @@ import { ElMessage, ElMessageBox, type FormInstance, type FormRules } from 'elem
|
|
|
import AidopDemoShell from '../../components/AidopDemoShell.vue';
|
|
|
import { useS0MfgOrgScope } from '../composables/useS0MfgOrgScope';
|
|
|
import { s0MfgProductionLinesApi, type S0LineMasterRow, type S0LineMasterUpsert } from '../api/s0ManufacturingApi';
|
|
|
+import { loadDictOptions, type OptionItem } from '../api/s0SalesApi';
|
|
|
+import DictDataMaintainPanel from '../sales/components/DictDataMaintainPanel.vue';
|
|
|
|
|
|
const route = useRoute();
|
|
|
-const pageTitle = computed(() => (route.meta?.title as string) || '产线');
|
|
|
+const pageTitle = computed(() => (route.meta?.title as string) || '生产线编码清单');
|
|
|
|
|
|
const { companyOptions, loadOrgs, factoriesForCompany } = useS0MfgOrgScope();
|
|
|
const queryFactories = computed(() => factoriesForCompany(query.companyRefId));
|
|
|
@@ -150,6 +208,27 @@ const editingId = ref<number | null>(null);
|
|
|
const saving = ref(false);
|
|
|
const formRef = ref<FormInstance>();
|
|
|
|
|
|
+const lineTypeOptions = ref<OptionItem[]>([]);
|
|
|
+const lineCategoryOptions = ref<OptionItem[]>([]);
|
|
|
+const lineLocationOptions = ref<OptionItem[]>([]);
|
|
|
+const configDialogVisible = ref(false);
|
|
|
+const configActiveTab = ref('lineType');
|
|
|
+
|
|
|
+async function loadDictOptionsAll() {
|
|
|
+ const [lineType, lineCategory, lineLocation] = await Promise.all([
|
|
|
+ loadDictOptions('s0_line_type'),
|
|
|
+ loadDictOptions('s0_line_category'),
|
|
|
+ loadDictOptions('s0_line_location'),
|
|
|
+ ]);
|
|
|
+ lineTypeOptions.value = lineType;
|
|
|
+ lineCategoryOptions.value = lineCategory;
|
|
|
+ lineLocationOptions.value = lineLocation;
|
|
|
+}
|
|
|
+
|
|
|
+async function onDictChanged() {
|
|
|
+ await loadDictOptionsAll();
|
|
|
+}
|
|
|
+
|
|
|
const form = reactive({
|
|
|
companyRefId: undefined,
|
|
|
factoryRefId: undefined,
|
|
|
@@ -346,6 +425,7 @@ function toggleActive(row: S0LineMasterRow) {
|
|
|
|
|
|
onMounted(async () => {
|
|
|
await loadOrgs();
|
|
|
+ await loadDictOptionsAll();
|
|
|
await loadList();
|
|
|
});
|
|
|
</script>
|