|
@@ -0,0 +1,1167 @@
|
|
|
+<template>
|
|
|
+ <div style="width: 100%; padding: 0px 15px">
|
|
|
+ <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom">
|
|
|
+ <template #commodity>
|
|
|
+ <div style="width: 100%;padding-left:25px">
|
|
|
+
|
|
|
+ <el-collapse v-model="activeNames">
|
|
|
+ <el-card style="margin-bottom:15px" v-for="(product,index) in formData.data.quotationProductList" :key="index">
|
|
|
+ <el-collapse-item :name="index">
|
|
|
+ <template #title>
|
|
|
+ <el-row style="width:100%">
|
|
|
+ <el-col :span="6">
|
|
|
+ <div style="font-size:14px;font-weight:700;padding-left:15px;"
|
|
|
+ :style="{background:product.isShowYiJia?'red':'',color:product.isShowYiJia?'#fff':''}">
|
|
|
+ 产品编码:{{product.productCode || '定制产品'}}
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="14" style="display:flex;justify-content:space-around">
|
|
|
+ <span>数量:{{product.quantity}}</span>
|
|
|
+ <span> 业务成本单价:{{moneyFormat(product.businessCostPrice,2)}}</span>
|
|
|
+ <span> 最低价:{{moneyFormat(product.minPrice,2)}}</span>
|
|
|
+ <span> 最高价:{{moneyFormat(product.maxPrice,2)}}</span>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-form-item label="单价" :prop="'quotationProductList.' + index + '.price'" :rules="rules.price" :inline-message="true"
|
|
|
+ class="margin-b-0 wid100" @click.stop>
|
|
|
+ <el-input-number onmousewheel="return false;" v-model="product.price" placeholder="请输入" style="width: 100%" :precision="2"
|
|
|
+ :controls="false" :min="0" @change="changeForeignQuantity()" />
|
|
|
+
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </template>
|
|
|
+ <el-form disabled label-width="100px">
|
|
|
+ <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-table :data="product.quotationProductBomList" style="width: 100%; margin-top: 16px">
|
|
|
+ <el-table-column prop="productName" label="物料名称" />
|
|
|
+ <el-table-column prop="productCode" label="物料编码" />
|
|
|
+ <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>
|
|
|
+ </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 style="width:100%">
|
|
|
+ <el-col :span="12">
|
|
|
+ <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="12">
|
|
|
+ <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" 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" 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" :prop="'quotationProductList.' +index + '.foldWay'" v-if="product.isFold==1"
|
|
|
+ :rules="product.isFold==1?rules.foldWay:''">
|
|
|
+ <el-select v-model="product.foldWay" 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" style="width:100%" multiple placeholder=" ">
|
|
|
+ <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" 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>
|
|
|
+ <div v-for="file in row.fileList" :key="file.id" class="el-click" @click="openImg(file.fileUrl)">
|
|
|
+ {{file.fileName}}
|
|
|
+ </div>
|
|
|
+ </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" />
|
|
|
+ </el-form-item>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
+ </el-collapse-item>
|
|
|
+ </el-card>
|
|
|
+ </el-collapse>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </byForm>
|
|
|
+
|
|
|
+ <el-dialog v-if="openProductCompany" v-model="openProductCompany" title="产品库" width="90%" append-to-body>
|
|
|
+ <SelectProduct @selectProduct="selectProduct"></SelectProduct>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog :title="'物料选择'" v-model="openSelectMaterial" width="90%" destroy-on-close>
|
|
|
+ <SelectMaterial @selectMaterial="selectMaterial"></SelectMaterial>
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="openSelectMaterial = false" size="defualt" v-debounce>关 闭</el-button>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- <el-dialog v-if="copyContract" v-model="copyContract" :title="copyType === 1 ? '报价选择' : '样品单选择'" width="90%" append-to-body>
|
|
|
+ <SelectContract @select="selectContract" v-if="copyType === 1"></SelectContract>
|
|
|
+ <SelectSample @select="selectContract" v-if="copyType === 2"></SelectSample>
|
|
|
+ </el-dialog> -->
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import byForm from "@/components/byForm/index";
|
|
|
+import SelectCompanyProduct from "@/components/product/SelectCompanyProduct.vue";
|
|
|
+import SelectProduct from "@/components/product/SelectProduct.vue";
|
|
|
+import SelectMaterial from "@/components/product/SelectMaterial.vue";
|
|
|
+// import SelectCustomerProduct from "@/components/product/SelectCustomerProduct.vue";
|
|
|
+import selectCity from "@/components/selectCity/index.vue";
|
|
|
+import { useRoute } from "vue-router";
|
|
|
+import SelectContract from "@/components/contractCom/selectContract.vue";
|
|
|
+import SelectSample from "@/components/contractCom/selectSample.vue";
|
|
|
+// import * as echarts from "echarts";
|
|
|
+// import $bus from "@/bus/index.js";
|
|
|
+const route = useRoute();
|
|
|
+const { proxy } = getCurrentInstance();
|
|
|
+// 接收父组件的传值
|
|
|
+const props = defineProps({
|
|
|
+ queryData: Object,
|
|
|
+});
|
|
|
+const packAskData = computed(() => proxy.useUserStore().allDict["pack_ask"]);
|
|
|
+const foldWayData = computed(() => proxy.useUserStore().allDict["fold_way"]);
|
|
|
+const currencyData = computed(
|
|
|
+ () => proxy.useUserStore().allDict["account_currency"]
|
|
|
+);
|
|
|
+const fundsPaymentMethod = computed(
|
|
|
+ () => proxy.useUserStore().allDict["funds_payment_method"]
|
|
|
+);
|
|
|
+const shippingMethod = computed(
|
|
|
+ () => proxy.useUserStore().allDict["shipping_method"]
|
|
|
+);
|
|
|
+const treeData = ref([]);
|
|
|
+const accountList = ref([]);
|
|
|
+const customerList = ref([]);
|
|
|
+const corporationList = ref([]);
|
|
|
+const customerUserList = ref([]);
|
|
|
+const countryData = ref([]);
|
|
|
+const provinceData = ref([]);
|
|
|
+const cityData = ref([]);
|
|
|
+const openProductCompany = ref(false);
|
|
|
+const copyType = ref(1);
|
|
|
+const copyContract = ref(false);
|
|
|
+const indexValue = ref(-1);
|
|
|
+const openSelectMaterial = ref(false);
|
|
|
+const formData = reactive({
|
|
|
+ data: {
|
|
|
+ contractType: "2",
|
|
|
+ rate: 1,
|
|
|
+ quotationProductList: [],
|
|
|
+ },
|
|
|
+});
|
|
|
+const uploadData = ref({});
|
|
|
+const formDom = ref(null);
|
|
|
+const judgeStatus = () => {
|
|
|
+ if (route.query.processType == 20 || route.query.processType == 10) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ if (props.queryData.recordList && props.queryData.recordList.length > 0) {
|
|
|
+ let data = props.queryData.recordList.filter(
|
|
|
+ (item) => item.status === 2 && item.nodeType !== 1
|
|
|
+ );
|
|
|
+ if (data && data.length > 0) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+};
|
|
|
+const formOption = reactive({
|
|
|
+ inline: true,
|
|
|
+ labelWidth: 100,
|
|
|
+ itemWidth: 100,
|
|
|
+ disabled: false,
|
|
|
+});
|
|
|
+const formConfig = computed(() => {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ type: "title1",
|
|
|
+ title: "商品信息",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ slotName: "commodity",
|
|
|
+ label: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "title1",
|
|
|
+ title: "报价总金额",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "amount",
|
|
|
+ label: "报价总金额",
|
|
|
+ itemWidth: 25,
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "title1",
|
|
|
+ title: "备注",
|
|
|
+ isShow: isShowYiJia.value,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ itemType: "textarea",
|
|
|
+ prop: "discussRemark",
|
|
|
+ label: "备注",
|
|
|
+ itemWidth: 100,
|
|
|
+ isShow: isShowYiJia.value,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "title1",
|
|
|
+ title: "附件上传",
|
|
|
+ isShow: isShowYiJia.value,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "upload",
|
|
|
+ listType: "text",
|
|
|
+ accept: "",
|
|
|
+ limit: 3,
|
|
|
+ prop: "discussFileList",
|
|
|
+ label: "附件上传",
|
|
|
+ isShow: isShowYiJia.value,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+});
|
|
|
+const rules = ref({
|
|
|
+ contractType: [
|
|
|
+ { required: true, message: "请选择报价类型", trigger: "change" },
|
|
|
+ ],
|
|
|
+ sellCorporationId: [
|
|
|
+ { required: true, message: "请选择卖方公司", trigger: "change" },
|
|
|
+ ],
|
|
|
+ buyCorporationId: [
|
|
|
+ { required: true, message: "请选择买方公司", trigger: "change" },
|
|
|
+ ],
|
|
|
+ countryId: [{ required: true, message: "请选择国家", trigger: "change" }],
|
|
|
+ sellAddress: [{ required: true, message: "请输入详细地址", trigger: "blur" }],
|
|
|
+ buyAddress: [{ required: true, message: "请输入详细地址", trigger: "blur" }],
|
|
|
+ buyContactName: [
|
|
|
+ { required: true, message: "请输入联系人", trigger: ["change", "blur"] },
|
|
|
+ ],
|
|
|
+ buyContactNumber: [
|
|
|
+ { required: true, message: "请输入联系电话", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
|
|
|
+ // price: [{ required: true, message: "请输入单价", trigger: "blur" }],
|
|
|
+ payName: [
|
|
|
+ { required: true, message: "请输入收费项目", trigger: ["change", "blur"] },
|
|
|
+ ],
|
|
|
+ currency: [{ required: true, message: "请选择币种", trigger: "change" }],
|
|
|
+ paymentMethod: [
|
|
|
+ { required: true, message: "请选择付款方式", trigger: "change" },
|
|
|
+ ],
|
|
|
+ advanceRatio: [
|
|
|
+ { required: true, message: "请输入预付比例", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ transportMethod: [
|
|
|
+ { required: true, message: "请选择运输方式", trigger: "change" },
|
|
|
+ ],
|
|
|
+ remark: [{ required: true, message: "请输入付款条件", trigger: "blur" }],
|
|
|
+ rate: [{ required: true, message: "请输入汇率", trigger: "blur" }],
|
|
|
+ shroffAccountId: [
|
|
|
+ { required: true, message: "请选择收款账号", trigger: "change" },
|
|
|
+ ],
|
|
|
+ // price: [{ required: true, message: "请输入单价", trigger: "blur" }],
|
|
|
+});
|
|
|
+const getDict = () => {
|
|
|
+ proxy
|
|
|
+ .post("/customer/selPage", {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 50,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ customerList.value = res.rows.map((x) => ({
|
|
|
+ ...x,
|
|
|
+ label: x.name,
|
|
|
+ value: x.id,
|
|
|
+ }));
|
|
|
+ });
|
|
|
+
|
|
|
+ proxy
|
|
|
+ .get("/tenantDept/list", {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 9999,
|
|
|
+ keyword: "",
|
|
|
+ tenantId: proxy.useUserStore().user.tenantId,
|
|
|
+ type: 0,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ treeData.value = proxy.handleTree(res.data, "deptId");
|
|
|
+ });
|
|
|
+
|
|
|
+ // proxy.post("/corporation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
|
|
|
+ // corporationList.value = res.rows.map((item) => {
|
|
|
+ // return {
|
|
|
+ // ...item,
|
|
|
+ // label: item.name,
|
|
|
+ // value: item.id,
|
|
|
+ // };
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+
|
|
|
+ // proxy
|
|
|
+ // .post("/accountManagement/page", { pageNum: 1, pageSize: 999 })
|
|
|
+ // .then((res) => {
|
|
|
+ // accountList.value = res.rows.map((item) => {
|
|
|
+ // return {
|
|
|
+ // ...item,
|
|
|
+ // label: item.alias,
|
|
|
+ // value: item.id,
|
|
|
+ // };
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+};
|
|
|
+const getCityData = (id, type, isChange) => {
|
|
|
+ proxy.post("/customizeArea/list", { parentId: id }).then((res) => {
|
|
|
+ if (type === "20") {
|
|
|
+ provinceData.value = res;
|
|
|
+ if (isChange) {
|
|
|
+ formData.data.provinceId = "";
|
|
|
+ formData.data.provinceName = "";
|
|
|
+ formData.data.cityId = "";
|
|
|
+ formData.data.cityName = "";
|
|
|
+ }
|
|
|
+ } else if (type === "30") {
|
|
|
+ cityData.value = res;
|
|
|
+ if (isChange) {
|
|
|
+ formData.data.cityId = "";
|
|
|
+ formData.data.cityName = "";
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ countryData.value = res;
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
+// getDict();
|
|
|
+// getCityData("0");
|
|
|
+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 sellCorporationIdChange = (val) => {
|
|
|
+ if (val) {
|
|
|
+ proxy.post("/corporation/detail", { id: val }).then((res) => {
|
|
|
+ if (formData.data.contractType == "2") {
|
|
|
+ formData.data.sellCountryName = res.countryName;
|
|
|
+ formData.data.sellProvinceName = res.provinceName;
|
|
|
+ formData.data.sellCityName = res.cityName;
|
|
|
+ formData.data.sellAddress = res.address;
|
|
|
+ } else {
|
|
|
+ formData.data.sellCountryName = res.countryEnStr;
|
|
|
+ formData.data.sellProvinceName = res.provinceEnStr;
|
|
|
+ formData.data.sellCityName = res.cityEnStr;
|
|
|
+ formData.data.sellAddress = res.addressEn;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const changeCustomer = (val) => {
|
|
|
+ formData.data.quotationProductList = [];
|
|
|
+ if (val) {
|
|
|
+ proxy.post("/customer/detail", { id: val }).then(
|
|
|
+ (res) => {
|
|
|
+ formData.data.buyCorporationName = res.name;
|
|
|
+ if (res.customerUserList && res.customerUserList.length > 0) {
|
|
|
+ formData.data.buyContactName = res.customerUserList[0].name;
|
|
|
+ if (res.customerUserList[0].contactJson) {
|
|
|
+ let contactJson = JSON.parse(res.customerUserList[0].contactJson);
|
|
|
+ if (contactJson && contactJson.length > 0) {
|
|
|
+ formData.data.buyContactNumber = contactJson[0].contactNo;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ customerUserList.value = res.customerUserList.map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ value: item.name,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // 回填客户的账户信息
|
|
|
+ // formData.data.beneficiaryName = res.beneficiaryName;
|
|
|
+ // formData.data.beneficiaryBank = res.beneficiaryBank;
|
|
|
+ // formData.data.beneficiaryBankAddress = res.beneficiaryBankAddress;
|
|
|
+ // formData.data.beneficiaryAccountNumber = res.beneficiaryAccountNumber;
|
|
|
+ // formData.data.swiftCode = res.swiftCode;
|
|
|
+ // formData.data.beneficiaryAddress = res.beneficiaryAddress;
|
|
|
+
|
|
|
+ formData.data.countryId = res.countryId;
|
|
|
+ formData.data.provinceId = res.provinceId;
|
|
|
+ formData.data.cityId = res.cityId;
|
|
|
+ formData.data.buyPostalCode = res.zipCode;
|
|
|
+ formData.data.buyAddress = res.address;
|
|
|
+ getCityData(formData.data.countryId, "20");
|
|
|
+ if (formData.data.provinceId) {
|
|
|
+ getCityData(formData.data.provinceId, "30");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ formData.data.countryId = "";
|
|
|
+ formData.data.provinceId = "";
|
|
|
+ formData.data.cityId = "";
|
|
|
+ formData.data.buyPostalCode = "";
|
|
|
+ formData.data.buyAddress = "";
|
|
|
+ }
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ formData.data.countryId = "";
|
|
|
+ formData.data.provinceId = "";
|
|
|
+ formData.data.cityId = "";
|
|
|
+ formData.data.buyPostalCode = "";
|
|
|
+ formData.data.buyAddress = "";
|
|
|
+ }
|
|
|
+};
|
|
|
+const createFilter = (queryString) => {
|
|
|
+ return (restaurant) => {
|
|
|
+ return (
|
|
|
+ restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
|
|
|
+ );
|
|
|
+ };
|
|
|
+};
|
|
|
+const querySearchPerson = (queryString, callback) => {
|
|
|
+ const results = queryString
|
|
|
+ ? customerUserList.value.filter(createFilter(queryString))
|
|
|
+ : customerUserList.value;
|
|
|
+ callback(results);
|
|
|
+};
|
|
|
+
|
|
|
+const handlePerson = (item) => {
|
|
|
+ if (item.contactJson) {
|
|
|
+ let data = JSON.parse(item.contactJson);
|
|
|
+ formData.data.buyContactNumber = data[0].contactNo;
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const selectProduct = (goods) => {
|
|
|
+ if (goods && goods.id) {
|
|
|
+ let fileUrl = "";
|
|
|
+ if (goods.fileList && goods.fileList.length > 0) {
|
|
|
+ fileUrl = goods.fileList[0].fileUrl;
|
|
|
+ }
|
|
|
+ formData.data.quotationProductList.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: "",
|
|
|
+ fileList: [],
|
|
|
+ listOne: [],
|
|
|
+ });
|
|
|
+ proxy.msgTip("添加成功", 1);
|
|
|
+ } else {
|
|
|
+ return proxy.msgTip("选择错误", 2);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const handleClickSelectMaterial = (index) => {
|
|
|
+ indexValue.value = index;
|
|
|
+ openSelectMaterial.value = true;
|
|
|
+};
|
|
|
+
|
|
|
+const selectMaterial = (goods) => {
|
|
|
+ console.log(indexValue.value, formData.data.quotationProductList, "ss");
|
|
|
+ let flag = formData.data.quotationProductList[indexValue.value].listOne.some(
|
|
|
+ (x) => x.productId == goods.id
|
|
|
+ );
|
|
|
+ if (!flag) {
|
|
|
+ let fileUrl = "";
|
|
|
+ if (goods.fileList && goods.fileList.length > 0) {
|
|
|
+ fileUrl = goods.fileList[0].fileUrl;
|
|
|
+ }
|
|
|
+ formData.data.quotationProductList[indexValue.value].listOne.push({
|
|
|
+ fileUrl: fileUrl,
|
|
|
+ productId: goods.id,
|
|
|
+ productCnName: goods.name,
|
|
|
+ productCode: goods.customCode,
|
|
|
+ productLength: goods["length"],
|
|
|
+ productWidth: goods.width,
|
|
|
+ productHeight: goods.height,
|
|
|
+ quantity: null,
|
|
|
+ price: null,
|
|
|
+ amount: "",
|
|
|
+ fileList: [],
|
|
|
+ });
|
|
|
+ proxy.msgTip("选择成功");
|
|
|
+ } else {
|
|
|
+ proxy.msgTip("该物料已选择", 2);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const changeProductPrice = () => {
|
|
|
+ let productIds = formData.data.quotationProductList.map((x) => x.productId);
|
|
|
+ if (productIds && productIds.length > 0) {
|
|
|
+ proxy
|
|
|
+ .post("/contract/getProductPriceInfo", {
|
|
|
+ productIds: productIds,
|
|
|
+ customerId: formData.data.buyCorporationId
|
|
|
+ ? formData.data.buyCorporationId
|
|
|
+ : "",
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ for (let i = 0; i < formData.data.quotationProductList.length; i++) {
|
|
|
+ const iele = formData.data.quotationProductList[i];
|
|
|
+ for (const key in res) {
|
|
|
+ if (key == iele.productId) {
|
|
|
+ iele.salePrice = res[key].price;
|
|
|
+ iele.currency = res[key].currency;
|
|
|
+ iele.saleCostPrice = res[key].costPrice;
|
|
|
+ iele.quotationProductList = res[key].quotationProductList
|
|
|
+ .map((x) => ({
|
|
|
+ createTime: x.createTime,
|
|
|
+ price: x.price,
|
|
|
+ currency: x.currency,
|
|
|
+ }))
|
|
|
+ .filter((y, index) => index < 3);
|
|
|
+ iele.contractProductListOne = res[key].quotationProductList.map(
|
|
|
+ (x) => ({
|
|
|
+ createTime: x.createTime,
|
|
|
+ price: x.price,
|
|
|
+ currency: x.currency,
|
|
|
+ })
|
|
|
+ );
|
|
|
+ iele.customerContractProductList = res[
|
|
|
+ key
|
|
|
+ ].customerContractProductList.map((x) => ({
|
|
|
+ createTime: x.createTime,
|
|
|
+ price: x.price,
|
|
|
+ currency: x.currency,
|
|
|
+ }));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+};
|
|
|
+const onPicture = (path) => {
|
|
|
+ window.open(path, "_blank");
|
|
|
+};
|
|
|
+const handleRemove = (index) => {
|
|
|
+ formData.data.quotationProductList.splice(index, 1);
|
|
|
+ totalAmount();
|
|
|
+};
|
|
|
+const calculationAmount = (att = "") => {
|
|
|
+ nextTick(() => {
|
|
|
+ if (
|
|
|
+ formData.data.quotationProductList &&
|
|
|
+ formData.data.quotationProductList.length > 0
|
|
|
+ ) {
|
|
|
+ for (let i = 0; i < formData.data.quotationProductList.length; i++) {
|
|
|
+ let money = 0;
|
|
|
+ money = parseFloat(
|
|
|
+ Number(formData.data.quotationProductList[i].quantity) *
|
|
|
+ Number(formData.data.quotationProductList[i].price)
|
|
|
+ ).toFixed(2);
|
|
|
+ formData.data.quotationProductList[i].amount = money;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ nextTick(() => {
|
|
|
+ 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++) {
|
|
|
+ if (formData.data.quotationProductList[i].amount) {
|
|
|
+ money = parseFloat(
|
|
|
+ Number(money) + Number(formData.data.quotationProductList[i].amount)
|
|
|
+ ).toFixed(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ formData.data.quotationPayList &&
|
|
|
+ formData.data.quotationPayList.length > 0
|
|
|
+ ) {
|
|
|
+ for (let i = 0; i < formData.data.quotationPayList.length; i++) {
|
|
|
+ if (formData.data.quotationPayList[i].amount) {
|
|
|
+ money = parseFloat(
|
|
|
+ Number(money) + Number(formData.data.quotationPayList[i].amount)
|
|
|
+ ).toFixed(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ formData.data.amount = money;
|
|
|
+};
|
|
|
+const clickAdd = () => {
|
|
|
+ if (
|
|
|
+ formData.data.quotationPayList &&
|
|
|
+ formData.data.quotationPayList.length > 0
|
|
|
+ ) {
|
|
|
+ formData.data.quotationPayList.push({
|
|
|
+ payName: "",
|
|
|
+ amount: null,
|
|
|
+ remark: "",
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ formData.data.quotationPayList = [
|
|
|
+ { payName: "", amount: null, remark: "" },
|
|
|
+ ];
|
|
|
+ }
|
|
|
+};
|
|
|
+const handleDelete = (index) => {
|
|
|
+ formData.data.quotationPayList.splice(index, 1);
|
|
|
+ totalAmount();
|
|
|
+};
|
|
|
+
|
|
|
+const handleDeleteMaterial = (index, sonIndex) => {
|
|
|
+ formData.data.quotationProductList[index].listOne.splice(sonIndex, 1);
|
|
|
+};
|
|
|
+
|
|
|
+const querySearch = (queryString, callback) => {
|
|
|
+ proxy.post("/quotationPay/page", { payName: queryString }).then((res) => {
|
|
|
+ if (res.rows && res.rows.length > 0) {
|
|
|
+ res.rows = res.rows.map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ value: item.payName,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ callback(res.rows);
|
|
|
+ } else {
|
|
|
+ callback([]);
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const handleBeforeUpload = async (file, index) => {
|
|
|
+ const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
|
|
|
+ uploadData.value = res.uploadBody;
|
|
|
+ formData.data.quotationProductList[index].fileList = [
|
|
|
+ {
|
|
|
+ id: res.id,
|
|
|
+ fileName: res.fileName,
|
|
|
+ fileUrl: res.fileUrl,
|
|
|
+ uploadState: false,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ formData.data.quotationProductList[index].imageUrl = res.fileUrl;
|
|
|
+ return true;
|
|
|
+};
|
|
|
+
|
|
|
+const handleSuccess = (index) => {
|
|
|
+ formData.data.quotationProductList[index].uploadState = true;
|
|
|
+};
|
|
|
+
|
|
|
+const loadingSearch = ref(false);
|
|
|
+const remoteMethod = (keyword) => {
|
|
|
+ if (keyword && typeof keyword === "string") {
|
|
|
+ loadingSearch.value = true;
|
|
|
+ proxy.post("/customer/selPage", { keyword }).then((res) => {
|
|
|
+ customerList.value = res.rows.map((x) => ({
|
|
|
+ ...x,
|
|
|
+ label: x.name,
|
|
|
+ value: x.id,
|
|
|
+ }));
|
|
|
+ loadingSearch.value = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return;
|
|
|
+};
|
|
|
+
|
|
|
+const handleSubmit = async () => {
|
|
|
+ let flag = await formDom.value.handleSubmit(() => {});
|
|
|
+ if (flag) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ setTimeout(() => {
|
|
|
+ const errorDiv = document.getElementsByClassName("is-error");
|
|
|
+ errorDiv[0].scrollIntoView();
|
|
|
+ }, 0);
|
|
|
+ }
|
|
|
+ return flag;
|
|
|
+};
|
|
|
+
|
|
|
+const getFormData = () => {
|
|
|
+ return proxy.deepClone(formData.data);
|
|
|
+};
|
|
|
+// 向父组件暴露
|
|
|
+defineExpose({
|
|
|
+ getFormData,
|
|
|
+ handleSubmit,
|
|
|
+});
|
|
|
+
|
|
|
+const changeShroffAccount = (val) => {
|
|
|
+ if (val) {
|
|
|
+ let data = accountList.value.find((item) => item.value == val);
|
|
|
+ if (formData.data.contractType == "2") {
|
|
|
+ if (data) {
|
|
|
+ formData.data.beneficiaryName = "";
|
|
|
+ formData.data.beneficiaryBank = "";
|
|
|
+ formData.data.beneficiaryBankAddress = "";
|
|
|
+ formData.data.beneficiaryAccountNumber = "";
|
|
|
+ formData.data.swiftCode = "";
|
|
|
+ formData.data.beneficiaryAddress = "";
|
|
|
+ formData.data.accountName = data.name;
|
|
|
+ formData.data.openingBank = data.openingBank;
|
|
|
+ formData.data.accountOpening = data.accountOpening;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (data) {
|
|
|
+ formData.data.accountName = "";
|
|
|
+ formData.data.openingBank = "";
|
|
|
+ formData.data.accountOpening = "";
|
|
|
+ formData.data.beneficiaryName = data.beneficiaryName;
|
|
|
+ formData.data.beneficiaryBank = data.beneficiaryBank;
|
|
|
+ formData.data.beneficiaryBankAddress = data.beneficiaryBankAddress;
|
|
|
+ formData.data.beneficiaryAccountNumber = data.beneficiaryAccountNumber;
|
|
|
+ formData.data.swiftCode = data.swiftCode;
|
|
|
+ formData.data.beneficiaryAddress = data.beneficiaryAddress;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+const activeNames = ref([]);
|
|
|
+
|
|
|
+let obj = {
|
|
|
+ 1: "定制刀模",
|
|
|
+ 2: "定制纹路",
|
|
|
+ 3: "定制模具",
|
|
|
+};
|
|
|
+const getLabelOne = (type) => {
|
|
|
+ return obj[type];
|
|
|
+};
|
|
|
+const isShowYiJia = ref(false);
|
|
|
+const changeForeignQuantity = () => {
|
|
|
+ let money = 0;
|
|
|
+ let num = 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];
|
|
|
+ if (iele.price > iele.maxPrice || iele.price < iele.minPrice) {
|
|
|
+ num += 1;
|
|
|
+ iele.isShowYiJia = true;
|
|
|
+ } else {
|
|
|
+ iele.isShowYiJia = false;
|
|
|
+ }
|
|
|
+ iele.amount = Number(parseFloat(iele.price * iele.quantity).toFixed(2));
|
|
|
+ money += Number(iele.amount);
|
|
|
+ }
|
|
|
+ formData.data.amount = parseFloat(money).toFixed(2);
|
|
|
+ }
|
|
|
+ isShowYiJia.value = num > 0 ? true : false;
|
|
|
+};
|
|
|
+const getAllData = (businessId) => {
|
|
|
+ proxy.post("/saleQuotation/detail", { id: businessId }).then((res) => {
|
|
|
+ formData.data = res;
|
|
|
+ // formData.data.saleQuotationId = res.id;
|
|
|
+ // 复制原本价格
|
|
|
+ for (let i = 0; i < formData.data.quotationProductList.length; i++) {
|
|
|
+ const iele = formData.data.quotationProductList[i];
|
|
|
+ iele.quotationProductId = iele.id;
|
|
|
+ // iele.guidePrice = iele.price;
|
|
|
+ iele.price = iele.discussPrice;
|
|
|
+ iele.maxPrice = Number(
|
|
|
+ parseFloat((iele.amplifyRatio / 100 + 1) * iele.minPrice).toFixed(2)
|
|
|
+ );
|
|
|
+ // iele.price = iele.minPrice;
|
|
|
+ for (let j = 0; j < iele.quotationProductBomList.length; j++) {
|
|
|
+ const jele = iele.quotationProductBomList[j];
|
|
|
+ jele.quotationProductBomId = jele.id;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ formData.data.quotationProductList &&
|
|
|
+ formData.data.quotationProductList.length > 0
|
|
|
+ ) {
|
|
|
+ for (let i = 0; i < formData.data.quotationProductList.length; i++) {
|
|
|
+ const iele = formData.data.quotationProductList[i];
|
|
|
+ if (iele.packAsk) {
|
|
|
+ iele.packAsk = iele.packAsk.split(",");
|
|
|
+ } else {
|
|
|
+ iele.packAsk = [];
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ iele.quotationProductBomList &&
|
|
|
+ iele.quotationProductBomList.length > 0
|
|
|
+ ) {
|
|
|
+ iele.quotationProductBomList = iele.quotationProductBomList
|
|
|
+ .filter((x) => x.type == 2)
|
|
|
+ .map((x) => ({
|
|
|
+ ...x,
|
|
|
+ materialName: x.productName,
|
|
|
+ materialCode: x.productCode,
|
|
|
+ }));
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ iele.quotationProductCustomInfoList &&
|
|
|
+ iele.quotationProductCustomInfoList.length > 0
|
|
|
+ ) {
|
|
|
+ for (let j = 0; j < iele.quotationProductCustomInfoList.length; j++) {
|
|
|
+ const jele = iele.quotationProductCustomInfoList[j];
|
|
|
+ if (jele.fileList) {
|
|
|
+ jele.fileList = jele.fileList.map((x) => ({
|
|
|
+ ...x,
|
|
|
+ url: x.fileUrl,
|
|
|
+ name: x.fileName,
|
|
|
+ }));
|
|
|
+ } else {
|
|
|
+ jele.fileList = [];
|
|
|
+ }
|
|
|
+ jele.isCheckBox = jele.isCheck == 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ isShowYiJia.value = false;
|
|
|
+ changeForeignQuantity();
|
|
|
+ proxy
|
|
|
+ .getFileData({
|
|
|
+ businessIdList: [formData.data.id],
|
|
|
+ getAll: true,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ console.log(res, "saa");
|
|
|
+ if (res && res[formData.data.id]) {
|
|
|
+ formData.data.discussFileList = res[formData.data.id]
|
|
|
+ .filter((x) => x.businessType == "10")
|
|
|
+ .map((x) => ({ ...x, name: x.fileName, url: x.fileUrl }));
|
|
|
+ } else {
|
|
|
+ formData.data.discussFileList = [];
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ if (currencyData.value && currencyData.value.length > 0) {
|
|
|
+ formData.data.currency = currencyData.value[0].dictKey;
|
|
|
+ }
|
|
|
+ formOption.disabled = judgeStatus();
|
|
|
+ if (route.query && route.query.businessId && route.query.processType) {
|
|
|
+ let businessId = route.query.businessId;
|
|
|
+ getAllData(businessId);
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
+watch(
|
|
|
+ () => props.queryData,
|
|
|
+ (val) => {
|
|
|
+ nextTick(() => {
|
|
|
+ formOption.disabled = judgeStatus();
|
|
|
+ });
|
|
|
+ if (val.businessId && val.processType) {
|
|
|
+ getAllData(val.businessId);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ deep: true,
|
|
|
+ immediate: true,
|
|
|
+ }
|
|
|
+);
|
|
|
+const showPriceInfo = () => {
|
|
|
+ if (props.queryData.processType) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (route.query.processType) {
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+};
|
|
|
+const optionTwo = reactive({
|
|
|
+ data: {
|
|
|
+ tooltip: {
|
|
|
+ trigger: "axis",
|
|
|
+ },
|
|
|
+ // legend: {
|
|
|
+ // data: ["价格"],
|
|
|
+ // },
|
|
|
+ grid: {
|
|
|
+ left: "3%",
|
|
|
+ right: "4%",
|
|
|
+ top: "10%",
|
|
|
+ bottom: "3%",
|
|
|
+ containLabel: true,
|
|
|
+ },
|
|
|
+ // toolbox: {
|
|
|
+ // feature: {
|
|
|
+ // saveAsImage: {},
|
|
|
+ // },
|
|
|
+ // },
|
|
|
+ xAxis: {
|
|
|
+ type: "category",
|
|
|
+ boundaryGap: false,
|
|
|
+ data: [],
|
|
|
+ },
|
|
|
+ yAxis: {
|
|
|
+ type: "value",
|
|
|
+ },
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ name: "价格",
|
|
|
+ type: "line",
|
|
|
+ data: [],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+});
|
|
|
+const showEcharts = (row, index) => {
|
|
|
+ let myChart = null;
|
|
|
+ myChart = echarts.init(proxy.$refs[row.productId + index]);
|
|
|
+ window.addEventListener("resize", () => {
|
|
|
+ myChart.resize();
|
|
|
+ });
|
|
|
+ if (row.contractProductListOne && row.contractProductListOne.length > 0) {
|
|
|
+ optionTwo.data.xAxis.data = row.contractProductListOne.map((item) => {
|
|
|
+ return item.createTime.slice(0, 10);
|
|
|
+ });
|
|
|
+ optionTwo.data.series[0].data = row.contractProductListOne.map((item) => {
|
|
|
+ return item.price;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ optionTwo.data.xAxis.data = [];
|
|
|
+ optionTwo.data.series[0].data = [];
|
|
|
+ }
|
|
|
+ myChart.setOption(optionTwo.data);
|
|
|
+ myChart.resize();
|
|
|
+};
|
|
|
+
|
|
|
+const clickCopy = (type) => {
|
|
|
+ copyType.value = type;
|
|
|
+ copyContract.value = true;
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.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;
|
|
|
+}
|
|
|
+// :deep(.el-collapse-item) {
|
|
|
+// margin-bottom: 10px;
|
|
|
+// }
|
|
|
+:deep(.el-collapse-item__header) {
|
|
|
+ background-color: #eee;
|
|
|
+}
|
|
|
+</style>
|