| | |
| | | <template> |
| | | <div> |
| | | <el-dialog |
| | | v-model="isShow" |
| | | <el-dialog v-model="isShow" |
| | | title="产出" |
| | | @close="closeModal" |
| | | > |
| | | <PIMTable |
| | | rowKey="id" |
| | | @close="closeModal"> |
| | | <PIMTable rowKey="id" |
| | | :column="tableColumn" |
| | | :tableData="data" |
| | | :page="page" |
| | | :tableLoading="tableLoading" |
| | | @pagination="pagination" |
| | | ></PIMTable> |
| | | @pagination="pagination"></PIMTable> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="closeModal">关闭</el-button> |
| | | <el-button type="primary" |
| | | @click="closeModal">关闭</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | |
| | | }, |
| | | }); |
| | | |
| | | const emit = defineEmits(['update:visible', 'completed']); |
| | | const emit = defineEmits(["update:visible", "completed"]); |
| | | |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 100, |
| | | total: 0 |
| | | total: 0, |
| | | }); |
| | | |
| | | const pagination = (obj) => { |
| | | const pagination = obj => { |
| | | page.current = obj.page; |
| | | page.size = obj.limit; |
| | | fetchData(); |
| | |
| | | |
| | | const tableColumn = [ |
| | | { |
| | | label: '报工单号', |
| | | prop: 'productNo', |
| | | label: "报工单号", |
| | | prop: "productNo", |
| | | }, |
| | | { |
| | | label: '产品型号', |
| | | prop: 'model', |
| | | label: "产品型号", |
| | | prop: "model", |
| | | }, |
| | | { |
| | | label: '投入数量', |
| | | prop: 'quantity', |
| | | label: "产出数量", |
| | | prop: "quantity", |
| | | }, |
| | | ] |
| | | ]; |
| | | |
| | | const isShow = computed({ |
| | | get() { |
| | | return props.visible; |
| | | }, |
| | | set(val) { |
| | | emit('update:visible', val); |
| | | emit("update:visible", val); |
| | | }, |
| | | }); |
| | | |
| | | const data = ref([]) |
| | | const data = ref([]); |
| | | |
| | | const closeModal = () => { |
| | | isShow.value = false; |
| | |
| | | tableLoading.value = true; |
| | | const params = { productMainId: props.productionProductMainId, ...page }; |
| | | |
| | | productionProductOutputListPage(params).then(res => { |
| | | productionProductOutputListPage(params) |
| | | .then(res => { |
| | | tableLoading.value = false; |
| | | data.value = res.data.records; |
| | | page.total = res.data.total; |
| | | }).catch(err => { |
| | | tableLoading.value = false; |
| | | }) |
| | | .catch(err => { |
| | | tableLoading.value = false; |
| | | }); |
| | | }; |
| | | |
| | | defineExpose({ |
| | |
| | | }); |
| | | |
| | | onMounted(() => { |
| | | fetchData() |
| | | }) |
| | | fetchData(); |
| | | }); |
| | | </script> |