commit by yzf

master
Yang 3 years ago
parent 2ddd4d3a55
commit 02d272acdf

@ -37,7 +37,7 @@
</lay-container> </lay-container>
</lay-scroll> </lay-scroll>
<lay-layer area="90%" v-model="showEditBox" title="视图查看"> <lay-layer area="90%" v-model="showEditBox" title="视图查看">
<ShowView :viewList="viewList" :viewHeight="viewHeight" @cancelClick="cancelClick"></ShowView> <ShowView :viewList="viewList" :viewHeight="viewHeight" :viewType="viewType" @cancelClick="cancelClick"></ShowView>
</lay-layer> </lay-layer>
</div> </div>
</template> </template>
@ -168,15 +168,12 @@ import {
watch watch
} from 'vue'; } from 'vue';
import { import {
getTeamProcessList,
getTeamworkView getTeamworkView
} from "/src/api/api/halfmaterialteamwork"; } from "/src/api/api/halfmaterialteamwork";
import {
getBasicRoleList
} from "/src/api/api/user";
import ShowView from './ShowView.vue'; import ShowView from './ShowView.vue';
import FormulaView from './FormulaView.vue';
export default { export default {
components: { components: {
@ -204,6 +201,7 @@ export default {
const viewList = ref([]); const viewList = ref([]);
const viewHeight = ref(500); const viewHeight = ref(500);
const objInfoObj = ref([]); const objInfoObj = ref([]);
const viewType = ref(0);
return { return {
dataList, dataList,
dataColumn, dataColumn,
@ -213,7 +211,8 @@ export default {
showEditBox1, showEditBox1,
viewList, viewList,
viewHeight, viewHeight,
objInfoObj objInfoObj,
viewType
} }
}, },
props: { props: {
@ -240,6 +239,7 @@ export default {
FType: type, FType: type,
HalfId : this.dataInfoObj.FMaterialHalfIDs HalfId : this.dataInfoObj.FMaterialHalfIDs
}; };
this.viewType = viewType;
if (this.dataInfoObj.FProgress == "100" || this.dataInfoObj.FProgress == "100%") { if (this.dataInfoObj.FProgress == "100" || this.dataInfoObj.FProgress == "100%") {
postData.FFinish = 1; postData.FFinish = 1;
} }

@ -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,6 +23,11 @@
import { import {
ref ref
} from 'vue'; } from 'vue';
import {
uploadViewMaterial,
uploadProductVersion,
uploadBom
} from "/src/api/api/sapUpload";
export default { export default {
setup() { setup() {
@ -33,11 +42,13 @@
} }
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: {
@ -89,6 +115,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上传失败');
}
}
} }
} }
} }

Loading…
Cancel
Save