|
@@ -11,7 +11,9 @@
|
|
|
<el-input v-model="query.usageDept" clearable style="width: 200px" />
|
|
<el-input v-model="query.usageDept" clearable style="width: 200px" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="类型">
|
|
<el-form-item label="类型">
|
|
|
- <el-select v-model="query.type" placeholder="请选择" clearable style="width: 200px" />
|
|
|
|
|
|
|
+ <el-select v-model="query.type" placeholder="请选择" clearable style="width: 200px">
|
|
|
|
|
+ <el-option v-for="o in typeOptions" :key="o.val" :label="o.val" :value="o.val!" />
|
|
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="模具类型编码">
|
|
<el-form-item label="模具类型编码">
|
|
|
<el-input v-model="query.moldTypeCode" clearable style="width: 200px" />
|
|
<el-input v-model="query.moldTypeCode" clearable style="width: 200px" />
|
|
@@ -45,15 +47,19 @@
|
|
|
:total="total"
|
|
:total="total"
|
|
|
:page-sizes="[10, 20, 50]"
|
|
:page-sizes="[10, 20, 50]"
|
|
|
layout="total, sizes, prev, pager, next"
|
|
layout="total, sizes, prev, pager, next"
|
|
|
|
|
+ @current-change="loadList"
|
|
|
|
|
+ @size-change="loadList"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
</AidopDemoShell>
|
|
</AidopDemoShell>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts" name="aidopS6EquipmentToolingToolingLedger">
|
|
<script setup lang="ts" name="aidopS6EquipmentToolingToolingLedger">
|
|
|
-import { computed, reactive, ref } from 'vue';
|
|
|
|
|
|
|
+import { computed, onActivated, onMounted, reactive, ref } from 'vue';
|
|
|
import { useRoute } from 'vue-router';
|
|
import { useRoute } from 'vue-router';
|
|
|
|
|
+import { ElMessage } from 'element-plus';
|
|
|
import AidopDemoShell from '/@/views/aidop/components/AidopDemoShell.vue';
|
|
import AidopDemoShell from '/@/views/aidop/components/AidopDemoShell.vue';
|
|
|
|
|
+import { fetchToolingLedgerList, fetchToolingLedgerTypeOptions, type ToolingLedgerRow, type ToolingLedgerTypeOption } from '../api/toolingLedger';
|
|
|
|
|
|
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
|
const pageTitle = computed(() => (route.meta?.title as string) || '模工具台账管理');
|
|
const pageTitle = computed(() => (route.meta?.title as string) || '模工具台账管理');
|
|
@@ -68,13 +74,45 @@ const query = reactive({
|
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-// 本批次为只读 UI 骨架,尚无真实模工具台账接口:渲染空表,不发请求、不造数据。
|
|
|
|
|
const loading = ref(false);
|
|
const loading = ref(false);
|
|
|
-const rows = ref<Record<string, unknown>[]>([]);
|
|
|
|
|
|
|
+const rows = ref<ToolingLedgerRow[]>([]);
|
|
|
const total = ref(0);
|
|
const total = ref(0);
|
|
|
|
|
+const typeOptions = ref<ToolingLedgerTypeOption[]>([]);
|
|
|
|
|
+
|
|
|
|
|
+async function loadList() {
|
|
|
|
|
+ loading.value = true;
|
|
|
|
|
+ try {
|
|
|
|
|
+ const data = await fetchToolingLedgerList({
|
|
|
|
|
+ name: query.name,
|
|
|
|
|
+ workGroup: query.workGroup,
|
|
|
|
|
+ usageDept: query.usageDept,
|
|
|
|
|
+ type: query.type,
|
|
|
|
|
+ moldTypeCode: query.moldTypeCode,
|
|
|
|
|
+ page: query.page,
|
|
|
|
|
+ pageSize: query.pageSize,
|
|
|
|
|
+ });
|
|
|
|
|
+ rows.value = data.list || [];
|
|
|
|
|
+ total.value = data.total || 0;
|
|
|
|
|
+ } catch (e: any) {
|
|
|
|
|
+ rows.value = [];
|
|
|
|
|
+ total.value = 0;
|
|
|
|
|
+ ElMessage.error(e?.message || '加载模工具台账列表失败');
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ loading.value = false;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+async function loadOptions() {
|
|
|
|
|
+ try {
|
|
|
|
|
+ typeOptions.value = (await fetchToolingLedgerTypeOptions()) || [];
|
|
|
|
|
+ } catch {
|
|
|
|
|
+ typeOptions.value = [];
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
function doSearch() {
|
|
function doSearch() {
|
|
|
query.page = 1;
|
|
query.page = 1;
|
|
|
|
|
+ loadList();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function resetQuery() {
|
|
function resetQuery() {
|
|
@@ -84,7 +122,14 @@ function resetQuery() {
|
|
|
query.type = '';
|
|
query.type = '';
|
|
|
query.moldTypeCode = '';
|
|
query.moldTypeCode = '';
|
|
|
query.page = 1;
|
|
query.page = 1;
|
|
|
|
|
+ loadList();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+onMounted(() => {
|
|
|
|
|
+ loadOptions();
|
|
|
|
|
+ loadList();
|
|
|
|
|
+});
|
|
|
|
|
+onActivated(() => loadList());
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|