|
@@ -194,7 +194,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" width="60" align="center" fixed="right" v-if="isEditList">
|
|
|
+ <el-table-column label="操作" width="60" align="center" fixed="right" v-if="!judgeStatus() && isEditList">
|
|
|
<template #default="{ row,$index }">
|
|
|
<el-button type="primary" link @click="handleDeleteMaterial(scope.$index,$index)">删除</el-button>
|
|
|
</template>
|
|
@@ -239,17 +239,19 @@
|
|
|
<template #default="{ row, $index }">
|
|
|
<div style="width:100%">
|
|
|
<div style="display:flex">
|
|
|
- <div class="el-click" style="writing-mode: vertical-rl" link @click="handleClickUploadOne($index)">
|
|
|
- {{row.isShowProductFile?'定制图稿':'取消定制'}}</div>
|
|
|
+ <el-button type="primary" text link style="writing-mode: vertical-rl;margin-right:10px;" @click="handleClickUploadOne($index)">
|
|
|
+ {{row.isShowProductFile?'定制图稿':'取消定制'}}
|
|
|
+ </el-button>
|
|
|
<div>
|
|
|
<div v-if="row.isShowProductFile &&row.fileListOne && row.fileListOne.length > 0">
|
|
|
<span class="el-click" @click="onPicture(row.fileListOne[0].fileUrl)">{{row.fileListOne[0].fileName}}</span>
|
|
|
</div>
|
|
|
<div v-else>
|
|
|
- <el-upload action="https://winfaster.obs.cn-south-1.myhuaweicloud.com" :data="uploadData" :limit="1"
|
|
|
- :before-upload="(file)=>handleBeforeUploadOne(file,$index)" :on-success="()=>handleSuccessOne($index)"
|
|
|
- :on-exceed="()=>msgTip(`上传文件数量不可大于1`, 2)">
|
|
|
- <span class="el-click" style="line-height:1">点击上传</span>
|
|
|
+ <el-upload :file-list="row.prodFileList" action="https://winfaster.obs.cn-south-1.myhuaweicloud.com" :data="uploadData"
|
|
|
+ :limit="1" :list-type="'text'" :before-upload="(file)=>handleBeforeUploadOne(file,$index)"
|
|
|
+ :on-success="()=>handleSuccessOne($index)" :on-remove="(file)=>handleRemoveFile(file,$index)"
|
|
|
+ :on-preview="onPreviewFile" :on-exceed="()=>msgTip(`上传文件数量不可大于1`, 2)">
|
|
|
+ <el-button text type="primary">上传</el-button>
|
|
|
</el-upload>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -943,11 +945,15 @@ const sellCorporationIdChange = (val) => {
|
|
|
formData.data.sellProvinceName = res.provinceName;
|
|
|
formData.data.sellCityName = res.cityName;
|
|
|
formData.data.sellAddress = res.address;
|
|
|
+ formData.data.sellContactName = res.contactName;
|
|
|
+ formData.data.sellContactNumber = res.contactPhone;
|
|
|
} else {
|
|
|
formData.data.sellCountryName = res.countryEnStr;
|
|
|
formData.data.sellProvinceName = res.provinceEnStr;
|
|
|
formData.data.sellCityName = res.cityEnStr;
|
|
|
formData.data.sellAddress = res.addressEn;
|
|
|
+ formData.data.sellContactName = res.contactName;
|
|
|
+ formData.data.sellContactNumber = res.contactPhone;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -1306,10 +1312,12 @@ const handleBeforeUpload = async (file, index) => {
|
|
|
return true;
|
|
|
};
|
|
|
|
|
|
-const fileData = ref({});
|
|
|
const handleBeforeUploadOne = async (file, index) => {
|
|
|
const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
|
|
|
+ file.id = res.id;
|
|
|
+ file.fileUrl = res.fileUrl;
|
|
|
uploadData.value = res.uploadBody;
|
|
|
+ formData.data.contractProductList[index].fileData = res;
|
|
|
return true;
|
|
|
};
|
|
|
|
|
@@ -1328,17 +1336,37 @@ const handleSuccess = (index) => {
|
|
|
};
|
|
|
|
|
|
const handleSuccessOne = (index) => {
|
|
|
- if (fileData.value && fileData.value.fileUrl) {
|
|
|
+ if (
|
|
|
+ formData.data.contractProductList[index].fileData &&
|
|
|
+ formData.data.contractProductList[index].fileData.fileUrl
|
|
|
+ ) {
|
|
|
+ let file = formData.data.contractProductList[index].fileData;
|
|
|
formData.data.contractProductList[index].prodFileList.push({
|
|
|
- id: fileData.value.id,
|
|
|
- fileName: fileData.value.fileName,
|
|
|
- name: fileData.value.fileName,
|
|
|
- url: fileData.value.fileUrl,
|
|
|
- fileUrl: fileData.value.fileUrl,
|
|
|
+ id: file.id,
|
|
|
+ fileName: file.fileName,
|
|
|
+ name: file.fileName,
|
|
|
+ url: file.fileUrl,
|
|
|
+ fileUrl: file.fileUrl,
|
|
|
});
|
|
|
+ formData.data.contractProductList[index].fileData = {};
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+const handleRemoveFile = (file, index) => {
|
|
|
+ let sonIndex = formData.data.contractProductList[
|
|
|
+ index
|
|
|
+ ].prodFileList.findIndex((x) => x.id == file.id || x.id == file.raw.id);
|
|
|
+ if (sonIndex > -1) {
|
|
|
+ formData.data.contractProductList[index].prodFileList.splice(sonIndex, 1);
|
|
|
+ }
|
|
|
+};
|
|
|
+const onPreviewFile = (file) => {
|
|
|
+ if (file && file.fileUrl) {
|
|
|
+ window.open(file.fileUrl, "_blank");
|
|
|
+ } else {
|
|
|
+ window.open(file.raw.fileUrl, "_blank");
|
|
|
+ }
|
|
|
+};
|
|
|
const loadingSearch = ref(false);
|
|
|
const remoteMethod = (keyword) => {
|
|
|
if (keyword && typeof keyword === "string") {
|
|
@@ -1442,6 +1470,7 @@ const handleClickUploadOne = (index) => {
|
|
|
!formData.data.contractProductList[index].isShowProductFile;
|
|
|
if (formData.data.contractProductList[index].isShowProductFile) {
|
|
|
formData.data.contractProductList[index].prodFileList = [];
|
|
|
+ formData.data.contractProductList[index].fileData = {};
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -1463,13 +1492,42 @@ const getAllData = (businessId) => {
|
|
|
) {
|
|
|
getFileData();
|
|
|
let ids = formData.data.contractProductList.map((x) => x.id);
|
|
|
- proxy.getFile(
|
|
|
- ids,
|
|
|
- formData.data.contractProductList,
|
|
|
- "id",
|
|
|
- "fileList",
|
|
|
- "imageUrl"
|
|
|
- );
|
|
|
+ // proxy.getFile(
|
|
|
+ // ids,
|
|
|
+ // formData.data.contractProductList,
|
|
|
+ // "id",
|
|
|
+ // "fileList",
|
|
|
+ // "imageUrl"
|
|
|
+ // );
|
|
|
+ proxy
|
|
|
+ .post("/fileInfo/getList", { businessIdList: ids })
|
|
|
+ .then((fileObj) => {
|
|
|
+ for (let i = 0; i < formData.data.contractProductList.length; i++) {
|
|
|
+ const ele = formData.data.contractProductList[i];
|
|
|
+ for (const key in fileObj) {
|
|
|
+ if (
|
|
|
+ ele.id == key &&
|
|
|
+ fileObj[ele.id] &&
|
|
|
+ fileObj[ele.id].length > 0
|
|
|
+ ) {
|
|
|
+ ele.fileListOne = fileObj[ele.id].filter(
|
|
|
+ (x) => x.businessType == "0"
|
|
|
+ );
|
|
|
+ if (ele.fileListOne && ele.fileListOne.length > 0) {
|
|
|
+ ele.imageUrl = ele.fileListOne[0].fileUrl;
|
|
|
+ }
|
|
|
+ ele.prodFileList = fileObj[ele.id]
|
|
|
+ .filter((x) => x.businessType == "1")
|
|
|
+ .map((x) => ({ ...x, name: x.fileName, url: x.fileUrl }));
|
|
|
+ if (ele.prodFileList && ele.prodFileList.length > 0) {
|
|
|
+ ele.isShowProductFile = false;
|
|
|
+ } else {
|
|
|
+ ele.isShowProductFile = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
changeProductPrice();
|
|
|
}
|
|
|
if (formData.data.countryId) {
|
|
@@ -1705,4 +1763,7 @@ const clickCopy = (type) => {
|
|
|
:deep(.el-upload-list--text .el-upload-list__item) {
|
|
|
min-width: 150px !important;
|
|
|
}
|
|
|
+:deep(.bom-table .el-table__body-wrapper .el-table__body .el-table__row) {
|
|
|
+ background: #fbfbfb !important;
|
|
|
+}
|
|
|
</style>
|