|
|
|
@ -2,6 +2,10 @@
|
|
|
|
<lay-container fluid="true" class="content-box">
|
|
|
|
<lay-container fluid="true" class="content-box">
|
|
|
|
<lay-table v-if="dataColumn.length>0" :height="viewHeight+'px'" :columns="dataColumn" :data-source="dataList"
|
|
|
|
<lay-table v-if="dataColumn.length>0" :height="viewHeight+'px'" :columns="dataColumn" :data-source="dataList"
|
|
|
|
:row-style="rowStyle">
|
|
|
|
:row-style="rowStyle">
|
|
|
|
|
|
|
|
<template v-slot:toolbar>
|
|
|
|
|
|
|
|
<lay-button v-if="this.buttonName" size="sm" type="primary" @click="upload">{{ buttonName }}
|
|
|
|
|
|
|
|
</lay-button>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
</lay-table>
|
|
|
|
</lay-table>
|
|
|
|
</lay-container>
|
|
|
|
</lay-container>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
@ -19,7 +23,12 @@
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
ref
|
|
|
|
ref
|
|
|
|
} from 'vue';
|
|
|
|
} from 'vue';
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
|
|
|
uploadViewMaterial,
|
|
|
|
|
|
|
|
uploadProductVersion,
|
|
|
|
|
|
|
|
uploadBom
|
|
|
|
|
|
|
|
} from "/src/api/api/sapUpload";
|
|
|
|
|
|
|
|
import { layer } from '@layui/layer-vue';
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
setup() {
|
|
|
|
setup() {
|
|
|
|
const dataColumn = ref([]);
|
|
|
|
const dataColumn = ref([]);
|
|
|
|
@ -32,12 +41,14 @@
|
|
|
|
if (rowIndex > dataColor.value[idx]) color = "color:#" + colors[idx];
|
|
|
|
if (rowIndex > dataColor.value[idx]) color = "color:#" + colors[idx];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return color;
|
|
|
|
return color;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
const buttonName = ref("");
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
dataColumn,
|
|
|
|
dataColumn,
|
|
|
|
dataList,
|
|
|
|
dataList,
|
|
|
|
dataColor,
|
|
|
|
dataColor,
|
|
|
|
rowStyle,
|
|
|
|
rowStyle,
|
|
|
|
|
|
|
|
buttonName
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
props: {
|
|
|
|
@ -48,9 +59,24 @@
|
|
|
|
viewHeight: {
|
|
|
|
viewHeight: {
|
|
|
|
type: Number,
|
|
|
|
type: Number,
|
|
|
|
default: () => 600,
|
|
|
|
default: () => 600,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
viewType: {
|
|
|
|
|
|
|
|
type: Number,
|
|
|
|
|
|
|
|
default: () => 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
mounted() {
|
|
|
|
|
|
|
|
if (this.viewType == 1) {
|
|
|
|
|
|
|
|
this.buttonName = "物料上传"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.viewType == 4) {
|
|
|
|
|
|
|
|
this.buttonName = "通用生产版本上传"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.viewType == 5) {
|
|
|
|
|
|
|
|
this.buttonName = "通用BOM上传"
|
|
|
|
|
|
|
|
}
|
|
|
|
this.initPage();
|
|
|
|
this.initPage();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
@ -63,6 +89,7 @@
|
|
|
|
}];
|
|
|
|
}];
|
|
|
|
let dataList = [];
|
|
|
|
let dataList = [];
|
|
|
|
let dataColor = []
|
|
|
|
let dataColor = []
|
|
|
|
|
|
|
|
|
|
|
|
this.viewList.forEach((item) => {
|
|
|
|
this.viewList.forEach((item) => {
|
|
|
|
if (item.length > 0) {
|
|
|
|
if (item.length > 0) {
|
|
|
|
if (dataColumn.length == 1) {
|
|
|
|
if (dataColumn.length == 1) {
|
|
|
|
@ -90,6 +117,46 @@
|
|
|
|
},
|
|
|
|
},
|
|
|
|
cancelClick() {
|
|
|
|
cancelClick() {
|
|
|
|
this.$emit('cancelClick', false);
|
|
|
|
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上传失败');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|