feat: 导入出入库明细

This commit is contained in:
caoqianming 2025-08-18 13:42:24 +08:00
parent 6b9962a8ee
commit 1e82e0eb7d
3 changed files with 35 additions and 2 deletions

View File

@ -127,6 +127,14 @@ export default {
);
}
},
daorumioitem: {
name: "导入",
req: async function(id,data){
return await http.post(
`${config.API_URL}/inm/mio/${id}/daoru_mioitem/`,data
);
}
},
},
// 出入库明细
mioitem: {

View File

@ -9,7 +9,7 @@
<template>
<slot :open="open">
<el-button type="primary" plain @click="open">导入</el-button>
<el-button type="primary" plain @click="open">{{ name }}</el-button>
</slot>
<el-dialog v-model="dialog" title="导入" :width="550" :close-on-click-modal="false" append-to-body destroy-on-close>
<el-progress v-if="loading" :text-inside="true" :stroke-width="20" :percentage="percentage" style="margin-bottom: 15px;"/>
@ -54,6 +54,7 @@
export default {
emits: ['success'],
props: {
name: { type: String, default: "导入" },
apiObj: { type: Object, default: () => {} },
data: { type: Object, default: () => {} },
accept: { type: String, default: ".xls, .xlsx" },
@ -66,7 +67,7 @@
dialog: false,
loading: false,
percentage: 0,
formData: {}
formData: {},
}
},
mounted() {

View File

@ -69,6 +69,14 @@
@click="table_pack"
v-if="mioObj.state == 10&&mode!=='show'&&type=='sale_out'&&project_code=='bxerp'"
>装箱</el-button>
<scFileImport
:templateUrl="mioitemT"
:name = "'导入明细'"
accept=".xlsx"
:apiObj="$API.common.upload"
@success="upSuccess1"
>
</scFileImport>
</div>
<div style="height: 8px"></div>
<scTable
@ -381,6 +389,7 @@ export default {
wprVisibleDrawer:false,
printer_name:localStorage.getItem("printer_name"),
checkTemplate: " /media/default/template/mioitemw_t.xlsx",
mioitemT: "/media/default/template/出入库明细.xlsx"
};
},
mounted() {
@ -636,6 +645,21 @@ export default {
that.$refs.packDialog.open();
});
},
upSuccess1(res, close) {
var that = this;
close();
const loading = ElLoading.service({
fullscreen: true,
text: "解析中...请稍等",
});
this.$API.inm.mio.req(that.mioId, { path: res.path }).then((res) => {
loading.close();
this.$message.success("导入成功");
this.$refs.table.queryData(this.query);
}).catch((err) => {
loading.close();
});
},
},
};
</script>