|
@@ -127,8 +127,54 @@
|
|
|
|
|
|
<template #commodity>
|
|
|
<div style="width: 100%">
|
|
|
- <el-button type="primary" @click="openProductCompany = true" plain style="margin-bottom: 16px" v-if="!judgeStatus()">产品库</el-button>
|
|
|
- <el-table :data="formData.data.contractProductList" style="width: 100%; ">
|
|
|
+ <el-button type="primary" @click="openProductCompany = true" plain style="margin-bottom: 16px"
|
|
|
+ v-if="!judgeStatus() && isEditList">产品库</el-button>
|
|
|
+ <el-table :data="formData.data.contractProductList" style="width: 100%; " default-expand-all>
|
|
|
+ <el-table-column type="expand" width="50" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <div style="padding-left:50px">
|
|
|
+ <div style="margin-bottom:10px;">
|
|
|
+ <TitleInfo content='BOM单:'></TitleInfo>
|
|
|
+ </div>
|
|
|
+ <el-table :data="scope.row.quotationProductBomList" style="width: 100%;" border class="bom-table">
|
|
|
+ <el-table-column label="图片" width="80">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <div v-if="row.fileUrl">
|
|
|
+ <img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
|
|
|
+ </div>
|
|
|
+ <div v-else></div>
|
|
|
+ </template>
|
|
|
+ </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*cm*cm" width="150">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="quantity" label="数量" width="110" />
|
|
|
+ <!-- <el-table-column prop="allQuantity" label="总量" width="80" /> -->
|
|
|
+ <!-- <el-table-column prop="price" label="单价" width="110">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ ¥ {{row.price}}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column> -->
|
|
|
+ <!-- <el-table-column prop="amount" label="小计" width="110">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ ¥ {{row.amount}}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column> -->
|
|
|
+ <el-table-column prop="remark" label="备注" width="180" />
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="商品图片" width="80">
|
|
|
<template #default="{ row }">
|
|
|
<div v-if="row.fileUrl">
|
|
@@ -171,7 +217,8 @@
|
|
|
<el-form-item :prop="'contractProductList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true"
|
|
|
class="margin-b-0 wid100">
|
|
|
<el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%" :precision="0"
|
|
|
- :controls="false" :min="0" @change="calculationAmount('quantity')" />
|
|
|
+ :controls="false" :min="0" @change="calculationAmount('quantity')" v-if="isEditList" />
|
|
|
+ <div v-else> {{row.quantity}}</div>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -183,7 +230,8 @@
|
|
|
class="margin-b-0 wid100">
|
|
|
<div style="display:flex;">
|
|
|
<el-input-number onmousewheel="return false;" v-model="row.price" placeholder="请输入" style="width: 100%" :precision="2"
|
|
|
- :controls="false" :min="0" @change="calculationAmount()" />
|
|
|
+ :controls="false" :min="0" @change="calculationAmount()" v-if="isEditList" />
|
|
|
+ <div v-else>¥ {{row.price}}</div>
|
|
|
<el-popover placement="top-start" :width="400" trigger="hover" @show="showEcharts(row,$index)">
|
|
|
<template #default>
|
|
|
<div>
|
|
@@ -242,11 +290,17 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="amount" label="小计" width="120" />
|
|
|
- <el-table-column label="操作" width="120" align="center" fixed="right" v-if="!judgeStatus()">
|
|
|
+ <el-table-column prop="amount" label="小计" width="110">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ ¥ {{row.amount}}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" width="140" align="center" fixed="right" v-if="!judgeStatus()">
|
|
|
<template #default="{ $index }">
|
|
|
- <el-button type="primary" link @click="handleClickUpload('prodFilePath',true,$index)">重置</el-button>
|
|
|
- <el-button type="primary" link @click="handleRemove($index)">删除</el-button>
|
|
|
+ <el-button type="primary" link @click="handleClickUpload('prodFilePath',true,$index)">定制图稿</el-button>
|
|
|
+ <el-button type="primary" link @click="handleRemove($index)" v-if="isEditList">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -306,7 +360,7 @@
|
|
|
|
|
|
<el-dialog v-if="openProductCompany" v-model="openProductCompany" title="公司产品库" width="90%" append-to-body>
|
|
|
<!-- <SelectCompanyProduct @selectProduct="selectProduct" :alreadySelectData="formData.data.contractProductList"></SelectCompanyProduct> -->
|
|
|
- <SelectProduct @selectProduct="selectProduct"></SelectProduct>
|
|
|
+ <SelectProduct @selectProduct="selectProduct" :isRawMaterial="'1'"></SelectProduct>
|
|
|
</el-dialog>
|
|
|
|
|
|
<!-- <el-dialog v-if="copyContract" v-model="copyContract" :title="copyType === 1 ? '合同选择' : '样品单选择'" width="90%" append-to-body>
|
|
@@ -404,7 +458,14 @@ const formConfig = computed(() => {
|
|
|
// },
|
|
|
{
|
|
|
type: "title",
|
|
|
- title: "合同类型",
|
|
|
+ title: "基本信息",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "code",
|
|
|
+ label: "合同号",
|
|
|
+ disabled: true,
|
|
|
+ isShow: formData.data.code ? true : false,
|
|
|
},
|
|
|
{
|
|
|
type: "select",
|
|
@@ -908,30 +969,60 @@ const handlePerson = (item) => {
|
|
|
formData.data.buyContactNumber = data[0].contactNo;
|
|
|
}
|
|
|
};
|
|
|
-
|
|
|
+const quotationProductBomList = ref([]);
|
|
|
const selectProduct = (goods) => {
|
|
|
if (goods && goods.id) {
|
|
|
let fileUrl = "";
|
|
|
if (goods.fileList && goods.fileList.length > 0) {
|
|
|
fileUrl = goods.fileList[0].fileUrl;
|
|
|
}
|
|
|
- formData.data.contractProductList.push({
|
|
|
- fileUrl: fileUrl,
|
|
|
- productId: goods.id,
|
|
|
- productCnName: goods.name,
|
|
|
- productCode: goods.customCode,
|
|
|
- productLength: goods["length"],
|
|
|
- productWidth: goods.width,
|
|
|
- productHeight: goods.height,
|
|
|
- prodFilePath: goods.prodFilePath,
|
|
|
- quantity: null,
|
|
|
- price: null,
|
|
|
- amount: "",
|
|
|
- remark: "",
|
|
|
- fileList: [],
|
|
|
+ proxy.post("/productBomInfo/detail", { id: goods.id }).then((res) => {
|
|
|
+ if (res.productBomDetailList && res.productBomDetailList.length > 0) {
|
|
|
+ quotationProductBomList.value = res.productBomDetailList.map((x) => ({
|
|
|
+ fileUrl: "",
|
|
|
+ materialId: x.materialId,
|
|
|
+ productName: x.materialName,
|
|
|
+ productCode: x.materialCode,
|
|
|
+ productLength: x["length"],
|
|
|
+ productWidth: x.width,
|
|
|
+ productHeight: x.height,
|
|
|
+ quantity: x.quantity || null,
|
|
|
+ allQuantity: "",
|
|
|
+ price: x.materialPrice || null,
|
|
|
+ amount: "",
|
|
|
+ fileList: [],
|
|
|
+ type: x.type,
|
|
|
+ }));
|
|
|
+ formData.data.contractProductList.push({
|
|
|
+ fileUrl: fileUrl,
|
|
|
+ productId: goods.id,
|
|
|
+ productCnName: goods.name,
|
|
|
+ productCode: goods.customCode,
|
|
|
+ productLength: goods["length"],
|
|
|
+ productWidth: goods.width,
|
|
|
+ productHeight: goods.height,
|
|
|
+ prodFilePath: goods.prodFilePath,
|
|
|
+ quantity: null,
|
|
|
+ price: goods.price || null,
|
|
|
+ amount: "",
|
|
|
+ remark: "",
|
|
|
+ fileList: [],
|
|
|
+ quotationProductBomList: quotationProductBomList.value,
|
|
|
+ });
|
|
|
+ proxy.msgTip("添加成功", 1);
|
|
|
+ changeProductPrice();
|
|
|
+ let ids = quotationProductBomList.value.map((x) => x.materialId);
|
|
|
+ proxy.getFile(
|
|
|
+ ids,
|
|
|
+ quotationProductBomList.value,
|
|
|
+ "materialId",
|
|
|
+ "fileList",
|
|
|
+ "fileUrl"
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ return proxy.msgTip("该产品未配置BOM", 2);
|
|
|
+ }
|
|
|
});
|
|
|
- proxy.msgTip("添加成功", 1);
|
|
|
- changeProductPrice();
|
|
|
} else {
|
|
|
return proxy.msgTip("选择错误", 2);
|
|
|
}
|
|
@@ -1230,7 +1321,6 @@ const getAllData = (businessId) => {
|
|
|
"fileList",
|
|
|
"imageUrl"
|
|
|
);
|
|
|
-
|
|
|
changeProductPrice();
|
|
|
}
|
|
|
if (formData.data.countryId) {
|
|
@@ -1241,6 +1331,34 @@ const getAllData = (businessId) => {
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
+
|
|
|
+const getFileData = () => {
|
|
|
+ let ids = [];
|
|
|
+ formData.data.contractProductList.map((x) => {
|
|
|
+ ids.push(x.productId);
|
|
|
+ x.quotationProductBomList.map((y) => {
|
|
|
+ ids.push(y.materialId);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ ids = Array.from(new Set(ids));
|
|
|
+ proxy
|
|
|
+ .post("/fileInfo/getList", {
|
|
|
+ businessIdList: ids,
|
|
|
+ })
|
|
|
+ .then((fileObj) => {
|
|
|
+ formData.data.contractProductList.map((x) => {
|
|
|
+ if (fileObj[x.productId] && fileObj[x.productId].length > 0) {
|
|
|
+ x.fileUrl = fileObj[x.productId][0].fileUrl;
|
|
|
+ }
|
|
|
+ x.quotationProductBomList.map((y) => {
|
|
|
+ y.fileList = fileObj[y.materialId] || [];
|
|
|
+ if (y.fileList && y.fileList.length > 0) {
|
|
|
+ y.fileUrl = y.fileList[0].fileUrl;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+};
|
|
|
const getPriceSheetData = (id) => {
|
|
|
proxy.post("/extQuotation/detail", { id }).then((res) => {
|
|
|
formData.data = res;
|
|
@@ -1253,6 +1371,7 @@ const getPriceSheetData = (id) => {
|
|
|
buyPostalCode: res.buyPostalCode,
|
|
|
buyContactName: res.buyContactName,
|
|
|
buyContactNumber: res.buyContactNumber,
|
|
|
+ amount: res.amount,
|
|
|
};
|
|
|
if (res.type == 1) {
|
|
|
formData.data.contractType = "2";
|
|
@@ -1277,17 +1396,23 @@ const getPriceSheetData = (id) => {
|
|
|
price: x.price,
|
|
|
amount: x.amount,
|
|
|
fileList: [],
|
|
|
+ quotationProductBomList: x.quotationProductBomList.map((y) => {
|
|
|
+ y.quotationProductBomId = y.id;
|
|
|
+ delete y.id;
|
|
|
+ return y;
|
|
|
+ }),
|
|
|
}));
|
|
|
changeProductPrice();
|
|
|
- let productIds = formData.data.contractProductList.map((x) => x.productId);
|
|
|
- proxy.getFile(
|
|
|
- productIds,
|
|
|
- formData.data.contractProductList,
|
|
|
- "productId",
|
|
|
- "fileListOne",
|
|
|
- "fileUrl"
|
|
|
- );
|
|
|
- totalAmount();
|
|
|
+ getFileData();
|
|
|
+ // let productIds = formData.data.contractProductList.map((x) => x.productId);
|
|
|
+ // proxy.getFile(
|
|
|
+ // productIds,
|
|
|
+ // formData.data.contractProductList,
|
|
|
+ // "productId",
|
|
|
+ // "fileListOne",
|
|
|
+ // "fileUrl"
|
|
|
+ // );
|
|
|
+ // totalAmount();
|
|
|
formData.data.countryId = res.buyCountryId;
|
|
|
formData.data.provinceId = res.buyProvinceId;
|
|
|
formData.data.cityId = res.buyCityId;
|
|
@@ -1299,6 +1424,8 @@ const getPriceSheetData = (id) => {
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
+// 是否能编辑修改产品列表
|
|
|
+const isEditList = ref(true);
|
|
|
onMounted(() => {
|
|
|
if (currencyData.value && currencyData.value.length > 0) {
|
|
|
formData.data.currency = currencyData.value[0].dictKey;
|
|
@@ -1307,6 +1434,7 @@ onMounted(() => {
|
|
|
// 报价转销售订单
|
|
|
if (route.query && route.query.priceSheetId) {
|
|
|
getPriceSheetData(route.query.priceSheetId);
|
|
|
+ isEditList.value = false;
|
|
|
} else if (route.query && route.query.businessId && route.query.processType) {
|
|
|
let businessId = route.query.businessId;
|
|
|
getAllData(businessId);
|
|
@@ -1328,6 +1456,7 @@ watch(
|
|
|
immediate: true,
|
|
|
}
|
|
|
);
|
|
|
+
|
|
|
const showPriceInfo = () => {
|
|
|
if (props.queryData.processType) {
|
|
|
return false;
|