|
@@ -8,6 +8,7 @@ export default {
|
|
|
dicts: initDicts(SelectColumns),
|
|
|
components: {
|
|
|
FileUploadCenter: () => import('../components/FileUploadCenter/index.vue'),
|
|
|
+ BatchImport: () => import("@/components/BatchImport/index.vue"),
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -478,6 +479,45 @@ export default {
|
|
|
|
|
|
return Infinity;
|
|
|
},
|
|
|
+
|
|
|
+ async handelImport(fileList){
|
|
|
+
|
|
|
+ try {
|
|
|
+
|
|
|
+ let formData = new FormData();
|
|
|
+
|
|
|
+ formData.append('file',fileList[0].raw);
|
|
|
+
|
|
|
+ this.$modal.loading("正在上传文件,请稍候...");
|
|
|
+
|
|
|
+ let {code,data} = await orderApi.orderImport(formData);
|
|
|
+
|
|
|
+ if(code == 200) {
|
|
|
+ // puOrderExecuteList puOrderItemList
|
|
|
+
|
|
|
+ for (const key in data) {
|
|
|
+ this.params[key].push(...data[key]);
|
|
|
+ }
|
|
|
+
|
|
|
+ let {setVisible} = this.$refs.batchImport;
|
|
|
+
|
|
|
+ setVisible(false);
|
|
|
+
|
|
|
+ this.handleGetPrice();
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (error) {
|
|
|
+
|
|
|
+ }finally{
|
|
|
+ this.$modal.closeLoading();
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ async handleTemDownload(){
|
|
|
+
|
|
|
+ this.download('/pu/order/downloadFailData',{}, `物料信息模板.xlsx`);
|
|
|
+ },
|
|
|
},
|
|
|
created() {},
|
|
|
mounted() { },
|
|
@@ -624,6 +664,7 @@ export default {
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</el-card>
|
|
|
+
|
|
|
<el-card :body-style="{
|
|
|
padding: '20px',
|
|
|
display: 'flex',
|
|
@@ -758,6 +799,12 @@ export default {
|
|
|
<el-row style="position: absolute; top: 20px; right: 20px">
|
|
|
<el-button v-if="params.source == '3' && !handleIsRevise()" :size="size"
|
|
|
@click="addTableRow(params[tabName])">增行</el-button>
|
|
|
+ <BatchImport
|
|
|
+ v-if="params.source == '3' && !handleIsRevise()"
|
|
|
+ ref="batchImport"
|
|
|
+ @import="handelImport"
|
|
|
+ @temDownload="handleTemDownload"
|
|
|
+ ></BatchImport>
|
|
|
</el-row>
|
|
|
</el-card>
|
|
|
</el-form>
|