|
@@ -106,7 +106,7 @@
|
|
|
<el-option v-for="item in customerList" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-row style="width: 100%">
|
|
|
+ <!-- <el-row style="width: 100%">
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="地址" class="wid100 margin-b-0">
|
|
|
<el-row style="padding-right:5px;width:100%">
|
|
@@ -146,15 +146,17 @@
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- </el-row>
|
|
|
+ </el-row> -->
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<template #commodity>
|
|
|
<div style="width: 100%;padding-left:25px">
|
|
|
+ <el-button type="warning" @click="clickPushProduct" plain style="margin-bottom: 16px" v-if="!isDetail"
|
|
|
+ :disabled="!formData.data.companyId">定制</el-button>
|
|
|
<el-button type="primary" @click="openProductCompany = true" plain style="margin-bottom: 16px" v-if="!isDetail"
|
|
|
- :disabled="!formData.data.companyId">产品库</el-button>
|
|
|
- <el-table :data="formData.data.quotationProductList" style="width: 100%;" default-expand-all>
|
|
|
+ :disabled="!formData.data.companyId">选择产品库</el-button>
|
|
|
+ <!-- <el-table :data="formData.data.quotationProductList" style="width: 100%;" default-expand-all>
|
|
|
<el-table-column type="expand" width="50" align="center">
|
|
|
<template #default="scope">
|
|
|
<div style="padding-left:50px">
|
|
@@ -179,35 +181,6 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <!-- <el-table-column label="数量" width="110">
|
|
|
- <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" v-if="row.type==2" @change="changeQuantity()" />
|
|
|
- <span v-else>{{row.quantity}}</span>
|
|
|
- </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%">
|
|
|
- <span v-if="row.price">¥ {{row.price}}</span>
|
|
|
- <span v-else>待报价</span>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="amount" label="小计" width="110">
|
|
|
- <template #default="{ row, $index }">
|
|
|
- <div style="width: 100%">
|
|
|
- <span v-if="row.amount">¥ {{row.amount}}</span>
|
|
|
- <span v-else>一</span>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column> -->
|
|
|
<el-table-column label="备注" width="180">
|
|
|
<template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
@@ -280,7 +253,255 @@
|
|
|
<el-button type="primary" link @click="handleRemove($index)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- </el-table>
|
|
|
+ </el-table> -->
|
|
|
+
|
|
|
+ <el-collapse v-model="activeNames">
|
|
|
+ <el-collapse-item :name="index" v-for="(product,index) in formData.data.quotationProductList" :key="index">
|
|
|
+ <template #title>
|
|
|
+ <!-- <TitleInfo :content="'主材'"></TitleInfo> -->
|
|
|
+ <div style="font-size:14px;font-weight:700;padding-left:25px;width:300px">
|
|
|
+ 产品编码:{{product.productCode}}
|
|
|
+ </div>
|
|
|
+ <el-form-item label="数量" class="margin-b-0" style="width:300px !important;" :prop="'quotationProductList.' +index + '.quantity'"
|
|
|
+ :rules="rules.quantity" :inline-message="true" @click.stop>
|
|
|
+ <el-input-number v-model="product.quantity" placeholder="请输入" style="width: 100%" :precision="0" :controls="false" :min="1"
|
|
|
+ onmousewheel="return false;" />
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ <div style="width:100%">
|
|
|
+ <div style="margin:10px 0">
|
|
|
+ <TitleInfo :content="'主材'"></TitleInfo>
|
|
|
+ </div>
|
|
|
+ <div style="width: 100%;padding-left:15px">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item :prop="'quotationProductList.' +index + '.rawMaterialId'" :rules="rules.rawMaterialId" :inline-message="true"
|
|
|
+ label="原材料" class="wid100">
|
|
|
+ <el-select v-model="product.rawMaterialId" placeholder="请选择" style="width:100%">
|
|
|
+ <el-option v-for="item in rawMaterialData" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="颜色" class="margin-b-0 wid100">
|
|
|
+ <el-row style="width: 100%">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item prop="productColor" label-width="0px" class="margin-b-0 wid100">
|
|
|
+ <el-input v-model="product.productColor" placeholder="颜色" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item prop="colorCardCode" label-width="0px" class="margin-b-0 wid100">
|
|
|
+ <el-input v-model="product.colorCardCode" placeholder="色卡号" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="尺寸" class="margin-b-0 wid100" required>
|
|
|
+ <el-row style="width:100%">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item :prop="'quotationProductList.' +index + '.productLength'" :rules="rules.productLength"
|
|
|
+ :inline-message="true" label-width="0px" class="margin-b-0 wid100">
|
|
|
+ <el-input-number v-model="product.productLength" placeholder="长 (cm)" style="width: 100%" :precision="2"
|
|
|
+ :controls="false" :min="0" onmousewheel="return false;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item :prop="'quotationProductList.' +index + '.productWidth'" :rules="rules.productWidth"
|
|
|
+ :inline-message="true" label-width="0px" class="margin-b-0 wid100">
|
|
|
+ <el-input-number v-model="product.productWidth" placeholder="宽 (cm)" style="width: 100%" :precision="2"
|
|
|
+ :controls="false" :min="0" onmousewheel="return false;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item :prop="'quotationProductList.' +index + '.productHeight'" :rules="rules.productHeight"
|
|
|
+ :inline-message="true" label-width="0px" class="margin-b-0 wid100">
|
|
|
+ <el-input-number v-model="product.productHeight" placeholder="高 (cm)" style="width: 100%" :precision="2"
|
|
|
+ :controls="false" :min="0" onmousewheel="return false;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="净重(kg)" prop="netWeight" class="margin-b-0 wid100">
|
|
|
+ <el-input-number v-model="product.netWeight" placeholder="请输入" style="width: 100%" :precision="2" :controls="false" :min="0"
|
|
|
+ onmousewheel="return false;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div style="margin:10px 0">
|
|
|
+ <TitleInfo :content="'辅材'"></TitleInfo>
|
|
|
+ </div>
|
|
|
+ <div style="width: 100%;padding-left:15px">
|
|
|
+ <el-button type="primary" @click="handleClickSelectMaterial(index)" plain>选择包材/配件/辅材</el-button>
|
|
|
+ <el-table :data="product.quotationProductBomList" style="width: 100%; margin-top: 16px">
|
|
|
+ <el-table-column prop="materialName" label="物料名称" min-width="130" />
|
|
|
+ <el-table-column prop="materialCode" label="物料编码" width="150" />
|
|
|
+ <el-table-column label="数量" width="150">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-form-item :prop="'quotationProductList.' + 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" />
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" width="60" align="center" fixed="right">
|
|
|
+ <template #default="{ $index }">
|
|
|
+ <el-button type="primary" link @click="handleRemoveBom(index,$index)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div style="margin:10px 0">
|
|
|
+ <TitleInfo :content="'附加工艺要求'"></TitleInfo>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div style="width:100%;padding-left:15px">
|
|
|
+ <div class="small-title">
|
|
|
+ ① 工艺线路
|
|
|
+ </div>
|
|
|
+ <el-row style="width:100%">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="工艺产线" class="wid100" :prop="'quotationProductList.' + index + '.technologyId'"
|
|
|
+ :rules="rules.technologyId" :inline-message="true">
|
|
|
+ <el-select v-model="product.technologyId" placeholder="请选择" style="width:100%">
|
|
|
+ <el-option v-for="item in technologyData" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <div class="small-title">
|
|
|
+ ② LOGO
|
|
|
+ </div>
|
|
|
+ <el-row style="width:100%">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="LOGO尺寸" class="wid100">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label-width="0px" class="margin-b-0 wid100" :prop="'quotationProductList.' +index + '.logoLength'"
|
|
|
+ :rules="rules.logoLength" :inline-message="true">
|
|
|
+ <el-input-number v-model="product.logoLength" placeholder="长 (cm)" style="width: 100%" :precision="2"
|
|
|
+ :controls="false" :min="0" onmousewheel="return false;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label-width="0px" class="margin-b-0 wid100" :prop="'quotationProductList.' +index + '.logoWidth'"
|
|
|
+ :rules="rules.logoWidth" :inline-message="true">
|
|
|
+ <el-input-number v-model="product.logoWidth" placeholder="宽 (cm)" style="width: 100%" :precision="2" :controls="false"
|
|
|
+ :min="0" onmousewheel="return false;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label-width="0px" class="margin-b-0 wid100" :prop="'quotationProductList.' +index + '.logoHeight'"
|
|
|
+ :rules="rules.logoHeight" :inline-message="true">
|
|
|
+ <el-input-number v-model="product.logoHeight" placeholder="高 (cm)" style="width: 100%" :precision="2"
|
|
|
+ :controls="false" :min="0" onmousewheel="return false;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="几色印刷" class="wid100">
|
|
|
+ <el-input-number v-model="product.colorCount" placeholder="请输入" style="width: 100%" :precision="0" :controls="false"
|
|
|
+ :min="1" onmousewheel="return false;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <div class="small-title">
|
|
|
+ ③ 折叠
|
|
|
+ </div>
|
|
|
+ <el-row style="width:100%">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="是否折叠" class="wid100">
|
|
|
+ <el-select v-model="product.isFold" placeholder="请选择" style="width:100%">
|
|
|
+ <el-option :label="'否'" :value="0" />
|
|
|
+ <el-option :label="'是'" :value="1" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="折叠数" class="wid100" v-if="product.isFold==1">
|
|
|
+ <el-select v-model="product.foldWay" placeholder="请选择" style="width:100%">
|
|
|
+ <el-option v-for="item in foldWayData" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <div class="small-title">
|
|
|
+ ④ 包装要求
|
|
|
+ </div>
|
|
|
+ <el-row style="width:100%">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="包装要求" class="wid100">
|
|
|
+ <el-select v-model="product.packAsk" placeholder="请选择" style="width:100%" multiple>
|
|
|
+ <el-option v-for="item in packAskData" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <div class="small-title">
|
|
|
+ ⑤ 是否定制
|
|
|
+ </div>
|
|
|
+ <el-row style="width:100%">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item prop="isCustomized" label="是否定制" class="wid100">
|
|
|
+ <el-select v-model="product.isCustomized" placeholder="请选择" style="width:100%">
|
|
|
+ <el-option :label="'否'" :value="0" />
|
|
|
+ <el-option :label="'是'" :value="1" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row style="width:100%">
|
|
|
+ <el-form-item label="定制内容" class="wid100" v-if="product.isCustomized==1">
|
|
|
+ <table style="width:100%" border class="table">
|
|
|
+ <tr>
|
|
|
+ <td style="width:20%">
|
|
|
+ </td>
|
|
|
+ <td style="width:40%">附件</td>
|
|
|
+ <td style="width:40%">备注</td>
|
|
|
+ </tr>
|
|
|
+ <tr v-for="(row,sonIndex) in product.quotationProductCustomInfoList" :key="sonIndex">
|
|
|
+ <td>
|
|
|
+ <el-checkbox v-model="row.isCheckBox" label="" /> <span style="position:relative;top:-2px">
|
|
|
+ {{getLabelOne(row.type)}}</span>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <el-upload :file-list="row.fileList" :action="uploadUrl" :data="uploadData" :limit="1" :list-type="'text'"
|
|
|
+ :before-upload="(file)=>handleBeforeUploadOne(file,index,sonIndex)"
|
|
|
+ :on-success="()=>handleSuccessOne(index,sonIndex)" :on-remove="(file)=>handleRemoveFile(file,index,sonIndex)"
|
|
|
+ :on-preview="onPreviewFile" :on-exceed="()=>msgTip(`上传文件数量不可大于1`, 2)">
|
|
|
+ <el-button text type="primary">上传附件</el-button>
|
|
|
+ </el-upload>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <el-form-item :prop="'quotationProductList.' + index + '.quotationProductCustomInfoList.' + sonIndex + '.remark'"
|
|
|
+ :rules="row.isCheckBox?rules.remark:''" :inline-message="true" class="margin-b-0 wid100">
|
|
|
+ <el-input v-model="row.remark" placeholder="请输入备注" />
|
|
|
+ </el-form-item>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-collapse-item>
|
|
|
+
|
|
|
+ </el-collapse>
|
|
|
</div>
|
|
|
</template>
|
|
|
</byForm>
|
|
@@ -598,6 +819,9 @@ import * as echarts from "echarts";
|
|
|
import PriceSheetDetailList from "@/views/EHSD/saleContract/PriceSheetDetailList";
|
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
+const uploadData = ref({});
|
|
|
+const packAskData = computed(() => proxy.useUserStore().allDict["pack_ask"]);
|
|
|
+const foldWayData = computed(() => proxy.useUserStore().allDict["fold_way"]);
|
|
|
const companyId = ref("");
|
|
|
const accountList = ref([]);
|
|
|
const corporationList = ref([]);
|
|
@@ -750,7 +974,7 @@ const config = computed(() => {
|
|
|
attrs: {
|
|
|
label: "客户名称",
|
|
|
prop: "buyCorporationName",
|
|
|
- "min-width": 150,
|
|
|
+ "min-width": 170,
|
|
|
},
|
|
|
},
|
|
|
{
|
|
@@ -851,6 +1075,28 @@ const getList = async (req) => {
|
|
|
};
|
|
|
getDict();
|
|
|
getList();
|
|
|
+const rawMaterialData = ref([]);
|
|
|
+const technologyData = ref([]);
|
|
|
+const getRawMaterialData = () => {
|
|
|
+ proxy.post("/productInfo/page", { productClassifyId: 100 }).then((res) => {
|
|
|
+ rawMaterialData.value = res.rows.map((x) => ({
|
|
|
+ ...x,
|
|
|
+ label:
|
|
|
+ x.name +
|
|
|
+ "," +
|
|
|
+ x.customCode +
|
|
|
+ "," +
|
|
|
+ `${x["length"]}*${x.width}*${x.height}(cm)` +
|
|
|
+ "," +
|
|
|
+ x.color,
|
|
|
+ value: x.id,
|
|
|
+ }));
|
|
|
+ });
|
|
|
+ proxy.post("/technology/page", { pageNum: 1, pageSize: 999 }).then((res) => {
|
|
|
+ technologyData.value = res.rows;
|
|
|
+ });
|
|
|
+};
|
|
|
+getRawMaterialData();
|
|
|
const openAddDialog = ref(false);
|
|
|
const submitLoading = ref(false);
|
|
|
const modalType = ref("add");
|
|
@@ -1106,20 +1352,20 @@ const formConfig = computed(() => {
|
|
|
label: "",
|
|
|
itemWidth: 100,
|
|
|
},
|
|
|
- {
|
|
|
- type: "input",
|
|
|
- itemType: "text",
|
|
|
- label: "联系人",
|
|
|
- prop: "buyContactName",
|
|
|
- itemWidth: 50,
|
|
|
- },
|
|
|
- {
|
|
|
- type: "input",
|
|
|
- itemType: "text",
|
|
|
- label: "联系人电话",
|
|
|
- prop: "buyContactNumber",
|
|
|
- itemWidth: 50,
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // type: "input",
|
|
|
+ // itemType: "text",
|
|
|
+ // label: "联系人",
|
|
|
+ // prop: "buyContactName",
|
|
|
+ // itemWidth: 50,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // type: "input",
|
|
|
+ // itemType: "text",
|
|
|
+ // label: "联系人电话",
|
|
|
+ // prop: "buyContactNumber",
|
|
|
+ // itemWidth: 50,
|
|
|
+ // },
|
|
|
{
|
|
|
type: "title1",
|
|
|
title: "商品信息",
|
|
@@ -1143,7 +1389,7 @@ const formConfig = computed(() => {
|
|
|
];
|
|
|
});
|
|
|
const rules = ref({
|
|
|
- type: [{ required: true, message: "请选择报价类型", trigger: "change" }],
|
|
|
+ // type: [{ required: true, message: "请选择报价类型", trigger: "change" }],
|
|
|
ofCompanyId: [
|
|
|
{ required: true, message: "请选择业务公司", trigger: "change" },
|
|
|
],
|
|
@@ -1152,6 +1398,22 @@ const rules = ref({
|
|
|
{ required: true, message: "请选择客户公司", trigger: "change" },
|
|
|
],
|
|
|
quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
|
|
|
+ productLength: [
|
|
|
+ { required: true, message: "请输入长 (cm)", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ productWidth: [
|
|
|
+ { required: true, message: "请输入宽 (cm)", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ productHeight: [
|
|
|
+ { required: true, message: "请输入高 (cm)", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ rawMaterialId: [
|
|
|
+ { required: true, message: "请选择原材料", trigger: "change" },
|
|
|
+ ],
|
|
|
+ technologyId: [
|
|
|
+ { required: true, message: "请选择工艺产线", trigger: "change" },
|
|
|
+ ],
|
|
|
+ remark: [{ required: true, message: "请输入备注", trigger: "blur" }],
|
|
|
});
|
|
|
|
|
|
const getCityData = (id, type, isChange = false) => {
|
|
@@ -1240,31 +1502,58 @@ const handlePerson = (item) => {
|
|
|
}
|
|
|
};
|
|
|
const quotationProductBomList = ref([]);
|
|
|
-const selectProduct = (goods) => {
|
|
|
- if (goods && goods.id) {
|
|
|
- let fileUrl = "";
|
|
|
- if (goods.fileList && goods.fileList.length > 0) {
|
|
|
- fileUrl = goods.fileList[0].fileUrl;
|
|
|
- }
|
|
|
- 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["materialLength"],
|
|
|
- productWidth: x.materialWidth,
|
|
|
- productHeight: x.materialHeight,
|
|
|
- quantity: x.quantity || null,
|
|
|
- allQuantity: "",
|
|
|
- price: null,
|
|
|
- amount: "",
|
|
|
- fileList: [],
|
|
|
- type: x.type,
|
|
|
- }));
|
|
|
+const productCustomInfoListData = ref([
|
|
|
+ {
|
|
|
+ type: 1,
|
|
|
+ isCheck: 0,
|
|
|
+ isCheckBox: false,
|
|
|
+ fileList: [],
|
|
|
+ remark: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 2,
|
|
|
+ isCheck: 0,
|
|
|
+ isCheckBox: false,
|
|
|
+ fileList: [],
|
|
|
+ remark: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 3,
|
|
|
+ isCheck: 0,
|
|
|
+ isCheckBox: false,
|
|
|
+ fileList: [],
|
|
|
+ remark: "",
|
|
|
+ },
|
|
|
+]);
|
|
|
+const selectProduct = (row) => {
|
|
|
+ if (row && row.id) {
|
|
|
+ proxy.post("/productInfo/detail", { id: row.id }).then((res) => {
|
|
|
+ let goods = res;
|
|
|
+ if (goods.productBomDetailList && goods.productBomDetailList.length > 0) {
|
|
|
+ let quotationProductCustomInfoList = goods.productCustomInfoList.map(
|
|
|
+ (x) => {
|
|
|
+ if (x.fileList) {
|
|
|
+ x.fileList = x.fileList.map((y) => ({
|
|
|
+ ...y,
|
|
|
+ url: y.fileUrl,
|
|
|
+ name: y.fileName,
|
|
|
+ }));
|
|
|
+ } else {
|
|
|
+ x.fileList = [];
|
|
|
+ }
|
|
|
+ x.isCheckBox = x.isCheck == 1;
|
|
|
+ delete x.id;
|
|
|
+ return x;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ if (goods.isCustomized == 0) {
|
|
|
+ quotationProductCustomInfoList = productCustomInfoListData.value;
|
|
|
+ }
|
|
|
+ let packAsk = goods.packAsk;
|
|
|
+ if (packAsk) {
|
|
|
+ packAsk = packAsk.split(",");
|
|
|
+ }
|
|
|
formData.data.quotationProductList.push({
|
|
|
- fileUrl: fileUrl,
|
|
|
productId: goods.id,
|
|
|
productName: goods.name,
|
|
|
productCode: goods.customCode,
|
|
@@ -1272,21 +1561,26 @@ const selectProduct = (goods) => {
|
|
|
productWidth: goods.width,
|
|
|
productHeight: goods.height,
|
|
|
productColor: goods.color,
|
|
|
+ colorCardCode: goods.colorCardCode,
|
|
|
+ netWeight: goods.netWeight,
|
|
|
quantity: null,
|
|
|
price: null,
|
|
|
amount: "",
|
|
|
fileList: [],
|
|
|
- quotationProductBomList: quotationProductBomList.value,
|
|
|
+ rawMaterialId: goods.rawMaterialId,
|
|
|
+ technologyId: goods.technologyId,
|
|
|
+ logoLength: goods.logoLength,
|
|
|
+ logoWidth: goods.logoWidth,
|
|
|
+ logoHeight: goods.logoHeight,
|
|
|
+ colorCount: goods.colorCount,
|
|
|
+ isFold: goods.isFold || 0,
|
|
|
+ foldWay: goods.foldWay,
|
|
|
+ packAsk: packAsk,
|
|
|
+ isCustomized: goods.isCustomized || 0,
|
|
|
+ quotationProductBomList: goods.productBomDetailList,
|
|
|
+ quotationProductCustomInfoList: quotationProductCustomInfoList,
|
|
|
});
|
|
|
proxy.msgTip("添加成功", 1);
|
|
|
- let ids = quotationProductBomList.value.map((x) => x.materialId);
|
|
|
- proxy.getFile(
|
|
|
- ids,
|
|
|
- quotationProductBomList.value,
|
|
|
- "materialId",
|
|
|
- "fileList",
|
|
|
- "fileUrl"
|
|
|
- );
|
|
|
} else {
|
|
|
return proxy.msgTip("该产品未配置BOM", 2);
|
|
|
}
|
|
@@ -1295,12 +1589,105 @@ const selectProduct = (goods) => {
|
|
|
return proxy.msgTip("选择错误", 2);
|
|
|
}
|
|
|
};
|
|
|
+const clickPushProduct = () => {
|
|
|
+ let quotationProductCustomInfoList = productCustomInfoListData.value;
|
|
|
+ formData.data.quotationProductList.push({
|
|
|
+ productId: "",
|
|
|
+ productName: "",
|
|
|
+ productCode: "",
|
|
|
+ productLength: null,
|
|
|
+ productWidth: null,
|
|
|
+ productHeight: null,
|
|
|
+ productColor: "",
|
|
|
+ colorCardCode: "",
|
|
|
+ netWeight: null,
|
|
|
+ quantity: null,
|
|
|
+ price: null,
|
|
|
+ amount: "",
|
|
|
+ fileList: [],
|
|
|
+ rawMaterialId: "",
|
|
|
+ technologyId: "",
|
|
|
+ logoLength: null,
|
|
|
+ logoWidth: null,
|
|
|
+ logoHeight: null,
|
|
|
+ colorCount: null,
|
|
|
+ isFold: 0,
|
|
|
+ foldWay: "",
|
|
|
+ packAsk: [],
|
|
|
+ isCustomized: 0,
|
|
|
+ quotationProductBomList: [],
|
|
|
+ quotationProductCustomInfoList: quotationProductCustomInfoList,
|
|
|
+ });
|
|
|
+ proxy.msgTip("添加成功", 1);
|
|
|
+};
|
|
|
+// const selectProduct = (goods) => {
|
|
|
+// if (goods && goods.id) {
|
|
|
+// let fileUrl = "";
|
|
|
+// if (goods.fileList && goods.fileList.length > 0) {
|
|
|
+// fileUrl = goods.fileList[0].fileUrl;
|
|
|
+// }
|
|
|
+// 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["materialLength"],
|
|
|
+// productWidth: x.materialWidth,
|
|
|
+// productHeight: x.materialHeight,
|
|
|
+// quantity: x.quantity || null,
|
|
|
+// allQuantity: "",
|
|
|
+// price: null,
|
|
|
+// amount: "",
|
|
|
+// fileList: [],
|
|
|
+// type: x.type,
|
|
|
+// }));
|
|
|
+// formData.data.quotationProductList.push({
|
|
|
+// fileUrl: fileUrl,
|
|
|
+// productId: goods.id,
|
|
|
+// productName: goods.name,
|
|
|
+// productCode: goods.customCode,
|
|
|
+// productLength: goods["length"],
|
|
|
+// productWidth: goods.width,
|
|
|
+// productHeight: goods.height,
|
|
|
+// productColor: goods.color,
|
|
|
+// quantity: null,
|
|
|
+// price: null,
|
|
|
+// amount: "",
|
|
|
+// fileList: [],
|
|
|
+// quotationProductBomList: quotationProductBomList.value,
|
|
|
+// });
|
|
|
+// proxy.msgTip("添加成功", 1);
|
|
|
+// let ids = quotationProductBomList.value.map((x) => x.materialId);
|
|
|
+// proxy.getFile(
|
|
|
+// ids,
|
|
|
+// quotationProductBomList.value,
|
|
|
+// "materialId",
|
|
|
+// "fileList",
|
|
|
+// "fileUrl"
|
|
|
+// );
|
|
|
+// } else {
|
|
|
+// return proxy.msgTip("该产品未配置BOM", 2);
|
|
|
+// }
|
|
|
+// });
|
|
|
+// } else {
|
|
|
+// return proxy.msgTip("选择错误", 2);
|
|
|
+// }
|
|
|
+// };
|
|
|
|
|
|
const handleClickSelectMaterial = (index) => {
|
|
|
indexValue.value = index;
|
|
|
openSelectMaterial.value = true;
|
|
|
};
|
|
|
|
|
|
+const handleRemoveBom = (index, sonIndex) => {
|
|
|
+ formData.data.quotationProductList[index].quotationProductBomList.splice(
|
|
|
+ sonIndex,
|
|
|
+ 1
|
|
|
+ );
|
|
|
+};
|
|
|
+
|
|
|
const selectMaterial = (goods) => {
|
|
|
let flag = formData.data.quotationProductList[
|
|
|
indexValue.value
|
|
@@ -1315,11 +1702,11 @@ const selectMaterial = (goods) => {
|
|
|
].quotationProductBomList.push({
|
|
|
fileUrl: fileUrl,
|
|
|
materialId: goods.id,
|
|
|
- productName: goods.name,
|
|
|
- productCode: goods.customCode,
|
|
|
- productLength: goods["length"],
|
|
|
- productWidth: goods.width,
|
|
|
- productHeight: goods.height,
|
|
|
+ materialName: goods.name,
|
|
|
+ materialCode: goods.customCode,
|
|
|
+ // productLength: goods["length"],
|
|
|
+ // productWidth: goods.width,
|
|
|
+ // productHeight: goods.height,
|
|
|
quantity: null,
|
|
|
price: null,
|
|
|
amount: "",
|
|
@@ -1332,6 +1719,37 @@ const selectMaterial = (goods) => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+// const selectMaterial = (goods) => {
|
|
|
+// let flag = formData.data.quotationProductList[
|
|
|
+// indexValue.value
|
|
|
+// ].quotationProductBomList.some((x) => x.materialId == goods.id);
|
|
|
+// if (!flag) {
|
|
|
+// let fileUrl = "";
|
|
|
+// if (goods.fileList && goods.fileList.length > 0) {
|
|
|
+// fileUrl = goods.fileList[0].fileUrl;
|
|
|
+// }
|
|
|
+// formData.data.quotationProductList[
|
|
|
+// indexValue.value
|
|
|
+// ].quotationProductBomList.push({
|
|
|
+// fileUrl: fileUrl,
|
|
|
+// materialId: goods.id,
|
|
|
+// productName: goods.name,
|
|
|
+// productCode: goods.customCode,
|
|
|
+// productLength: goods["length"],
|
|
|
+// productWidth: goods.width,
|
|
|
+// productHeight: goods.height,
|
|
|
+// quantity: null,
|
|
|
+// price: null,
|
|
|
+// amount: "",
|
|
|
+// fileList: [],
|
|
|
+// type: 2,
|
|
|
+// });
|
|
|
+// proxy.msgTip("选择成功");
|
|
|
+// } else {
|
|
|
+// proxy.msgTip("该物料已选择", 2);
|
|
|
+// }
|
|
|
+// };
|
|
|
+
|
|
|
const onPicture = (path) => {
|
|
|
window.open(path, "_blank");
|
|
|
};
|
|
@@ -1413,10 +1831,46 @@ const handleSubmit = (type) => {
|
|
|
formData.data.quotationProductList &&
|
|
|
formData.data.quotationProductList.length > 0
|
|
|
) {
|
|
|
+ let data = proxy.deepClone(formData.data);
|
|
|
+ for (let i = 0; i < data.quotationProductList.length; i++) {
|
|
|
+ const iele = data.quotationProductList[i];
|
|
|
+ if (
|
|
|
+ !(
|
|
|
+ iele.quotationProductBomList &&
|
|
|
+ iele.quotationProductBomList.length > 0
|
|
|
+ )
|
|
|
+ ) {
|
|
|
+ return proxy.msgTip("请添加辅材", 2);
|
|
|
+ }
|
|
|
+ iele.quotationProductBomList.push({
|
|
|
+ materialId: iele.rawMaterialId,
|
|
|
+ type: 1,
|
|
|
+ });
|
|
|
+ if (iele.packAsk) {
|
|
|
+ iele.packAsk = iele.packAsk.join(",");
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ iele.quotationProductCustomInfoList &&
|
|
|
+ iele.quotationProductCustomInfoList.length > 0
|
|
|
+ ) {
|
|
|
+ for (let j = 0; j < iele.quotationProductCustomInfoList.length; j++) {
|
|
|
+ let jele = iele.quotationProductCustomInfoList[j];
|
|
|
+ jele.isCheck = jele.isCheckBox ? 1 : 0;
|
|
|
+ if (jele.isCheckBox) {
|
|
|
+ if (!(jele.fileList && jele.fileList.length > 0)) {
|
|
|
+ return proxy.msgTip(
|
|
|
+ `请上传第${i + 1}条数据的${getLabel(jele.type)}附件`,
|
|
|
+ 2
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
submitLoading.value = true;
|
|
|
- formData.data.status = type;
|
|
|
+ data.status = type;
|
|
|
if (isChange.value) {
|
|
|
- proxy.post("/saleQuotation/change", formData.data).then(
|
|
|
+ proxy.post("/saleQuotation/change", data).then(
|
|
|
(res) => {
|
|
|
proxy.msgTip("操作成功", 1);
|
|
|
openAddDialog.value = false;
|
|
@@ -1429,7 +1883,7 @@ const handleSubmit = (type) => {
|
|
|
}
|
|
|
);
|
|
|
} else {
|
|
|
- proxy.post("/saleQuotation/" + modalType.value, formData.data).then(
|
|
|
+ proxy.post("/saleQuotation/" + modalType.value, data).then(
|
|
|
(res) => {
|
|
|
proxy.msgTip("操作成功", 1);
|
|
|
openAddDialog.value = false;
|
|
@@ -1998,6 +2452,70 @@ const changeForeignQuantity = () => {
|
|
|
formData.data.amount = parseFloat(money).toFixed(2);
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
+const activeNames = ref([]);
|
|
|
+
|
|
|
+let obj = {
|
|
|
+ 1: "定制刀模",
|
|
|
+ 2: "定制纹路",
|
|
|
+ 3: "定制模具",
|
|
|
+};
|
|
|
+const getLabelOne = (type) => {
|
|
|
+ return obj[type];
|
|
|
+};
|
|
|
+
|
|
|
+const handleBeforeUploadOne = async (file, index, sonIndex) => {
|
|
|
+ const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
|
|
|
+ file.id = res.id;
|
|
|
+ file.fileUrl = res.fileUrl;
|
|
|
+ uploadData.value = res.uploadBody;
|
|
|
+ formData.data.quotationProductList[index].quotationProductCustomInfoList[
|
|
|
+ sonIndex
|
|
|
+ ].fileData = res;
|
|
|
+ return true;
|
|
|
+};
|
|
|
+
|
|
|
+const handleSuccessOne = (index, sonIndex) => {
|
|
|
+ if (
|
|
|
+ formData.data.quotationProductList[index].quotationProductCustomInfoList[
|
|
|
+ sonIndex
|
|
|
+ ].fileData &&
|
|
|
+ formData.data.quotationProductList[index].quotationProductCustomInfoList[
|
|
|
+ sonIndex
|
|
|
+ ].fileData.fileUrl
|
|
|
+ ) {
|
|
|
+ let file =
|
|
|
+ formData.data.quotationProductList[index].quotationProductCustomInfoList[
|
|
|
+ sonIndex
|
|
|
+ ].fileData;
|
|
|
+ formData.data.quotationProductList[index].quotationProductCustomInfoList[
|
|
|
+ sonIndex
|
|
|
+ ].fileList.push({
|
|
|
+ id: file.id,
|
|
|
+ fileName: file.fileName,
|
|
|
+ name: file.fileName,
|
|
|
+ url: file.fileUrl,
|
|
|
+ fileUrl: file.fileUrl,
|
|
|
+ });
|
|
|
+ formData.data.quotationProductList[index].quotationProductCustomInfoList[
|
|
|
+ sonIndex
|
|
|
+ ].fileData = {};
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const handleRemoveFile = (file, index, sonIndex) => {
|
|
|
+ formData.data.quotationProductList[index].quotationProductCustomInfoList[
|
|
|
+ sonIndex
|
|
|
+ ].fileList.splice(sonIndex, 1);
|
|
|
+};
|
|
|
+
|
|
|
+const onPreviewFile = (file) => {
|
|
|
+ if (file && file.fileUrl) {
|
|
|
+ window.open(file.fileUrl, "_blank");
|
|
|
+ } else {
|
|
|
+ window.open(file.raw.fileUrl, "_blank");
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
@@ -2028,5 +2546,25 @@ const changeForeignQuantity = () => {
|
|
|
:deep(.bom-table .el-table__body-wrapper .el-table__body .el-table__row) {
|
|
|
background: #f4f4f5 !important;
|
|
|
}
|
|
|
+
|
|
|
+.table {
|
|
|
+ border-collapse: collapse;
|
|
|
+ border-spacing: 0;
|
|
|
+
|
|
|
+ td {
|
|
|
+ text-align: center;
|
|
|
+ padding: 2px 4px;
|
|
|
+ // padding: 5px 10px;
|
|
|
+ }
|
|
|
+}
|
|
|
+.small-title {
|
|
|
+ padding-left: 15px;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ color: #3366ff;
|
|
|
+ font-size: 14px;
|
|
|
+}
|
|
|
+:deep(.el-checkbox) {
|
|
|
+ margin-right: 0px;
|
|
|
+}
|
|
|
</style>
|
|
|
|