12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964 |
- <template>
- <div class="pageIndexClass">
- <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" :selectConfig="selectConfig"
- highlight-current-row :action-list="[
-
- ]" @get-list="getList">
- <template #code="{ item }">
- <div style="width: 100%">
- <span style="color: #409eff; cursor: pointer; word-break: break-all" @click="getDtlOne(item,true,0)">{{ item.code }}</span>
- </div>
- </template>
- <template #status="{ item }">
- <div style="width: 100%">
- <span :style="{color: item.status ==88? 'red' :''}">{{dictValueLabel(item.status, statusData)}}</span>
- </div>
- </template>
- <template #quotationStatus="{item}">
- <div style="width: 100%">
- <span
- :class="{ 'tag-active-1': item.quotationStatus==1, 'tag-active': item.quotationStatus==2 }">{{dictValueLabel(item.quotationStatus, quotationStatusData)}}</span>
- </div>
- </template>
- <template #amount="{ item }">
- <div>
- <!-- <span style="padding-right: 4px">{{ item.currency }}</span> -->
- <span>{{ moneyFormat(item.prodAmount, 2) }}</span>
- </div>
- </template>
- <template #product="{ item }">
- <div style="width:100%;">
- <el-popover placement="bottom-start" title="" :width="300" trigger="hover">
- <div default>
- <div v-for="(product,index) in item.quotationProductList">
- {{index+1}}、{{product.productName}}
- <!-- <span v-if="index<item.quotationProductList.length-1">,</span> -->
- </div>
- </div>
- <template #reference>
- <div style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;cursor:pointer">
- <span v-for="(product,index) in item.quotationProductList">
- {{product.productName}}
- <span v-if="index<item.quotationProductList.length-1"> , </span>
- </span>
- </div>
- </template>
- </el-popover>
- </div>
- </template>
- </byTable>
- <el-dialog v-if="openAddDialog" v-model="openAddDialog" title="报价评估" width="98%" 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="handleLookDetail(item,index)">查看</el-button>
- <el-button plain type="primary" @click="handleReportPrice(item,index)">报价</el-button>
- </div>
- <el-table :data="[item]" style="width: 100%;">
- <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="prodPrice" fixed="right">
- <template #default="{ row, $index }">
- <div style="width: 100%;">
- <span :style="{
- color:row.prodPrice?'red':''
- }">¥{{row.prodPrice}}</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.prodPrice?'red':''
- }">¥{{row.amount}}</span>
- </div>
- </template>
- </el-table-column>
- </el-table>
- </el-card> -->
- <el-form disabled label-width="80px">
- <el-collapse v-model="activeNames">
- <el-card style="margin-bottom:15px" v-for="(product,index) in quotationProductList" :key="index">
- <el-collapse-item :name="index">
- <template #title>
- <el-row style="width:100%">
- <el-col :span="8">
- <div style="font-size:14px;font-weight:700;padding-left:10px">
- 产品编码:{{product.productCode || '定制产品'}}
- </div>
- </el-col>
- <el-col :span="4">
- <!-- <el-form-item label="数量" class="margin-b-0" :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> -->
- <span>数量:{{product.quantity}}</span>
- </el-col>
- <el-col :span="4">
- <!-- <el-form-item label="单价" class="margin-b-0" @click.stop>
- <el-input-number v-model="product.price" placeholder="" style="width: 100%" :precision="2" :controls="false" :min="1"
- onmousewheel="return false;" disabled />
- </el-form-item> -->
- 单价:<span :style="{color:product.prodPrice?'red':''}">{{product.prodPrice}}</span>
- </el-col>
- <el-col :span="4">
- <!-- <el-form-item label="总价" class="margin-b-0" @click.stop>
- <el-input-number v-model="product.amount" placeholder="" style="width: 100%" :precision="2" :controls="false" :min="1"
- onmousewheel="return false;" disabled />
- </el-form-item> -->
- 总价:<span :style="{color:product.prodPrice?'red':''}">{{product.amount}}</span>
- </el-col>
- <el-col :span="4" style="padding-left:10px">
- <!-- <el-button plain type="primary" @click="handleReportPrice(product,index)">报价</el-button> -->
- <span class="el-click" @click.stop="handleReportPrice(product,index)">报价</span>
- </el-col>
- </el-row>
- </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-col :span="12">
- <el-form-item label="尺寸" 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-row>
- <el-row>
- <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="'BOM'"></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="物料名称" width="170" />
- <el-table-column prop="productCode" label="物料编码" width="180" />
- <el-table-column label="规格尺寸(cm)" width="130">
- <template #default="{ row, $index }">
- <div style="width: 100%" v-if="row.productLength&&row.productWidth && row.productHeight">
- {{row.productLength}}*{{row.productWidth}}*{{row.productHeight}}
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="productColor" label="颜色" width="170" />
- <el-table-column prop="quantity" label="数量" width="100" />
- <el-table-column prop="standardDosage" label="标准用量" width="100" />
- <el-table-column prop="lossRate" label="损耗率(%)" width="100" />
- <el-table-column prop="remark" label="备注" min-width="150" />
- </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-collapse-item>
- </el-card>
- </el-collapse>
- </el-form>
- </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:15%">
- 编码
- </th>
- <th style="width:15%">
- 名称
- </th>
- <th style="width:8%" class="align-right">
- 一出几
- </th>
- <th style="width:16%" class="align-right">
- 模具
- </th>
- <th style="width:9%" class="align-right">
- 数量/件
- </th>
- <th style="width:9%" 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 + '.cavityNum'"
- :rules="rules.cavityNum" :inline-message="true">
- <el-input-number onmousewheel="return false;" v-model="row.cavityNum" placeholder="一出几" style="width: 100%" :precision="0"
- :controls="false" :min="1" @change="(val)=>changeCavityNum(val,index)" />
- </el-form-item>
- </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="(val)=>changeMoldId(val,index)">
- <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="4"
- :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">
- -
- </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="4"
- :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">
- -
- </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="4"
- :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="8">
- 合计
- </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>
- </template>
- <template #commodity>
- <div style="width: 100%;padding-left:25px">
- <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">
- <div style="margin-bottom:10px;margin-left:-20px">
- <TitleInfo content='BOM单:'></TitleInfo>
- </div>
- <el-table :data="scope.row.quotationProductBomList" style="width: 100%;" border class="bom-table">
- <el-table-column label="图片" width="80">
- <template #default="{ row }">
- <div v-if="row.fileUrl">
- <img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
- </div>
- <div v-else></div>
- </template>
- </el-table-column>
- <el-table-column prop="productCode" label="物料编码" width="190" />
- <el-table-column prop="productName" label="物料名称" min-width="200" />
- <el-table-column label="规格尺寸 (cm)" 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">
- <template #default="{ row, $index }">
- <div style="width: 100%">
- ¥ {{row.price}}
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="amount" label="小计" width="120">
- <template #default="{ row, $index }">
- <div style="width: 100%">
- ¥ {{row.amount}}
- </div>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </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>
- <div style="text-align:center" v-if="!isDetail">
- <el-button type="primary" @click="handleSubmitOne()" size="default" v-debounce>提交</el-button>
- </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 v-if="detailDialog" v-model="detailDialog" :title="formData.detailsData.productCode+`(${formData.detailsData.productName})产品详情`"
- width="60%" append-to-body>
- <byForm :formConfig="detailsFormConfig" :formOption="detailsFormOption" v-model="formData.detailsData">
- <template #detail>
- <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 label="原材料" class="wid100">
- <el-select v-model="formData.detailsData.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="formData.detailsData.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="formData.detailsData.colorCardCode" placeholder="" />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="尺寸" 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="formData.detailsData.productLength" placeholder="" 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="formData.detailsData.productWidth" placeholder="" 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="formData.detailsData.productHeight" placeholder="" 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-row>
- <el-row>
- <el-col :span="12">
- <el-form-item label="净重(kg)" prop="netWeight" class="margin-b-0 wid100">
- <el-input-number v-model="formData.detailsData.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="'BOM'"></TitleInfo>
- </div>
- <div style="width: 100%;padding-left:15px">
- <el-table :data="formData.detailsData.quotationProductBomList" style="width: 100%;">
- <el-table-column prop="productName" label="物料名称" width="170" />
- <el-table-column prop="productCode" label="物料编码" width="180" />
- <el-table-column label="规格尺寸(cm)" width="130">
- <template #default="{ row, $index }">
- <div style="width: 100%" v-if="row.productLength&&row.productWidth && row.productHeight">
- {{row.productLength}}*{{row.productWidth}}*{{row.productHeight}}
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="productColor" label="颜色" width="170" />
- <el-table-column prop="quantity" label="数量" width="100" />
- <el-table-column prop="standardDosage" label="标准用量" width="100" />
- <el-table-column prop="lossRate" label="损耗率(%)" width="100" />
- <el-table-column prop="remark" label="备注" min-width="150" />
- </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="formData.detailsData.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="formData.detailsData.logoLength" placeholder="" 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="formData.detailsData.logoWidth" placeholder="" 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="formData.detailsData.logoHeight" placeholder="" 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="formData.detailsData.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="formData.detailsData.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="formData.detailsData.isFold==1">
- <el-select v-model="formData.detailsData.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="formData.detailsData.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="formData.detailsData.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 prop="technologyId" label="定制内容" class="wid100" v-if="formData.detailsData.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 formData.detailsData.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" placeholder="" />
- </el-form-item>
- </td>
- </tr>
- </table>
- </el-form-item>
- </el-row>
- </div>
- </div>
- </template>
- </byForm>
- <template #footer>
- <el-button @click="detailDialog = false" 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>
- <el-dialog title="打印" v-if="openPrint" v-model="openPrint" width="840">
- <QuotationPDF :rowData="rowData"></QuotationPDF>
- </el-dialog>
- </div>
- </template>
- <script setup>
- 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";
- import QuotationPDF from "@/components/PDF/quotationPDF.vue";
- const { proxy } = getCurrentInstance();
- const packAskData = computed(() => proxy.useUserStore().allDict["pack_ask"]);
- const foldWayData = computed(() => proxy.useUserStore().allDict["fold_way"]);
- const sourceList = ref({
- data: [],
- pagination: {
- total: 0,
- pageNum: 1,
- pageSize: 10,
- keyword: "",
- status: "",
- type: "",
- quotationStatus: "",
- companyId: "",
- quotationTimeSta: "",
- quotationTimeEnd: "",
- beginTime: "",
- endTime: "",
- isEstimate: "1",
- },
- });
- const loading = ref(false);
- const openAddDialog = ref(false);
- const statusData = ref([
- {
- label: "草稿",
- value: 0,
- },
- {
- label: "正常",
- value: 30,
- },
- {
- label: "作废",
- value: 88,
- },
- ]);
- const quotationStatusData = ref([
- {
- label: "未报价",
- value: 0,
- },
- {
- label: "报价中",
- value: 1,
- },
- {
- label: "已报价",
- value: 2,
- },
- ]);
- const selectConfig = computed(() => {
- return [
- {
- label: "业务公司",
- prop: "ofCompanyId",
- data: proxy.useUserStore().allDict["list_company_data"],
- },
- {
- label: "报价单状态",
- prop: "status",
- data: statusData.value,
- },
- {
- label: "工厂报价状态",
- prop: "quotationStatus",
- data: quotationStatusData.value,
- },
- {
- type: "time",
- label: "报价时间",
- placeholder: "开始日期",
- prop: "quotationTimeSta",
- placeholderOne: "结束日期",
- propOne: "quotationTimeEnd",
- },
- ];
- });
- const config = computed(() => {
- return [
- {
- attrs: {
- label: "业务公司",
- prop: "ofCompanyName",
- width: 110,
- },
- },
- {
- attrs: {
- label: "报价单号",
- slot: "code",
- width: 180,
- },
- },
- {
- attrs: {
- label: "报价单状态",
- slot: "status",
- width: 100,
- },
- },
- {
- attrs: {
- label: "工厂报价状态",
- slot: "quotationStatus",
- width: 130,
- },
- },
- {
- attrs: {
- label: "报价金额",
- slot: "amount",
- width: 120,
- },
- },
- {
- attrs: {
- label: "报价时间",
- prop: "quotationTime",
- width: 160,
- },
- },
- {
- attrs: {
- label: "创建时间",
- prop: "createTime",
- width: 160,
- },
- },
- {
- attrs: {
- label: "报价单产品",
- slot: "product",
- "min-width": 180,
- },
- },
- {
- attrs: {
- label: "操作",
- width: 120,
- align: "center",
- fixed: "right",
- },
- renderHTML(row) {
- return [
- row.quotationStatus < 2 && row.status == 30
- ? {
- attrs: {
- label: "报价",
- type: "primary",
- text: true,
- },
- el: "button",
- click() {
- getDtlOne(row, false, 0);
- },
- }
- : {},
- row.quotationStatus == 2 && row.status == 30
- ? {
- attrs: {
- label: "打印",
- type: "primary",
- text: true,
- },
- el: "button",
- click() {
- handlePrint(row);
- },
- }
- : {},
- ];
- },
- },
- ];
- });
- const getList = async (req) => {
- sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
- loading.value = true;
- proxy.post("/saleQuotation/page", sourceList.value.pagination).then((res) => {
- res.rows.forEach((x) => {
- x.addTagShow = false;
- if (x.tag) {
- x.tags = x.tag.split(",");
- } else {
- x.tags = [];
- }
- });
- sourceList.value.data = res.rows;
- sourceList.value.pagination.total = res.total;
- setTimeout(() => {
- loading.value = false;
- }, 200);
- });
- };
- getList();
- const rawMaterialData = ref([]);
- const technologyData = ref([]);
- const getRawMaterialData = () => {
- proxy.post("/productInfo/page", { productClassifyId: 110 }).then((res) => {
- rawMaterialData.value = res.rows.map((x) => ({
- label: x.name + "," + x.customCode,
- value: x.id,
- }));
- });
- proxy.post("/technology/page", { pageNum: 1, pageSize: 999 }).then((res) => {
- technologyData.value = res.rows;
- });
- };
- getRawMaterialData();
- const formDom = ref(null);
- const submitLoading = ref(false);
- const formData = reactive({
- data: {},
- detailsData: {},
- });
- const formOption = reactive({
- inline: true,
- labelWidth: 100,
- itemWidth: 100,
- disabled: false,
- });
- const isShowBackRemark = ref(false);
- let myChart = null;
- const chartDom = ref(null);
- 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: "slot",
- // slotName: "commodity",
- // label: "",
- // },
- // {
- // type: "title1",
- // title: "报价总金额",
- // },
- // {
- // type: "input",
- // prop: "amount",
- // label: "报价总金额",
- // itemWidth: 25,
- // disabled: true,
- // },
- {
- type: "slot",
- slotName: "quotationDetail",
- label: "",
- },
- ];
- });
- const rules = ref({
- 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({
- data: {
- tooltip: {
- trigger: "axis",
- },
- // legend: {
- // data: ["价格"],
- // },
- grid: {
- left: "3%",
- right: "6%",
- top: "10%",
- bottom: "3%",
- containLabel: true,
- },
- tooltip: {
- show: true,
- trigger: "axis",
- // 格式化函数
- // valueFormatter: (val) => {
- // return val + "aaa";
- // },
- formatter: (params, ticket, callback) => {
- return `
- ${params[0].seriesName}:${params[0].value}
- <br/>
- 报价单号:${chartData.value[params[0].dataIndex].code}
- `;
- },
- textStyle: {
- fontSize: 12,
- },
- },
- // toolbox: {
- // feature: {
- // saveAsImage: {},
- // },
- // },
- xAxis: {
- type: "category",
- boundaryGap: false,
- data: [],
- },
- yAxis: {
- type: "value",
- },
- series: [
- {
- name: "报价金额",
- type: "line",
- symbolSize: 10,
- data: [],
- },
- ],
- },
- });
- const getFileData = () => {
- let ids = [];
- formData.data.quotationProductList.map((x) => {
- // ids.push(x.productId);
- x.quotationProductBomList.map((y) => {
- ids.push(y.materialId);
- });
- });
- ids = Array.from(new Set(ids));
- proxy
- .post("/fileInfo/getList", {
- businessIdList: ids,
- })
- .then((fileObj) => {
- formData.data.quotationProductList.map((x) => {
- // x.fileList = fileObj[x.productId] || [];
- // if (x.fileList && x.fileList.length > 0) {
- // x.fileUrl = x.fileList[0].fileUrl;
- // }
- x.quotationProductBomList.map((y) => {
- y.fileList = fileObj[y.materialId] || [];
- if (y.fileList && y.fileList.length > 0) {
- y.fileUrl = y.fileList[0].fileUrl;
- }
- });
- });
- });
- };
- const getDtl = (row, flag = false) => {
- formOption.disabled = flag;
- isDetail.value = flag;
- openAddDialog.value = true;
- proxy.post("/saleQuotation/detail", { id: row.id }).then((res) => {
- formData.data = res;
- // 是否显示退回原因
- 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");
- // }
- // 价格计算
- changeQuantity();
- // 文件数据回显
- getFileData();
- let productIds = formData.data.quotationProductList.map((x) => x.productId);
- proxy.getFileData({
- businessIdList: productIds,
- data: formData.data.quotationProductList,
- 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 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, index = 0) => {
- 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.quotationProductList && res.quotationProductList.length > 0) {
- for (let i = 0; i < res.quotationProductList.length; i++) {
- const iele = res.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
- // );
- // }
- 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;
- }
- }
- }
- }
- quotationProductList.value = res.quotationProductList.map((x) => ({
- ...x,
- amount: parseFloat(x.quantity * x.prodPrice).toFixed(2),
- }));
- if (quotationProductList.value && quotationProductList.value.length > 0) {
- handleReportPrice(quotationProductList.value[index], index);
- }
- // getFileDataOne();
- // let productIds = quotationProductList.value.map((x) => x.productId);
- // proxy.getFileData({
- // businessIdList: productIds,
- // data: quotationProductList.value,
- // att: "productId",
- // businessType: "0",
- // fileAtt: "productFile",
- // filePathAtt: "fileUrl",
- // });
- });
- };
- const changeQuantity = () => {
- if (
- formData.data.quotationProductList &&
- formData.data.quotationProductList.length > 0
- ) {
- for (let i = 0; i < formData.data.quotationProductList.length; i++) {
- let iele = formData.data.quotationProductList[i];
- if (iele.quantity) {
- for (let j = 0; j < iele.quotationProductBomList.length; j++) {
- const jele = iele.quotationProductBomList[j];
- if (!jele.price) {
- jele.price = jele.costPrice;
- }
- jele.allQuantity = iele.quantity * jele.quantity;
- }
- }
- }
- totalAmount();
- }
- };
- const totalAmount = () => {
- let money = 0;
- if (
- formData.data.quotationProductList &&
- formData.data.quotationProductList.length > 0
- ) {
- // 先算单个产品的价格
- for (let i = 0; i < formData.data.quotationProductList.length; i++) {
- let iele = formData.data.quotationProductList[i];
- let productPrice = 0;
- for (let j = 0; j < iele.quotationProductBomList.length; j++) {
- const jele = iele.quotationProductBomList[j];
- productPrice += Number(
- parseFloat(Number(jele.quantity) * Number(jele.price)).toFixed(2)
- );
- }
- iele.price = parseFloat(productPrice).toFixed(2);
- }
- for (let i = 0; i < formData.data.quotationProductList.length; i++) {
- let iele = formData.data.quotationProductList[i];
- iele.amount = parseFloat(
- Number(iele.quantity) * Number(iele.price)
- ).toFixed(2);
- money += Number(iele.amount);
- for (let j = 0; j < iele.quotationProductBomList.length; j++) {
- const jele = iele.quotationProductBomList[j];
- jele.amount = parseFloat(
- Number(jele.allQuantity) * Number(jele.price)
- ).toFixed(2);
- }
- }
- }
- formData.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.quotationEstimateList &&
- formData.data.quotationEstimateList.length > 0
- ) {
- submitLoading.value = true;
- proxy.post("/quotationEstimate/addOrEdit", formData.data).then(
- (res) => {
- proxy.msgTip("操作成功", 1);
- // openAddDialog.value = false;
- submitLoading.value = false;
- // getList();
- getDtlOne(allData.value, false, currentIndex.value);
- },
- (err) => {
- submitLoading.value = false;
- }
- );
- } else {
- return proxy.msgTip("无报价明细", 2);
- }
- });
- };
- const handleSubmitOne = () => {
- let listLength = 0;
- for (let i = 0; i < quotationProductList.value.length; i++) {
- const ele = quotationProductList.value[i];
- if (ele.prodPrice && Number(ele.prodPrice) > 0) {
- listLength += 1;
- }
- }
- if (listLength == quotationProductList.value.length) {
- proxy
- .msgConfirm()
- .then((res) => {
- proxy
- .post("/quotationEstimate/submitQuotation", {
- quotationId: allData.value.id,
- })
- .then((res) => {
- proxy.msgTip("操作成功", 1);
- openAddDialog.value = false;
- getList();
- });
- })
- .catch((err) => {});
- } else {
- return proxy.msgTip("还有未报价的商品", 2);
- }
- };
- const moldData = ref([]);
- const getDict = () => {
- proxy
- .post("/moldInfo/page", {
- pageNum: 1,
- pageSize: 9999,
- })
- .then((res) => {
- moldData.value = res.rows.map((x) => ({
- ...x,
- area: Number(parseFloat(x.moldLength * x.moldWidth).toFixed(2)),
- moldName:
- x.moldName + `(${x.moldLength}*${x.moldWidth}*${x.moldHeight})`,
- }));
- });
- };
- getDict();
- let currentIndex = ref(-1);
- const currentProduct = ref({});
- const handleReportPrice = (item, index) => {
- currentProduct.value = item;
- currentIndex.value = index;
- 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);
- };
- const openPrint = ref(false);
- const rowData = ref({});
- const handlePrint = (row) => {
- openPrint.value = true;
- rowData.value = row;
- };
- const changeTotalQuantity = (index) => {
- formData.data.quotationEstimateList[index].totalQuantity = Math.ceil(
- currentProduct.value.quantity /
- formData.data.quotationEstimateList[index].cavityNum
- );
- changeTotalAmount();
- };
- const changeCavityNum = (val, index) => {
- let { productLength, productWidth } = currentProduct.value;
- if (val) {
- // 单个产品所需的长
- let realityProductLength = productLength + 2;
- // 单个产品所需的宽
- let realityProductWidth = productWidth + 2;
- // 计算商品所需的理论面积
- let theoryArea = realityProductLength * realityProductWidth * val;
- // 计算模具的理论面积
- for (let i = 0; i < moldData.value.length; i++) {
- const ele = moldData.value[i];
- // 计算模具可做产品数量的理论面积
- // 第一种面积
- let theoryLength =
- Math.floor(ele.moldLength / realityProductLength) *
- realityProductLength;
- let theoryWidth =
- Math.floor(ele.moldWidth / realityProductWidth) * realityProductWidth;
- let theoryArea = Number(
- parseFloat(theoryLength * theoryWidth).toFixed(2)
- );
- // 第二种面积
- let theoryLengthOne =
- Math.floor(ele.moldLength / realityProductWidth) * realityProductWidth;
- let theoryWidthOne =
- Math.floor(ele.moldWidth / realityProductLength) * realityProductLength;
- let theoryAreaOne = Number(
- parseFloat(theoryLengthOne * theoryWidthOne).toFixed(2)
- );
- ele.theoryArea = theoryArea >= theoryAreaOne ? theoryArea : theoryAreaOne;
- }
- // 过滤出模具理论面积 >= 商品的理论面积
- let filterData = moldData.value.filter((x) => x.theoryArea >= theoryArea);
- // 取出面积最小的模具
- if (filterData && filterData.length > 0) {
- let sortList = filterData.sort((a, b) => a.area - b.area);
- formData.data.quotationEstimateList[index].moldId = sortList[0].id;
- } else {
- formData.data.quotationEstimateList[index].moldId = "";
- return proxy.msgTip("未找到合适的模具", 2);
- }
- changeTotalQuantity(index);
- }
- };
- const changeMoldId = (val, index) => {
- let { productLength, productWidth } = currentProduct.value;
- // 一出几
- let cavityNum = formData.data.quotationEstimateList[index].cavityNum || 1;
- // 单个产品所需的长
- let realityProductLength = productLength + 2;
- // 单个产品所需的宽
- let realityProductWidth = productWidth + 2;
- // 计算商品所需的理论面积
- let productTheoryArea =
- realityProductLength * realityProductWidth * cavityNum;
- // 计算商品的总面积
- if (val && cavityNum) {
- for (let i = 0; i < moldData.value.length; i++) {
- const ele = moldData.value[i];
- if (ele.id == val) {
- // 计算模具可做产品数量的理论面积
- // 第一种面积
- let theoryLength =
- Math.floor(ele.moldLength / realityProductLength) *
- realityProductLength;
- let theoryWidth =
- Math.floor(ele.moldWidth / realityProductWidth) * realityProductWidth;
- let theoryArea = Number(
- parseFloat(theoryLength * theoryWidth).toFixed(2)
- );
- // 第二种面积
- let theoryLengthOne =
- Math.floor(ele.moldLength / realityProductWidth) *
- realityProductWidth;
- let theoryWidthOne =
- Math.floor(ele.moldWidth / realityProductLength) *
- realityProductLength;
- let theoryAreaOne = Number(
- parseFloat(theoryLengthOne * theoryWidthOne).toFixed(2)
- );
- ele.theoryArea =
- theoryArea >= theoryAreaOne ? theoryArea : theoryAreaOne;
- if (ele.theoryArea) {
- formData.data.quotationEstimateList[index].cavityNum = Math.floor(
- ele.theoryArea / (realityProductLength * realityProductWidth)
- );
- } else {
- proxy.msgTip(`该模具不能一出${cavityNum}`, 2);
- formData.data.quotationEstimateList[index].moldId = "";
- }
- }
- }
- changeTotalQuantity(index);
- }
- };
- const detailDialog = ref(false);
- const detailsFormOption = reactive({
- inline: true,
- labelWidth: 100,
- itemWidth: 100,
- disabled: true,
- });
- const detailsFormConfig = computed(() => {
- return [
- {
- type: "slot",
- slotName: "detail",
- label: "",
- },
- ];
- });
- const handleLookDetail = (item) => {
- let obj = proxy.deepClone(item);
- if (obj.packAsk) {
- obj.packAsk = obj.packAsk.split(",");
- }
- obj.quotationProductCustomInfoList.forEach((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;
- });
- obj.quotationProductBomList = obj.quotationProductBomList.filter(
- (x) => x.type == 2
- );
- formData.detailsData = obj;
- detailDialog.value = true;
- };
- let obj = {
- 1: "定制刀模",
- 2: "定制纹路",
- 3: "定制模具",
- };
- const getLabelOne = (type) => {
- return obj[type];
- };
- </script>
- <style lang="scss" scoped>
- .pic {
- object-fit: contain;
- width: 50px;
- height: 50px;
- cursor: pointer;
- vertical-align: middle;
- }
- :deep(.bom-table .el-table__body-wrapper .el-table__body .el-table__row) {
- background: #f4f4f5 !important;
- }
- .box {
- width: 100%;
- display: flex;
- .left {
- width: 45%;
- height: 100%;
- overflow: auto;
- border-right: 1px solid #eee;
- padding: 4px 15px 4px 4px;
- }
- .right {
- width: 55%;
- height: 100%;
- overflow: auto;
- position: relative;
- padding: 4px 0 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(.box .el-input-number .el-input__inner) {
- text-align: right !important;
- }
- ::v-deep(.box .el-input-number.is-without-controls .el-input__wrapper) {
- padding-left: 10px;
- padding-right: 10px;
- }
- .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>
|