From 63b57abc9ea781939d0eea91c3edea4e7d9f9249 Mon Sep 17 00:00:00 2001 From: leo <10200039@qq.com> Date: Fri, 28 Apr 2023 09:59:25 +0800 Subject: [PATCH 1/3] =?UTF-8?q?SAP=E6=95=B0=E6=8D=AE=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/api/sapUpload.ts | 28 ++++++++++ src/views/Team/components/ShowData1.vue | 16 +++--- src/views/Team/components/ShowView.vue | 71 ++++++++++++++++++++++++- 3 files changed, 107 insertions(+), 8 deletions(-) create mode 100644 src/api/api/sapUpload.ts diff --git a/src/api/api/sapUpload.ts b/src/api/api/sapUpload.ts new file mode 100644 index 0000000..598e8e9 --- /dev/null +++ b/src/api/api/sapUpload.ts @@ -0,0 +1,28 @@ +import http from '../http'; + +// 通用BOM上载 +export async function uploadBom(params: any) { + let result = {}; + await http.post('/api/SapUpload/UploadBom', params).then((data) => { + result = data.Data; + }); + return result; +} + +// 物料上载 +export async function uploadViewMaterial(params: any) { + let result = {}; + await http.post('/api/SapUpload/UploadViewMaterial', params).then((data) => { + result = data.Data; + }); + return result; +} + +// 通用生产版本上传 +export async function uploadProductVersion(params: any) { + let result = {}; + await http.post('/api/SapUpload/UploadProductVersion', params).then((data) => { + result = data.Data; + }); + return result; +} \ No newline at end of file diff --git a/src/views/Team/components/ShowData1.vue b/src/views/Team/components/ShowData1.vue index 00c8fc6..86ee959 100644 --- a/src/views/Team/components/ShowData1.vue +++ b/src/views/Team/components/ShowData1.vue @@ -84,7 +84,7 @@ - + @@ -248,6 +248,7 @@ const showEditBox = ref(false); const viewList = ref([]); const viewHeight = ref(500); + const viewType = ref(0); return { dataList, dataColumn, @@ -255,7 +256,8 @@ viewTypeCount, showEditBox, viewList, - viewHeight + viewHeight, + viewType } }, props: { @@ -289,10 +291,11 @@ let result = await getBasicRoleList({ FRoleType: 39 }) || []; + console.log('result', result); + console.log('this.dataInfoObj', this.dataInfoObj); let dataList = []; let hasType = this.dataInfoObj.FViewType.split(','); - console.log(result); - console.log(hasType); + result.forEach((item) => { let viewData = dataList.find(s => s.name == item.FName) || null; if (viewData == null) { @@ -311,7 +314,7 @@ if (item.FRemark.indexOf("导出") != -1) viewData.outCode = item.FCode; } }); - console.log(dataList) + this.dataList = dataList; }, async _getTeamworkView(data, type) { @@ -322,7 +325,8 @@ FViewType: viewType, 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/Team/components/ShowView.vue b/src/views/Team/components/ShowView.vue index 2daf745..55fd05a 100644 --- a/src/views/Team/components/ShowView.vue +++ b/src/views/Team/components/ShowView.vue @@ -2,6 +2,10 @@ + @@ -19,7 +23,12 @@ import { ref } from 'vue'; - + import { + uploadViewMaterial, + uploadProductVersion, + uploadBom + } from "/src/api/api/sapUpload"; +import { layer } from '@layui/layer-vue'; export default { setup() { const dataColumn = ref([]); @@ -32,12 +41,14 @@ if (rowIndex > dataColor.value[idx]) color = "color:#" + colors[idx]; } 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: { @@ -63,6 +89,7 @@ }]; let dataList = []; let dataColor = [] + this.viewList.forEach((item) => { if (item.length > 0) { if (dataColumn.length == 1) { @@ -90,6 +117,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上传失败'); + } + } } } } From 9c28a8bce762d7121f8b8c2779cabe2ea4231703 Mon Sep 17 00:00:00 2001 From: leo <10200039@qq.com> Date: Fri, 28 Apr 2023 10:11:58 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E9=85=8D=E6=96=B9=E6=B8=85=E5=8D=95?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=88=97=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Order/formula.vue | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/views/Order/formula.vue b/src/views/Order/formula.vue index 58994e3..dabd70b 100644 --- a/src/views/Order/formula.vue +++ b/src/views/Order/formula.vue @@ -63,6 +63,12 @@ + + @@ -138,17 +144,12 @@ }, { title: "转规格人员", - key: "", + key: "FConversionPersonnel", width: "110px" }, { title: "开发日期", - key: "", - width: "110px" - }, - { - title: "BOM版本号", - key: "", + key: "FDevDate", width: "110px" }, { @@ -258,12 +259,14 @@ this.postData.FPageIndex = this.pageInfo.current; this.postData.FPageSize = this.pageInfo.limit; let result = await getPageList(this.postData, "Formula"); + console.log('result', result); result.Data.List = result.Data.List || []; result.Data.List.forEach((item) => { let type = this.typeList.find(s => s.FValue == item.FType); item.FTypeName = type == null ? item.FType : type.FName; item.FAddDate = item.FAddDate == null ? "" : this.dateFormat(item.FAddDate); item.FEditDate = item.FEditDate == null ? "" : this.dateFormat(item.FEditDate); + item.FDevDate = item.FDevDate == null ? "" : this.dateFormat(item.FDevDate); }); this.pageInfo.total = result.Data.Total || 0; this.dataList = result.Data.List; From 0e1bfc43a6dcdaef0d0da27584024253813ce352 Mon Sep 17 00:00:00 2001 From: leo <10200039@qq.com> Date: Fri, 28 Apr 2023 14:16:53 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=89=A9=E6=96=99=E8=B7=AF=E7=BA=BF?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=8A=E4=BC=A0SAP=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/materia/components/EditView.vue | 37 +++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/views/materia/components/EditView.vue b/src/views/materia/components/EditView.vue index db75027..9692919 100644 --- a/src/views/materia/components/EditView.vue +++ b/src/views/materia/components/EditView.vue @@ -18,6 +18,8 @@ 导出视图 + 物料上传 +