|
@@ -26,7 +26,10 @@
|
|
|
|
|
|
<template #follow="{ item }">
|
|
<template #follow="{ item }">
|
|
<div style="width: 100%">
|
|
<div style="width: 100%">
|
|
- <div style="width: 100%; display: flex">
|
|
|
|
|
|
+ <div style="width: 100%; display: flex;align-items:center">
|
|
|
|
+ <el-icon :size="20" style="cursor:pointer;margin-right: 8px;" @click="handleFollow(item)">
|
|
|
|
+ <Edit />
|
|
|
|
+ </el-icon>
|
|
<template v-if="
|
|
<template v-if="
|
|
item.extQuotationFollowList &&
|
|
item.extQuotationFollowList &&
|
|
item.extQuotationFollowList.length > 0
|
|
item.extQuotationFollowList.length > 0
|
|
@@ -90,8 +93,9 @@
|
|
|
|
|
|
<template #btn="{item}">
|
|
<template #btn="{item}">
|
|
<div style="width: 100%">
|
|
<div style="width: 100%">
|
|
- <el-button type="primary" text v-debounce @click="handleFollow(item)">跟进</el-button>
|
|
|
|
|
|
+ <!-- <el-button type="primary" text v-debounce @click="handleFollow(item)">跟进</el-button> -->
|
|
<el-button type="primary" text v-debounce @click="handleGenerate(item)">生成订单</el-button>
|
|
<el-button type="primary" text v-debounce @click="handleGenerate(item)">生成订单</el-button>
|
|
|
|
+ <el-button type="primary" text v-debounce @click="getDtl(item)">变更</el-button>
|
|
<el-button type="danger" text v-debounce v-if="item.status !=0" @click="handleRepeal(item)">作废</el-button>
|
|
<el-button type="danger" text v-debounce v-if="item.status !=0" @click="handleRepeal(item)">作废</el-button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -123,6 +127,90 @@
|
|
<el-button @click="openRecordMore = false" size="default" v-debounce>关 闭</el-button>
|
|
<el-button @click="openRecordMore = false" size="default" v-debounce>关 闭</el-button>
|
|
</template>
|
|
</template>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+
|
|
|
|
+ <el-dialog v-if="openAddDialog" v-model="openAddDialog" title="报价变更" width="90%" append-to-body>
|
|
|
|
+ <byForm :formConfig="updateFormConfig" :formOption="updateFormOption" v-model="formData.updateData" :rules="updateRules" ref="formDomOne">
|
|
|
|
+ <template #commodity>
|
|
|
|
+ <div style="width: 100%;padding-left:25px">
|
|
|
|
+ <el-table :data="formData.updateData.quotationProductList" style="width: 100%;" default-expand-all row-key="productId">
|
|
|
|
+ <el-table-column type="expand" width="50" align="center">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <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">
|
|
|
|
+ </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>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <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 label="数量" width="120" prop="quantity">
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="单价" width="120" prop="price">
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="amount" label="小计" width="120">
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </byForm>
|
|
|
|
+ <template #footer v-if="!isDetail">
|
|
|
|
+ <el-button @click="openAddDialog = false" size="default" v-debounce>关 闭</el-button>
|
|
|
|
+ <el-button type="primary" @click="handleSubmitOne()" size="default" v-debounce>提 交</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -274,7 +362,7 @@ const config = computed(() => {
|
|
attrs: {
|
|
attrs: {
|
|
label: "跟进",
|
|
label: "跟进",
|
|
slot: "follow",
|
|
slot: "follow",
|
|
- "min-width": 360,
|
|
|
|
|
|
+ "min-width": 400,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -337,6 +425,7 @@ const followDialog = ref(false);
|
|
const submitLoading = ref(false);
|
|
const submitLoading = ref(false);
|
|
const formData = reactive({
|
|
const formData = reactive({
|
|
data: {},
|
|
data: {},
|
|
|
|
+ updateData: {},
|
|
});
|
|
});
|
|
const formOption = reactive({
|
|
const formOption = reactive({
|
|
inline: true,
|
|
inline: true,
|
|
@@ -454,6 +543,164 @@ const handleRepeal = (row) => {
|
|
})
|
|
})
|
|
.catch((err) => {});
|
|
.catch((err) => {});
|
|
};
|
|
};
|
|
|
|
+
|
|
|
|
+const formDomOne = ref(null);
|
|
|
|
+const updateFormOption = reactive({
|
|
|
|
+ inline: true,
|
|
|
|
+ labelWidth: 100,
|
|
|
|
+ itemWidth: 100,
|
|
|
|
+ disabled: false,
|
|
|
|
+});
|
|
|
|
+const updateFormConfig = computed(() => {
|
|
|
|
+ return [
|
|
|
|
+ {
|
|
|
|
+ type: "title1",
|
|
|
|
+ title: "商品信息",
|
|
|
|
+ haveLine: true,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ type: "slot",
|
|
|
|
+ slotName: "commodity",
|
|
|
|
+ label: "",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ type: "title1",
|
|
|
|
+ title: "报价总金额",
|
|
|
|
+ haveLine: true,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ type: "input",
|
|
|
|
+ prop: "amount",
|
|
|
|
+ label: "报价总金额",
|
|
|
|
+ itemWidth: 25,
|
|
|
|
+ disabled: true,
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
|
|
+});
|
|
|
|
+const updateRules = ref({
|
|
|
|
+ price: [{ required: true, message: "请输入单价", trigger: "blur" }],
|
|
|
|
+});
|
|
|
|
+const isDetail = ref(false);
|
|
|
|
+const openAddDialog = ref(false);
|
|
|
|
+const getDtl = (row, flag = false) => {
|
|
|
|
+ formOption.disabled = flag;
|
|
|
|
+ isDetail.value = flag;
|
|
|
|
+ openAddDialog.value = true;
|
|
|
|
+ proxy.post("/extQuotation/detail", { id: row.id }).then((res) => {
|
|
|
|
+ formData.updateData = res;
|
|
|
|
+ // 价格计算
|
|
|
|
+ changeQuantity();
|
|
|
|
+ // 文件数据回显
|
|
|
|
+ let ids = [];
|
|
|
|
+ formData.updateData.quotationProductList.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.updateData.quotationProductList.map((x) => {
|
|
|
|
+ x.fileList = fileObj[x.productId] || [];
|
|
|
|
+ if (x.fileList && x.fileList.length > 0) {
|
|
|
|
+ x.fileUrl = x.fileList[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 changeQuantity = () => {
|
|
|
|
+ if (
|
|
|
|
+ formData.updateData.quotationProductList &&
|
|
|
|
+ formData.updateData.quotationProductList.length > 0
|
|
|
|
+ ) {
|
|
|
|
+ for (let i = 0; i < formData.updateData.quotationProductList.length; i++) {
|
|
|
|
+ let iele = formData.updateData.quotationProductList[i];
|
|
|
|
+ if (iele.quantity) {
|
|
|
|
+ for (let j = 0; j < iele.quotationProductBomList.length; j++) {
|
|
|
|
+ const jele = iele.quotationProductBomList[j];
|
|
|
|
+ if (!jele.price) {
|
|
|
|
+ jele.price = jele.costPrice;
|
|
|
|
+ }
|
|
|
|
+ jele.allQuantity = iele.quantity * jele.quantity;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ totalAmount();
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+const totalAmount = () => {
|
|
|
|
+ let money = 0;
|
|
|
|
+ if (
|
|
|
|
+ formData.updateData.quotationProductList &&
|
|
|
|
+ formData.updateData.quotationProductList.length > 0
|
|
|
|
+ ) {
|
|
|
|
+ // 先算单个产品的价格
|
|
|
|
+ for (let i = 0; i < formData.updateData.quotationProductList.length; i++) {
|
|
|
|
+ let iele = formData.updateData.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.updateData.quotationProductList.length; i++) {
|
|
|
|
+ let iele = formData.updateData.quotationProductList[i];
|
|
|
|
+ iele.amount = parseFloat(
|
|
|
|
+ Number(iele.quantity) * Number(iele.price)
|
|
|
|
+ ).toFixed(2);
|
|
|
|
+ money += Number(iele.amount);
|
|
|
|
+ for (let j = 0; j < iele.quotationProductBomList.length; j++) {
|
|
|
|
+ const jele = iele.quotationProductBomList[j];
|
|
|
|
+ jele.amount = parseFloat(
|
|
|
|
+ Number(jele.allQuantity) * Number(jele.price)
|
|
|
|
+ ).toFixed(2);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ formData.updateData.amount = parseFloat(money).toFixed(2);
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+const handleSubmitOne = (type) => {
|
|
|
|
+ formDomOne.value.handleSubmit(() => {
|
|
|
|
+ if (
|
|
|
|
+ formData.updateData.quotationProductList &&
|
|
|
|
+ formData.updateData.quotationProductList.length > 0
|
|
|
|
+ ) {
|
|
|
|
+ submitLoading.value = true;
|
|
|
|
+ proxy.post("/extQuotation/change", formData.updateData).then(
|
|
|
|
+ (res) => {
|
|
|
|
+ proxy.msgTip("操作成功", 1);
|
|
|
|
+ openAddDialog.value = false;
|
|
|
|
+ submitLoading.value = false;
|
|
|
|
+ getList();
|
|
|
|
+ },
|
|
|
|
+ (err) => {
|
|
|
|
+ submitLoading.value = false;
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ } else {
|
|
|
|
+ return proxy.msgTip("请添加至少一件商品", 2);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|