123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583 |
- <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 style="width:100%">
- <span class="el-click" @click="getConfirmDtl(item,true)">{{ 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%">
- <div>
- <span v-if="item.status == 0">
- <el-button type="primary" text v-debounce @click="getDtl(item, false)" v-hasPermi="['quotation:edit']">修改</el-button>
- <el-button type="danger" text v-debounce @click="handleRepeal(item,'/saleQuotation/delete')"
- v-hasPermi="['quotation:del']">删除</el-button>
- </span>
- <span v-if="item.status !=88">
- <!-- <el-button type="primary" text v-debounce v-if="item.status == 30 && item.quotationStatus==2"
- @click="getDtl(item, false,true)">变更</el-button> -->
- <span v-if="item.quotationStatus==2 && !item.extQuotationId && item.confirmStatus==0">
- <el-button type="primary" text v-debounce v-hasPermi="['quotation:price:back']" @click="handleBack(item)">退回</el-button>
- </span>
- <span v-if="item.confirmStatus==2&&item.quotationStatus==2 && !item.extQuotationId">
- <el-button type="primary" text v-debounce v-hasPermi="['quotation:price:change']" @click="handleForeign(item)">转对外</el-button>
- </span>
- <span v-if="item.status !=0 && item.status !=88 && item.confirmStatus==0">
- <el-button type="danger" text v-debounce v-hasPermi="['quotation:remove']"
- @click="handleRepeal(item,'/saleQuotation/cancellation')">作废</el-button>
- </span>
- </span>
- <span v-if="item.status !=88">
- <span v-if="item.confirmStatus==0 && item.quotationStatus==2">
- <el-button type="primary" text v-debounce v-hasPermi="['quotation:price:confirm']"
- @click="getConfirmDtl(item, false)">价格确认</el-button>
- </span>
- </span>
- </div>
- </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-row style="width: 100%">
- <el-col :span="12">
- <el-form-item label="地址" class="wid100 margin-b-0">
- <el-row style="padding-right:5px;width:100%">
- <el-col :span="6">
- <el-form-item label="" prop="buyCountryId" class="margin-b-0 wid100" label-width="0px">
- <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" label-width="0px">
- <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" label-width="0px">
- <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" label-width="0px">
- <el-input v-model="formData.data.buyPostalCode" placeholder="请输入邮编" />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form-item>
- </el-col>
- <el-col :span="12" style="padding-left:5px">
- <el-form-item label="详细地址" prop="buyAddress" class="margin-b-0 wid100">
- <el-input v-model="formData.data.buyAddress" type="text" placeholder="请输入详细地址">
- </el-input>
- </el-form-item>
- </el-col>
- </el-row> -->
- </div>
- </template>
- <template #commodity>
- <div style="width: 100%;padding-left:25px">
- <el-button type="warning" @click="clickPushProduct" plain style="margin-bottom: 16px" v-if="!isDetail"
- :disabled="!formData.data.companyId">定制</el-button>
- <el-button type="primary" @click="openProductCompany = true" plain style="margin-bottom: 16px" v-if="!isDetail"
- :disabled="!formData.data.companyId">选择产品库</el-button>
- <!-- <el-table :data="formData.data.quotationProductList" style="width: 100%;" default-expand-all>
- <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)" 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="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)" 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="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> -->
- <el-collapse v-model="activeNames">
- <el-collapse-item :name="index" v-for="(product,index) in formData.data.quotationProductList" :key="index">
- <template #title>
- <!-- <TitleInfo :content="'主材'"></TitleInfo> -->
- <div style="font-size:14px;font-weight:700;padding-left:25px;width:300px">
- 产品编码:{{product.productCode || '定制产品'}}
- </div>
- <el-form-item label="数量" class="margin-b-0" style="width:300px !important;" :prop="'quotationProductList.' +index + '.quantity'"
- :rules="rules.quantity" :inline-message="true" @click.stop>
- <el-input-number v-model="product.quantity" placeholder="请输入" style="width: 100%" :precision="0" :controls="false" :min="1"
- onmousewheel="return false;" />
- </el-form-item>
- <el-button text type="primary" style="margin-left:10px" @click="handleRemove(index)">删除</el-button>
- </template>
- <div style="width:100%">
- <div style="margin:10px 0">
- <TitleInfo :content="'主材'"></TitleInfo>
- </div>
- <div style="width: 100%;padding-left:15px">
- <el-row>
- <el-col :span="12">
- <el-form-item :prop="'quotationProductList.' +index + '.rawMaterialId'" :rules="rules.rawMaterialId" :inline-message="true"
- label="原材料" class="wid100">
- <el-select v-model="product.rawMaterialId" placeholder="请选择" style="width:100%">
- <el-option v-for="item in rawMaterialData" :key="item.value" :label="item.label" :value="item.value" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="颜色" class="margin-b-0 wid100">
- <el-row style="width: 100%">
- <el-col :span="12">
- <el-form-item prop="productColor" label-width="0px" class="margin-b-0 wid100">
- <el-input v-model="product.productColor" placeholder="颜色" />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item prop="colorCardCode" label-width="0px" class="margin-b-0 wid100">
- <el-input v-model="product.colorCardCode" placeholder="色卡号" />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item label="尺寸" class="margin-b-0 wid100" required>
- <el-row style="width:100%">
- <el-col :span="8">
- <el-form-item :prop="'quotationProductList.' +index + '.productLength'" :rules="rules.productLength"
- :inline-message="true" label-width="0px" class="margin-b-0 wid100">
- <el-input-number v-model="product.productLength" placeholder="长 (cm)" style="width: 100%" :precision="2"
- :controls="false" :min="0" onmousewheel="return false;" />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item :prop="'quotationProductList.' +index + '.productWidth'" :rules="rules.productWidth"
- :inline-message="true" label-width="0px" class="margin-b-0 wid100">
- <el-input-number v-model="product.productWidth" placeholder="宽 (cm)" style="width: 100%" :precision="2"
- :controls="false" :min="0" onmousewheel="return false;" />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item :prop="'quotationProductList.' +index + '.productHeight'" :rules="rules.productHeight"
- :inline-message="true" label-width="0px" class="margin-b-0 wid100">
- <el-input-number v-model="product.productHeight" placeholder="高 (cm)" style="width: 100%" :precision="2"
- :controls="false" :min="0" onmousewheel="return false;" />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="净重(kg)" prop="netWeight" class="margin-b-0 wid100">
- <el-input-number v-model="product.netWeight" placeholder="请输入" style="width: 100%" :precision="2" :controls="false" :min="0"
- onmousewheel="return false;" />
- </el-form-item>
- </el-col>
- </el-row>
- </div>
- <div style="margin:10px 0">
- <TitleInfo :content="'辅材'"></TitleInfo>
- </div>
- <div style="width: 100%;padding-left:15px">
- <el-button type="primary" @click="handleClickSelectMaterial(index)" plain>选择包材/配件/辅材</el-button>
- <el-table :data="product.quotationProductBomList" style="width: 100%; margin-top: 16px">
- <el-table-column prop="materialName" label="物料名称" min-width="130" />
- <el-table-column prop="materialCode" label="物料编码" width="150" />
- <el-table-column label="数量" width="150">
- <template #default="{ row, $index }">
- <div style="width: 100%">
- <el-form-item :prop="'quotationProductList.' + index + '.quotationProductBomList.' + $index + '.quantity'"
- :rules="rules.quantity" :inline-message="true" class="margin-b-0 wid100">
- <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%"
- :precision="0" :controls="false" :min="1" />
- </el-form-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="操作" width="60" align="center" fixed="right">
- <template #default="{ $index }">
- <el-button type="primary" link @click="handleRemoveBom(index,$index)">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div style="margin:10px 0">
- <TitleInfo :content="'附加工艺要求'"></TitleInfo>
- </div>
- <div style="width:100%;padding-left:15px">
- <div class="small-title">
- ① 工艺线路
- </div>
- <el-row style="width:100%">
- <el-col :span="12">
- <el-form-item label="工艺产线" class="wid100" :prop="'quotationProductList.' + index + '.technologyId'"
- :rules="rules.technologyId" :inline-message="true">
- <el-select v-model="product.technologyId" placeholder="请选择" style="width:100%">
- <el-option v-for="item in technologyData" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <div class="small-title">
- ② LOGO
- </div>
- <el-row style="width:100%">
- <el-col :span="12">
- <el-form-item label="LOGO尺寸" class="wid100">
- <el-row>
- <el-col :span="8">
- <el-form-item label-width="0px" class="margin-b-0 wid100" :prop="'quotationProductList.' +index + '.logoLength'"
- :rules="rules.logoLength" :inline-message="true">
- <el-input-number v-model="product.logoLength" placeholder="长 (cm)" style="width: 100%" :precision="2"
- :controls="false" :min="0" onmousewheel="return false;" />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label-width="0px" class="margin-b-0 wid100" :prop="'quotationProductList.' +index + '.logoWidth'"
- :rules="rules.logoWidth" :inline-message="true">
- <el-input-number v-model="product.logoWidth" placeholder="宽 (cm)" style="width: 100%" :precision="2" :controls="false"
- :min="0" onmousewheel="return false;" />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label-width="0px" class="margin-b-0 wid100" :prop="'quotationProductList.' +index + '.logoHeight'"
- :rules="rules.logoHeight" :inline-message="true">
- <el-input-number v-model="product.logoHeight" placeholder="高 (cm)" style="width: 100%" :precision="2"
- :controls="false" :min="0" onmousewheel="return false;" />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="几色印刷" class="wid100">
- <el-input-number v-model="product.colorCount" placeholder="请输入" style="width: 100%" :precision="0" :controls="false"
- :min="1" onmousewheel="return false;" />
- </el-form-item>
- </el-col>
- </el-row>
- <div class="small-title">
- ③ 折叠
- </div>
- <el-row style="width:100%">
- <el-col :span="12">
- <el-form-item label="是否折叠" class="wid100">
- <el-select v-model="product.isFold" placeholder="请选择" style="width:100%">
- <el-option :label="'否'" :value="0" />
- <el-option :label="'是'" :value="1" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="折叠数" class="wid100" :prop="'quotationProductList.' +index + '.foldWay'" v-if="product.isFold==1"
- :rules="product.isFold==1?rules.foldWay:''">
- <el-select v-model="product.foldWay" placeholder="请选择" style="width:100%">
- <el-option v-for="item in foldWayData" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <div class="small-title">
- ④ 包装要求
- </div>
- <el-row style="width:100%">
- <el-col :span="12">
- <el-form-item label="包装要求" class="wid100">
- <el-select v-model="product.packAsk" placeholder="请选择" style="width:100%" multiple>
- <el-option v-for="item in packAskData" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <div class="small-title">
- ⑤ 是否定制
- </div>
- <el-row style="width:100%">
- <el-col :span="12">
- <el-form-item prop="isCustomized" label="是否定制" class="wid100">
- <el-select v-model="product.isCustomized" placeholder="请选择" style="width:100%">
- <el-option :label="'否'" :value="0" />
- <el-option :label="'是'" :value="1" />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row style="width:100%">
- <el-form-item label="定制内容" class="wid100" v-if="product.isCustomized==1">
- <table style="width:100%" border class="table">
- <tr>
- <td style="width:20%">
- </td>
- <td style="width:40%">附件</td>
- <td style="width:40%">备注</td>
- </tr>
- <tr v-for="(row,sonIndex) in product.quotationProductCustomInfoList" :key="sonIndex">
- <td>
- <el-checkbox v-model="row.isCheckBox" label="" /> <span style="position:relative;top:-2px">
- {{getLabelOne(row.type)}}</span>
- </td>
- <td>
- <el-upload :file-list="row.fileList" :action="uploadUrl" :data="uploadData" :limit="1" :list-type="'text'"
- :before-upload="(file)=>handleBeforeUploadOne(file,index,sonIndex)"
- :on-success="()=>handleSuccessOne(index,sonIndex)" :on-remove="(file)=>handleRemoveFile(file,index,sonIndex)"
- :on-preview="onPreviewFile" :on-exceed="()=>msgTip(`上传文件数量不可大于1`, 2)">
- <el-button text type="primary">上传附件</el-button>
- </el-upload>
- </td>
- <td>
- <el-form-item :prop="'quotationProductList.' + index + '.quotationProductCustomInfoList.' + sonIndex + '.remark'"
- :rules="row.isCheckBox?rules.remark:''" :inline-message="true" class="margin-b-0 wid100">
- <el-input v-model="row.remark" placeholder="请输入备注" />
- </el-form-item>
- </td>
- </tr>
- </table>
- </el-form-item>
- </el-row>
- </div>
- </div>
- </el-collapse-item>
- </el-collapse>
- </div>
- </template>
- </byForm>
- <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%;" row-key="productId">
- <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)" 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">
- <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 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-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="110" prop="quantity">
- </el-table-column>
- <el-table-column label="指导价" width="100" prop="guidePrice">
- <template #default="{ row, $index }">
- <div style="width: 100%">
- <span class="tag-active">{{row.guidePrice}}</span>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="最低价" width="100" prop="minPrice">
- <template #default="{ row, $index }">
- <div style="width: 100%">
- <span style="color:red">{{row.minPrice}}</span>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="最高价" width="100" prop="maxPrice">
- <template #default="{ row, $index }">
- <div style="width: 100%">
- <span style="color:red">{{row.maxPrice}}</span>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="单价" width="110" prop="price">
- <template #default="{ row, $index }">
- <el-form-item :prop="'quotationProductList.' + $index + '.price'" :rules="rulesOne.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="row.minPrice" @change="changeForeignQuantity()" :max="row.maxPrice" />
- </el-form-item>
- </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="confirmDialog" v-model="confirmDialog" title="价格确认" width="90%" append-to-body>
- <byForm :formConfig="formConfigTwo" :formOption="formOptionTwo" v-model="formData.dataTwo" :rules="rulesTwo" ref="formDomTwo"
- v-loading="submitLoading">
- <template #commodity>
- <div style="width: 100%;padding-left:25px">
- <el-table :data="formData.dataTwo.quotationProductList" style="width: 100%;" row-key="id">
- <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)" 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="180" prop="remark">
- </el-table-column>
- </el-table>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="图片" width="70" align="center">
- <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="120">
- <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="80" prop="quantity">
- </el-table-column>
- <el-table-column label="工厂单价" width="100" prop="prodPrice">
- </el-table-column>
- <el-table-column label="指导价" width="120" prop="price">
- <template #default="{ row, $index }">
- <div style="width: 100%">
- <el-form-item :prop="'quotationProductList.' + $index + '.price'" :rules="rulesTwo.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="changeQuantityOne" />
- </el-form-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="业务员最低报价" width="125" prop="minPrice">
- <template #default="{ row, $index }">
- <div style="width: 100%">
- <el-form-item :prop="'quotationProductList.' + $index + '.minPrice'" :rules="rulesTwo.minPrice" :inline-message="true"
- class="margin-b-0 wid100">
- <el-input-number onmousewheel="return false;" v-model="row.minPrice" placeholder="请输入" style="width: 100%" :precision="2"
- :controls="false" :min="row.price" @change="changeMinPrice" />
- </el-form-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="上调比列(%)" width="110" prop="amplifyRatio">
- <template #default="{ row, $index }">
- <div style="width: 100%">
- <el-form-item :prop="'quotationProductList.' + $index + '.amplifyRatio'" :rules="rulesTwo.amplifyRatio" :inline-message="true"
- class="margin-b-0 wid100">
- <el-input-number onmousewheel="return false;" v-model="row.amplifyRatio" placeholder="请输入" style="width: 100%" :precision="2"
- :controls="false" :min="1" :max="100" @change="changeMinPrice" />
- </el-form-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="业务员最高报价" width="125" prop="maxPrice">
- </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 v-if="!isDetailData">
- <el-button @click="confirmDialog = false" size="default" v-debounce>关 闭</el-button>
- <el-button type="primary" size="default" v-debounce @click="confirmSubmit()">提 交</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'" :disablePerm="'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 &&leftRowData.status !=70"
- @click="handleBack(leftRowData)">退回</el-button>
- <el-button type="primary" v-debounce
- v-if="leftRowData.status == 30 && leftRowData.quotationStatus==2 && leftRowData.status !=88 &&leftRowData.status !=70"
- @click="getDtl(leftRowData, false,true)">变更</el-button>
- <el-button type="primary" v-debounce
- v-if="leftRowData.quotationStatus==2 && !leftRowData.extQuotationId &&leftRowData.status !=88 &&leftRowData.status !=70"
- @click="handleForeign(leftRowData)">转对外</el-button>
- <el-button type="danger" v-debounce v-if="leftRowData.status !=0 && leftRowData.status !=88 &&leftRowData.status !=70"
- @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 uploadData = ref({});
- const packAskData = computed(() => proxy.useUserStore().allDict["pack_ask"]);
- const foldWayData = computed(() => proxy.useUserStore().allDict["fold_way"]);
- const companyId = ref("");
- const accountList = ref([]);
- const corporationList = ref([]);
- 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: "ofCompanyId",
- data: proxy.useUserStore().allDict["list_company_data"],
- },
- {
- 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: "业务公司",
- prop: "ofCompanyName",
- width: 110,
- },
- },
- {
- 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": 170,
- },
- },
- {
- 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: 220,
- 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 rawMaterialData = ref([]);
- const technologyData = ref([]);
- const getRawMaterialData = () => {
- proxy.post("/productInfo/page", { productClassifyId: 100 }).then((res) => {
- rawMaterialData.value = res.rows.map((x) => ({
- ...x,
- label:
- x.name +
- "," +
- x.customCode +
- "," +
- `${x["length"]}*${x.width}*${x.height}(cm)` +
- "," +
- x.color,
- value: x.id,
- }));
- });
- proxy.post("/technology/page", { pageNum: 1, pageSize: 999 }).then((res) => {
- technologyData.value = res.rows;
- });
- };
- getRawMaterialData();
- const openAddDialog = ref(false);
- const submitLoading = ref(false);
- const modalType = ref("add");
- 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();
- 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",
- });
- // 价格计算
- 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: {},
- dataTwo: {},
- });
- 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: "ofCompanyId",
- label: "业务公司",
- data: proxy.useUserStore().allDict["tree_company_data"],
- propsTreeLabel: "deptName",
- propsTreeValue: "deptId",
- 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" }],
- ofCompanyId: [
- { required: true, message: "请选择业务公司", trigger: "change" },
- ],
- companyId: [{ required: true, message: "请选择报价公司", trigger: "change" }],
- buyCorporationId: [
- { required: true, message: "请选择客户公司", trigger: "change" },
- ],
- quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
- productLength: [
- { required: true, message: "请输入长 (cm)", trigger: "blur" },
- ],
- productWidth: [
- { required: true, message: "请输入宽 (cm)", trigger: "blur" },
- ],
- productHeight: [
- { required: true, message: "请输入高 (cm)", trigger: "blur" },
- ],
- rawMaterialId: [
- { required: true, message: "请选择原材料", trigger: "change" },
- ],
- technologyId: [
- { required: true, message: "请选择工艺产线", trigger: "change" },
- ],
- foldWay: [{ required: true, message: "请选择折叠数", trigger: "change" }],
- remark: [{ 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 productCustomInfoListData = ref([
- {
- type: 1,
- isCheck: 0,
- isCheckBox: false,
- fileList: [],
- remark: "",
- },
- {
- type: 2,
- isCheck: 0,
- isCheckBox: false,
- fileList: [],
- remark: "",
- },
- {
- type: 3,
- isCheck: 0,
- isCheckBox: false,
- fileList: [],
- remark: "",
- },
- ]);
- const selectProduct = (row) => {
- if (row && row.id) {
- proxy.post("/productInfo/detail", { id: row.id }).then((res) => {
- let goods = res;
- if (goods.productBomDetailList && goods.productBomDetailList.length > 0) {
- let quotationProductCustomInfoList = goods.productCustomInfoList.map(
- (x) => {
- if (x.fileList) {
- x.fileList = x.fileList.map((y) => ({
- ...y,
- url: y.fileUrl,
- name: y.fileName,
- }));
- } else {
- x.fileList = [];
- }
- x.isCheckBox = x.isCheck == 1;
- delete x.id;
- return x;
- }
- );
- if (goods.isCustomized == 0) {
- quotationProductCustomInfoList = productCustomInfoListData.value;
- }
- let packAsk = goods.packAsk;
- if (packAsk) {
- packAsk = packAsk.split(",");
- }
- formData.data.quotationProductList.push({
- productId: goods.id,
- productName: goods.name,
- productCode: goods.customCode,
- productLength: goods["length"],
- productWidth: goods.width,
- productHeight: goods.height,
- productColor: goods.color,
- colorCardCode: goods.colorCardCode,
- netWeight: goods.netWeight,
- quantity: null,
- price: null,
- amount: "",
- fileList: [],
- rawMaterialId: goods.rawMaterialId,
- technologyId: goods.technologyId,
- logoLength: goods.logoLength,
- logoWidth: goods.logoWidth,
- logoHeight: goods.logoHeight,
- colorCount: goods.colorCount,
- isFold: goods.isFold || 0,
- foldWay: goods.foldWay,
- packAsk: packAsk,
- isCustomized: goods.isCustomized || 0,
- quotationProductBomList: goods.productBomDetailList,
- quotationProductCustomInfoList: quotationProductCustomInfoList,
- });
- activeNames.value.push(formData.data.quotationProductList.length - 1);
- proxy.msgTip("添加成功", 1);
- } else {
- return proxy.msgTip("该产品未配置BOM", 2);
- }
- });
- } else {
- return proxy.msgTip("选择错误", 2);
- }
- };
- const clickPushProduct = () => {
- let quotationProductCustomInfoList = productCustomInfoListData.value;
- formData.data.quotationProductList.push({
- productId: "",
- productName: "",
- productCode: "",
- productLength: null,
- productWidth: null,
- productHeight: null,
- productColor: "",
- colorCardCode: "",
- netWeight: null,
- quantity: null,
- price: null,
- amount: "",
- fileList: [],
- rawMaterialId: "",
- technologyId: "",
- logoLength: null,
- logoWidth: null,
- logoHeight: null,
- colorCount: null,
- isFold: 0,
- foldWay: "",
- packAsk: [],
- isCustomized: 0,
- quotationProductBomList: [],
- quotationProductCustomInfoList: quotationProductCustomInfoList,
- });
- proxy.msgTip("添加成功", 1);
- activeNames.value.push(formData.data.quotationProductList.length - 1);
- };
- // const selectProduct = (goods) => {
- // if (goods && goods.id) {
- // let fileUrl = "";
- // if (goods.fileList && goods.fileList.length > 0) {
- // fileUrl = goods.fileList[0].fileUrl;
- // }
- // proxy.post("/productBomInfo/detail", { id: goods.id }).then((res) => {
- // if (res.productBomDetailList && res.productBomDetailList.length > 0) {
- // quotationProductBomList.value = res.productBomDetailList.map((x) => ({
- // fileUrl: "",
- // materialId: x.materialId,
- // productName: x.materialName,
- // productCode: x.materialCode,
- // productLength: x["materialLength"],
- // productWidth: x.materialWidth,
- // productHeight: x.materialHeight,
- // quantity: x.quantity || null,
- // allQuantity: "",
- // price: null,
- // amount: "",
- // fileList: [],
- // type: x.type,
- // }));
- // formData.data.quotationProductList.push({
- // fileUrl: fileUrl,
- // productId: goods.id,
- // productName: goods.name,
- // productCode: goods.customCode,
- // productLength: goods["length"],
- // productWidth: goods.width,
- // productHeight: goods.height,
- // productColor: goods.color,
- // quantity: null,
- // price: null,
- // amount: "",
- // fileList: [],
- // quotationProductBomList: quotationProductBomList.value,
- // });
- // proxy.msgTip("添加成功", 1);
- // let ids = quotationProductBomList.value.map((x) => x.materialId);
- // proxy.getFile(
- // ids,
- // quotationProductBomList.value,
- // "materialId",
- // "fileList",
- // "fileUrl"
- // );
- // } else {
- // return proxy.msgTip("该产品未配置BOM", 2);
- // }
- // });
- // } else {
- // return proxy.msgTip("选择错误", 2);
- // }
- // };
- const handleClickSelectMaterial = (index) => {
- indexValue.value = index;
- openSelectMaterial.value = true;
- };
- const handleRemoveBom = (index, sonIndex) => {
- formData.data.quotationProductList[index].quotationProductBomList.splice(
- sonIndex,
- 1
- );
- };
- const selectMaterial = (goods) => {
- let flag = formData.data.quotationProductList[
- indexValue.value
- ].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,
- materialName: goods.name,
- materialCode: 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 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
- ) {
- let data = proxy.deepClone(formData.data);
- for (let i = 0; i < data.quotationProductList.length; i++) {
- const iele = data.quotationProductList[i];
- if (
- !(
- iele.quotationProductBomList &&
- iele.quotationProductBomList.length > 0
- )
- ) {
- return proxy.msgTip("请添加辅材", 2);
- }
- iele.quotationProductBomList.push({
- materialId: iele.rawMaterialId,
- type: 1,
- });
- if (iele.packAsk) {
- iele.packAsk = iele.packAsk.join(",");
- }
- if (
- iele.quotationProductCustomInfoList &&
- iele.quotationProductCustomInfoList.length > 0
- ) {
- let checkNum = 0;
- for (let j = 0; j < iele.quotationProductCustomInfoList.length; j++) {
- let jele = iele.quotationProductCustomInfoList[j];
- jele.isCheck = jele.isCheckBox ? 1 : 0;
- if (jele.isCheckBox) {
- checkNum += 1;
- }
- if (jele.isCheckBox) {
- if (!(jele.fileList && jele.fileList.length > 0)) {
- return proxy.msgTip(
- `请上传第${i + 1}条数据的${getLabel(jele.type)}附件`,
- 2
- );
- }
- }
- }
- if (checkNum == 0) {
- return proxy.msgTip(`请至少勾选一个第${i + 1}条数据的定制内容`, 2);
- }
- }
- }
- submitLoading.value = true;
- data.status = type;
- if (isChange.value) {
- proxy.post("/saleQuotation/change", data).then(
- (res) => {
- proxy.msgTip("操作成功", 1);
- openAddDialog.value = false;
- submitLoading.value = false;
- detailDialog.value = false;
- getList();
- },
- (err) => {
- submitLoading.value = false;
- }
- );
- } else {
- proxy.post("/saleQuotation/" + modalType.value, data).then(
- (res) => {
- proxy.msgTip("操作成功", 1);
- openAddDialog.value = false;
- submitLoading.value = false;
- detailDialog.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);
- detailDialog.value = false;
- 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.code;
- 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;
- iele.guidePrice = iele.price;
- iele.maxPrice = Number(
- parseFloat((iele.amplifyRatio / 100 + 1) * iele.minPrice).toFixed(2)
- );
- iele.price = iele.minPrice;
- for (let j = 0; j < iele.quotationProductBomList.length; j++) {
- const jele = iele.quotationProductBomList[j];
- jele.quotationProductBomId = jele.id;
- delete jele.id;
- // jele.priceCopy = jele.price;
- // jele.price = Number(parseFloat(jele.price * 1.1)).toFixed(2);
- // 默认系数
- // jele.coefficient = 1.1;
- }
- }
- // changeQuantity();
- // 城市数据回显
- // if (formData.data.buyCountryId) {
- // getCityData(formData.data.buyCountryId, "20");
- // }
- // if (formData.data.buyProvinceId) {
- // getCityData(formData.data.buyProvinceId, "30");
- // }
- changeForeignQuantity();
- // 文件数据回显
- 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",
- });
- });
- };
- 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) => {
- submitLoading.value = false;
- });
- });
- };
- 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();
- detailDialog.value = false;
- });
- })
- .catch((err) => {
- submitLoading.value = false;
- });
- });
- };
- const getFileDataOne = () => {
- let ids = [];
- formData.dataTwo.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.dataTwo.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 changeQuantityOne = () => {
- let money = 0;
- if (
- formData.dataTwo.quotationProductList &&
- formData.dataTwo.quotationProductList.length > 0
- ) {
- // 单个产品的价格
- for (let i = 0; i < formData.dataTwo.quotationProductList.length; i++) {
- let iele = formData.dataTwo.quotationProductList[i];
- iele.amount = Number(
- parseFloat(Number(iele.quantity) * Number(iele.price)).toFixed(2)
- );
- money += iele.amount;
- }
- formData.dataTwo.amount = parseFloat(money).toFixed(2);
- }
- };
- const changeQuantityTwo = () => {
- let money = 0;
- if (
- formData.dataTwo.quotationProductList &&
- formData.dataTwo.quotationProductList.length > 0
- ) {
- // 单个产品的价格
- for (let i = 0; i < formData.dataTwo.quotationProductList.length; i++) {
- let iele = formData.dataTwo.quotationProductList[i];
- money += Number(
- parseFloat(Number(iele.quantity) * Number(iele.prodPrice)).toFixed(2)
- );
- }
- formData.dataTwo.amountTwo = parseFloat(money).toFixed(2);
- }
- };
- const changeMinPrice = () => {
- if (
- formData.dataTwo.quotationProductList &&
- formData.dataTwo.quotationProductList.length > 0
- ) {
- // 单个产品的价格
- for (let i = 0; i < formData.dataTwo.quotationProductList.length; i++) {
- let iele = formData.dataTwo.quotationProductList[i];
- if (iele.minPrice && iele.amplifyRatio) {
- iele.maxPrice = Number(
- parseFloat(
- Number(iele.minPrice) * (1 + Number(iele.amplifyRatio) / 100)
- ).toFixed(2)
- );
- }
- }
- }
- };
- const isDetailData = ref(false);
- const getConfirmDtl = (row, flag) => {
- if (!proxy.useUserStore().roles.includes("GM")) {
- return;
- }
- isDetailData.value = flag;
- formOptionTwo.disabled = flag;
- modalType.value = "edit";
- confirmDialog.value = true;
- proxy.post("/saleQuotation/detail", { id: row.id }).then((res) => {
- formData.dataTwo = res;
- if (!flag) {
- formData.dataTwo.quotationProductList =
- formData.dataTwo.quotationProductList.map((x) => ({
- ...x,
- price: x.prodPrice,
- }));
- }
- // 文件数据回显
- getFileDataOne();
- let productIds = formData.dataTwo.quotationProductList.map(
- (x) => x.productId
- );
- proxy.getFileData({
- businessIdList: productIds,
- data: formData.dataTwo.quotationProductList,
- att: "productId",
- businessType: "0",
- fileAtt: "productFile",
- filePathAtt: "fileUrl",
- });
- // 价格计算
- changeQuantityOne();
- changeQuantityTwo();
- changeMinPrice();
- });
- };
- const formDomTwo = ref(null);
- const confirmDialog = ref(false);
- const formConfigTwo = computed(() => {
- return [
- {
- type: "title1",
- title: "商品信息",
- },
- {
- type: "slot",
- slotName: "commodity",
- label: "",
- },
- {
- type: "title1",
- title: "报价总金额",
- },
- {
- type: "input",
- prop: "amountTwo",
- label: "工厂报价总额",
- itemWidth: 25,
- disabled: true,
- },
- {
- type: "input",
- prop: "amount",
- label: "调整报价总额",
- itemWidth: 25,
- disabled: true,
- },
- ];
- });
- const formOptionTwo = reactive({
- inline: true,
- labelWidth: 100,
- itemWidth: 100,
- disabled: false,
- });
- const rulesTwo = ref({
- price: [{ required: true, message: "请输入单价", trigger: "blur" }],
- // coefficient: [{ required: true, message: "请输入系数", trigger: "blur" }],
- minPrice: [{ required: true, message: "业务员最低报价", trigger: "blur" }],
- amplifyRatio: [{ required: true, message: "上调比例", trigger: "blur" }],
- });
- const confirmSubmit = () => {
- formDomTwo.value.handleSubmit(() => {
- formData.dataTwo.quotationStatus = 2;
- proxy
- .msgConfirm()
- .then((res) => {
- submitLoading.value = true;
- proxy.post("/saleQuotation/edit", formData.dataTwo).then((res) => {
- proxy.msgTip("操作成功", 1);
- submitLoading.value = false;
- confirmDialog.value = false;
- getList();
- detailDialog.value = false;
- });
- })
- .catch((err) => {
- submitLoading.value = false;
- });
- });
- };
- const changeForeignQuantity = () => {
- 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];
- iele.amount = Number(parseFloat(iele.price * iele.quantity).toFixed(2));
- money += Number(iele.amount);
- }
- formData.data.amount = parseFloat(money).toFixed(2);
- }
- };
- const activeNames = ref([]);
- let obj = {
- 1: "定制刀模",
- 2: "定制纹路",
- 3: "定制模具",
- };
- const getLabelOne = (type) => {
- return obj[type];
- };
- const handleBeforeUploadOne = async (file, index, sonIndex) => {
- const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
- file.id = res.id;
- file.fileUrl = res.fileUrl;
- uploadData.value = res.uploadBody;
- formData.data.quotationProductList[index].quotationProductCustomInfoList[
- sonIndex
- ].fileData = res;
- return true;
- };
- const handleSuccessOne = (index, sonIndex) => {
- if (
- formData.data.quotationProductList[index].quotationProductCustomInfoList[
- sonIndex
- ].fileData &&
- formData.data.quotationProductList[index].quotationProductCustomInfoList[
- sonIndex
- ].fileData.fileUrl
- ) {
- let file =
- formData.data.quotationProductList[index].quotationProductCustomInfoList[
- sonIndex
- ].fileData;
- formData.data.quotationProductList[index].quotationProductCustomInfoList[
- sonIndex
- ].fileList.push({
- id: file.id,
- fileName: file.fileName,
- name: file.fileName,
- url: file.fileUrl,
- fileUrl: file.fileUrl,
- });
- formData.data.quotationProductList[index].quotationProductCustomInfoList[
- sonIndex
- ].fileData = {};
- }
- };
- const handleRemoveFile = (file, index, sonIndex) => {
- formData.data.quotationProductList[index].quotationProductCustomInfoList[
- sonIndex
- ].fileList.splice(sonIndex, 1);
- };
- const onPreviewFile = (file) => {
- if (file && file.fileUrl) {
- window.open(file.fileUrl, "_blank");
- } else {
- window.open(file.raw.fileUrl, "_blank");
- }
- };
- </script>
- <style lang="scss" scoped>
- .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: #f4f4f5 !important;
- }
- .table {
- border-collapse: collapse;
- border-spacing: 0;
- td {
- text-align: center;
- padding: 2px 4px;
- // padding: 5px 10px;
- }
- }
- .small-title {
- padding-left: 15px;
- margin-bottom: 10px;
- color: #3366ff;
- font-size: 14px;
- }
- :deep(.el-checkbox) {
- margin-right: 0px;
- }
- </style>
|