From 02d272acdfd24dd9d2fe8d9b5982f85eda6165c9 Mon Sep 17 00:00:00 2001 From: Yang <903110162@qq.com> Date: Fri, 28 Apr 2023 15:15:37 +0800 Subject: [PATCH] commit by yzf --- src/views/half/components/ShowData1.vue | 14 +++--- src/views/half/components/ShowView.vue | 66 +++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 7 deletions(-) diff --git a/src/views/half/components/ShowData1.vue b/src/views/half/components/ShowData1.vue index 0492402..765649a 100644 --- a/src/views/half/components/ShowData1.vue +++ b/src/views/half/components/ShowData1.vue @@ -37,7 +37,7 @@ - + @@ -168,15 +168,12 @@ import { watch } from 'vue'; import { - getTeamProcessList, getTeamworkView } from "/src/api/api/halfmaterialteamwork"; -import { - getBasicRoleList -} from "/src/api/api/user"; + import ShowView from './ShowView.vue'; -import FormulaView from './FormulaView.vue'; + export default { components: { @@ -204,6 +201,7 @@ export default { const viewList = ref([]); const viewHeight = ref(500); const objInfoObj = ref([]); + const viewType = ref(0); return { dataList, dataColumn, @@ -213,7 +211,8 @@ export default { showEditBox1, viewList, viewHeight, - objInfoObj + objInfoObj, + viewType } }, props: { @@ -240,6 +239,7 @@ export default { FType: type, HalfId : this.dataInfoObj.FMaterialHalfIDs }; + this.viewType = viewType; if (this.dataInfoObj.FProgress == "100" || this.dataInfoObj.FProgress == "100%") { postData.FFinish = 1; } diff --git a/src/views/half/components/ShowView.vue b/src/views/half/components/ShowView.vue index 64263b1..d75ef1f 100644 --- a/src/views/half/components/ShowView.vue +++ b/src/views/half/components/ShowView.vue @@ -2,6 +2,10 @@ + @@ -19,6 +23,11 @@ import { ref } from 'vue'; + import { + uploadViewMaterial, + uploadProductVersion, + uploadBom + } from "/src/api/api/sapUpload"; export default { setup() { @@ -33,11 +42,13 @@ } return color; } + const buttonName = ref(""); return { dataColumn, dataList, dataColor, rowStyle, + buttonName } }, props: { @@ -48,9 +59,24 @@ viewHeight: { type: Number, default: () => 600, + }, + viewType: { + type: Number, + default: () => 0 } }, mounted() { + if (this.viewType == 1) { + this.buttonName = "物料上传" + } + + if (this.viewType == 4) { + this.buttonName = "通用生产版本上传" + } + + if (this.viewType == 5) { + this.buttonName = "通用BOM上传" + } this.initPage(); }, methods: { @@ -89,6 +115,46 @@ }, cancelClick() { this.$emit('cancelClick', false); + }, + async upload() { + if (this.viewType == 1) { + let idx = layer.load(2); + let result = await uploadViewMaterial(this.dataList) + console.log('result', result); + layer.close(idx); + + if (result > 0) { + layer.msg('物料上传成功'); + } else { + layer.msg('物料上传失败'); + } + } + + if (this.viewType == 4) { + let idx = layer.load(2); + let result = await uploadProductVersion(this.dataList) + console.log('result', result); + layer.close(idx); + + if (result > 0) { + layer.msg('通用生产版本上传'); + } else { + layer.msg('通用生产版本上传'); + } + } + + if (this.viewType == 5) { + let idx = layer.load(2); + let result = await uploadBom(this.dataList) + console.log('result', result); + layer.close(idx); + + if (result > 0) { + layer.msg('通用BOM上传成功'); + } else { + layer.msg('通用BOM上传失败'); + } + } } } }