12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631 |
- <template>
- <div class="pageIndexClass">
- <div class="content">
- <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" :selectConfig="selectConfig"
- highlight-current-row :action-list="[
- {
- text: '新建报价单',
- action: () => newPriceSheet(),
- },
- ]" @get-list="getList">
- <template #code="{ item }">
- <div style="width: 100%">
- <!-- <span style="color: #409eff; cursor: pointer; word-break: break-all" @click="getDtl(item,true)">{{ item.code }}</span> -->
- <span style="color: #409eff; cursor: pointer; word-break: break-all" @click="handleOpenDetail(item)">{{ 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.amount, 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>
- <template #btn="{item}">
- <div style="width: 100%">
- <span v-if="item.status == 0">
- <el-button type="primary" text v-debounce @click="getDtl(item, false)">修改</el-button>
- <el-button type="danger" text v-debounce @click="handleRepeal(item,'/saleQuotation/delete')">删除</el-button>
- </span>
- <span v-if="item.status !=88">
- <el-button type="primary" text v-debounce v-if="item.quotationStatus==2 && !item.extQuotationId"
- @click="handleBack(item)">退回</el-button>
- <el-button type="primary" text v-debounce v-if="item.status == 30 && item.quotationStatus==2"
- @click="getDtl(item, false,true)">变更</el-button>
- <el-button type="primary" text v-debounce v-if="item.quotationStatus==2 && !item.extQuotationId"
- @click="handleForeign(item)">转对外</el-button>
- <el-button type="danger" text v-debounce v-if="item.status !=0 && item.status !=88"
- @click="handleRepeal(item,'/saleQuotation/cancellation')">作废</el-button>
- </span>
- </div>
- </template>
- </byTable>
- </div>
- <el-dialog v-if="openAddDialog" v-model="openAddDialog" title="报价单" width="90%" append-to-body>
- <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom" v-loading="submitLoading">
- <template #chart>
- <div style="width:100%;padding-left:25px">
- <div ref="chartDom" style="height:300px"></div>
- </div>
- </template>
- <template #buyer>
- <div style="width: 100%">
- <el-form-item label="客户信息" prop="buyCorporationId" class="wid100">
- <el-select v-model="formData.data.buyCorporationId" filterable remote reserve-keyword placeholder="请输入关键字" remote-show-suffix
- :remote-method="remoteMethod" :loading="loadingSearch" @input="remoteMethod" style="width: 100%" @change="changeCustomer">
- <el-option v-for="item in customerList" :key="item.value" :label="item.label" :value="item.value" />
- </el-select>
- </el-form-item>
- <el-form-item label="地址" class="wid100">
- <el-row style="width: 100%">
- <el-col :span="6">
- <el-form-item label="" prop="buyCountryId" class="margin-b-0 wid100">
- <el-select v-model="formData.data.buyCountryId" placeholder="国家" style="width:100%" filterable
- @change="(val) => getCityData(val, '20', true)">
- <el-option v-for="item in countryData" :label="item.name" :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="" prop="provinceName" class="margin-b-0 wid100">
- <selectCity placeholder="省/洲" @change="(val) => getCityData(val, '30', true)" addressId="buyProvinceId" addressName="provinceName"
- v-model="formData.data" :data="provinceData">
- </selectCity>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="" prop="cityName" class="margin-b-0 wid100">
- <selectCity placeholder="城市" addressId="buyCityId" addressName="cityName" v-model="formData.data" :data="cityData">
- </selectCity>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="" prop="buyPostalCode" class="margin-b-0">
- <el-input v-model="formData.data.buyPostalCode" placeholder="请输入邮编" />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form-item>
- <el-form-item label="详细地址" prop="buyAddress" class="margin-b-0 wid100">
- <el-input v-model="formData.data.buyAddress" type="textarea">
- </el-input>
- </el-form-item>
- <!-- <el-form-item label="联系人" class="wid100">
- <el-row style="width: 100%">
- <el-col :span="8">
- <el-form-item label="" prop="buyContactName" label-width="0px" class="margin-b-0 wid100">
- <el-autocomplete v-model="formData.data.buyContactName" :fetch-suggestions="querySearchPerson" style="width:100%" clearable
- class="inline-input w-50" placeholder="请输入联系人" @select="handlePerson">
- </el-autocomplete>
- </el-form-item>
- </el-col>
- <el-col :span="16">
- <el-form-item label="" prop="buyContactNumber" label-width="0px" class="margin-b-0 wid100">
- <el-input v-model="formData.data.buyContactNumber" placeholder="请输入联系人电话" />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form-item> -->
- </div>
- </template>
- <template #commodity>
- <div style="width: 100%;padding-left:25px">
- <el-button type="primary" @click="openProductCompany = true" plain style="margin-bottom: 16px" v-if="!isDetail"
- :disabled="!formData.data.companyId">产品库</el-button>
- <el-table :data="formData.data.quotationProductList" style="width: 100%;" default-expand-all>
- <el-table-column type="expand" width="50" align="center">
- <template #default="scope">
- <div style="padding-left:50px">
- <div style="margin-bottom:10px; ">
- <TitleInfo content='BOM单:'></TitleInfo>
- </div>
- <el-table :data="scope.row.quotationProductBomList" style="width: 100%;" border class="bom-table">
- <el-table-column label="图片" width="80">
- <template #default="{ row }">
- <div v-if="row.fileUrl">
- <img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
- </div>
- <div v-else></div>
- </template>
- </el-table-column>
- <el-table-column prop="productCode" label="物料编码" width="190" />
- <el-table-column prop="productName" label="物料名称" min-width="200" />
- <el-table-column label="尺寸 cm*cm*cm" width="150">
- <template #default="{ row, $index }">
- <div style="width: 100%">
- {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
- </div>
- </template>
- </el-table-column>
- <el-table-column label="数量" width="110">
- <template #default="{ row, $index }">
- <div style="width: 100%">
- <el-form-item :prop="'quotationProductList.' + scope.$index + '.quotationProductBomList.' + $index + '.quantity'"
- :rules="rules.quantity" :inline-message="true" class="margin-b-0 wid100">
- <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%"
- :precision="0" :controls="false" :min="1" v-if="row.type==2" @change="changeQuantity()" />
- <span v-else>{{row.quantity}}</span>
- </el-form-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="allQuantity" label="总量" width="80" />
- <el-table-column label="单价" width="110">
- <template #default="{ row, $index }">
- <div style="width: 100%">
- <span v-if="row.price">¥ {{row.price}}</span>
- <span v-else>待报价</span>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="amount" label="小计" width="110">
- <template #default="{ row, $index }">
- <div style="width: 100%">
- <span v-if="row.amount">¥ {{row.amount}}</span>
- <span v-else>一</span>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="备注" width="180">
- <template #default="{ row, $index }">
- <div style="width: 100%">
- <el-form-item :prop="'quotationProductList.' + scope.$index + '.quotationProductBomList.' + $index + '.remark'"
- :rules="rules.remark" :inline-message="true" class="margin-b-0 wid100">
- <el-input v-model="row.remark" placeholder="请输入" style="width: 100%" :min="0" />
- </el-form-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="操作" width="60" align="center" fixed="right" v-if="!isDetail">
- <template #default="{ row,$index }">
- <el-button type="primary" link @click="handleDeleteMaterial(scope.$index,$index)" v-if="row.type==2">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="图片" width="80">
- <template #default="{ row }">
- <div v-if="row.fileUrl">
- <img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
- </div>
- <div v-else></div>
- </template>
- </el-table-column>
- <el-table-column prop="productCode" label="商品编码" width="190" />
- <el-table-column prop="productName" label="商品名称" min-width="200" />
- <el-table-column label="尺寸 cm*cm*cm" width="150">
- <template #default="{ row, $index }">
- <div style="width: 100%">
- {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
- </div>
- </template>
- </el-table-column>
- <el-table-column label="数量" width="110">
- <template #default="{ row, $index }">
- <div style="width: 100%">
- <el-form-item :prop="'quotationProductList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true"
- class="margin-b-0 wid100">
- <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%" :precision="0"
- :controls="false" :min="1" @change="changeQuantity()" />
- </el-form-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="单价" width="110">
- <template #default="{ row, $index }">
- <div style="width: 100%">
- <span v-if="row.price">¥ {{row.price}}</span>
- <span v-else>待报价</span>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="amount" label="小计" width="110">
- <template #default="{ row, $index }">
- <div style="width: 100%">
- <span v-if="row.amount">¥ {{row.amount}}</span>
- <span v-else>一</span>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="操作" width="140" align="center" fixed="right" v-if="!isDetail">
- <template #default="{ $index }">
- <el-button type="primary" link @click="handleClickSelectMaterial($index)">包材辅材</el-button>
- <el-button type="primary" link @click="handleRemove($index)">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </template>
- </byForm>
- <template #footer v-if="!isDetail">
- <el-button @click="openAddDialog = false" size="default" v-debounce>关 闭</el-button>
- <el-button type="primary" @click="handleSubmit(0)" size="default" v-debounce v-if="!isChange">暂 存</el-button>
- <el-button type="primary" @click="handleSubmit(30)" size="default" v-debounce>提 交</el-button>
- </template>
- </el-dialog>
- <el-dialog v-if="foreignDialog" v-model="foreignDialog" title="转对外报价单" width="90%" append-to-body>
- <byForm :formConfig="formConfigOne" :formOption="formOptionOne" v-model="formData.data" :rules="rulesOne" ref="formDomOne"
- v-loading="submitLoading">
- <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; ">
- <TitleInfo content='BOM单:'></TitleInfo>
- </div>
- <el-table :data="scope.row.quotationProductBomList" style="width: 100%;" border class="bom-table">
- <el-table-column label="图片" width="80">
- <template #default="{ row }">
- <div v-if="row.fileUrl">
- <img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
- </div>
- <div v-else></div>
- </template>
- </el-table-column>
- <el-table-column prop="productCode" label="物料编码" width="190" />
- <el-table-column prop="productName" label="物料名称" min-width="200" />
- <el-table-column label="尺寸 cm*cm*cm" width="150">
- <template #default="{ row, $index }">
- <div style="width: 100%">
- {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
- </div>
- </template>
- </el-table-column>
- <el-table-column label="数量" width="80" prop="quantity">
- </el-table-column>
- <el-table-column label="总数量" width="80" prop="allQuantity">
- </el-table-column>
- <el-table-column label="原本单价" width="110" prop="priceCopy">
- <template #default="{ row, $index }">
- <div style="width: 100%">
- ¥ {{row.priceCopy}}
- </div>
- </template>
- </el-table-column>
- <el-table-column label="单价" width="110" prop="price">
- <template #default="{ row, $index }">
- <div style="width: 100%">
- ¥ {{row.price}}
- </div>
- </template>
- </el-table-column>
- <el-table-column label="利润点数" width="110">
- <template #default="{ row, $index }">
- <div style="width: 100%">
- <el-form-item :prop="'quotationProductList.' + scope.$index + '.quotationProductBomList.' + $index + '.coefficient'"
- :rules="rules.coefficient" :inline-message="true" class="margin-b-0 wid100">
- <el-input-number onmousewheel="return false;" v-model="row.coefficient" 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*cm*cm" width="150">
- <template #default="{ row, $index }">
- <div style="width: 100%">
- {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
- </div>
- </template>
- </el-table-column>
- <el-table-column label="数量" width="110" prop="quantity">
- </el-table-column>
- <el-table-column label="单价" width="110" prop="price">
- <template #default="{ row, $index }">
- <div style="width: 100%">
- ¥ {{row.price}}
- </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>
- </div>
- </template>
- </byForm>
- <template #footer>
- <el-button @click="foreignDialog = false" size="default" v-debounce>关 闭</el-button>
- <el-button type="primary" @click="handleSubmitOne()" size="default" v-debounce>提 交</el-button>
- </template>
- </el-dialog>
- <el-dialog v-if="openProductCompany" v-model="openProductCompany" title="产品库" width="90%" append-to-body>
- <SelectProduct @selectProduct="selectProduct" :companyId="companyId" :isRawMaterial="'1'"></SelectProduct>
- <template #footer>
- <el-button @click="openProductCompany = false" size="defualt" 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 v-if="detailDialog" v-model="detailDialog" title="报价详情" width="90%" append-to-body>
- <PriceSheetDetailList :rowData="detailRowData" dataType="1" @changeLeftData="changeLeftData"></PriceSheetDetailList>
- <template #footer>
- <el-button @click="detailDialog = false" size="defualt" v-debounce>关 闭</el-button>
- <el-button type="primary" v-debounce v-if="leftRowData.quotationStatus==2 && !leftRowData.extQuotationId &&leftRowData.status !=88"
- @click="handleBack(leftRowData)">退回</el-button>
- <el-button type="primary" v-debounce v-if="leftRowData.status == 30 && leftRowData.quotationStatus==2 && leftRowData.status !=88"
- @click="getDtl(leftRowData, false,true)">变更</el-button>
- <el-button type="primary" v-debounce v-if="leftRowData.quotationStatus==2 && !leftRowData.extQuotationId &&leftRowData.status !=88"
- @click="handleForeign(leftRowData)">转对外</el-button>
- <el-button type="danger" v-debounce v-if="leftRowData.status !=0 && leftRowData.status !=88"
- @click="handleRepeal(leftRowData,'/saleQuotation/cancellation')">作废</el-button>
- </template>
- </el-dialog>
- <el-dialog v-if="backDialog" v-model="backDialog" title="退回" width="50%" append-to-body>
- <byForm :formConfig="backFormConfig" :formOption="backFormOption" v-model="formData.backData" :rules="backRules" ref="backFormDom"
- v-loading="submitLoading">
- </byForm>
- <template #footer>
- <el-button @click="backDialog = false" size="default" v-debounce>关 闭</el-button>
- <el-button type="primary" @click="handleSubmitBack()" size="default" v-debounce>提 交</el-button>
- </template>
- </el-dialog>
- </div>
- </template>
- <script setup>
- import byTable from "@/components/byTable/index";
- import moment from "moment";
- import byForm from "@/components/byForm/index";
- import selectCity from "@/components/selectCity/index.vue";
- import SelectProduct from "@/components/product/SelectProduct.vue";
- import SelectMaterial from "@/components/product/SelectMaterial.vue";
- import * as echarts from "echarts";
- import PriceSheetDetailList from "@/views/EHSD/saleContract/PriceSheetDetailList";
- const { proxy } = getCurrentInstance();
- const companyId = ref("");
- const accountList = ref([]);
- const corporationList = ref([]);
- const tradeMethods = ref([]);
- const accountCurrency = ref([]);
- const companyData = ref([]);
- 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 typeData = ref([
- {
- label: "内销",
- value: 1,
- },
- {
- label: "外贸",
- value: 2,
- },
- ]);
- const sourceList = ref({
- data: [],
- pagination: {
- total: 0,
- pageNum: 1,
- pageSize: 10,
- keyword: "",
- status: "",
- type: "",
- quotationStatus: "",
- companyId: "",
- quotationTimeSta: "",
- quotationTimeEnd: "",
- beginTime: "",
- endTime: "",
- },
- });
- const loading = ref(false);
- const selectConfig = computed(() => {
- return [
- {
- label: "报价单状态",
- prop: "status",
- data: statusData.value,
- },
- {
- label: "报价单类型",
- prop: "type",
- data: typeData.value,
- },
- {
- label: "子公司报价状态",
- prop: "quotationStatus",
- data: quotationStatusData.value,
- },
- {
- label: "报价子公司",
- prop: "companyId",
- data: companyData.value,
- },
- {
- type: "time",
- label: "报价时间",
- placeholder: "开始日期",
- prop: "quotationTimeSta",
- placeholderOne: "结束日期",
- propOne: "quotationTimeEnd",
- },
- // {
- // type: "time",
- // label: "创建时间",
- // placeholder: "开始日期",
- // prop: "beginTime",
- // placeholderOne: "结束日期",
- // propOne: "endTime",
- // },
- ];
- });
- const config = computed(() => {
- return [
- {
- attrs: {
- label: "报价单号",
- slot: "code",
- width: 180,
- },
- },
- {
- attrs: {
- label: "报价单状态",
- slot: "status",
- width: 100,
- },
- },
- {
- attrs: {
- label: "报价单类型",
- prop: "type",
- width: 100,
- },
- render(val) {
- return proxy.dictValueLabel(val, typeData.value);
- },
- },
- {
- attrs: {
- label: "报价子公司",
- prop: "companyName",
- width: 100,
- },
- },
- {
- attrs: {
- label: "客户名称",
- prop: "buyCorporationName",
- "min-width": 150,
- },
- },
- {
- attrs: {
- label: "子公司报价状态",
- slot: "quotationStatus",
- width: 130,
- },
- },
- {
- attrs: {
- label: "报价金额",
- slot: "amount",
- width: 120,
- },
- },
- {
- attrs: {
- label: "报价时间",
- prop: "quotationTime",
- width: 160,
- },
- },
- {
- attrs: {
- label: "报价单产品",
- slot: "product",
- "min-width": 180,
- },
- },
- {
- attrs: {
- label: "创建时间",
- prop: "createTime",
- width: 160,
- },
- },
- {
- attrs: {
- label: "创建人",
- prop: "userName",
- width: 80,
- },
- },
- {
- attrs: {
- label: "操作",
- width: 200,
- slot: "btn",
- align: "right",
- fixed: "right",
- },
- },
- ];
- });
- 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) => {
- companyData.value = res.data.map((x) => ({
- ...x,
- label: x.deptName,
- value: x.deptId,
- }));
- treeData.value = proxy.handleTree(res.data, "deptId");
- });
- };
- const getList = async (req) => {
- sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
- loading.value = true;
- proxy.post("/saleQuotation/page", sourceList.value.pagination).then((res) => {
- sourceList.value.data = res.rows;
- sourceList.value.pagination.total = res.total;
- setTimeout(() => {
- loading.value = false;
- }, 200);
- });
- };
- getDict();
- getList();
- const openAddDialog = ref(false);
- const submitLoading = ref(false);
- const modalType = ref("add");
- const newPriceSheet = () => {
- formOption.disabled = false;
- isDetail.value = false;
- isChange.value = false;
- isShowChart.value = false;
- modalType.value = "add";
- openAddDialog.value = true;
- formData.data = {
- type: "1",
- quotationProductList: [],
- };
- };
- const isDetail = ref(false);
- const isChange = ref(false);
- 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, change = false) => {
- formOption.disabled = flag;
- modalType.value = "edit";
- isChange.value = change;
- isDetail.value = flag;
- isShowChart.value = flag;
- openAddDialog.value = true;
- proxy.post("/saleQuotation/detail", { id: row.id }).then((res) => {
- formData.data = res;
- // 城市数据回显
- if (formData.data.buyCountryId) {
- getCityData(formData.data.buyCountryId, "20");
- }
- if (formData.data.buyProvinceId) {
- getCityData(formData.data.buyProvinceId, "30");
- }
- // 文件数据回显
- getFileData();
- // 价格计算
- changeQuantity();
- //折线图
- if (flag && res.quotationTrendList && res.quotationTrendList.length >= 2) {
- 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 openPrint = ref(false);
- const printDetails = ref({});
- const clickPrint = (row) => {
- printDetails.value = {};
- openPrint.value = true;
- proxy.post("/saleQuotation/detail", { id: row.id }).then((res) => {
- printDetails.value = res;
- if (printDetails.value.ehsdJson) {
- let ehsdJson = JSON.parse(printDetails.value.ehsdJson);
- printDetails.value.deliveryTime = ehsdJson.deliveryTime;
- }
- });
- };
- const clickDownload = () => {
- proxy.getPdf("报价单PDF文件");
- };
- const statistics = (label, index) => {
- let num = 0;
- if (
- printDetails.value.quotationProductList &&
- printDetails.value.quotationProductList.length > 0
- ) {
- printDetails.value.quotationProductList.map((item) => {
- if (item[label]) {
- num = parseFloat(Number(num) + Number(item[label])).toFixed(index);
- }
- });
- }
- return num;
- };
- const getLabel = (key, list, label) => {
- let text = "";
- if (list && list.length > 0) {
- let data = list.filter((item) => item.id === key);
- if (data && data.length > 0) {
- text = data[0][label];
- }
- }
- return text;
- };
- const getAllMoney = (num) => {
- let money = num;
- if (
- printDetails.value.quotationPayList &&
- printDetails.value.quotationPayList.length > 0
- ) {
- printDetails.value.quotationPayList.map((item) => {
- if (item.amount) {
- money = parseFloat(Number(money) + Number(item.amount)).toFixed(2);
- }
- });
- }
- return money;
- };
- 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 customerList = 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: {
- type: "1",
- quotationProductList: [],
- },
- backData: {},
- });
- const formDom = ref(null);
- const formOption = reactive({
- inline: true,
- labelWidth: 100,
- itemWidth: 100,
- disabled: 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: "报价类型",
- },
- {
- type: "select",
- prop: "type",
- label: "报价类型",
- data: typeData.value,
- itemWidth: 50,
- },
- {
- type: "treeSelect",
- prop: "companyId",
- label: "报价公司",
- data: treeData.value,
- propsTreeLabel: "deptName",
- propsTreeValue: "deptId",
- itemWidth: 50,
- fn: (val) => {
- companyId.value = val;
- formData.data.quotationProductList = [];
- },
- },
- {
- type: "title1",
- title: "贸易信息",
- },
- {
- type: "slot",
- slotName: "buyer",
- label: "",
- itemWidth: 100,
- },
- {
- type: "input",
- itemType: "text",
- label: "联系人",
- prop: "buyContactName",
- itemWidth: 50,
- },
- {
- type: "input",
- itemType: "text",
- label: "联系人电话",
- prop: "buyContactNumber",
- itemWidth: 50,
- },
- {
- type: "title1",
- title: "商品信息",
- },
- {
- type: "slot",
- slotName: "commodity",
- label: "",
- },
- {
- type: "title1",
- title: "报价总金额",
- },
- {
- type: "input",
- prop: "amount",
- label: "报价总金额",
- itemWidth: 25,
- disabled: true,
- },
- ];
- });
- const rules = ref({
- type: [{ required: true, message: "请选择报价类型", trigger: "change" }],
- companyId: [{ required: true, message: "请选择报价公司", trigger: "change" }],
- buyCorporationId: [
- { required: true, message: "请选择客户公司", trigger: "change" },
- ],
- quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
- });
- const getCityData = (id, type, isChange = false) => {
- proxy.post("/customizeArea/list", { parentId: id }).then((res) => {
- if (type === "20") {
- provinceData.value = res;
- if (isChange) {
- formData.data.buyProvinceId = "";
- formData.data.provinceName = "";
- formData.data.buyCityId = "";
- formData.data.cityName = "";
- }
- } else if (type === "30") {
- cityData.value = res;
- if (isChange) {
- formData.data.buyCityId = "";
- formData.data.cityName = "";
- }
- } else {
- countryData.value = res;
- }
- });
- };
- getCityData("0");
- 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.buyCountryId = res.countryId;
- formData.data.buyProvinceId = res.provinceId;
- formData.data.buyCityId = res.cityId;
- formData.data.buyPostalCode = res.zipCode;
- formData.data.buyAddress = res.address;
- getCityData(formData.data.buyCountryId, "20");
- if (formData.data.buyProvinceId) {
- getCityData(formData.data.buyProvinceId, "30");
- }
- },
- (err) => {
- formData.data.buyCountryId = "";
- formData.data.buyProvinceId = "";
- formData.data.buyCityId = "";
- formData.data.buyPostalCode = "";
- formData.data.buyAddress = "";
- }
- );
- } else {
- formData.data.buyCountryId = "";
- formData.data.buyProvinceId = "";
- formData.data.buyCityId = "";
- formData.data.buyPostalCode = "";
- formData.data.buyAddress = "";
- }
- };
- const handlePerson = (item) => {
- if (item.contactJson) {
- let data = JSON.parse(item.contactJson);
- formData.data.buyContactNumber = data[0].contactNo;
- }
- };
- const quotationProductBomList = ref([]);
- const selectProduct = (goods) => {
- if (goods && goods.id) {
- let fileUrl = "";
- if (goods.fileList && goods.fileList.length > 0) {
- fileUrl = goods.fileList[0].fileUrl;
- }
- proxy.post("/productBomInfo/detail", { id: goods.id }).then((res) => {
- if (res.productBomDetailList && res.productBomDetailList.length > 0) {
- quotationProductBomList.value = res.productBomDetailList || [];
- quotationProductBomList.value = quotationProductBomList.value.map(
- (x) => ({
- fileUrl: "",
- materialId: x.materialId,
- productName: x.materialName,
- productCode: x.materialCode,
- productLength: x["length"],
- productWidth: x.width,
- productHeight: x.height,
- quantity: x.quantity || null,
- allQuantity: "",
- price: null,
- amount: "",
- fileList: [],
- type: x.type,
- })
- );
- formData.data.quotationProductList.push({
- fileUrl: fileUrl,
- productId: goods.id,
- productName: goods.name,
- productCode: goods.customCode,
- productLength: goods["length"],
- productWidth: goods.width,
- productHeight: goods.height,
- quantity: null,
- price: null,
- amount: "",
- fileList: [],
- quotationProductBomList: quotationProductBomList.value,
- });
- proxy.msgTip("添加成功", 1);
- let ids = quotationProductBomList.value.map((x) => x.materialId);
- proxy.getFile(
- ids,
- quotationProductBomList.value,
- "materialId",
- "fileList",
- "fileUrl"
- );
- } else {
- return proxy.msgTip("该产品未配置BOM", 2);
- }
- });
- } else {
- return proxy.msgTip("选择错误", 2);
- }
- };
- const handleClickSelectMaterial = (index) => {
- indexValue.value = index;
- openSelectMaterial.value = true;
- };
- const selectMaterial = (goods) => {
- let flag = formData.data.quotationProductList[
- indexValue.value
- ].quotationProductBomList.some((x) => x.materialId == goods.id);
- if (!flag) {
- let fileUrl = "";
- if (goods.fileList && goods.fileList.length > 0) {
- fileUrl = goods.fileList[0].fileUrl;
- }
- formData.data.quotationProductList[
- indexValue.value
- ].quotationProductBomList.push({
- fileUrl: fileUrl,
- materialId: goods.id,
- productName: goods.name,
- productCode: goods.customCode,
- productLength: goods["length"],
- productWidth: goods.width,
- productHeight: goods.height,
- quantity: null,
- price: null,
- amount: "",
- fileList: [],
- type: 2,
- });
- proxy.msgTip("选择成功");
- } else {
- proxy.msgTip("该物料已选择", 2);
- }
- };
- const onPicture = (path) => {
- window.open(path, "_blank");
- };
- const handleRemove = (index) => {
- formData.data.quotationProductList.splice(index, 1);
- changeQuantity();
- };
- const handleDeleteMaterial = (index, sonIndex) => {
- formData.data.quotationProductList[index].quotationProductBomList.splice(
- sonIndex,
- 1
- );
- changeQuantity();
- };
- 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 changeQuantity = () => {
- 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];
- if (iele.quantity) {
- if (iele.price) {
- 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.allQuantity = iele.quantity * jele.quantity;
- if (jele.price) {
- 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.status = type;
- if (isChange.value) {
- proxy.post("/saleQuotation/change", formData.data).then(
- (res) => {
- proxy.msgTip("操作成功", 1);
- openAddDialog.value = false;
- submitLoading.value = false;
- getList();
- },
- (err) => {
- submitLoading.value = false;
- }
- );
- } else {
- proxy.post("/saleQuotation/" + modalType.value, formData.data).then(
- (res) => {
- proxy.msgTip("操作成功", 1);
- openAddDialog.value = false;
- submitLoading.value = false;
- getList();
- },
- (err) => {
- submitLoading.value = false;
- }
- );
- }
- } else {
- return proxy.msgTip("请添加至少一件商品", 2);
- }
- });
- };
- 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",
- data: [],
- },
- ],
- },
- });
- const handleRepeal = (row, url) => {
- proxy
- .msgConfirm()
- .then((res) => {
- proxy
- .post(url, {
- id: row.id,
- })
- .then((res) => {
- proxy.msgTip("操作成功", 1);
- getList();
- });
- })
- .catch((err) => {});
- };
- const formDomOne = ref(null);
- const foreignDialog = ref(false);
- const formConfigOne = computed(() => {
- return [
- {
- type: "title1",
- title: "利润点数",
- },
- {
- type: "number",
- prop: "coefficient",
- label: "利润点数",
- precision: 2,
- min: 0.01,
- controls: false,
- itemWidth: 25,
- fn: (val) => {
- publicTotalAmount(val);
- },
- },
- {
- type: "title1",
- title: "商品信息",
- },
- {
- type: "slot",
- slotName: "commodity",
- label: "",
- },
- {
- type: "title1",
- title: "报价总金额",
- },
- {
- type: "input",
- prop: "amount",
- label: "报价总金额",
- itemWidth: 25,
- disabled: true,
- },
- ];
- });
- const formOptionOne = reactive({
- inline: true,
- labelWidth: 100,
- itemWidth: 100,
- disabled: false,
- });
- const rulesOne = ref({
- price: [{ required: true, message: "请输入单价", trigger: "blur" }],
- // coefficient: [{ required: true, message: "请输入系数", trigger: "blur" }],
- });
- const handleForeign = (row) => {
- foreignDialog.value = true;
- proxy.post("/saleQuotation/detail", { id: row.id }).then((res) => {
- formData.data = res;
- formData.data.saleQuotationId = res.id;
- delete formData.data.id;
- // 复制原本价格
- for (let i = 0; i < formData.data.quotationProductList.length; i++) {
- const iele = formData.data.quotationProductList[i];
- iele.quotationProductId = iele.id;
- delete iele.id;
- for (let j = 0; j < iele.quotationProductBomList.length; j++) {
- const jele = iele.quotationProductBomList[j];
- jele.quotationProductBomId = jele.id;
- delete jele.id;
- jele.priceCopy = jele.price;
- // 默认系数
- jele.coefficient = 1;
- }
- }
- changeQuantity();
- // 城市数据回显
- if (formData.data.buyCountryId) {
- getCityData(formData.data.buyCountryId, "20");
- }
- if (formData.data.buyProvinceId) {
- getCityData(formData.data.buyProvinceId, "30");
- }
- // 文件数据回显
- getFileData();
- });
- };
- 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];
- // 计算新单价
- jele.price = parseFloat(
- Number(jele.priceCopy) * Number(jele.coefficient)
- ).toFixed(2);
- // 计算物料总计
- jele.amount = parseFloat(
- Number(jele.allQuantity) *
- Number(jele.priceCopy) *
- Number(jele.coefficient)
- ).toFixed(2);
- // 单个产品的一个物料的钱
- productPrice += Number(
- parseFloat(
- Number(jele.quantity) *
- Number(jele.priceCopy) *
- Number(jele.coefficient)
- ).toFixed(2)
- );
- }
- iele.price = parseFloat(productPrice).toFixed(2);
- iele.amount = parseFloat(
- Number(iele.quantity) * Number(iele.price)
- ).toFixed(2);
- money += Number(iele.amount);
- }
- }
- formData.data.amount = parseFloat(money).toFixed(2);
- };
- const publicTotalAmount = (val) => {
- if (val) {
- 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];
- // 系数赋值
- jele.coefficient = val;
- // 计算新单价
- jele.price = parseFloat(
- Number(jele.priceCopy) * Number(jele.coefficient)
- ).toFixed(2);
- // 计算物料总计
- jele.amount = parseFloat(
- Number(jele.allQuantity) *
- Number(jele.priceCopy) *
- Number(jele.coefficient)
- ).toFixed(2);
- // 单个产品的一个物料的钱
- productPrice += Number(
- parseFloat(
- Number(jele.quantity) *
- Number(jele.priceCopy) *
- Number(jele.coefficient)
- ).toFixed(2)
- );
- }
- iele.price = parseFloat(productPrice).toFixed(2);
- iele.amount = parseFloat(
- Number(iele.quantity) * Number(iele.price)
- ).toFixed(2);
- money += Number(iele.amount);
- }
- }
- formData.data.amount = parseFloat(money).toFixed(2);
- }
- };
- const handleSubmitOne = () => {
- formDomOne.value.handleSubmit(() => {
- proxy
- .msgConfirm()
- .then((res) => {
- submitLoading.value = true;
- proxy.post("/extQuotation/add", formData.data).then((res) => {
- proxy.msgTip("操作成功", 1);
- submitLoading.value = false;
- foreignDialog.value = false;
- getList();
- });
- })
- .catch((err) => {});
- });
- };
- const detailDialog = ref(false);
- const detailRowData = ref({});
- const handleOpenDetail = (item) => {
- detailRowData.value = item;
- detailDialog.value = true;
- };
- const leftRowData = ref({});
- const changeLeftData = (i) => {
- leftRowData.value = i;
- };
- const backFormDom = ref(null);
- const backDialog = ref(false);
- const backFormConfig = computed(() => {
- return [
- {
- type: "input",
- itemType: "textarea",
- rows: 10,
- prop: "backRemark",
- label: "退回原因",
- itemWidth: 100,
- disabled: false,
- },
- ];
- });
- const backFormOption = reactive({
- inline: true,
- labelWidth: 100,
- itemWidth: 100,
- disabled: false,
- });
- const backRules = ref({
- backRemark: [{ required: true, message: "请输入退回原因", trigger: "blur" }],
- });
- const handleBack = (row) => {
- formData.backData = {
- id: row.id,
- quotationStatus: 1,
- backRemark: "",
- };
- backDialog.value = true;
- };
- const handleSubmitBack = () => {
- backFormDom.value.handleSubmit(() => {
- submitLoading.value = true;
- proxy
- .msgConfirm()
- .then((res) => {
- proxy.post("/saleQuotation/edit", formData.backData).then((res) => {
- proxy.msgTip("操作成功", 1);
- submitLoading.value = false;
- backDialog.value = false;
- getList();
- });
- })
- .catch((err) => {});
- });
- };
- </script>
- <style lang="scss" scoped>
- .tenant {
- padding: 20px;
- }
- ::v-deep(.el-input-number .el-input__inner) {
- text-align: left;
- }
- .baseRow {
- min-height: 24px;
- border-top: 1px solid black;
- border-left: 1px solid black;
- }
- .contentRow {
- border-right: 1px solid black;
- line-height: 24px;
- padding-left: 4px;
- }
- .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: #fbfbfb !important;
- }
- :deep(.bom-table .el-table-fixed-column--right) {
- // background: #fbfbfb !important;
- }
- </style>
|