|
@@ -48,7 +48,7 @@
|
|
|
<el-button type="primary" plain @click="openMaterial = true"
|
|
|
>添加物料/半成品</el-button
|
|
|
>
|
|
|
- <el-button type="primary" plain> Excel导入</el-button>
|
|
|
+ <!-- <el-button type="primary" plain> Excel导入</el-button> -->
|
|
|
<el-form
|
|
|
ref="tableForm"
|
|
|
:model="formData.data"
|
|
@@ -200,20 +200,21 @@
|
|
|
:size="17"
|
|
|
style="margin-top: 12px; cursor: pointer"
|
|
|
>
|
|
|
- <Edit />
|
|
|
+ <Plus />
|
|
|
</el-icon>
|
|
|
</el-upload>
|
|
|
- <div>
|
|
|
- <div>
|
|
|
- <el-tag
|
|
|
- style="margin-left: 10px"
|
|
|
- class="ml-2"
|
|
|
- type="info"
|
|
|
- v-for="(item, index) in row.fileListCopy"
|
|
|
- :key="index"
|
|
|
- >{{ item.fileName }}</el-tag
|
|
|
- >
|
|
|
- </div>
|
|
|
+
|
|
|
+ <div
|
|
|
+ v-if="row.fileListCopy && row.fileListCopy.length > 0"
|
|
|
+ >
|
|
|
+ <el-tag
|
|
|
+ style="margin-left: 10px"
|
|
|
+ class="ml-2"
|
|
|
+ type="info"
|
|
|
+ v-for="(item, index) in row.fileListCopy"
|
|
|
+ :key="index"
|
|
|
+ >{{ item.fileName }}</el-tag
|
|
|
+ >
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
@@ -235,6 +236,21 @@
|
|
|
</el-table>
|
|
|
</div>
|
|
|
</template>
|
|
|
+ <template #file>
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-upload
|
|
|
+ v-model:fileList="formData.dataOne.fileList"
|
|
|
+ action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
|
|
|
+ :data="uploadData"
|
|
|
+ multiple
|
|
|
+ :before-upload="handleBeforeUploadOne"
|
|
|
+ :on-success="handleSuccess"
|
|
|
+ :on-preview="onPreviewFile"
|
|
|
+ >
|
|
|
+ <el-button type="primary" plain>选择</el-button>
|
|
|
+ </el-upload>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</byForm>
|
|
|
<template #footer>
|
|
|
<el-button @click="dialogVisibleOne = false" size="large"
|
|
@@ -413,7 +429,7 @@ const config = computed(() => {
|
|
|
// 渲染 el-button,一般用在最后一列。
|
|
|
renderHTML(row) {
|
|
|
return [
|
|
|
- row.isCustomized == 1
|
|
|
+ row.isCustomized == 1 && (row.bomStatus == 0 || row.bomStatus == null)
|
|
|
? {
|
|
|
attrs: {
|
|
|
label: "调整BOM",
|
|
@@ -426,7 +442,8 @@ const config = computed(() => {
|
|
|
},
|
|
|
}
|
|
|
: {},
|
|
|
- row.isCustomized == 1
|
|
|
+ row.isCustomized == 1 &&
|
|
|
+ (row.technologyStatus == 0 || row.technologyStatus == null)
|
|
|
? {
|
|
|
attrs: {
|
|
|
label: "调整工艺",
|
|
@@ -472,6 +489,11 @@ const formConfigOne = reactive([
|
|
|
slotName: "slot",
|
|
|
label: "",
|
|
|
},
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ slotName: "file",
|
|
|
+ label: "上传附件",
|
|
|
+ },
|
|
|
]);
|
|
|
const getList = async (req) => {
|
|
|
sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
|
|
@@ -526,6 +548,15 @@ const submitFormOne = (type) => {
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
+ formData.dataOne.fileList = formData.dataOne.fileList.map((item) => {
|
|
|
+ return {
|
|
|
+ id: item.raw.id,
|
|
|
+ fileName: item.raw.fileName,
|
|
|
+ fileUrl: item.raw.fileUrl,
|
|
|
+ uploadState: item.raw.uploadState,
|
|
|
+ };
|
|
|
+ });
|
|
|
+
|
|
|
for (
|
|
|
let i = 0;
|
|
|
i < formData.dataOne.workOrderProductionProcessesList.length;
|
|
@@ -594,22 +625,27 @@ const getDtlOne = (row) => {
|
|
|
dialogVisibleOne.value = true;
|
|
|
res = res.map((x) => ({
|
|
|
...x,
|
|
|
- fileList: [
|
|
|
- {
|
|
|
- fileName: x.fileName,
|
|
|
- id: x.oldId,
|
|
|
- },
|
|
|
- ],
|
|
|
- fileListCopy: [
|
|
|
- {
|
|
|
- fileName: x.fileName,
|
|
|
- id: x.oldId,
|
|
|
- },
|
|
|
- ],
|
|
|
+ fileList: x.oldId
|
|
|
+ ? [
|
|
|
+ {
|
|
|
+ fileName: x.fileName,
|
|
|
+ id: x.oldId,
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ : [],
|
|
|
+ fileListCopy: x.oldId
|
|
|
+ ? [
|
|
|
+ {
|
|
|
+ fileName: x.fileName,
|
|
|
+ id: x.oldId,
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ : [],
|
|
|
}));
|
|
|
formData.dataOne = {
|
|
|
workOrderId: row.id,
|
|
|
workOrderProductionProcessesList: res,
|
|
|
+ fileList: [],
|
|
|
};
|
|
|
nextTick(() => {
|
|
|
initSort();
|
|
@@ -679,6 +715,22 @@ const handleBeforeUpload = async (file, index) => {
|
|
|
},
|
|
|
];
|
|
|
};
|
|
|
+
|
|
|
+const handleBeforeUploadOne = async (file) => {
|
|
|
+ const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
|
|
|
+ uploadData.value = res.uploadBody;
|
|
|
+ file.id = res.id;
|
|
|
+ file.fileName = res.fileName;
|
|
|
+ file.fileUrl = res.fileUrl;
|
|
|
+ file.uploadState = true;
|
|
|
+ return true;
|
|
|
+};
|
|
|
+const handleSuccess = (any, UploadFile) => {
|
|
|
+ UploadFile.raw.uploadState = false;
|
|
|
+};
|
|
|
+const onPreviewFile = (file) => {
|
|
|
+ window.open(file.raw.fileUrl, "_blank");
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|