|
@@ -13,7 +13,7 @@
|
|
|
|
|
|
<template #status="{ item }">
|
|
|
<div style="width: 100%">
|
|
|
- <span :style="{color: item.status ==99? 'red' :''}">{{dictValueLabel(item.status, statusData)}}</span>
|
|
|
+ <span :style="{color: item.status ==88? 'red' :''}">{{dictValueLabel(item.status, statusData)}}</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -54,51 +54,72 @@
|
|
|
|
|
|
</byTable>
|
|
|
|
|
|
- <el-dialog v-if="openAddDialog" v-model="openAddDialog" title="报价评估" width="60%" append-to-body>
|
|
|
+ <el-dialog v-if="openAddDialog" v-model="openAddDialog" title="报价评估" width="80%" append-to-body>
|
|
|
<byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom">
|
|
|
<template #commodity>
|
|
|
<div style="width: 100%;padding-left:25px">
|
|
|
<el-table :data="formData.data.quotationProductList" style="width: 100%;" default-expand-all row-key="productId">
|
|
|
<el-table-column type="expand" width="50" align="center">
|
|
|
<template #default="scope">
|
|
|
- <el-table :data="scope.row.quotationProductBomList" style="width: 100%;" :show-header="false">
|
|
|
- <el-table-column label="" width="50" />
|
|
|
- <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="150" />
|
|
|
- <el-table-column prop="productName" label="商品名称" min-width="130" />
|
|
|
- <el-table-column label="尺寸 cm*cm*cm" width="180">
|
|
|
- <template #default="{ row, $index }">
|
|
|
- <div style="width: 100%">
|
|
|
- {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="数量" width="150" prop="quantity">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="单价" width="150">
|
|
|
- <template #default="{ row, $index }">
|
|
|
- <div style="width: 100%">
|
|
|
- <el-form-item :prop="'quotationProductList.' + scope.$index + '.quotationProductBomList.' + $index + '.price'"
|
|
|
- :rules="rules.price" :inline-message="true" class="margin-b-0 wid100">
|
|
|
- <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="请输入" style="width: 100%" :precision="2"
|
|
|
- :controls="false" :min="0" @change="totalAmount()" />
|
|
|
- </el-form-item>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="amount" label="小计" width="120">
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
+ <div style="padding-left:50px">
|
|
|
+ <div style="margin-bottom:10px;margin-left:-20px">
|
|
|
+ <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="80">
|
|
|
+ <!-- <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-form-item :prop="'quotationProductList.' + scope.$index + '.quotationProductBomList.' + $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="1" @change="changeQuantity()" />
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </template> -->
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="allQuantity" label="总量" width="80" />
|
|
|
+ <el-table-column label="单价" width="110">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-form-item :prop="'quotationProductList.' + scope.$index + '.quotationProductBomList.' + $index + '.price'"
|
|
|
+ :rules="rules.price" :inline-message="true" class="margin-b-0 wid100">
|
|
|
+ <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="请输入" style="width: 100%" :precision="2"
|
|
|
+ :controls="false" :min="0" @change="totalAmount()" />
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="amount" label="小计" width="110">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="备注" width="180" prop="remark">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" width="60" align="center" fixed="right" v-if="!isDetail">
|
|
|
+ <template #default="{ $index }">
|
|
|
+ <el-button type="primary" link @click="handleDeleteMaterial(scope.$index,$index)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="商品图片" width="80">
|
|
|
+ <el-table-column label="图片" width="80">
|
|
|
<template #default="{ row }">
|
|
|
<div v-if="row.fileUrl">
|
|
|
<img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
|
|
@@ -106,27 +127,18 @@
|
|
|
<div v-else></div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="productCode" label="商品编码" width="150" />
|
|
|
- <el-table-column prop="productName" label="商品名称" min-width="130" />
|
|
|
- <el-table-column label="尺寸 cm*cm*cm" width="180">
|
|
|
+ <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 label="数量" width="150" prop="quantity">
|
|
|
+ <el-table-column label="数量" width="120" prop="quantity">
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="单价" width="150">
|
|
|
- <template #default="{ row, $index }">
|
|
|
- <div style="width: 100%">
|
|
|
- <el-form-item :prop="'quotationProductList.' + $index + '.price'" :rules="rules.price" :inline-message="true"
|
|
|
- class="margin-b-0 wid100">
|
|
|
- <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="请输入" style="width: 100%" :precision="2"
|
|
|
- :controls="false" :min="0" @change="totalAmount()" />
|
|
|
- </el-form-item>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
+ <el-table-column label="单价" width="120" prop="price">
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="amount" label="小计" width="120">
|
|
|
</el-table-column>
|
|
@@ -155,8 +167,14 @@ const sourceList = ref({
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
keyword: "",
|
|
|
- status: 30,
|
|
|
- sellCorporationId: "",
|
|
|
+ status: "",
|
|
|
+ type: "",
|
|
|
+ quotationStatus: "",
|
|
|
+ companyId: "",
|
|
|
+ quotationTimeSta: "",
|
|
|
+ quotationTimeEnd: "",
|
|
|
+ beginTime: "",
|
|
|
+ endTime: "",
|
|
|
},
|
|
|
});
|
|
|
const loading = ref(false);
|
|
@@ -172,7 +190,7 @@ const statusData = ref([
|
|
|
},
|
|
|
{
|
|
|
label: "作废",
|
|
|
- value: 99,
|
|
|
+ value: 88,
|
|
|
},
|
|
|
]);
|
|
|
const quotationStatusData = ref([
|
|
@@ -364,6 +382,8 @@ const getDtl = (row, flag = false) => {
|
|
|
// if (formData.data.buyProvinceId) {
|
|
|
// getCityData(formData.data.buyProvinceId, "30");
|
|
|
// }
|
|
|
+ // 价格计算
|
|
|
+ changeQuantity();
|
|
|
// 文件数据回显
|
|
|
let ids = [];
|
|
|
formData.data.quotationProductList.map((x) => {
|
|
@@ -394,12 +414,43 @@ const getDtl = (row, flag = false) => {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+const changeQuantity = () => {
|
|
|
+ if (
|
|
|
+ formData.data.quotationProductList &&
|
|
|
+ formData.data.quotationProductList.length > 0
|
|
|
+ ) {
|
|
|
+ for (let i = 0; i < formData.data.quotationProductList.length; i++) {
|
|
|
+ let iele = formData.data.quotationProductList[i];
|
|
|
+ if (iele.quantity) {
|
|
|
+ for (let j = 0; j < iele.quotationProductBomList.length; j++) {
|
|
|
+ const jele = iele.quotationProductBomList[j];
|
|
|
+ jele.allQuantity = iele.quantity * jele.quantity;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ totalAmount();
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
const totalAmount = () => {
|
|
|
let money = 0;
|
|
|
if (
|
|
|
formData.data.quotationProductList &&
|
|
|
formData.data.quotationProductList.length > 0
|
|
|
) {
|
|
|
+ // 先算单个产品的价格
|
|
|
+ for (let i = 0; i < formData.data.quotationProductList.length; i++) {
|
|
|
+ let iele = formData.data.quotationProductList[i];
|
|
|
+ let productPrice = 0;
|
|
|
+ for (let j = 0; j < iele.quotationProductBomList.length; j++) {
|
|
|
+ const jele = iele.quotationProductBomList[j];
|
|
|
+ productPrice += Number(
|
|
|
+ parseFloat(Number(jele.quantity) * Number(jele.price)).toFixed(2)
|
|
|
+ );
|
|
|
+ }
|
|
|
+ iele.price = parseFloat(productPrice).toFixed(2);
|
|
|
+ }
|
|
|
+
|
|
|
for (let i = 0; i < formData.data.quotationProductList.length; i++) {
|
|
|
let iele = formData.data.quotationProductList[i];
|
|
|
iele.amount = parseFloat(
|
|
@@ -409,12 +460,12 @@ const totalAmount = () => {
|
|
|
for (let j = 0; j < iele.quotationProductBomList.length; j++) {
|
|
|
const jele = iele.quotationProductBomList[j];
|
|
|
jele.amount = parseFloat(
|
|
|
- Number(jele.quantity) * Number(jele.price)
|
|
|
+ Number(jele.allQuantity) * Number(jele.price)
|
|
|
).toFixed(2);
|
|
|
- money += Number(jele.amount);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
formData.data.amount = parseFloat(money).toFixed(2);
|
|
|
};
|
|
|
|