|
@@ -54,9 +54,260 @@
|
|
|
|
|
|
</byTable>
|
|
|
|
|
|
- <el-dialog v-if="openAddDialog" v-model="openAddDialog" title="报价评估" width="90%" append-to-body>
|
|
|
- <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom">
|
|
|
- <template #chart>
|
|
|
+ <el-dialog v-if="openAddDialog" v-model="openAddDialog" title="报价评估" width="95%" append-to-body>
|
|
|
+ <div style="height:calc(100vh - 215px)" class="box">
|
|
|
+ <div class="left">
|
|
|
+ <el-card style="width:100%;margin-bottom:15px" v-for="(item,index) in quotationProductList" :key="index">
|
|
|
+ <div style="text-align:right">
|
|
|
+ <el-button plain type="primary" @click="handleReportPrice(item)">报价</el-button>
|
|
|
+ </div>
|
|
|
+ <el-table :data="[item]" style="width: 100%;">
|
|
|
+ <el-table-column type="expand" width="50" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <div>
|
|
|
+ <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)" 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">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ ¥ {{row.amount}}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </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)" 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="productColor" label="颜色" width="100" />
|
|
|
+ <el-table-column label="数量" width="120" prop="quantity">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="单价" width="120" prop="price" fixed="right">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%;">
|
|
|
+ <span :style="{
|
|
|
+ color:row.price?'red':''
|
|
|
+ }">¥{{row.price}}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="amount" label="小计" width="120" fixed="right">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ <span :style="{
|
|
|
+ color:row.price?'red':''
|
|
|
+ }">¥{{row.amount}}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-card>
|
|
|
+ </div>
|
|
|
+ <div class="right">
|
|
|
+ <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom"
|
|
|
+ v-if="formData.data.quotationProductId" v-loading="submitLoading">
|
|
|
+ <template #quotationDetail>
|
|
|
+ <div style="width:100%">
|
|
|
+ <div style="text-align:center">
|
|
|
+ 正在对 <span style="color:red">{{formData.data.productCode}},{{formData.data.productName}}({{formData.data.quantity}})</span> 进行报价
|
|
|
+ </div>
|
|
|
+ <table class="table" border>
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th style="width:10%">
|
|
|
+ 类型
|
|
|
+ </th>
|
|
|
+ <th style="width:20%">
|
|
|
+ 编码
|
|
|
+ </th>
|
|
|
+ <th style="width:20%">
|
|
|
+ 名称
|
|
|
+ </th>
|
|
|
+ <th style="width:16%" class="align-right">
|
|
|
+ 模具
|
|
|
+ </th>
|
|
|
+ <th style="width:8%" class="align-right">
|
|
|
+ 数量/件
|
|
|
+ </th>
|
|
|
+ <th style="width:8%" class="align-right">
|
|
|
+ 单价
|
|
|
+ </th>
|
|
|
+ <th style="width:8%" class="align-right">
|
|
|
+ 总量
|
|
|
+ </th>
|
|
|
+ <th style="width:10%" class="align-right">
|
|
|
+ 总价
|
|
|
+ </th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ <template v-for="(row,index) in formData.data.quotationEstimateList" :key="index">
|
|
|
+ <tr v-if="row.type==1">
|
|
|
+ <td>原材料</td>
|
|
|
+ <td>{{row.code}}</td>
|
|
|
+ <td>{{row.name}}</td>
|
|
|
+ <td class="align-right">
|
|
|
+ <el-form-item label-width="0px" class="margin-b-0" :prop="'quotationEstimateList.' + index + '.moldId'"
|
|
|
+ :rules="rules.moldId" :inline-message="true">
|
|
|
+ <el-select v-model="row.moldId" filterable placeholder="请选择模具" style="width: 100%" @change="changeTotalAmount()">
|
|
|
+ <el-option v-for="item in moldData" :key="item.id" :label="item.moldName" :value="item.id" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </td>
|
|
|
+ <td class="align-right">-</td>
|
|
|
+ <td class="align-right">
|
|
|
+ <el-form-item label-width="0px" class="margin-b-0" :prop="'quotationEstimateList.' + index + '.price'" :rules="rules.price"
|
|
|
+ :inline-message="true">
|
|
|
+ <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="单价" style="width: 100%" :precision="2"
|
|
|
+ :controls="false" :min="0" @change="changeTotalAmount()" />
|
|
|
+ </el-form-item>
|
|
|
+ </td>
|
|
|
+ <td class="align-right">
|
|
|
+ <el-form-item label-width="0px" class="margin-b-0" :prop="'quotationEstimateList.' + index + '.totalQuantity'"
|
|
|
+ :rules="rules.totalQuantity" :inline-message="true">
|
|
|
+ <el-input-number onmousewheel="return false;" v-model="row.totalQuantity" placeholder="总量" style="width: 100%"
|
|
|
+ :precision="0" :controls="false" :min="1" @change="changeTotalAmount()" />
|
|
|
+ </el-form-item>
|
|
|
+ </td>
|
|
|
+ <td class="align-right">{{row.amount}}</td>
|
|
|
+ </tr>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-for="(row,index) in formData.data.quotationEstimateList" :key="index">
|
|
|
+ <tr v-if="row.type == 2">
|
|
|
+ <td :rowspan="getRowSpan(2)" v-if="row.show">
|
|
|
+ <el-button text type="primary" @click="openSelectMaterial=true">选择</el-button>
|
|
|
+ <div>包材辅材</div>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ {{row.code}}
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ {{row.name}}
|
|
|
+ </td>
|
|
|
+ <td class="align-right">
|
|
|
+ -
|
|
|
+ </td>
|
|
|
+ <td class="align-right">
|
|
|
+ <el-form-item label-width="0px" class="margin-b-0" :prop="'quotationEstimateList.' + index + '.quantity'"
|
|
|
+ :rules="rules.quantity" :inline-message="true">
|
|
|
+ <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="数量" style="width: 100%" :precision="0"
|
|
|
+ :controls="false" :min="1" @change="changeTotalAmount()" />
|
|
|
+ </el-form-item>
|
|
|
+ </td>
|
|
|
+ <td class="align-right">
|
|
|
+ <el-form-item label-width="0px" class="margin-b-0" :prop="'quotationEstimateList.' + index + '.price'" :rules="rules.price"
|
|
|
+ :inline-message="true">
|
|
|
+ <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="单价" style="width: 100%" :precision="2"
|
|
|
+ :controls="false" :min="0" @change="changeTotalAmount()" />
|
|
|
+ </el-form-item>
|
|
|
+ </td>
|
|
|
+ <td class="align-right">
|
|
|
+ {{row.totalQuantity}}
|
|
|
+ </td>
|
|
|
+ <td class="align-right">
|
|
|
+ {{row.amount}}
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-for="(row,index) in formData.data.quotationEstimateList" :key="index">
|
|
|
+ <tr v-if="row.type == 3">
|
|
|
+ <td :rowspan="getRowSpan(3)" v-if="row.show">
|
|
|
+ 工序
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ {{row.code}}
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ {{row.name}}
|
|
|
+ </td>
|
|
|
+ <td class="align-right">
|
|
|
+ -
|
|
|
+ </td>
|
|
|
+ <td class="align-right">
|
|
|
+ {{row.quantity}}
|
|
|
+ </td>
|
|
|
+ <td class="align-right">
|
|
|
+ <el-form-item label-width="0px" class="margin-b-0" :prop="'quotationEstimateList.' + index + '.price'" :rules="rules.price"
|
|
|
+ :inline-message="true">
|
|
|
+ <el-input-number onmousewheel="return false;" v-model="row.price" placeholder="单价" style="width: 100%" :precision="2"
|
|
|
+ :controls="false" :min="0" @change="changeTotalAmount()" />
|
|
|
+ </el-form-item>
|
|
|
+ </td>
|
|
|
+ <td class="align-right">
|
|
|
+ {{row.totalQuantity}}
|
|
|
+ </td>
|
|
|
+ <td class="align-right">
|
|
|
+ {{row.amount}}
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <tr>
|
|
|
+ <td colspan="7">
|
|
|
+ 合计
|
|
|
+ </td>
|
|
|
+ <td class="align-right">
|
|
|
+ {{formData.data.totalAmount}}
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <!-- <template #chart>
|
|
|
<div style="width:100%;padding-left:25px">
|
|
|
<div ref="chartDom" style="height:300px"></div>
|
|
|
</div>
|
|
@@ -89,15 +340,7 @@
|
|
|
</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">
|
|
@@ -160,12 +403,28 @@
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
- </template>
|
|
|
- </byForm>
|
|
|
- <template #footer v-if="!isDetail">
|
|
|
+ </template> -->
|
|
|
+ </byForm>
|
|
|
+ <div style="text-align:center" class="btn" v-if="!isDetail && formData.data.quotationProductId">
|
|
|
+ <el-button @click="openAddDialog = false" size="default" v-debounce>关 闭</el-button>
|
|
|
+ <!-- <el-button type="primary" @click="handleSubmit(1)" size="default" v-debounce>暂 存</el-button> -->
|
|
|
+ <el-button type="primary" @click="handleSubmit(2)" size="default" v-debounce>提 交</el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- <template #footer v-if="!isDetail">
|
|
|
<el-button @click="openAddDialog = false" size="default" v-debounce>关 闭</el-button>
|
|
|
<el-button type="primary" @click="handleSubmit(1)" size="default" v-debounce>暂 存</el-button>
|
|
|
<el-button type="primary" @click="handleSubmit(2)" size="default" v-debounce>提 交</el-button>
|
|
|
+ </template> -->
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog :title="'物料选择'" v-model="openSelectMaterial" width="90%" destroy-on-close>
|
|
|
+ <SelectMaterial :isNeRawMaterial="'1'" @selectMaterial="selectMaterial"></SelectMaterial>
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="openSelectMaterial = false" size="defualt" v-debounce>关 闭</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -176,6 +435,7 @@ import byTable from "@/components/byTable/index";
|
|
|
import byForm from "@/components/byForm/index";
|
|
|
import { ref } from "vue";
|
|
|
import * as echarts from "echarts";
|
|
|
+import SelectMaterial from "@/components/product/SelectMaterial.vue";
|
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
const sourceList = ref({
|
|
@@ -318,7 +578,7 @@ const config = computed(() => {
|
|
|
},
|
|
|
el: "button",
|
|
|
click() {
|
|
|
- getDtl(row);
|
|
|
+ getDtlOne(row);
|
|
|
},
|
|
|
}
|
|
|
: {},
|
|
@@ -365,55 +625,63 @@ const chartData = ref([]);
|
|
|
const isShowChart = ref(false);
|
|
|
const formConfig = computed(() => {
|
|
|
return [
|
|
|
- {
|
|
|
- type: "title1",
|
|
|
- title: "报价趋势",
|
|
|
- isShow: isShowChart.value,
|
|
|
- },
|
|
|
- {
|
|
|
- type: "slot",
|
|
|
- slotName: "chart",
|
|
|
- isShow: isShowChart.value,
|
|
|
- },
|
|
|
- {
|
|
|
- type: "title1",
|
|
|
- title: "退回原因",
|
|
|
- isShow: isShowBackRemark.value,
|
|
|
- },
|
|
|
- {
|
|
|
- type: "input",
|
|
|
- itemType: "textarea",
|
|
|
- rows: 10,
|
|
|
- prop: "backRemark",
|
|
|
- label: "退回原因",
|
|
|
- itemWidth: 100,
|
|
|
- disabled: true,
|
|
|
- isShow: isShowBackRemark.value,
|
|
|
- },
|
|
|
- {
|
|
|
- type: "title1",
|
|
|
- title: "商品信息",
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // type: "title1",
|
|
|
+ // title: "报价趋势",
|
|
|
+ // isShow: isShowChart.value,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // type: "slot",
|
|
|
+ // slotName: "chart",
|
|
|
+ // isShow: isShowChart.value,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // type: "title1",
|
|
|
+ // title: "退回原因",
|
|
|
+ // isShow: isShowBackRemark.value,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // type: "input",
|
|
|
+ // itemType: "textarea",
|
|
|
+ // rows: 10,
|
|
|
+ // prop: "backRemark",
|
|
|
+ // label: "退回原因",
|
|
|
+ // itemWidth: 100,
|
|
|
+ // disabled: true,
|
|
|
+ // isShow: isShowBackRemark.value,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // type: "title1",
|
|
|
+ // title: "商品信息",
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // type: "slot",
|
|
|
+ // slotName: "commodity",
|
|
|
+ // label: "",
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // type: "title1",
|
|
|
+ // title: "报价总金额",
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // type: "input",
|
|
|
+ // prop: "amount",
|
|
|
+ // label: "报价总金额",
|
|
|
+ // itemWidth: 25,
|
|
|
+ // disabled: true,
|
|
|
+ // },
|
|
|
{
|
|
|
type: "slot",
|
|
|
- slotName: "commodity",
|
|
|
+ slotName: "quotationDetail",
|
|
|
label: "",
|
|
|
},
|
|
|
- {
|
|
|
- type: "title1",
|
|
|
- title: "报价总金额",
|
|
|
- },
|
|
|
- {
|
|
|
- type: "input",
|
|
|
- prop: "amount",
|
|
|
- label: "报价总金额",
|
|
|
- itemWidth: 25,
|
|
|
- disabled: true,
|
|
|
- },
|
|
|
];
|
|
|
});
|
|
|
const rules = ref({
|
|
|
- price: [{ required: true, message: "请输入单价", trigger: "blur" }],
|
|
|
+ price: [{ required: true, message: "单价", trigger: "blur" }],
|
|
|
+ moldId: [{ required: true, message: "请选择模具", trigger: "change" }],
|
|
|
+ quantity: [{ required: true, message: "数量", trigger: "blur" }],
|
|
|
+ totalQuantity: [{ required: true, message: "总量", trigger: "blur" }],
|
|
|
});
|
|
|
const isDetail = ref(false);
|
|
|
const chartOption = reactive({
|
|
@@ -563,6 +831,109 @@ const getDtl = (row, flag = false) => {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+const getFileDataOne = () => {
|
|
|
+ let ids = [];
|
|
|
+ quotationProductList.value.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) => {
|
|
|
+ quotationProductList.value.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 quotationProductList = ref([]);
|
|
|
+const allData = ref({});
|
|
|
+const getDtlOne = (row, flag = false) => {
|
|
|
+ formOption.disabled = flag;
|
|
|
+ isDetail.value = flag;
|
|
|
+ openAddDialog.value = true;
|
|
|
+ proxy.post("/saleQuotation/detail", { id: row.id }).then((res) => {
|
|
|
+ allData.value = res;
|
|
|
+ formData.data = {
|
|
|
+ quotationProductId: "",
|
|
|
+ };
|
|
|
+ // // 是否显示退回原因
|
|
|
+ // if (res.backRemark) {
|
|
|
+ // isShowBackRemark.value = true;
|
|
|
+ // } else {
|
|
|
+ // isShowBackRemark.value = false;
|
|
|
+ // }
|
|
|
+ // 城市数据回显
|
|
|
+ // if (formData.data.buyCountryId) {
|
|
|
+ // getCityData(formData.data.buyCountryId, "20");
|
|
|
+ // }
|
|
|
+ // if (formData.data.buyProvinceId) {
|
|
|
+ // getCityData(formData.data.buyProvinceId, "30");
|
|
|
+ // }
|
|
|
+ // 价格计算
|
|
|
+ quotationProductList.value = res.quotationProductList.map((x) => ({
|
|
|
+ ...x,
|
|
|
+ amount: parseFloat(x.quantity * x.price).toFixed(2),
|
|
|
+ }));
|
|
|
+ if (quotationProductList.value && quotationProductList.value.length > 0) {
|
|
|
+ handleReportPrice(quotationProductList.value[0]);
|
|
|
+ }
|
|
|
+ // changeQuantity();
|
|
|
+ // 文件数据回显
|
|
|
+ getFileDataOne();
|
|
|
+ let productIds = quotationProductList.value.map((x) => x.productId);
|
|
|
+ proxy.getFileData({
|
|
|
+ businessIdList: productIds,
|
|
|
+ data: quotationProductList.value,
|
|
|
+ att: "productId",
|
|
|
+ businessType: "0",
|
|
|
+ fileAtt: "productFile",
|
|
|
+ filePathAtt: "fileUrl",
|
|
|
+ });
|
|
|
+ //折线图
|
|
|
+ // if (res.quotationTrendList && res.quotationTrendList.length >= 2) {
|
|
|
+ // isShowChart.value = true;
|
|
|
+ // nextTick(() => {
|
|
|
+ // myChart = echarts.init(chartDom.value);
|
|
|
+ // window.addEventListener("resize", () => {
|
|
|
+ // myChart.resize();
|
|
|
+ // });
|
|
|
+ // chartData.value = res.quotationTrendList;
|
|
|
+ // chartOption.data.xAxis.data = chartData.value.map((item) => {
|
|
|
+ // return item.createTime.slice(0, 10);
|
|
|
+ // });
|
|
|
+ // chartOption.data.series[0].data = chartData.value.map((item, index) => {
|
|
|
+ // if (item.code == row.code) {
|
|
|
+ // return {
|
|
|
+ // value: item.amount || 0,
|
|
|
+ // itemStyle: { color: "red" },
|
|
|
+ // };
|
|
|
+ // } else {
|
|
|
+ // return item.amount || 0;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // myChart.setOption(chartOption.data);
|
|
|
+ // myChart.resize();
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // isShowChart.value = false;
|
|
|
+ // }
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
const changeQuantity = () => {
|
|
|
if (
|
|
|
formData.data.quotationProductList &&
|
|
@@ -621,30 +992,170 @@ const totalAmount = () => {
|
|
|
formData.data.amount = parseFloat(money).toFixed(2);
|
|
|
};
|
|
|
|
|
|
+// const handleSubmit = (type) => {
|
|
|
+// formDom.value.handleSubmit(() => {
|
|
|
+// if (
|
|
|
+// formData.data.quotationProductList &&
|
|
|
+// formData.data.quotationProductList.length > 0
|
|
|
+// ) {
|
|
|
+// submitLoading.value = true;
|
|
|
+// formData.data.quotationStatus = type;
|
|
|
+// proxy.post("/saleQuotation/edit", formData.data).then(
|
|
|
+// (res) => {
|
|
|
+// proxy.msgTip("操作成功", 1);
|
|
|
+// openAddDialog.value = false;
|
|
|
+// submitLoading.value = false;
|
|
|
+// getList();
|
|
|
+// },
|
|
|
+// (err) => {
|
|
|
+// submitLoading.value = false;
|
|
|
+// }
|
|
|
+// );
|
|
|
+// } else {
|
|
|
+// return proxy.msgTip("请添加至少一件商品", 2);
|
|
|
+// }
|
|
|
+// });
|
|
|
+// };
|
|
|
+
|
|
|
const handleSubmit = (type) => {
|
|
|
formDom.value.handleSubmit(() => {
|
|
|
if (
|
|
|
- formData.data.quotationProductList &&
|
|
|
- formData.data.quotationProductList.length > 0
|
|
|
+ formData.data.quotationEstimateList &&
|
|
|
+ formData.data.quotationEstimateList.length > 0
|
|
|
) {
|
|
|
submitLoading.value = true;
|
|
|
- formData.data.quotationStatus = type;
|
|
|
- proxy.post("/saleQuotation/edit", formData.data).then(
|
|
|
+ proxy.post("/quotationEstimate/addOrEdit", formData.data).then(
|
|
|
(res) => {
|
|
|
proxy.msgTip("操作成功", 1);
|
|
|
- openAddDialog.value = false;
|
|
|
+ // openAddDialog.value = false;
|
|
|
submitLoading.value = false;
|
|
|
- getList();
|
|
|
+ // getList();
|
|
|
+ getDtlOne(allData.value, false);
|
|
|
},
|
|
|
(err) => {
|
|
|
submitLoading.value = false;
|
|
|
}
|
|
|
);
|
|
|
} else {
|
|
|
- return proxy.msgTip("请添加至少一件商品", 2);
|
|
|
+ return proxy.msgTip("无报价明细", 2);
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
+
|
|
|
+const moldData = ref([]);
|
|
|
+const getDict = () => {
|
|
|
+ proxy
|
|
|
+ .post("/moldInfo/page", {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 9999,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ moldData.value = res.rows;
|
|
|
+ });
|
|
|
+};
|
|
|
+getDict();
|
|
|
+
|
|
|
+const handleReportPrice = (item) => {
|
|
|
+ submitLoading.value = true;
|
|
|
+ formData.data = {
|
|
|
+ quotationProductId: item.id,
|
|
|
+ productCode: item.productCode,
|
|
|
+ productName: item.productName,
|
|
|
+ quantity: item.quantity,
|
|
|
+ };
|
|
|
+ proxy
|
|
|
+ .post("/quotationEstimate/detail", {
|
|
|
+ quotationProductId: formData.data.quotationProductId,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ let type1Status = true;
|
|
|
+ let type2Status = true;
|
|
|
+ let type3Status = true;
|
|
|
+ if (res && res.length > 0) {
|
|
|
+ for (let i = 0; i < res.length; i++) {
|
|
|
+ const ele = res[i];
|
|
|
+ if (ele.type == 1 && type1Status) {
|
|
|
+ ele.show = true;
|
|
|
+ type1Status = false;
|
|
|
+ } else if (ele.type == 2 && type2Status) {
|
|
|
+ ele.show = true;
|
|
|
+ type2Status = false;
|
|
|
+ } else if (ele.type == 3 && type3Status) {
|
|
|
+ ele.show = true;
|
|
|
+ type3Status = false;
|
|
|
+ } else {
|
|
|
+ ele.show = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ formData.data.quotationEstimateList = res;
|
|
|
+ }
|
|
|
+ submitLoading.value = false;
|
|
|
+ changeTotalAmount();
|
|
|
+ });
|
|
|
+};
|
|
|
+const openSelectMaterial = ref(false);
|
|
|
+const selectMaterial = (goods) => {
|
|
|
+ let flag = formData.data.quotationEstimateList.some(
|
|
|
+ (x) => x.materialId == goods.id
|
|
|
+ );
|
|
|
+ if (!flag) {
|
|
|
+ formData.data.quotationEstimateList.push({
|
|
|
+ materialId: goods.id,
|
|
|
+ name: goods.name,
|
|
|
+ code: goods.customCode,
|
|
|
+ quantity: 1,
|
|
|
+ price: null,
|
|
|
+ totalQuantity: null,
|
|
|
+ amount: "",
|
|
|
+ type: 2,
|
|
|
+ });
|
|
|
+ proxy.msgTip("选择成功");
|
|
|
+ } else {
|
|
|
+ proxy.msgTip("该物料已选择", 2);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const getRowSpan = (type) => {
|
|
|
+ if (
|
|
|
+ formData.data.quotationEstimateList &&
|
|
|
+ formData.data.quotationEstimateList.length > 0
|
|
|
+ ) {
|
|
|
+ return formData.data.quotationEstimateList.filter((x) => x.type == type)
|
|
|
+ .length;
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const changeTotalAmount = () => {
|
|
|
+ let money = 0;
|
|
|
+ for (let i = 0; i < formData.data.quotationEstimateList.length; i++) {
|
|
|
+ const ele = formData.data.quotationEstimateList[i];
|
|
|
+ let amount = 0;
|
|
|
+ if (ele.type == 1 && ele.moldId) {
|
|
|
+ let mold = moldData.value.find((x) => x.id == ele.moldId);
|
|
|
+ if (mold) {
|
|
|
+ amount = parseFloat(
|
|
|
+ mold.moldLength *
|
|
|
+ mold.moldWidth *
|
|
|
+ Number(ele.price) *
|
|
|
+ Number(ele.totalQuantity)
|
|
|
+ ).toFixed(2);
|
|
|
+ }
|
|
|
+ } else if (ele.type == 2) {
|
|
|
+ ele.totalQuantity = ele.quantity * formData.data.quantity;
|
|
|
+ amount = parseFloat(
|
|
|
+ Number(ele.price) * Number(ele.totalQuantity)
|
|
|
+ ).toFixed(2);
|
|
|
+ } else if (ele.type == 3) {
|
|
|
+ ele.totalQuantity = formData.data.quantity;
|
|
|
+ amount = parseFloat(
|
|
|
+ Number(ele.price) * Number(ele.totalQuantity)
|
|
|
+ ).toFixed(2);
|
|
|
+ }
|
|
|
+ ele.amount = amount;
|
|
|
+ money += Number(parseFloat(amount).toFixed(2));
|
|
|
+ }
|
|
|
+ formData.data.totalAmount = parseFloat(money).toFixed(2);
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
@@ -659,4 +1170,50 @@ const handleSubmit = (type) => {
|
|
|
:deep(.bom-table .el-table__body-wrapper .el-table__body .el-table__row) {
|
|
|
background: #f4f4f5 !important;
|
|
|
}
|
|
|
+.box {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ .left {
|
|
|
+ width: 40%;
|
|
|
+ height: 100%;
|
|
|
+ overflow: auto;
|
|
|
+ border-right: 1px solid #eee;
|
|
|
+ padding: 4px 15px 4px 4px;
|
|
|
+ }
|
|
|
+ .right {
|
|
|
+ width: 60%;
|
|
|
+ height: 100%;
|
|
|
+ overflow: auto;
|
|
|
+ position: relative;
|
|
|
+ padding: 4px 15px;
|
|
|
+ .btn {
|
|
|
+ // position: absolute;
|
|
|
+ // bottom: 20px;
|
|
|
+ // height: 32px;
|
|
|
+ // left: 50%;
|
|
|
+ // transform: translateX(-50%);
|
|
|
+ height: 32px;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ .table {
|
|
|
+ border-collapse: collapse;
|
|
|
+ border-spacing: 0;
|
|
|
+ width: 100%;
|
|
|
+ td,
|
|
|
+ th {
|
|
|
+ text-align: left;
|
|
|
+ padding: 5px;
|
|
|
+ font-size: 12px;
|
|
|
+ // padding: 5px 10px;
|
|
|
+ }
|
|
|
+ .align-right {
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+::v-deep(.el-input-number .el-input__inner) {
|
|
|
+ text-align: right;
|
|
|
+}
|
|
|
</style>
|