|
@@ -149,7 +149,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="productCode" label="物料编码" width="190" />
|
|
|
<el-table-column prop="productName" label="物料名称" min-width="200" />
|
|
|
- <el-table-column label="尺寸 (cm)" width="150">
|
|
|
+ <el-table-column label="尺寸 (cm)" width="130">
|
|
|
<template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
|
{{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
|
|
@@ -213,7 +213,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="productCnName" label="商品名称" min-width="130" />
|
|
|
<el-table-column prop="productCode" label="商品编码" width="130" />
|
|
|
- <el-table-column label="尺寸 cm*cm*cm" width="180">
|
|
|
+ <el-table-column label="尺寸 (cm)" width="130">
|
|
|
<template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
|
{{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
|
|
@@ -235,14 +235,29 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="生产源文件" width="140">
|
|
|
+ <el-table-column label="生产源文件" width="210">
|
|
|
<template #default="{ row, $index }">
|
|
|
- <!-- <span class="el-click" v-if="!row.prodFilePath" @click="handleClickUpload('prodFilePath',false)">点击</span> -->
|
|
|
- <span class="el-click" v-if="row.prodFilePath" @click="handleClickUpload('prodFilePath',false,$index)">点击上传 (查看)</span>
|
|
|
- <el-button type="primary" link @click="handleClickUpload('prodFilePath',true,$index)" v-else>定制图稿</el-button>
|
|
|
+ <div style="width:100%">
|
|
|
+ <div style="display:flex">
|
|
|
+ <div class="el-click" style="writing-mode: vertical-rl" link @click="handleClickUploadOne($index)">
|
|
|
+ {{row.isShowProductFile?'定制图稿':'取消定制'}}</div>
|
|
|
+ <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>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="数量" width="150">
|
|
|
+ <el-table-column label="数量" width="110">
|
|
|
<template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
|
<el-form-item :prop="'contractProductList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true"
|
|
@@ -254,7 +269,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="单价" width="180">
|
|
|
+ <el-table-column label="单价" width="160">
|
|
|
<template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
|
<el-form-item :prop="'contractProductList.' + $index + '.price'" :rules="rules.price" :inline-message="true"
|
|
@@ -421,6 +436,7 @@ import SelectContract from "@/components/contractCom/selectContract.vue";
|
|
|
import SelectSample from "@/components/contractCom/selectSample.vue";
|
|
|
import * as echarts from "echarts";
|
|
|
import $bus from "@/bus/index.js";
|
|
|
+import { async } from "@antv/x6/lib/registry/marker/main";
|
|
|
const route = useRoute();
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
// 接收父组件的传值
|
|
@@ -456,7 +472,7 @@ const formData = reactive({
|
|
|
contractType: "2",
|
|
|
rate: 1,
|
|
|
contractProductList: [],
|
|
|
- companyId: companyId.value,
|
|
|
+ companyId: "",
|
|
|
templateContent: "",
|
|
|
},
|
|
|
});
|
|
@@ -543,7 +559,7 @@ const formConfig = computed(() => {
|
|
|
propsTreeLabel: "deptName",
|
|
|
propsTreeValue: "deptId",
|
|
|
itemWidth: 50,
|
|
|
- disabled: companyId.value != "100" || !isEditList.value,
|
|
|
+ disabled: !isEditList.value,
|
|
|
fn: () => {
|
|
|
formData.data.contractProductList = [];
|
|
|
},
|
|
@@ -1019,12 +1035,21 @@ const handleClickSelectMaterial = (index) => {
|
|
|
};
|
|
|
|
|
|
const contractProductBomList = ref([]);
|
|
|
-const selectProduct = (goods) => {
|
|
|
+const selectProduct = async (goods) => {
|
|
|
if (goods && goods.id) {
|
|
|
+ let allFile = [];
|
|
|
let fileUrl = "";
|
|
|
if (goods.fileList && goods.fileList.length > 0) {
|
|
|
fileUrl = goods.fileList[0].fileUrl;
|
|
|
}
|
|
|
+ const fileData = await proxy.post("/fileInfo/getList", {
|
|
|
+ businessIdList: [goods.id],
|
|
|
+ });
|
|
|
+ if (fileData[goods.id] && fileData[goods.id].length > 0) {
|
|
|
+ allFile = fileData[goods.id];
|
|
|
+ } else {
|
|
|
+ allFile = [];
|
|
|
+ }
|
|
|
proxy.post("/productBomInfo/detail", { id: goods.id }).then((res) => {
|
|
|
if (res.productBomDetailList && res.productBomDetailList.length > 0) {
|
|
|
contractProductBomList.value = res.productBomDetailList.map((x) => ({
|
|
@@ -1042,6 +1067,10 @@ const selectProduct = (goods) => {
|
|
|
fileList: [],
|
|
|
type: x.type,
|
|
|
}));
|
|
|
+ let fileListOne = [];
|
|
|
+ if (allFile && allFile.length > 0) {
|
|
|
+ fileListOne = allFile.filter((x) => x.businessType == "2");
|
|
|
+ }
|
|
|
formData.data.contractProductList.push({
|
|
|
fileUrl: fileUrl,
|
|
|
productId: goods.id,
|
|
@@ -1056,8 +1085,12 @@ const selectProduct = (goods) => {
|
|
|
amount: "",
|
|
|
remark: "",
|
|
|
fileList: [],
|
|
|
+ isShowProductFile: true,
|
|
|
+ fileListOne: fileListOne,
|
|
|
+ prodFileList: [],
|
|
|
contractProductBomList: contractProductBomList.value,
|
|
|
});
|
|
|
+ fileData;
|
|
|
proxy.msgTip("添加成功", 1);
|
|
|
changeProductPrice();
|
|
|
let ids = contractProductBomList.value.map((x) => x.materialId);
|
|
@@ -1273,6 +1306,13 @@ 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 });
|
|
|
+ uploadData.value = res.uploadBody;
|
|
|
+ return true;
|
|
|
+};
|
|
|
+
|
|
|
const handleSuccess = (index) => {
|
|
|
if (
|
|
|
formData.data.contractProductList[index].fileData &&
|
|
@@ -1287,6 +1327,18 @@ const handleSuccess = (index) => {
|
|
|
}, 400);
|
|
|
};
|
|
|
|
|
|
+const handleSuccessOne = (index) => {
|
|
|
+ if (fileData.value && fileData.value.fileUrl) {
|
|
|
+ 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,
|
|
|
+ });
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
const loadingSearch = ref(false);
|
|
|
const remoteMethod = (keyword) => {
|
|
|
if (keyword && typeof keyword === "string") {
|
|
@@ -1385,6 +1437,14 @@ const handleClickUpload = async (att, flag, index) => {
|
|
|
document.body.removeChild(a);
|
|
|
};
|
|
|
|
|
|
+const handleClickUploadOne = (index) => {
|
|
|
+ formData.data.contractProductList[index].isShowProductFile =
|
|
|
+ !formData.data.contractProductList[index].isShowProductFile;
|
|
|
+ if (formData.data.contractProductList[index].isShowProductFile) {
|
|
|
+ formData.data.contractProductList[index].prodFileList = [];
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
const getAllData = (businessId) => {
|
|
|
proxy.post("/contract/detail", { id: businessId }).then((res) => {
|
|
|
res.countryId = res.buyCountryId;
|
|
@@ -1636,4 +1696,13 @@ const clickCopy = (type) => {
|
|
|
.ql-editor {
|
|
|
padding: 0px;
|
|
|
}
|
|
|
+:deep(.el-upload-list) {
|
|
|
+ margin: 0px !important;
|
|
|
+ position: relative;
|
|
|
+ top: -8px;
|
|
|
+ left: -8px;
|
|
|
+}
|
|
|
+:deep(.el-upload-list--text .el-upload-list__item) {
|
|
|
+ min-width: 150px !important;
|
|
|
+}
|
|
|
</style>
|