12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524 |
- <template>
- <div class="app-container">
- <div v-if="isPercentage" class="percentage" style="width: 210px;height: 90px;background: #fff;position: fixed;bottom: 0;left: 0;z-index: 9999999999999;">
- <h4 style="padding-left: 10px;line-height: 0;">导出进度:</h4>
- <el-progress style="padding-left: 10px;" :text-inside="true" :stroke-width="26" :percentage="percentage" />
- </div>
- <el-tabs v-model="activeName" @tab-click="handleClick">
- <el-tab-pane v-if="isDistributionSheet" label="采购配单" name="first">
- <div class="purchaseDistributionSheet">
- <div class="filter-container">
- <el-select v-model="getdataListParm1.parammaps.departmentId" style="width: 140px;" placeholder="部门" class="filter-item" @change="change_dept">
- <el-option v-for="item in deptNameList" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- </div>
- <el-table
- :key="tableKey1"
- v-loading="listLoading1"
- element-loading-text="给我一点时间"
- :data="list1"
- border
- fit
- :row-style="tableRowStyle"
- :cell-style="tableCellStyle"
- highlight-current-row
- style="width: 100%;"
- class="elTable table-fixed"
- :max-height="myHeight"
- @cell-click="cellClick"
- @sort-change="tableSort"
- >
- <el-table-column label="序号" align="center" type="index" width="50px">
- <template slot-scope="scope">
- <span>{{ scope.$index + (pageNum1-1) * pageSize1 + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件编号" align="center" min-width="150px">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件名称" align="center" min-width="120px">
- <template slot-scope="scope">
- <span>{{ scope.row.partName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件规格" align="center" min-width="120px">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件品牌" min-width="100px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brand }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计量单位" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column label="图片" min-width="110px" align="center">
- <template slot-scope="scope">
- <el-popover placement="right" title="" trigger="hover">
- <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
- <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
- </el-popover>
- </template>
- </el-table-column>
- <el-table-column label="供应商" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.providerName }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="price" label="单价" min-width="70px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.price }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="sumAmount" label="申购数量" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sumAmount }}</span>
- </template>
- </el-table-column>
- <el-table-column label="采购数量" min-width="110px" align="center">
- <template slot-scope="scope">
- <el-form :model="scope.row" :rules="rules">
- <el-form-item prop="amount">
- <el-input v-model="scope.row.amount" style="width:80px;margin-top:25px;height:10px" />
- <!-- 白少让先注释了 -->
- <!-- <el-input v-if ="scope.row.amount == 0" v-model="scope.row.amount" style="width:80px;margin-top:25px;height:10px" disabled/>
- <el-input v-else v-model="scope.row.amount" style="width:80px;margin-top:25px;height:10px" /> -->
- </el-form-item>
- </el-form>
- </template>
- </el-table-column>
- </el-table>
- <el-button :disabled="confirmationSheetDisabled" type="primary" style="float: right;margin-top: 10px;" @click="confirmationSheet()">确认配单</el-button>
- <el-dialog :title="textMap[dialogStatusConfirmation]" :visible.sync="dialogFormVisibleConfirmation" :close-on-click-modal="false" style="width:100%;margin: 0 auto;overflow:auto">
- <div class="app-contentConfirmationSheet">
- <el-form ref="temp1" :rules="rules" :model="temp1" label-position="right" label-width="90px" style="width:100%;margin-bottom:50px">
- <el-row>
- <el-col :span="8">
- <el-form-item label="配单号:" prop="matchCode">
- <el-input ref="matchCode" v-model="temp1.matchCode" disabled />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="提交日期:" prop="buyerDate">
- <el-date-picker
- v-model="temp1.buyerDate"
- :picker-options="pickerOptions"
- type="date"
- placeholder="提交日期"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- style="width:170px;"
- />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="采购员:" prop="buyerPerson">
- <el-select v-model="temp1.buyerPerson" placeholder="采购员" class="filter-item">
- <el-option
- v-for="item in findAllEmploye"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div v-for="(item,index) in listConfirmationSheet" :key="index" class="app-content">
- <div class="title">
- <div>
- <b>采购单号:</b>
- <span>{{ item.orderNumber }}</span>
- </div>
- <div>
- <b>供应商:</b>
- <span>{{ item.providerName }}</span>
- </div>
- </div>
- <el-table
- :key="tableKey1"
- v-loading="listLoading1"
- element-loading-text="给我一点时间"
- :data="item.list"
- border
- fit
- highlight-current-row
- style="width: 97%;margin:0 auto"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- >
- <!-- table表格 -->
- <el-table-column label="序号" align="center" type="index" width="50px">
- <template slot-scope="scope">
- <span>{{ scope.$index + (pageNum1-1) * pageSize1 + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件编号" align="center" min-width="150px">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件名称" align="center" min-width="120px">
- <template slot-scope="scope">
- <span>{{ scope.row.partName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件规格" align="center" min-width="120px">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column label="图片" min-width="110px" align="center">
- <template slot-scope="scope">
- <el-popover placement="right" title="" trigger="hover">
- <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
- <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
- </el-popover>
- </template>
- </el-table-column>
- <el-table-column label="备件品牌" min-width="100px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brand }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计量单位" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column label="单价" min-width="70px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row. price }}</span>
- </template>
- </el-table-column>
- <el-table-column label="申购数量" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sumAmount }}</span>
- </template>
- </el-table-column>
- <el-table-column label="合计采购数量" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.amount }}</span>
- </template>
- </el-table-column>
- <el-table-column label="总价" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ (scope.row.sumPrice = scope.row.price * parseFloat(scope.row.amount))| keepTwoNum }}</span>
- </template>
- </el-table-column>
- </el-table>
- <div ref="total" class="total">
- 合计:
- <span>{{ item.Sum }}</span>
- </div>
- </div>
- <div slot="footer" class="dialog-footer" style="bottom:10px">
- <el-button type="primary" :disabled="isokDisable" @click="confirmationSheetData()">确认</el-button>
- <el-button @click="dialogFormVisibleConfirmation= false;get_table_data1();">取消</el-button>
- </div>
- </div>
- </el-dialog>
- </div>
- </el-tab-pane>
- <el-tab-pane v-if="isDistributionManagement" label="配单管理" name="fouth">
- <div class="DistributionManagement">
- <div class="filter-container">
- <el-select v-model="getdataListParm4.parammaps.pastureArr" style="width: 210px;" placeholder="牧场" class="filter-item" multiple
- collapse-tags collapse-tags-tooltip >
- <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
- </el-select>
- <el-input v-model="getdataListParm4.parammaps.matchCode" placeholder="配单号" clearable style="width: 200px;" class="filter-item" />
- <el-select v-model="getdataListParm4.parammaps.statue" clearable placeholder="审核状态" class="filter-item" style="width: 120px;">
- <el-option v-for="item in status2" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- <el-date-picker ref="inputDatetime4" v-model="getdataListParm4.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 270px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始提交日期" end-placeholder="结束提交日期" />
- <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search4">搜索</el-button>
- </div>
- <el-table
- :key="tableKey4"
- v-loading="listLoading4"
- element-loading-text="给我一点时间"
- :data="list4"
- border
- fit
- highlight-current-row
- style="width: 100%;"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- :max-height="myHeight"
- @sort-change="tableSort"
- @current-change="handleCurrentChange"
- >
- <el-table-column label="序号" align="center" type="index" width="50px">
- <template slot-scope="scope">
- <span>{{ scope.$index + (pageNum2-1) * pageSize2 + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="牧场" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.pastureName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="配单号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.matchCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="采购员" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.empname }}</span>
- </template>
- </el-table-column>
- <el-table-column label="提交日期" sortable prop="dealTime" min-width="110px" align="center" />
- <el-table-column sortable prop="cou" label="采购单数" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.cou }}</span>
- </template>
- </el-table-column>
- <el-table-column label="审核状态" min-width="80px" align="center" :formatter="statue" />
- <el-table-column label="操作" align="center" width="250px" class-name="small-padding fixed-width" fixed="right">
- <template slot-scope="{row}">
- <el-button v-if="isPurchaseSee" type="primary" size="mini" @click="form_see4(row)">查看</el-button>
- <el-button v-if="parseFloat(row.statue) === 0 && isExamineDM" style="display:inline-block" type="success" size="mini" @click="handleExamine(row)">审核</el-button>
- <el-button v-else style="display:none;" type="success" size="mini" @click="handleExamine(row)">审核</el-button>
- <el-button v-if="parseFloat(row.statue) === 2" type="success" style="display:inline-block" size="mini" @click="form_edit(row)">编辑</el-button>
- <el-button v-else style="display:none;" type="success" size="mini" @click="form_edit(row)">编辑</el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination v-show="total4>0" :total="total4" :page.sync="getdataListParm4.offset" :limit.sync="getdataListParm4.pagecount" @pagination="get_table_data4" />
- <el-dialog :title="textMap[dialogStatusSee4]" :visible.sync="dialogFormVisibleSee4" :close-on-click-modal="false">
- <div class="app-contentSee">
- <el-form ref="temp4" :rules="rules" :model="temp4" label-position="right" label-width="80px" style="width: 800px;margin-bottom:30px">
- <el-row>
- <el-col :span="8">
- <el-form-item label="配单号:" prop="matchCode">
- <span>{{ temp4.matchCode }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="采购员:" prop="empname">
- <span>{{ temp4.empname }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="配单日期:" prop="dealTime">
- <span>{{ temp4.dealTime }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <el-table
- :key="tableKeySee4"
- v-loading="listLoadingSee4"
- element-loading-text="给我一点时间"
- :data="listSee4"
- border
- fit
- highlight-current-row
- style="width: 100%;margin-bottom:100px"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- >
- <el-table-column label="序号" align="center" type="index" width="50px" />
- <el-table-column label="采购单号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.buyeCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件编号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件名称" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件规格" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件品牌" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brand }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计量单位" min-width="60px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column label="供应商" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.providerName }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="price" label="单价" min-width="60px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.price }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="sumAmount" label="申购数量" min-width="60px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sumAmount }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="amount" label="采购数量" min-width="60px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.amount }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="sumPrice" label="总价" min-width="60px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sumPrice }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件图片" min-width="110px" align="center">
- <template slot-scope="scope">
- <el-popover placement="right" title="" trigger="hover">
- <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
- <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
- </el-popover>
- </template>
- </el-table-column>
- <el-table-column prop="SGremark" label="备注" min-width="60px" align="center" />
- </el-table>
- <el-form ref="temp4" :rules="rules" :model="temp4" label-position="right" label-width="120px" style="width: 90%;margin:0 auto;">
- <el-row>
- <el-col>
- <el-form-item label="流程进度" />
- <el-steps :active="active" align-center finish-status="success">
- <el-step
- v-for="(item,index) in activeList"
- :key="index"
- :title="item.title"
- :status="item.status"
- >
- <template slot="description">
- <div class="step-row">
- <div>{{ item.name }} {{ item.date }}</div>
- <div>{{ item.reason }}</div>
- </div>
- </template>
- </el-step>
- </el-steps>
- </el-col>
- </el-row>
- <el-row>
- <el-col>
- <el-form-item label="操作:">
- <!-- 审核 -->
- <el-button v-if="isExamineDM && temp4.statue == 0" type="success" style="display:inline-block" @click="handleExamine()">审核</el-button>
- <el-button v-else type="success" style="display:none" @click="handleExamine()">审核</el-button>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:10px">
- <el-button @click="dialogFormVisibleSee4 = false;">关闭</el-button>
- </div>
- </div>
- </el-dialog>
- <el-dialog :title="textMap[dialogStatusUpdate4]" width="90%" :visible.sync="dialogFormVisibleUpdate4" :close-on-click-modal="false">
- <div class="app-contentUpdate">
- <el-form
- ref="updateTemp4"
- :rules="rules"
- :model="updateTemp4"
- label-position="right"
- label-width="80px"
- style="width:80%;margin-bottom:30px"
- >
- <el-row>
- <el-col :span="8">
- <el-form-item label="配单号:" prop="matchCode">
- <span>{{ updateTemp4.matchCode }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="采购员:" prop="empname">
- <span>{{ updateTemp4.empname }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="配单日期:" prop="dealTime">
- <span>{{ updateTemp4.dealTime }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <el-table
- :key="tableKeyUpdate4"
- v-loading="listLoadingUpdate4"
- element-loading-text="给我一点时间"
- :data="listUpdate4"
- border
- fit
- highlight-current-row
- style="width: 100%;margin-bottom:100px"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- >
- <!-- table表格 -->
- <el-table-column label="序号" align="center" type="index" width="50px" />
- <el-table-column label="采购单号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.buyeCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件编号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件名称" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件规格" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件品牌" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brand }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计量单位" min-width="60px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column label="供应商" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.providerName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="单价" min-width="60px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.price }}</span>
- </template>
- </el-table-column>
- <el-table-column label="申购数量" min-width="60px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sumAmount }}</span>
- </template>
- </el-table-column>
- <el-table-column label="采购数量" min-width="100px" align="center">
- <template slot-scope="scope">
- <el-form :model="scope.row" :rules="rules">
- <el-form-item prop="amount">
- <el-input
- v-model="scope.row.amount"
- style="width:80px;margin-top:25px;height:10px"
- />
- </el-form-item>
- </el-form>
- </template>
- </el-table-column>
- <el-table-column label="总价" min-width="60px" align="center">
- <template slot-scope="scope">
- <span>{{ (parseFloat(scope.row.price) * parseFloat(scope.row.amount)) | keepTwoNum2 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件图片" min-width="110px" align="center">
- <template slot-scope="scope">
- <el-popover placement="right" title="" trigger="hover">
- <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
- <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
- </el-popover>
- </template>
- </el-table-column>
- </el-table>
- <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:10px">
- <el-button type="primary" :disabled="isokDisable" @click="edit_dialog_save()">确认</el-button>
- <el-button @click="dialogFormVisibleUpdate4 = false;">关闭</el-button>
- </div>
- </div>
- </el-dialog>
- <el-dialog :title="textMap[dialogStatus_Examine]" :visible.sync="dialogFormVisible_Examine" :close-on-click-modal="false" width="30%">
- <div class="app-examine">
- <h3 style="width: 100%;margin:0 0 0 5%;line-height:50px;">请确认审核结果:</h3>
- <el-form ref="examineTemp" :rules="rules" :model="examineTemp" label-position="right" style="width: 50%;margin:0 auto;">
- <el-row style="width:88%;height:150px;margin:0 auto;">
- <el-col :span="20">
- <el-form-item>
- <el-radio-group v-model="examineTemp.SHstatue" @change="changeSHStatue">
- <el-radio :label="1" checked>通过</el-radio>
- <el-radio :label="2">不通过</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-col>
- <el-col v-if="statueReason" :span="20">
- <el-input v-model="examineTemp.workflowNote" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入不通过原因" />
- </el-col>
- </el-row>
- </el-form>
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" :disabled="isokDisable" @click="dialogStatus_Examine==='examine'?createExamineData():createExamineData()">确认</el-button>
- <el-button @click="dialogFormVisible_Examine = false;">关闭</el-button>
- </div>
- </el-dialog>
- </div>
- </el-tab-pane>
- <el-tab-pane label="采购单管理" name="second">
- <div class="purchaseOrderManagement">
- <div class="filter-container">
- <el-select v-model="getdataListParm2.parammaps.pastureArr" style="width: 210px;" placeholder="牧场" class="filter-item" multiple
- collapse-tags collapse-tags-tooltip>
- <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
- </el-select>
- <el-input v-model="getdataListParm2.parammaps.buyeCode" placeholder="采购单号" clearable style="width: 200px;" class="filter-item" />
- <el-select v-model="getdataListParm2.parammaps.statu" clearable placeholder="单据状态" class="filter-item" style="width: 120px;">
- <el-option v-for="item in status" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- <el-autocomplete v-model="getdataListParm2.parammaps.providerName" value-key="providerName" class="inline-input" :fetch-suggestions="providerSearch" placeholder="供应商" style="width:150px;top:-3px;" @select="handleSelectProvider" />
- <el-date-picker ref="inputDatetime2" v-model="getdataListParm2.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 270px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始提交日期" end-placeholder="结束提交日期" />
- <el-select v-model="getdataListParm2.parammaps.purchase_type" clearable style="width: 140px;" placeholder="申购类型" class="filter-item">
- <el-option v-for="item in subscriptionStatusList" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search2">搜索</el-button>
- <el-button v-if="isPurchaseSap" v-waves class="filter-item" type="primary" @click="sapUpload">SAP上传</el-button>
- <el-button v-if="isPurchaseSrm" v-waves class="filter-item" type="primary" @click="srmUpload">SRM上传</el-button>
- </div>
- <el-table
- :key="tableKey2"
- v-loading="listLoading2"
- element-loading-text="给我一点时间"
- :data="list2"
- border
- fit
- highlight-current-row
- style="width: 100%;"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- :max-height="myHeight"
- @sort-change="tableSort"
- @selection-change="change_table_selection"
- >
- <el-table-column type="selection" :selectable="checkboxInit" align="center" width="50" disabled />
- <el-table-column label="序号1" align="center" type="index" width="50px">
- <template slot-scope="scope">
- <span>{{ scope.$index + (pageNum2-1) * pageSize2 + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="牧场" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.pastureName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="采购单号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.buyeCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="供应商" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.providerName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="采购员" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.empname }}</span>
- </template>
- </el-table-column>
- <el-table-column label="提交日期" sortable prop="buyerDate" min-width="110px" align="center" />
- <el-table-column label="最近到货日期" sortable prop="DoneDate" min-width="110px" align="center" />
- <el-table-column label="单据状态" min-width="80px" align="center" :formatter="statu" />
- <el-table-column prop="sapNumber" label="sap编码" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sapNumber }}</span>
- </template>
- </el-table-column>
- <el-table-column label="申购类型" min-width="80px" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.purchase_type == 1">暂估申购</span>
- <span v-else-if="scope.row.purchase_type == 3">赠品申购</span>
- <span v-else-if="scope.row.purchase_type == 4">奶厅申购</span>
- <span v-else>新增申购</span>
- </template>
- </el-table-column>
- <el-table-column prop="sapstatus" label="sap上传状态" min-width="80px" align="center">
- <template slot-scope="scope">
- <span v-show="scope.row.sapstatus == 1">上传失败</span>
- <span v-show="scope.row.sapstatus == -1">未上传</span>
- <span v-show="scope.row.sapstatus == 0">上传成功</span>
- </template>
- </el-table-column>
- <el-table-column prop="srmstatus" label="srm上传状态" min-width="80px" align="center">
- <template slot-scope="scope">
- <span v-show="scope.row.srmstatus == 1">上传失败</span>
- <span v-show="scope.row.srmstatus == -1">未上传</span>
- <span v-show="scope.row.srmstatus == 0">上传成功</span>
- </template>
- </el-table-column>
- <el-table-column label="srm错误" prop="srmError" min-width="110px" align="center" />
- <el-table-column label="sap错误" prop="sapError" min-width="110px" align="center" />
- <el-table-column label="操作" align="center" width="250px" class-name="small-padding fixed-width" fixed="right">
- <template slot-scope="{row}">
- <el-button v-if="isPurchaseSee" type="primary" size="mini" @click="form_see2(row)">查看</el-button>
- <el-button v-if="(row.statu === 2 || row.statu === 4) && isPurchaseClose" style="display:none" type="danger" size="mini" @click="handleClose2(row)">关闭</el-button>
- <el-button v-else-if="isPurchaseClose" style="display:inline-block" type="danger" size="mini" @click="handleClose2(row)">关闭</el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination v-show="total2>0" :total="total2" :page.sync="getdataListParm2.offset" :limit.sync="getdataListParm2.pagecount" @pagination="get_table_data2" />
- <el-dialog :title="textMap[dialogStatusSee2]" :visible.sync="dialogFormVisibleSee2" :close-on-click-modal="false">
- <div class="app-contentSee">
- <el-form
- ref="temp2"
- :rules="rules"
- :model="temp2"
- label-position="right"
- label-width="80px"
- style="width: 800px;margin-bottom:30px"
- >
- <el-row>
- <el-col :span="8">
- <el-form-item label="采购单号:" prop="buyeCode">
- <span>{{ temp2.buyeCode }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="供应商:" prop="providerName">
- <span>{{ temp2.providerName }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="5">
- <el-form-item label="采购员:" prop="empname">
- <span>{{ temp2.empname }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="5">
- <el-form-item label="提交日期:" prop="buyerDate">
- <span>{{ temp2.buyerDate }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <el-table
- :key="tableKeySee2"
- v-loading="listLoadingSee2"
- element-loading-text="给我一点时间"
- :data="listSee2"
- border
- fit
- highlight-current-row
- style="width: 100%;margin-bottom:100px"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- @sort-change="tableSort2"
- >
- <el-table-column label="序号" align="center" type="index" width="50px" />
- <el-table-column label="备件编号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件名称" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件规格" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件图片" min-width="110px" align="center">
- <template slot-scope="scope">
- <el-popover placement="right" title="" trigger="hover">
- <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
- <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
- </el-popover>
- </template>
- </el-table-column>
- <el-table-column label="备件品牌" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brand }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计量单位" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="price" label="单价(元)" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.price }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="sumAmount" label="申购数量" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sumAmount }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="amount" label="采购数量" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.amount }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="sumPrice" label="总价(元)" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sumPrice }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="receiveAmount" label="入库数" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.receiveAmount }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="SGremark" label="备注" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.SGremark }}</span>
- </template>
- </el-table-column>
- </el-table>
- <div class="sum" style="right:30px;position:absolute;bottom:90px">
- <b>总计:{{ temp2.sumPrices }}元</b>
- </div>
- <div class="stuts" style="left:30px;position:absolute;bottom:70px">
- <b>单据状态:{{ temp2.statu }}</b>
- <b v-if="isStatu">关闭原因:{{ temp2.note }}</b>
- <div v-if="isExtensionDays">延期天数:{{ temp2.extensionDays }}</div>
- </div>
- <div
- slot="footer"
- class="dialog-footer"
- style="right:30px;position:absolute;bottom:10px"
- >
- <el-button @click="dialogFormVisibleSee2 = false;get_table_data2()">关闭</el-button>
- </div>
- </div>
- </el-dialog>
- <el-dialog :title="textMap[dialogStatusClose]" :visible.sync="dialogFormVisibleClose" :close-on-click-modal="false" style="width:70%;margin: 0 auto">
- <div class="app-contentClose">
- <el-form
- ref="temp2"
- :rules="rules"
- :model="temp2"
- label-position="right"
- label-width="80px"
- style="width: 300px;margin-bottom:30px"
- >
- <el-row>
- <el-col :span="24">
- <el-form-item label="采购单号:" prop="orderNo">
- <span>{{ temp2.buyeCode }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- <el-form-item label="" prop="note">
- <el-input ref="note" v-model="temp2.note" type="textarea" placeholder="请输入关闭该采购单原因" />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div
- slot="footer"
- class="dialog-footer"
- style="right:30px;position:absolute;bottom:10px"
- >
- <el-button @click="dialogFormVisibleClose = false;get_table_data2();">取消</el-button>
- <el-button type="primary" :disabled="isokDisable" @click="closeData()">确认关闭</el-button>
- </div>
- </div>
- </el-dialog>
- </div>
- </el-tab-pane>
- <el-tab-pane label="采购明细" name="third">
- <div class="procurementDetails">
- <div class="filter-container">
- <el-select v-model="getdataListParm3.parammaps.pastureArr" style="width: 210px;" placeholder="牧场" class="filter-item" multiple
- collapse-tags collapse-tags-tooltip >
- <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
- </el-select>
- <el-input v-model="getdataListParm3.parammaps.partCode" placeholder="备件编号" style="width: 200px;" class="filter-item" />
- <el-input v-model="getdataListParm3.parammaps.partName" placeholder="备件名称" style="width: 140px;" class="filter-item" />
- <el-autocomplete v-model="getdataListParm3.parammaps.providerName" value-key="providerName" class="inline-input" :fetch-suggestions="providerSearch" placeholder="供应商" style="width:150px;top:-3px;" @select="handleSelectProvider" />
- <el-input v-model="getdataListParm3.parammaps.matchCode" placeholder="配单号" style="width: 140px;" class="filter-item" />
- <el-input v-model="getdataListParm3.parammaps.buyeCode" placeholder="采购单号" style="width: 140px;" class="filter-item" />
- <el-select v-model="getdataListParm3.parammaps.isStorage" clearable placeholder="到货情况" class="filter-item" style="width: 120px;">
- <el-option v-for="item in isStorages" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- <el-select v-model="getdataListParm3.parammaps.purchase_type" clearable style="width: 140px;" placeholder="申购类型" class="filter-item">
- <el-option v-for="item in subscriptionStatusList" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- <el-date-picker ref="inputDatetime3" v-model="getdataListParm3.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 270px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
- <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search3">搜索</el-button>
- <el-button v-if="isPurchaseExport" class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-edit" @click="handleDownload3">导出</el-button>
- </div>
- <el-table
- :key="tableKey3"
- v-loading="listLoading3"
- element-loading-text="给我一点时间"
- :data="list3"
- border
- fit
- highlight-current-row
- style="width: 100%;"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- :max-height="myHeight"
- @sort-change="tableSort"
- >
- <el-table-column label="序号" align="center" type="index" width="50px">
- <template slot-scope="scope">
- <span>{{ scope.$index + (pageNum3-1) * pageSize3 + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="牧场" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.pastureName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="配单号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.matchCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="采购单号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.buyeCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件编号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件名称" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件规格" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件品牌" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brand }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计量单位" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column label="供应商" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.providerName }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="price" label="单价" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.price }}</span>
- </template>
- </el-table-column>
- <el-table-column label="当前库存" prop="reportery" align="center" min-width="120px">
- <template slot-scope="scope">
- <span>{{ parseFloat(scope.row.reportery ) }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="sumAmount" label="申购数量" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sumAmount }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="amount" label="采购数量" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.amount }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="receiveAmount" label="入库数" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.receiveAmount }}</span>
- </template>
- </el-table-column>
- <el-table-column label="申购类型" min-width="80px" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.purchase_type == 1">暂估申购</span>
- <span v-else-if="scope.row.purchase_type == 3">赠品申购</span>
- <span v-else-if="scope.row.purchase_type == 4">奶厅申购</span>
- <span v-else>新增申购</span>
- </template>
- </el-table-column>
- <el-table-column label="申购部门" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.departmentName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="采购人" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.empname }}</span>
- </template>
- </el-table-column>
- <el-table-column label="配单日期" sortable prop="buyerDate" min-width="110px" align="center" />
- <!-- <el-table-column label="备注" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.note }}</span>
- </template>
- </el-table-column> -->
- </el-table>
- <pagination v-show="total3>=0" :total="total3" :page.sync="getdataListParm3.offset" :limit.sync="getdataListParm3.pagecount" @pagination="get_table_data3" />
- </div>
- </el-tab-pane>
- <el-tab-pane label="采购退货" name="fifth">
- <div class="procurementDetails">
- <div class="filter-container">
- <el-select v-model="getdataListParm5.parammaps.pastureArr" style="width: 220px;" placeholder="牧场" class="filter-item" multiple
- collapse-tags collapse-tags-tooltip >
- <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
- </el-select>
- <el-input v-model="getdataListParm5.parammaps.buyeCode" placeholder="采购单号" style="width: 140px;" class="filter-item" />
- <el-autocomplete v-model="getdataListParm5.parammaps.providerName" value-key="providerName" class="inline-input" :fetch-suggestions="providerSearch" placeholder="供应商" style="width:150px;top:-3px;" @select="handleSelectProvider" />
- <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search5">搜索</el-button>
- <el-button class="filter-item" type="primary" icon="el-icon-edit" @click="form_add5">新增</el-button>
- </div>
- <el-table
- :key="tableKey5"
- v-loading="listLoading5"
- element-loading-text="给我一点时间"
- :data="list5"
- border
- fit
- highlight-current-row
- style="width: 100%;"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- :max-height="myHeight"
- @sort-change="tableSort"
- >
- <el-table-column label="序号" align="center" type="index" width="50px">
- <template slot-scope="scope">
- <span>{{ scope.$index + (pageNum3-1) * pageSize3 + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="采购单号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.buyeCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="供应商" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.providerName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="牧场" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.pastureName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="录入人" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.empname }}</span>
- </template>
- </el-table-column>
- <el-table-column label="采购员" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.empname }}</span>
- </template>
- </el-table-column>
- <el-table-column label="提交日期" sortable prop="buyerDate" min-width="110px" align="center" />
- <el-table-column label="单据状态" min-width="80px" align="center" :formatter="statu" />
- <el-table-column prop="sapNumber" label="sap编码" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sapNumber }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="sapstatus" label="sap上传状态" min-width="80px" align="center">
- <template slot-scope="scope">
- <span v-show="scope.row.sapstatus == 1">上传失败</span>
- <span v-show="scope.row.sapstatus == -1">未上传</span>
- <span v-show="scope.row.sapstatus == 0">上传成功</span>
- </template>
- </el-table-column>
- <el-table-column prop="srmstatus" label="srm上传状态" min-width="80px" align="center">
- <template slot-scope="scope">
- <span v-show="scope.row.srmstatus == 1">上传失败</span>
- <span v-show="scope.row.srmstatus == -1">未上传</span>
- <span v-show="scope.row.srmstatus == 0">上传成功</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center" width="250px" class-name="small-padding fixed-width" fixed="right">
- <template slot-scope="{row}">
- <el-button type="primary" size="mini" @click="form_see5(row)">查看</el-button>
- <el-button v-if="row.statu === 0" type="danger" size="mini" @click="handleClose5(row)">关闭</el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination v-show="total5>=0" :total="total5" :page.sync="getdataListParm5.offset" :limit.sync="getdataListParm5.pagecount" @pagination="get_table_data5" />
- </div>
- </el-tab-pane>
- </el-tabs>
- <el-dialog title="查看详情" :visible.sync="dialogFormVisibleSee5" :close-on-click-modal="false">
- <div class="app-contentSee">
- <el-form
- ref="temp5"
- :model="temp5"
- label-position="right"
- label-width="80px"
- style="width: 800px;margin-bottom:30px"
- >
- <el-row>
- <el-col :span="8">
- <el-form-item label="采购单号:" prop="buyeCode">
- <span>{{ temp5.buyeCode }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="供应商:" prop="providerName">
- <span>{{ temp5.providerName }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="5">
- <el-form-item label="采购员:" prop="empname">
- <span>{{ temp5.empname }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="5">
- <el-form-item label="提交日期:" prop="buyerDate">
- <span>{{ temp5.buyerDate }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <el-table
- element-loading-text="给我一点时间"
- :data="listSee5"
- border
- fit
- highlight-current-row
- style="width: 100%;margin-bottom:100px"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- >
- <el-table-column label="序号" align="center" type="index" width="50px" />
- <el-table-column label="备件编号" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件名称" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件规格" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件图片" min-width="110px" align="center">
- <template slot-scope="scope">
- <el-popover placement="right" title="" trigger="hover">
- <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
- <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
- </el-popover>
- </template>
- </el-table-column>
- <el-table-column label="备件品牌" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brand }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计量单位" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="price" label="单价(元)" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.price }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="amount" label="采购数量" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.amount }}</span>
- </template>
- </el-table-column>
- <el-table-column sortable prop="sumPrice" label="总价(元)" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sumPrice }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="SGremark" label="备注" min-width="110px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.SGremark }}</span>
- </template>
- </el-table-column>
- </el-table>
- <div class="sum" style="right:30px;position:absolute;bottom:90px">
- <b>总计:{{ temp5.sumPrices }}元</b>
- </div>
- <div class="stuts" style="left:30px;position:absolute;bottom:70px">
- <b>单据状态:{{ temp5.statu }}</b>
- <b v-if="isStatu">关闭原因:{{ temp5.note }}</b>
- <!-- <div v-if="isExtensionDays">延期天数:{{ temp5.extensionDays }}</div> -->
- </div>
- <div
- slot="footer"
- class="dialog-footer"
- style="right:30px;position:absolute;bottom:10px"
- >
- <el-button @click="dialogFormVisibleSee5 = false;get_table_data5()">关闭</el-button>
- </div>
- </div>
- </el-dialog>
- <el-dialog title="关闭提示" :visible.sync="dialogFormVisibleClose5" :close-on-click-modal="false" style="width:70%;margin: 0 auto">
- <div class="app-contentClose">
- <el-form
- ref="temp5"
- :rules="rules55"
- :model="temp5"
- label-position="right"
- label-width="80px"
- style="width: 300px;margin-bottom:30px"
- >
- <el-row>
- <el-col :span="24">
- <el-form-item label="采购单号:" prop="orderNo">
- <span>{{ temp5.buyeCode }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- <el-form-item label="" prop="note">
- <el-input ref="note" v-model="temp5.note" type="textarea" placeholder="请输入关闭该采购单原因" />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div
- slot="footer"
- class="dialog-footer"
- style="right:30px;position:absolute;bottom:10px"
- >
- <el-button @click="dialogFormVisibleClose5 = false;get_table_data5();">取消</el-button>
- <el-button type="primary" :disabled="isokDisable" @click="closeData5()">确认关闭</el-button>
- </div>
- </div>
- </el-dialog>
- <!-- 弹出层新增 -->
- <el-dialog title="采购退货" :visible.sync="dialogFormVisible5" :close-on-click-modal="false" width="90%">
- <div class="app-container">
- <el-form
- ref="createTemp5"
- :rules="rules5"
- :model="createTemp5"
- label-position="right"
- label-width="100px"
- style="width: 90%;margin:0 auto;"
- >
- <el-row>
- <el-col :span="8">
- <el-form-item label="采购单号:" prop="buyeCode">
- <el-input v-model="createTemp5.buyeCode" disabled placeholder="采购单号" style="width:100%" />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="供应商:" prop="providerId">
- <el-select v-model="createTemp5.providerId" filterable placeholder="供应商" style="width: 220px;" @change="changeProvider5">
- <el-option v-for="item in findAllProvider5" :key="item.id" clearable :label="item.name" :value="item.id" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="牧场:" prop="pastureId">
- <el-select v-model="createTemp5.pastureId" placeholder="牧场" class="filter-item" style="width: 220px;">
- <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="录入人:" prop="employeId">
- <el-select v-model="createTemp5.employeId" placeholder="录入人" class="filter-item" style="width: 220px;">
- <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="15">
- <el-form-item label="备件:" prop="partCode">
- <el-autocomplete
- v-model="createTemp5.partCode"
- value-key="name"
- class="inline-input"
- :fetch-suggestions="sparePartSearch5"
- placeholder="请输入备件编号或备件名称或备件规格"
- style="width:100%"
- @select="handleSelectSparePart5"
- >
- <template slot-scope="{ item }">
- <b>备件编号:</b><div class="name" style="display: inline;">{{ item.partCode }}</div>
- | <b>备件名称:</b><span class="addr">{{ item.partName }}</span>
- | <b>备件规格:</b><span class="addr">{{ item.specification }}</span>
- </template>
- </el-autocomplete>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <el-table
- element-loading-text="给我一点时间"
- :data="listAdd5"
- border
- fit
- highlight-current-row
- style="width: 100%;margin-bottom:30px"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- >
- <el-table-column label="序号" align="center" type="index" width="50px" />
- <el-table-column label="备件编号" prop="partCode" align="center" min-width="90">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件名称" prop="partName" align="center" min-width="90">
- <template slot-scope="scope">
- <span>{{ scope.row.partName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件规格" prop="specification" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件图片" prop="picpath" min-width="110px" align="center">
- <template slot-scope="scope">
- <el-popover placement="right" title="" trigger="hover">
- <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
- <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
- </el-popover>
- </template>
- </el-table-column>
- <el-table-column label="备件品牌" prop="brand" align="center" min-width="60">
- <template slot-scope="scope">
- <span>{{ scope.row.brand }}</span>
- </template>
- </el-table-column>
- <el-table-column label="计量单位" prop="unit" align="center" min-width="60">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column label="库存数" prop="reportery" align="center" min-width="60">
- <template slot-scope="scope">
- <span>{{ scope.row.reportery }}</span>
- </template>
- </el-table-column>
- <el-table-column label="退货数量" min-width="120px" align="center" valign="middle">
- <template slot-scope="scope">
- <el-form :model="scope.row">
- <el-form-item prop="amount">
- <el-input v-model="scope.row.amount" style="margin-top:15px" />
- </el-form-item>
- </el-form>
- </template>
- </el-table-column>
- <el-table-column label="单价" min-width="110px" align="center" valign="middle">
- <template slot-scope="scope">
- <span>{{ scope.row.price }}</span>
- </template>
- </el-table-column>
- <!-- <el-table-column label="总价" min-width="110px" align="center" valign="middle">
- <template slot-scope="scope">
- <span>{{ scope.row.price * parseFloat(scope.row.amount) | keepTwoNum }}</span>
- </template>
- </el-table-column> -->
- <el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width" fixed="right">
- <template slot-scope="{row}">
- <a class="del" @click="partDelete5(row)">删除</a>
- </template>
- </el-table-column>
- </el-table>
- <div slot="footer" class="dialog-footer" style="bottom:10px">
- <el-button type="primary" :disabled="isokDisable" @click="add_dialog_save5()">保存并关闭</el-button>
- <el-button @click="dialogFormVisible5 = false;get_table_data5()">取消并关闭</el-button>
- </div>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- // 引入
- import { GetDataByName, GetDataByNames, ExecDataByConfig, PostDataByName, failproccess, checkButtons, GetAccount, SapOrder, SrmOrder } from '@/api/common'
- import waves from '@/directive/waves' // waves directive
- import Pagination from '@/components/Pagination' // secondary package based on el-pagination
- import Cookies from 'js-cookie'
- import { MessageBox } from 'element-ui'
- import { parseTime, sortChange, json2excel } from '@/utils/index.js'
- export default {
- name: 'Purchase',
- components: { Pagination },
- directives: { waves },
- filters: {
- keepTwoNum(value) {
- value = Number(value)
- return value.toFixed(3)
- },
- keepTwoNum2(value) {
- value = Number(value)
- return value.toFixed(2)
- }
- },
- data() {
- return {
- myHeight: document.documentElement.clientHeight - 85 - 150,
- isSap: 1,
- isSrm: 1,
- selectList: [],
- isPurchaseSap: [], isPurchaseSrm: [],
- isPurchaseSee: [], isPurchaseClose: [], isPurchaseExport: [], isDistributionSheet: [], isDistributionManagement: [], isExamineDM: [],
- stripe: true,
- activeName: 'first',
- listLoading1: false,
- tableKey1: 0,
- list1: [],
- confirmationSheetDisabled: false,
- isokDisable: false,
- pickerOptions: {
- disabledDate(time) {
- return time.getTime() > Date.now() // 当天之前的时间可选
- }
- },
- temp: {},
- total: 0,
- total1: 0,
- listParmConfirmation: [],
- listConfirmationSheet: null,
- getParmPurchaseOrderNumber: {
- name: 'autoCreatCode',
- page: 1,
- offset: 1,
- returntype: 'Map',
- parammaps: {
- pastureId: Cookies.get('pastureid'),
- codeType: 'CG'
- }
- },
- postDataPramas: {},
- requestProvider: {
- name: 'getProviderList',
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {}
- },
- listLoading2: false,
- tableKey2: 0,
- list2: [],
- status2: [
- { id: '0', name: '审核中' },
- { id: '1', name: '审核通过' },
- { id: '2', name: '审核驳回' }
- ],
- status: [
- { id: '0', name: '未到货' },
- { id: '1', name: '部分到货' },
- { id: '2', name: '按时到货' },
- { id: '3', name: '已延期' },
- { id: '4', name: '已关闭' },
- { id: '5', name: '部分到货-延期' },
- { id: '6', name: '全部到货-延期' }
- ],
- isStorages: [
- { id: '0', name: '未入库' },
- { id: '1', name: '已入库' }
- ],
- isStatu: false,
- listLoadingSee2: false,
- tableKeySee2: 0,
- total2: 0,
- total3: 0,
- listLoading3: false,
- tableKey3: 0,
- list3: [],
- subscriptionStatusList: [
- { id: 0, name: '新增申购' },
- { id: 1, name: '暂估申购' },
- { id: 3, name: '赠品申购' },
- { id: 4, name: '奶厅申购' }], // 申购状态
- findAllEmploye: [],
- findAllPasture: [],
- requestParams: [
- { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
- { name: 'getDepartmentNY', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
- { name: 'findAllMainPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
- { name: 'findAllProvider', offset: 0, pagecount: 0, params: [] }
- ],
- getdataListParm1: {
- name: 'getbuydetailParts',
- page: 1,
- // offset: 1,
- // pagecount: 10,
- returntype: 'Map',
- parammaps: {
- pastureId: Cookies.get('pastureid'),
- departmentId: 0
- }
- },
- getdataListPart: {
- name: 'getpartpurchasebg',
- page: 1,
- // offset: 1,
- // pagecount: 10,
- returntype: 'Map',
- parammaps: {
- id: Cookies.get('pastureid'),
- departmentId: 0
- }
- },
- partData: [],
- getParmCreateNumber: {
- name: 'autoCreatCode',
- page: 1,
- offset: 1,
- returntype: 'Map',
- parammaps: {
- pastureId: Cookies.get('pastureid'),
- codeType: 'PD'
- }
- },
- pageNum1: 0,
- pageSize1: 0,
- temp1: {
- pastureId: Cookies.get('pastureid'),
- buyerPerson: this.$store.state.user.employeid,
- buyerDate: parseTime(new Date(), '{y}-{m}-{d}')
- },
- getdataListParm2: {
- name: 'getBigbuydetailList',
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {
- pastureArr:[],
- providerName: '',
- buyeCode: '',
- inputDatetime: '',
- // pastureId: Cookies.get('pastureid'),
- pastureName: Cookies.get('pasturename'),
- purchase_type: ''
- }
- },
- dialogFormVisibleConfirmation: false,
- dialogStatusConfirmation: '',
- pageNum2: 0,
- pageSize2: 0,
- temp2: {
- note: ''
- },
- getdataListParm3: {
- name: 'getbuydetailList',
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {
- pastureArr:[],
- pastureName: Cookies.get('pasturename'),
- providerName: '',
- partCode: '',
- partName: '',
- matchCode: '',
- buyeCode: '',
- isStorage: '',
- startTime: '',
- stopTime: '',
- inputDatetime: '',
- purchase_type: '',
- reportery: ''
- }
- },
- isExtensionDays: false,
- listSee2: [],
- getdataListSee2: {
- name: 'getbuydetailListbyBig',
- returntype: 'Map',
- parammaps: {}
- },
- requestParamStute: {
- name: 'updateBigbuydetailStatu',
- returntype: 'Map',
- parammaps: {}
- },
- requestParamStute5: {
- name: 'shutDownBigrefunddetail',
- returntype: 'Map',
- parammaps: {}
- },
- pageNum3: 0,
- pageSize3: 0,
- temp3: {},
- dialogFormVisibleSee2: false,
- dialogStatusSee2: '',
- // 配单管理
- listLoading4: false,
- tableKey4: 0,
- list4: [],
- pageNum4: 0,
- pageSize4: 0,
- total4: 0,
- getdataListParm4: {
- name: 'getbigpartdeallist',
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {
- pastureArr:[],
- pastureName: Cookies.get('pasturename'),
- matchCode: '',
- statue: '',
- inputDatetime: '',
- startTime: '',
- stopTime: ''
- }
- },
- dialogFormVisibleSee4: false,
- dialogStatusSee4: '',
- temp4: {},
- listSee4: [],
- tableKeySee4: 0,
- listLoadingSee4: false,
- getdataListSee4: {
- name: 'getbigpartdealdetiallist',
- returntype: 'Map',
- parammaps: {}
- },
- // 退货
- listLoading5: false,
- tableKey5: 0,
- list5: [],
- pageNum5: 0,
- pageSize5: 0,
- total5: 0,
- getdataListParm5: {
- name: 'getBigRefunddetailList',
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {
- pastureArr:[],
- pastureName: Cookies.get('pasturename'),
- providerName: '',
- partCode: '',
- partName: '',
- matchCode: '',
- buyeCode: '',
- isStorage: '',
- startTime: '',
- stopTime: '',
- inputDatetime: ''
- }
- },
- dialogFormVisible5: false,
- createTemp5: {
- providerId: '',
- buyeCode: '',
- note: '',
- pastureId: this.$store.state.user.pastureid,
- employeId: this.$store.state.user.employeid,
- createTime: parseTime(new Date(), '{y}-{m}-{d}')
- },
- rules5: {
- // useForm: [{ required: true, message: '必填', trigger: 'blur' }],
- providerId: [{ required: true, message: '必填', trigger: 'blur' }]
- },
- rules55: {
- note: [{ required: true, message: '必填', trigger: 'blur' }]
- },
- listSee5: [],
- getdataListSee5: {
- name: 'getrefunddetailListbyBig',
- returntype: 'Map',
- parammaps: {}
- },
- getParmCreateNumber5: {
- name: 'autoCreatCode',
- page: 0,
- offset: 0,
- pagecount: 0,
- returntype: 'Map',
- parammaps: {
- pastureId: Cookies.get('pastureid'),
- codeType: 'CG'
- }
- },
- requestSparePart5: {
- name: 'getPartsListThdd',
- page: 1,
- offset: 1,
- pagecount: 20,
- returntype: 'Map',
- parammaps: {
- pastureId: Cookies.get('pastureid')
- }
- },
- getParmBatchOperation5: {
- name: 'getStockPastureListBypv',
- returntype: 'Map',
- parammaps: {
- pastureId: Cookies.get('pastureid'),
- providerId: ''
- }
- },
- listAdd5: [],
- findAllProvider5: [],
- temp5: {
- note: ''
- },
- dialogFormVisibleSee5: false,
- dialogStatusSee5: '',
- activeList: [],
- deptNameList: [],
- active: 3,
- currentRow: {},
- dialogStatusUpdate4: '',
- dialogFormVisibleUpdate4: false,
- updateTemp4: {},
- listUpdate4: [],
- tableKeyUpdate4: 0,
- listLoadingUpdate4: false,
- dialogFormVisible_Examine: false,
- dialogStatus_Examine: '',
- examineTemp: {
- SHstatue: 1,
- workflowNote: ''
- },
- statueReason: false,
- dialogFormVisibleClose: false,
- dialogFormVisibleClose5: false,
- dialogStatusClose: '',
- textMap: {
- confirmation: '确认配单',
- see: '查看详情',
- close: '关闭提示',
- examine: '审核',
- update: '编辑'
- },
- // 校验规则
- rules: {
- equipmentName: [{ required: true, message: '必填', trigger: 'blur' }],
- note: [{ required: true, message: '必填', trigger: 'blur' }]
- },
- rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
- cellStyle: { padding: 0 + 'px' },
- buttons: [],
- downloadListParm3: {},
- downloadList3: [],
- isPercentage: false,
- percentage: 1
- }
- },
- created() {
- const that = this
- GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
- that.buttons = response.data.list
- that.get_auto_buttons()
- if (this.isDistributionSheet == true) {
- this.activeName = 'first'
- console.log(1, this.isDistributionSheet, this.isDistributionManagement)
- } else if (this.isDistributionManagement == true) {
- this.activeName = 'fouth'
- console.log(2, this.isDistributionSheet, this.isDistributionManagement)
- } else if (this.isDistributionSheet == false && this.isDistributionManagement == false) {
- this.activeName = 'second'
- console.log(3, this.isDistributionSheet, this.isDistributionManagement)
- }
- })
- this.get_select_list()
- this.get_table_data1()
- this.get_table_data2()
- this.get_table_data3()
- this.get_table_data4()
- this.get_table_data5()
- if (this.$route.query.activeName !== undefined) {
- this.activeName = this.$route.query.activeName
- }
- },
- methods: {
- form_add5() {
- this.resetCreateTemp5()
- this.createTemp5.buyeCode = ''
- this.dialogFormVisible5 = true
- this.getCreateNumber5()
- },
- resetCreateTemp5() {
- this.createTemp5.pastureId = this.$store.state.user.pastureid
- this.createTemp5.providerId = ''
- this.createTemp5.note = ''
- this.createTemp5.employeId = this.$store.state.user.employeid
- this.createTemp5.createTime = parseTime(new Date(), '{y}-{m}-{d}')
- this.createTemp5.buyeCode = ''
- this.listAdd5 = []
- this.TotalAmount5 = 0
- },
- getCreateNumber5() {
- GetDataByName(this.getParmCreateNumber5).then(response => {
- this.$nextTick(() => {
- console.log('新增退货单号', response.data.list[0].orderCode)
- this.createTemp5.buyeCode = response.data.list[0].orderCode
- this.$forceUpdate()
- })
- })
- },
- sparePartSearch5(queryString, cb) {
- console.log('备件模糊查询输入值', queryString)
- if (this.createTemp5.providerId !== '') {
- this.requestSparePart5.parammaps.providerId = this.createTemp5.providerId
- this.requestSparePart5.parammaps['partCode'] = queryString
- GetDataByName(this.requestSparePart5).then(response => {
- console.log('备件模糊查询搜索data', response.data.list)
- if (response.data.list == null) {
- cb([])
- } else {
- cb(response.data.list)
- }
- })
- } else {
- this.$message({
- title: '',
- message: '请选择供应商',
- type: 'warning',
- duration: 2000
- })
- }
- },
- handleSelectSparePart5(item) {
- console.log('备件模糊查询选中值', item)
- console.log('备件模糊查询选中值', item.id)
- if (this.listAdd5.length > 0) {
- // eslint-disable-next-line no-redeclare
- if (this.listAdd5.find(obj => obj.id === item.id)) {
- this.$message({
- type: 'warning',
- message: '此备件已存在,请重新选择备件'
- })
- console.log(this.listAdd5)
- console.log(this.listAdd5.length)
- return false
- } else {
- this.listAdd5.unshift(item)
- this.$set(item, 'amount', item.reportery)
- if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
- this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
- this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
- } else {
- item.srcpath = ''
- item.picpath = ''
- }
- }
- } else {
- this.listAdd5.unshift(item)
- this.$set(item, 'amount', item.reportery)
- if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
- this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
- this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
- } else {
- item.srcpath = ''
- item.picpath = ''
- }
- }
- this.$forceUpdate()
- console.log(this.listAdd5)
- },
- changeProvider5(val) {
- console.log(val, '供应商change')
- this.listAdd5 = []
- this.getParmBatchOperation5.parammaps.providerId = val
- },
- // 新增删除
- partDelete5(row) {
- console.log(this.listAdd5)
- MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- for (var i = 0; i < this.listAdd5.length; i++) {
- console.log(this.listAdd5[i])
- if (this.listAdd5[i].id === row.id) {
- var listAddIndex = this.listAdd5.indexOf(this.listAdd5[i])
- }
- if (listAddIndex > -1) {
- this.listAdd5.splice(listAddIndex, 1)
- return
- }
- }
- })
- },
- add_dialog_save5() {
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- this.$refs['createTemp5'].validate(valid => {
- if (valid) {
- console.log(this.listAdd5)
- console.log(this.createTemp5.buyeCode)
- if (this.createTemp5.buyeCode == '' || this.createTemp5.buyeCode == null || this.createTemp5.buyeCode == undefined) {
- GetDataByName(this.getParmCreateNumber5).then(response => {
- this.$nextTick(() => {
- console.log('退库单号', response.data.list[0].orderCode)
- this.createTemp5.buyeCode = response.data.list[0].orderCode
- this.$forceUpdate()
- this.add_dialog_saveSave5()
- })
- })
- } else {
- this.add_dialog_saveSave5()
- }
- }
- })
- },
- add_dialog_saveSave5() {
- if (this.listAdd5.length !== 0) {
- for (var j = 0; j < this.listAdd5.length; j++) {
- console.log(this.listAdd5[j].amount)
- // eslint-disable-next-line use-isnan
- if (this.listAdd5[j].amount == null || this.listAdd5[j].amount === '') {
- this.$message({
- type: 'warning',
- message: '请检查数量是否未填写',
- duration: 2000
- })
- return false
- } else {
- var rulesRefundNumber = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
- if (!rulesRefundNumber.test(this.listAdd5[j].amount)) {
- this.$message({
- type: 'error',
- message: '数量请输入正数,最多保留两位小数点',
- duration: 2000
- })
- return false
- } else if (parseFloat(this.listAdd5[j].amount) > parseFloat(this.listAdd5[j].reportery)) {
- this.$message({
- type: 'error',
- message: '数量不可大于库存数',
- duration: 2000
- })
- return false
- }
- }
- }
- // 保存发的参数!!!!
- var send_data = {
- 'common': {
- 'returnmap': '0'
- },
- 'data': [
- {
- 'name': 'addBigrefunddetail',
- 'type': 'e',
- 'parammaps': {
- 'pastureId': Cookies.get('pastureid'),
- 'buyeCode': this.createTemp5.buyeCode,
- 'providerId': this.createTemp5.providerId,
- 'buyerDate': '',
- 'buyerPerson': this.createTemp5.employeId,
- 'note': ''
- }
- },
- {
- 'name': 'insertSpotList',
- 'resultmaps': {
- 'list': this.listAdd5
- },
- 'children': [
- {
- 'name': 'addRefunddetail',
- 'type': 'e',
- 'parammaps': {
- 'brandId': '@insertSpotList.brandId',
- 'contractId': '@insertSpotList.contractId',
- 'contractCode': '@insertSpotList.contractCode',
- 'bigId': '@insertSpotList.bigId',
- 'partCode': '@insertSpotList.partCode',
- 'partId': '@insertSpotList.partId',
- 'pastureId': '@insertSpotList.pastureId',
- 'price': '@insertSpotList.price',
- 'statue': '@insertSpotList.statue',
- 'remark': '@insertSpotList.remark',
- 'amount': '@insertSpotList.amount',
- 'providerId': '@insertSpotList.providerId',
- 'departmentName': '@insertSpotList.departmentName',
- 'bigId': '@addBigrefunddetail.LastInsertId'
- }
- }
- ]
- }
- ]
- }
- ExecDataByConfig(send_data).then(response => {
- console.log('新增保存发送参数', send_data)
- if (response.msg === 'fail') {
- this.$notify({
- title: '保存失败',
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- } else {
- this.dialogFormVisible5 = false
- this.getdataListParm5.parammaps.inputDatetime = ''
- setTimeout(() => {
- this.get_table_data5()
- }, 1000)
- this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
- }
- })
- return true
- } else {
- this.$message({
- title: '',
- message: '请选择备件',
- type: 'warning',
- duration: 2000
- })
- return false
- }
- },
- change_dept(e) {
- console.log(e)
- this.getdataListParm1.parammaps.departmentId = e
- this.getdataListPart.parammaps.departmentId = e
- this.get_table_data1()
- },
- tableSort(column) {
- if (this.activeName == 'first') {
- sortChange(column, this.list1)
- } else if (this.activeName == 'second') {
- sortChange(column, this.list2)
- } else if (this.activeName == 'third') {
- sortChange(column, this.list3)
- } else if (this.activeName == 'fouth') {
- sortChange(column, this.list4)
- }
- },
- tableSort2(column) {
- sortChange(column, this.listSee2)
- },
- get_auto_buttons() {
- const DistributionSheet = 'customs:purchase:distributionSheet'
- const isDistributionSheet = checkButtons(this.$store.state.user.buttons, DistributionSheet)
- this.isDistributionSheet = isDistributionSheet
- const PurchaseSee = 'customs:purchase:see'
- const isPurchaseSee = checkButtons(this.$store.state.user.buttons, PurchaseSee)
- this.isPurchaseSee = isPurchaseSee
- const PurchaseClose = 'customs:purchase:close'
- const isPurchaseClose = checkButtons(this.$store.state.user.buttons, PurchaseClose)
- this.isPurchaseClose = isPurchaseClose
- const PurchaseSap = 'customs:purchase:sap'
- const isPurchaseSap = checkButtons(this.$store.state.user.buttons, PurchaseSap)
- this.isPurchaseSap = isPurchaseSap
- const PurchaseSrm = 'customs:purchase:srm'
- const isPurchaseSrm = checkButtons(this.$store.state.user.buttons, PurchaseSrm)
- this.isPurchaseSrm = isPurchaseSrm
- const PurchaseExport = 'customs:purchase:export'
- const isPurchaseExport = checkButtons(this.$store.state.user.buttons, PurchaseExport)
- this.isPurchaseExport = isPurchaseExport
- const ExamineDM = 'customs:purchase:shenhe'
- const isExamineDM = checkButtons(this.$store.state.user.buttons, ExamineDM)
- this.isExamineDM = isExamineDM
- const DistributionManagement = 'customs:purchase:peidanjiemian'
- const isDistributionManagement = checkButtons(this.$store.state.user.buttons, DistributionManagement)
- this.isDistributionManagement = isDistributionManagement
- },
- cellClick(row, column, cell, event) {
- console.log(cell)
- console.log('column', column)
- console.log('行索引', row.id)
- console.log('列索引', column.id)
- return {
- background: '#eceb3c'
- }
- // console.log('event',event)
- },
- tableRowStyle({ row, rowIndex }) {
- console.log(row, row)
- console.log(' row.isParity', row.isParity)
- console.log(parseInt(row.isParity) % 2 == 0)
- if (parseInt(row.isParity) % 2 == 0) {
- return {
- background: '#eee'
- }
- }
- return {
- background: ''
- }
- },
- tableCellStyle({ row, column, rowIndex, columnIndex }) {
- if (row.isNo == 'No' && columnIndex === 10) {
- return {
- background: 'red'
- }
- }
- return {
- background: ''
- }
- },
- handleClick(tab, event) {
- console.log(tab, event)
- if (tab.name === 'first') {
- this.get_table_data1()
- } else if (tab.name === 'fouth') {
- this.get_table_data4()
- } else if (tab.name === 'second') {
- this.get_table_data2()
- } else if (tab.name === 'third') {
- this.get_table_data3()
- } else if (tab.name === 'fifth') {
- this.get_table_data5()
- }
- },
- get_select_list() {
- GetDataByNames(this.requestParams).then(response => {
- this.findAllEmploye = response.data.findAllEmploye.list
- this.findAllPasture = response.data.findAllMainPasture.list
- this.deptNameList = response.data.getDepartmentNY.list
- this.findAllProvider5 = response.data.findAllProvider.list
- this.findAllProvider = response.data.findAllProvider.list
- this.getdataListParm2.parammaps.pastureArr = this.findAllPasture.map(item => {
- return item.name
- })
- this.getdataListParm3.parammaps.pastureArr = this.findAllPasture.map(item => {
- return item.name
- })
- this.getdataListParm4.parammaps.pastureArr = this.findAllPasture.map(item => {
- return item.name
- })
- this.getdataListParm5.parammaps.pastureArr = this.findAllPasture.map(item => {
- return item.name
- })
- console.log(this.deptNameList)
- })
- },
- providerSearch(queryString, cb) {
- console.log('供应商模糊查询输入值', queryString)
- this.requestProvider.parammaps['providerName'] = queryString
- GetDataByName(this.requestProvider).then(response => {
- console.log('供应商模糊查询搜索data', response.data.list)
- cb(response.data.list)
- })
- },
- handleSelectProvider(item) {
- console.log('供应商模糊查询选中值', item)
- },
- get_table_data1() {
- this.listLoading1 = true
- GetDataByName(this.getdataListPart).then(response => {
- console.log(response)
- this.partData = response.data.list
- })
- // 对于多选的牧场,根据数组的名称来转换 pastureArr =》 pastureId TODO:
- if (this.getdataListParm1.parammaps.pastureArr && this.getdataListParm1.parammaps.pastureArr.length > 0) {
- const arr = this.findAllPasture.filter((item) => {
- if (this.getdataListParm1.parammaps.pastureArr.includes(item.name)) {
- return item
- }
- })
- const ids = arr.map((child) => { return child.id })
- console.log(arr,ids,'999999')
- this.getdataListParm1.parammaps.pastureId = ids.toString();
- }
- GetDataByName(this.getdataListParm1).then(response => {
- console.log('this.list1', response.data.list)
- if (response.data.list === null) {
- this.list1 = []
- this.confirmationSheetDisabled = true
- } else {
- // eslint-disable-next-line no-unused-vars
- var list1
- list1 = response.data.list
- var result = []
- list1.forEach((i, j) => {
- // eslint-disable-next-line no-irregular-whitespace
- Array.from(new Set(list1.map(function(item) { return item.partCode }))).forEach((x, y) => {
- if (i.partCode === x) {
- result.push({
- 'amount': i.amount,
- 'amountPre': i.amountPre,
- 'bigId': i.bigId,
- 'brand': i.brand,
- 'brandId': i.brandId,
- 'contractCode': i.contractCode,
- 'count': i.count,
- 'enable': i.enable,
- 'id': i.id,
- 'inventoryType': i.inventoryType,
- 'isZeroStock': i.isZeroStock,
- 'orderNumber': i.orderNumber,
- 'partCode': i.partCode,
- 'partId': i.partId,
- 'partName': i.partName,
- 'pastureId': i.pastureId,
- 'pastureName': i.pastureName,
- 'planAmount': i.planAmount,
- 'price': i.price,
- 'providerId': i.providerId,
- 'providerName': i.providerName,
- 'purpose': i.purpose,
- 'remark': i.remark,
- 'specification': i.specification,
- 'sumAmount': i.sumAmount,
- 'unit': i.unit,
- 'isNo': i.isNo,
- 'srcpath': i.srcpath,
- 'picpath': i.picpath,
- 'departmentName': i.departmentName,
- 'isParity': y
- })
- }
- })
- })
- console.log(result)
- if (result !== null) {
- for (let i = 0; i < result.length; i++) {
- console.log(result[i].srcpath)
- if (result[i].srcpath !== null && result[i].picpath !== null && result[i].srcpath !== undefined && result[i].picpath !== undefined) {
- result[i].srcpath = process.env.VUE_APP_BASE_API + result[i].srcpath
- result[i].picpath = process.env.VUE_APP_BASE_API + result[i].picpath
- } else {
- // this.$set(result[i], 'srcpath', '')
- // this.$set(result[i], 'picpath', '')
- result[i].srcpath = ''
- result[i].picpath = ''
- }
- }
- }
- // console.log(result)
- this.list1 = result
- console.log('处理后table数', this.list1)
- this.confirmationSheetDisabled = false
- }
- var tem = ''
- for (var i = 0; i < this.list1.length; i++) {
- if (tem !== this.list1[i].partCode) {
- this.list1[i].amount = this.list1[i].sumAmount
- tem = this.list1[i].partCode
- } else {
- this.list1[i].amount = 0
- }
- }
- // var a = 0
- // var b = 0
- // for (var i = 0; i < this.list1.length; i++) {
- // if (parseInt(this.list1[i].amountPre) !== 0) {
- // console.log(parseInt(this.list1[i].amountPre))
- // if (a <= 0) {
- // a = this.list1[i].count - 1
- // if (b === 0) {
- // b = parseInt(this.list1[i].amountPre)
- // }
- // } else {
- // a--
- // }
- // if (b > 0) {
- // this.list1[i].amount = this.list1[i].amount + 1
- // b--
- // }
- // }
- // }
- if (response.data.total) {
- this.total1 = response.data.total
- }
- // Just to simulate the time of the request
- setTimeout(() => {
- this.listLoading1 = false
- }, 300)
- })
- },
- confirmationSheet() {
- console.log('点击立确认配单')
- this.temp1.matchCode = ''
- console.log(this.list1) // table表格数据
- // -------------------------------------------
- function groupBy1(array, f) {
- var groups1 = {}
- array.forEach(function(o) {
- var group2 = JSON.stringify(f(o))
- console.log('group2', group2)
- groups1[group2] = groups1[group2] || []
- groups1[group2].push(o)
- })
- return Object.keys(groups1).map(function(group2) {
- return groups1[group2]
- })
- }
- var sorted1 = groupBy1(this.list1, function(item) {
- return [item.partCode]
- })
- console.log('表格数据根据供应商分划', sorted1)
- for (var i = 0; i < sorted1.length; i++) {
- var b = 0
- var c = 0
- for (var j = 0; j < sorted1[i].length; j++) {
- // eslint-disable-next-line no-self-compare
- if (sorted1[i][j].partCode === sorted1[i][j].partCode) {
- // console.log(sorted1[i][j])
- var element = sorted1[i][j]
- b += parseInt(element.amount)
- c = parseInt(element.sumAmount)
- // console.log("amount", element.amount);
- }
- }
- if (b > c || b < c) {
- console.log('No')
- console.log(element.id)
- for (var a = 0; a < this.list1.length; a++) {
- if (element.id === this.list1[a].id) {
- console.log(this.list1[a].partCode)
- for (var b = 0; b < this.list1.length; b++) {
- if (this.list1[b].partCode === this.list1[a].partCode) {
- console.log(this.list1[b])
- this.$set(this.list1[b], 'isNo', 'No')
- } else {
- this.$set(this.list1[b], 'isNo', 'Yes')
- }
- }
- } else {
- this.$set(this.list1[a], 'isNo', 'Yes')
- }
- }
- console.log(b)
- this.$message({
- type: 'warning',
- message: '同一备件多个供应商合计采购数量总和等于申购数量'
- })
- return
- } else {
- for (var a = 0; a < this.list1.length; a++) {
- this.$set(this.list1[a], 'isNo', 'Yes')
- var rulesAmount = /^[0-9]\d*$/
- if (!rulesAmount.test(this.list1[a].amount)) {
- this.$message({
- type: 'error',
- message: '采购数量请输入正整数',
- duration: 2000
- })
- return false
- }
- }
- // console.log('Yes')
- }
- }
- this.getCreateNumber()
- // -------------------------------------------
- this.dialogStatusConfirmation = 'confirmation'
- this.dialogFormVisibleConfirmation = true
- console.log('确认配单data------', this.list1)
- // this.list1 = this.list1.filter(i => parseFloat(i.amount) !== 0)
- console.log(this.list1)
- console.log('根据供应商分类', sorted1)
- console.log('根据供应商分类表格listConfirmationSheet', this.listConfirmationSheet)
- // 处理渲染数据
- var providerNameMap = {}
- var providerNameDest = []
- // eslint-disable-next-line no-redeclare
- for (var i = 0; i < this.list1.length; i++) {
- console.log(this.list1[i])
- var ai = this.list1[i]
- var price = this.list1[i].price
- var amount = this.list1[i].amount
- // console.log(price, amount)
- var sumPrice = 0
- sumPrice = parseFloat(price) * parseFloat(amount)
- if (!providerNameMap[ai.providerName]) {
- providerNameDest.push({
- price: [price],
- amount: [amount],
- sumPrice: [sumPrice],
- providerId: ai.providerId,
- providerName: ai.providerName,
- purpose: ai.purpose,
- list: [ai]
- })
- providerNameMap[ai.providerName] = ai
- providerNameMap[ai.providerId] = ai
- } else {
- // eslint-disable-next-line no-redeclare
- for (var j = 0; j < providerNameDest.length; j++) {
- console.log(providerNameDest[j])
- var dj = providerNameDest[j]
- if (dj.providerName === ai.providerName) {
- dj.sumPrice.push(sumPrice)
- dj.price.push(price)
- // eslint-disable-next-line no-mixed-spaces-and-tabs
- dj.amount.push(amount)
- dj.list.push(ai)
- break
- }
- }
- }
- }
- var providerNameArray = []
- // eslint-disable-next-line no-redeclare
- for (var i = 0; i < this.list1.length; i++) {
- providerNameArray.push(this.list1[i].providerName)
- }
- // console.log('原供应商', providerNameArray)
- function unique(providerNameArray) {
- return Array.from(new Set(providerNameArray))
- }
- var uniqueProviderNameArray = unique(providerNameArray)
- console.log('去重后供应商', uniqueProviderNameArray) // ["泰森机电", "浩祥晟机电", "国宇商贸", "赛娜牧业"]
- // ------------------------------------------
- var OrderNumberArray = []
- this.postDataPramas.common = { 'returnmap': '0' }
- this.postDataPramas.data = []
- for (var i = 0; i < uniqueProviderNameArray.length; i++) {
- this.postDataPramas.data[i] = { 'name': 'autoCreatCode', 'type': 'sm', 'parammaps': {
- pastureId: Cookies.get('pastureid'),
- codeType: 'CG'
- }}
- }
- ExecDataByConfig(this.postDataPramas).then(response => {
- console.log('采购单请求发送参数', this.postDataPramas)
- for (var i = 0; i < response.data.length; i++) {
- // console.log(response.data[i].resultmaps[0].orderCode)
- OrderNumberArray.push(response.data[i].resultmaps[0].orderCode)
- }
- console.log(OrderNumberArray)
- this.listConfirmationSheet.map((item, index) => {
- item.orderNumber = OrderNumberArray[index]
- return item
- })
- this.$forceUpdate()
- })
- console.log(OrderNumberArray)
- this.listConfirmationSheet = providerNameDest
- // console.log(JSON.stringify(this.listConfirmationSheet))
- console.log('根据供应商分类表格listConfirmationSheet', this.listConfirmationSheet)
- var SumArray = []
- this.listConfirmationSheet.forEach((item, index) => {
- console.log(item.sumPrice)
- // console.log(item.sumPrice.reduce((count, v) => count + v, 0))
- SumArray.push(item.sumPrice.reduce((count, v) => count + v, 0).toFixed(3))
- })
- this.listConfirmationSheet.map((item, index) => {
- // console.log(item, index)
- item.Sum = SumArray[index]
- return item
- })
- console.log('根据供应商分类表格listConfirmationSheet', this.listConfirmationSheet)
- // -------------------------------------------
- },
- getCreateNumber() {
- GetDataByName(this.getParmCreateNumber).then(response => {
- this.$nextTick(() => {
- this.show = false
- console.log('配单号', response.data.list[0].orderCode)
- this.temp1.matchCode = response.data.list[0].orderCode
- this.$forceUpdate()
- })
- })
- },
- confirmationSheetData() {
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- console.log('点击了确认配单提交')
- this.$refs['temp1'].validate(valid => {
- if (valid) {
- // orderNumber
- if (this.temp1.matchCode == '' || this.temp1.matchCode == null || this.temp1.matchCode == undefined) {
- this.getCreateNumber()
- }
- this.postDataPramas.common = { 'returnmap': '0' }
- this.postDataPramas.data = []
- console.log(this.listConfirmationSheet)
- for (let i = 0; i < this.listConfirmationSheet.length; i++) {
- if (this.listConfirmationSheet[i].orderNumber == null || this.listConfirmationSheet[i].orderNumber == undefined) {
- this.$notify({
- title: '保存失败',
- message: '网络异常未生成采购单,请刷新后重新进行配单',
- type: 'warning',
- duration: 2000
- })
- return false
- }
- }
- var a = this.listConfirmationSheet.length
- this.listConfirmationSheet.forEach((item, index) => {
- console.log(item)
- this.postDataPramas.data[index] = { 'name': 'insertBigbuydetail', 'resultname': 'insertBigbuydetail' + index, 'type': 'e', 'parammaps': {
- pastureId: Cookies.get('pastureid'),
- buyeCode: item.orderNumber,
- providerId: item.providerId,
- buyerPerson: this.temp1.buyerPerson,
- buyerDate: this.temp1.buyerDate,
- matchCode: this.temp1.matchCode
- }}
- this.postDataPramas.data[a] = { 'name': 'insertSpotList', 'resultmaps': { 'list': item.list }}
- this.postDataPramas.data[a].children = []
- this.postDataPramas.data[a].children[0] = { 'name': 'insertbuydetail', 'type': 'e', 'parammaps': {
- bigId: '@insertBigbuydetail' + index + '.LastInsertId',
- pastureId: '@insertSpotList.pastureId',
- contractCode: '@insertSpotList.contractCode',
- amount: '@insertSpotList.amount',
- sumAmount: '@insertSpotList.sumAmount',
- contractId: '@insertSpotList.id',
- departmentName: '@insertSpotList.departmentName',
- remark: '@insertSpotList.purpose'
- }}
- a = a + 1
- })
- this.postDataPramas.data[a] = { 'name': 'insertSpotListbpp', 'resultmaps': { 'list': this.partData }}
- this.postDataPramas.data[a].children = []
- this.postDataPramas.data[a].children[0] = { 'name': 'updateBigpartpurchaseStatu', 'type': 'e', 'parammaps': {
- id: '@insertSpotListbpp.id',
- matchCode: this.temp1.matchCode
- }}
- this.postDataPramas.data.push({ 'name': 'insertbigpartdeal', 'type': 'e', 'parammaps': {
- empId: this.temp1.buyerPerson,
- pastureId: Cookies.get('pastureid'),
- matchCode: this.temp1.matchCode
- }}
- )
- ExecDataByConfig(this.postDataPramas).then(response => {
- if (response.msg === 'fail') {
- var buyeCode = new RegExp('buyeCode')
- if (buyeCode.test(response.data)) {
- this.$notify({
- title: '',
- message: '网络异常未生成采购单,请刷新后重新进行配单',
- type: 'warning',
- duration: 2000
- })
- } else {
- this.$notify({
- title: '保存失败',
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- }
- } else {
- this.dialogFormVisibleConfirmation = false
- this.activeName = 'fouth'
- this.get_table_data4()
- this.$notify({
- title: '',
- message: '保存成功',
- type: 'success',
- duration: 2000
- })
- }
- })
- }
- })
- },
- get_table_data2() {
- this.listLoading2 = true
- if (this.$refs['inputDatetime2'] !== undefined && this.$refs['inputDatetime2'].value !== null) {
- this.getdataListParm2.parammaps.startTime = this.$refs['inputDatetime2'].value[0]
- this.getdataListParm2.parammaps.stopTime = this.$refs['inputDatetime2'].value[1]
- } else {
- this.getdataListParm2.parammaps.startTime = ''
- this.getdataListParm2.parammaps.stopTime = ''
- }
- // 对于多选的牧场,根据数组的名称来转换 pastureArr =》 pastureId TODO:
- if (this.getdataListParm2.parammaps.pastureArr && this.getdataListParm2.parammaps.pastureArr.length > 0) {
- const arr = this.findAllPasture.filter((item) => {
- if (this.getdataListParm2.parammaps.pastureArr.includes(item.name)) {
- return item
- }
- })
- const ids = arr.map((child) => { return child.id })
- console.log(arr,ids,'999999')
- this.getdataListParm2.parammaps.pastureId = ids.toString();
- }
- GetDataByName(this.getdataListParm2).then(response => {
- this.list2 = response.data.list
- this.pageNum2 = response.data.pageNum
- this.pageSize2 = response.data.pageSize
- if (response.data.total) {
- this.total2 = response.data.total
- }
- // Just to simulate the time of the request
- setTimeout(() => {
- this.listLoading2 = false
- }, 300)
- })
- },
- form_search2() {
- this.listLoading = true
- if (this.getdataListParm2.parammaps.inputDatetime === null) {
- this.getdataListParm2.parammaps.inputDatetime = ''
- }
- this.getdataListParm2.offset = 1
- this.get_table_data2()
- },
- statu: function(cellValue) {
- if (cellValue.statu === 0) {
- return '未到货'
- } else if (cellValue.statu === 1) {
- return '部分到货'
- } else if (cellValue.statu === 2) {
- return '按时到货'
- } else if (cellValue.statu === 3) {
- return '已延期'
- } else if (cellValue.statu === 4) {
- return '已关闭'
- } else if (cellValue.statu === 5) {
- return '部分到货-延期'
- } else if (cellValue.statu === 6) {
- return '全部到货-延期'
- }
- },
- statue: function(cellValue) {
- if (cellValue.statue === 0) {
- return '审核中'
- } else if (cellValue.statue === 1) {
- return '审核通过'
- } else if (cellValue.statue === 2) {
- return '未通过'
- }
- },
- form_see2(row) {
- this.temp2 = Object.assign({}, row)
- if (this.temp2.statu === 0) {
- this.isStatu = false
- this.temp2.statu = '未到货'
- this.isExtensionDays = false
- } else if (this.temp2.statu === 1) {
- this.isStatu = false
- this.temp2.statu = '部分到货'
- this.isExtensionDays = false
- } else if (this.temp2.statu === 2) {
- this.isStatu = false
- this.temp2.statu = '按时到货'
- this.isExtensionDays = false
- } else if (this.temp2.statu === 3) {
- this.isStatu = false
- this.temp2.statu = '已延期'
- this.isExtensionDays = true
- } else if (this.temp2.statu === 4) {
- this.temp2.statu = '已关闭'
- this.isStatu = true
- this.isExtensionDays = false
- } else if (this.temp2.statu === 5) {
- this.isStatu = false
- this.temp2.statu = '部分到货-延期'
- this.isExtensionDays = true
- } else if (this.temp2.statu === 6) {
- this.isStatu = false
- this.temp2.statu = '全部到货-延期'
- this.isExtensionDays = true
- }
- this.dialogStatusSee2 = 'see'
- this.dialogFormVisibleSee2 = true
- this.getdataListSee2.parammaps.id = row.id
- this.getSeeList2()
- },
- getSeeList2() {
- GetDataByName(this.getdataListSee2).then(response => {
- this.listSee2 = response.data.list
- if (response.data.list !== null) {
- for (let i = 0; i < response.data.list.length; i++) {
- if (response.data.list[i].srcpath !== null && response.data.list[i].picpath !== null && response.data.list[i].srcpath !== undefined && response.data.list[i].picpath !== undefined) {
- this.listSee2[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
- this.listSee2[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
- } else {
- this.listSee2[i].srcpath = ''
- this.listSee2[i].picpath = ''
- }
- }
- }
- console.log('查看下方table数据', response.data.list)
- // this.pageNum2 = response.data.pageNum
- // this.pageSize2 = response.data.pageSize
- var sumArray = []
- for (var i = 0; i < this.listSee2.length; i++) {
- console.log()
- sumArray.push(
- this.listSee2[i].sumPrice
- )
- }
- console.log('总价', sumArray)
- var arrvalue = 0
- for (var i = 0; i < sumArray.length; i++) {
- console.log('table内总价每一个值', sumArray[i])
- arrvalue += parseFloat(sumArray[i])// 数组的索引是从0开始的
- }
- this.temp2.sumPrices = arrvalue.toFixed(3)
- setTimeout(() => {
- this.listLoadingSee = false
- }, 100)
- })
- },
- resetCloseTemp() {
- this.temp2.note = ''
- },
- handleClose2(row) {
- this.resetCloseTemp()
- this.temp2 = Object.assign({}, row)
- this.dialogStatusClose = 'close'
- this.dialogFormVisibleClose = true
- },
- handleClose5(row) {
- this.resetCloseTemp5()
- this.temp5 = Object.assign({}, row)
- this.dialogFormVisibleClose5 = true
- },
- resetCloseTemp5() {
- this.temp2.note = ''
- },
- closeData5() {
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- console.log('点击确认关闭', this.temp2)
- this.$refs['temp5'].validate(valid => {
- if (valid) {
- this.requestParamStute5.parammaps.id = this.temp5.id
- this.requestParamStute5.parammaps.note = this.temp5.note
- PostDataByName(this.requestParamStute5).then(response => {
- console.log('新增保存发送参数', this.requestParamStute5)
- if (response.msg !== 'fail') {
- this.get_table_data5()
- this.dialogFormVisibleClose5 = false
- this.$notify({
- title: '成功',
- message: '关闭成功',
- type: 'success',
- duration: 2000
- })
- } else {
- failproccess(response, this.$notify)
- }
- })
- }
- })
- },
- form_see5(row) {
- this.temp5 = Object.assign({}, row)
- if (this.temp5.statu === 0) {
- this.isStatu = false
- this.temp5.statu = '未到货'
- } else if (this.temp2.statu === 1) {
- this.isStatu = false
- this.temp5.statu = '部分到货'
- } else if (this.temp2.statu === 2) {
- this.isStatu = false
- this.temp5.statu = '按时到货'
- } else if (this.temp2.statu === 3) {
- this.isStatu = false
- this.temp5.statu = '已延期'
- } else if (this.temp2.statu === 4) {
- this.temp5.statu = '已关闭'
- this.isStatu = true
- } else if (this.temp2.statu === 5) {
- this.isStatu = false
- this.temp5.statu = '部分到货-延期'
- } else if (this.temp2.statu === 6) {
- this.isStatu = false
- this.temp5.statu = '全部到货-延期'
- }
- this.dialogStatusSee5 = 'see'
- this.dialogFormVisibleSee5 = true
- this.getdataListSee5.parammaps.id = row.id
- this.getSeeList5()
- },
- getSeeList5() {
- GetDataByName(this.getdataListSee5).then(response => {
- this.listSee5 = response.data.list
- if (response.data.list !== null) {
- for (let i = 0; i < response.data.list.length; i++) {
- if (response.data.list[i].srcpath !== null && response.data.list[i].picpath !== null && response.data.list[i].srcpath !== undefined && response.data.list[i].picpath !== undefined) {
- this.listSee5[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
- this.listSee5[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
- } else {
- this.listSee5[i].srcpath = ''
- this.listSee5[i].picpath = ''
- }
- }
- }
- console.log('查看下方table数据', response.data.list)
- // this.pageNum2 = response.data.pageNum
- // this.pageSize2 = response.data.pageSize
- var sumArray = []
- for (var i = 0; i < this.listSee2.length; i++) {
- console.log()
- sumArray.push(
- this.listSee5[i].sumPrice
- )
- }
- console.log('总价', sumArray)
- var arrvalue = 0
- for (var i = 0; i < sumArray.length; i++) {
- console.log('table内总价每一个值', sumArray[i])
- arrvalue += parseFloat(sumArray[i])// 数组的索引是从0开始的
- }
- this.temp5.sumPrices = arrvalue.toFixed(3)
- setTimeout(() => {
- this.listLoadingSee = false
- }, 100)
- })
- },
- handleCurrentChange(val) {
- this.currentRow = val
- console.log('currentRow', this.currentRow)
- },
- sapUpload() {
- const that = this
- console.log('currentRow', this.currentRow.sapstatus)
- var send_data = this.selectList
- if (send_data.length == 0) {
- that.$notify({ title: '失败', message: '请勾选数据!', type: 'error', duration: 2000 })
- return false
- }
- console.log(that.isSap)
- if (that.isSap == 1) {
- that.isSap = 0
- SapOrder(send_data).then(response => {
- console.log('response', response)
- if (response.msg !== 'fail') {
- that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
- that.selectList = []
- that.get_table_data2()
- } else {
- that.$notify({ title: '失败', message: '上传失败', type: 'error', duration: 2000 })
- }
- })
- } else {
- that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击', type: 'error', duration: 2000 })
- }
- setTimeout(() => {
- that.isSap = 1
- }, 3000)
- // if(this.currentRow.sapstatus){
- // if(this.currentRow.sapstatus != 0){
- // const sapArr = this.currentRow.sapbuyeCode.split(",")
- // console.log("sapArr",sapArr)
- // sapArr.forEach(function(item){
- // console.log("sapArr item",item)
- // var send_data = {
- // "code":item,
- // "pastureid":Cookies.get('pastureid')
- // }
- // SapOrder(send_data).then(response => {
- // console.log('response', response)
- // if (response.msg !== 'fail') {
- // that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
- // that.get_table_data()
- // } else {
- // that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
- // }
- // })
- // })
- // }
- // }
- },
- checkboxInit(row, index) {
- console.log(row)
- var data1 = new Date(row.buyerDate)
- var data2 = new Date('2022-10-25')
- if (data1 > data2) {
- if (row.srmstatus !== 0) {
- return 1
- } else {
- return 0
- }
- } else {
- return 0
- }
- },
- // 监听 - 表格 - 勾选
- change_table_selection(val) {
- this.selectList = val
- console.log('勾选数据selectList', this.selectList)
- },
- srmUpload() {
- const that = this
- console.log('currentRow', this.currentRow.srmstatus)
- console.log('勾选数据selectList', this.selectList)
- var send_data = this.selectList
- if (send_data.length == 0) {
- that.$notify({ title: '失败', message: '请勾选数据!', type: 'error', duration: 2000 })
- return false
- }
- console.log(that.isSrm)
- if (that.isSrm == 1) {
- that.isSrm = 0
- SrmOrder(send_data).then(response => {
- console.log('response', response)
- if (response.msg !== 'fail') {
- that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
- that.selectList = []
- that.get_table_data2()
- } else {
- that.$notify({ title: '失败', message: '上传失败', type: 'error', duration: 2000 })
- }
- })
- } else {
- that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击', type: 'error', duration: 2000 })
- }
- setTimeout(() => {
- that.isSrm = 1
- }, 3000)
- // if(this.currentRow.srmstatus){
- // if(this.currentRow.srmstatus != 0){
- // const srmArr = this.currentRow.srmbuyeCode.split(",")
- // console.log("srmArr",srmArr)
- // srmArr.forEach(function(item){
- // console.log("srmArr item",item)
- // var send_data = {
- // "code":item,
- // "pastureid":Cookies.get('pastureid')
- // }
- // SrmOrder(send_data).then(response => {
- // console.log('response', response)
- // if (response.msg !== 'fail') {
- // that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
- // that.get_table_data()
- // } else {
- // that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
- // }
- // })
- // })
- // }
- // }
- },
- closeData() {
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- console.log('点击确认关闭', this.temp2)
- this.$refs['temp2'].validate(valid => {
- if (valid) {
- this.requestParamStute.parammaps.id = this.temp2.id
- this.requestParamStute.parammaps.note = this.temp2.note
- PostDataByName(this.requestParamStute).then(response => {
- console.log('新增保存发送参数', this.requestParamStute)
- if (response.msg !== 'fail') {
- this.get_table_data2()
- this.dialogFormVisibleClose = false
- this.$notify({
- title: '成功',
- message: '关闭成功',
- type: 'success',
- duration: 2000
- })
- } else {
- failproccess(response, this.$notify)
- }
- })
- }
- })
- },
- get_table_data3() {
- this.listLoading3 = true
- if (this.$refs['inputDatetime3'] !== undefined && this.$refs['inputDatetime3'].value !== null) {
- this.getdataListParm3.parammaps.startTime = this.$refs['inputDatetime3'].value[0]
- this.getdataListParm3.parammaps.stopTime = this.$refs['inputDatetime3'].value[1]
- } else {
- this.getdataListParm3.parammaps.startTime = ''
- this.getdataListParm3.parammaps.stopTime = ''
- }
- // 对于多选的牧场,根据数组的名称来转换 pastureArr =》 pastureId TODO:
- if (this.getdataListParm3.parammaps.pastureArr && this.getdataListParm3.parammaps.pastureArr.length > 0) {
- const arr = this.findAllPasture.filter((item) => {
- if (this.getdataListParm3.parammaps.pastureArr.includes(item.name)) {
- return item
- }
- })
- const ids = arr.map((child) => { return child.id })
- console.log(arr,ids,'999999')
- this.getdataListParm3.parammaps.pastureId = ids.toString();
- }
- GetDataByName(this.getdataListParm3).then(response => {
- this.list3 = response.data.list
- this.pageNum3 = response.data.pageNum
- this.pageSize3 = response.data.pageSize
- if (response.data.total) {
- this.total3 = response.data.total
- }
- // Just to simulate the time of the request
- setTimeout(() => {
- this.listLoading3 = false
- }, 300)
- })
- },
- form_search3() {
- this.listLoading = true
- if (this.getdataListParm3.parammaps.inputDatetime === null) {
- this.getdataListParm3.parammaps.inputDatetime = ''
- }
- this.getdataListParm3.offset = 1
- this.get_table_data3()
- },
- handleDownload3() {
- this.$alert('采购明细正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
- this.isPercentage = true
- this.percentage = 1
- var timer = setInterval(() => {
- this.percentage += 5
- if (this.percentage > 95) {
- this.percentage = 99
- clearInterval(timer)
- }
- this.percentage = this.percentage
- }, 1000)
- this.downloadListParm3.name = this.getdataListParm3.name
- this.downloadListParm3.parammaps = this.getdataListParm3.parammaps
- GetAccount(this.downloadListParm3).then(response => {
- if (response.data.list !== '') {
- this.percentage = 99
- setTimeout(() => {
- this.isPercentage = false
- }, 2000)
- }
- const obj = {
- 0: '新增申购',
- 1: '暂估申购',
- 3: '赠品申购',
- 4: '奶厅申购'
- }
- response.data.list.length && response.data.list.forEach((item) => {
- item.reportery = parseFloat(item.reportery)
- item.purchase_type = obj[item.purchase_type]
- })
- this.downloadList3 = response.data.list
- const elecExcelDatas = [
- {
- tHeader: ['配单号', '采购单号', '备件编号', '备件名称', '备件规格', '备件品牌', '计量单位', '供应商', '单价', '当前库存', '申购数量', '采购数量', '入库数', '申购类型', '申购部门', '采购人', '配单日期'],
- filterVal: ['matchCode', 'buyeCode', 'partCode', 'partName', 'specification', 'brand', 'unit', 'providerName', 'price', 'reportery', 'sumAmount', 'amount', 'receiveAmount', 'purchase_type', 'departmentName', 'empname', 'buyerDate'],
- tableDatas: this.downloadList3,
- sheetName: '采购明细'
- }
- ]
- json2excel(elecExcelDatas, '采购明细', true, 'xlsx')
- })
- },
- get_table_data5() {
- this.listLoading5 = true
- // 对于多选的牧场,根据数组的名称来转换 pastureArr =》 pastureId TODO:
- if (this.getdataListParm5.parammaps.pastureArr && this.getdataListParm5.parammaps.pastureArr.length > 0) {
- const arr = this.findAllPasture.filter((item) => {
- if (this.getdataListParm5.parammaps.pastureArr.includes(item.name)) {
- return item
- }
- })
- const ids = arr.map((child) => { return child.id })
- console.log(arr,ids,'999999')
- this.getdataListParm5.parammaps.pastureId = ids.toString();
- }
- GetDataByName(this.getdataListParm5).then(response => {
- this.list5 = response.data.list
- this.pageNum5 = response.data.pageNum
- this.pageSize5 = response.data.pageSize
- if (response.data.total) {
- this.total5 = response.data.total
- }
- // Just to simulate the time of the request
- setTimeout(() => {
- this.listLoading5 = false
- }, 300)
- })
- },
- form_search5() {
- this.listLoading = true
- this.getdataListParm5.offset = 1
- this.get_table_data5()
- },
- get_table_data4() {
- this.listLoading4 = true
- if (this.$refs['inputDatetime4'] !== undefined && this.$refs['inputDatetime4'].value !== null) {
- this.getdataListParm4.parammaps.startTime = this.$refs['inputDatetime4'].value[0]
- this.getdataListParm4.parammaps.stopTime = this.$refs['inputDatetime4'].value[1]
- } else {
- this.getdataListParm4.parammaps.startTime = ''
- this.getdataListParm4.parammaps.stopTime = ''
- }
- // 对于多选的牧场,根据数组的名称来转换 pastureArr =》 pastureId TODO:
- if (this.getdataListParm4.parammaps.pastureArr && this.getdataListParm4.parammaps.pastureArr.length > 0) {
- const arr = this.findAllPasture.filter((item) => {
- if (this.getdataListParm4.parammaps.pastureArr.includes(item.name)) {
- return item
- }
- })
- const ids = arr.map((child) => { return child.id })
- console.log(arr,ids,'999999')
- this.getdataListParm4.parammaps.pastureId = ids.toString();
- }
- GetDataByName(this.getdataListParm4).then(response => {
- this.list4 = response.data.list
- this.pageNum4 = response.data.pageNum
- this.pageSize4 = response.data.pageSize
- if (response.data.total) {
- this.total4 = response.data.total
- }
- // Just to simulate the time of the request
- setTimeout(() => {
- this.listLoading4 = false
- }, 300)
- })
- },
- form_search4() {
- this.listLoading = true
- if (this.getdataListParm4.parammaps.inputDatetime === null) {
- this.getdataListParm4.parammaps.inputDatetime = ''
- }
- this.getdataListParm4.offset = 1
- this.get_table_data4()
- },
- form_see4(row) {
- this.dialogStatusSee4 = 'see'
- this.dialogFormVisibleSee4 = true
- this.temp4 = Object.assign({}, row)
- this.getdataListSee4.parammaps.matchCode = row.matchCode
- this.getSeeList4()
- var reason = '未通过原因:' + this.temp4.workflowNote
- if (this.temp4.statue === 0) {
- this.activeList = [{ title: '配单', date: this.temp4.dealTime, name: this.temp4.empname }, { title: '供应主管审核' }]
- this.active = 1
- } else if (this.temp4.statue === 1) {
- this.activeList = [{ title: '配单', date: this.temp4.dealTime, name: this.temp4.empname }, { title: '供应主管审核', date: this.temp4.chargeDate, name: this.temp4.chargeName }]
- this.active = 2
- } else if (this.temp4.statue === 2) {
- this.activeList = [{ title: '配单', date: this.temp4.dealTime, name: this.temp4.empname }, { title: '供应主管审核', date: this.temp4.chargeDate, name: this.temp4.chargeName, status: 'error', reason: reason }]
- this.active = 2
- }
- },
- getSeeList4() {
- GetDataByName(this.getdataListSee4).then(response => {
- this.listSee4 = response.data.list
- this.listUpdate4 = response.data.list
- if (response.data.list !== null) {
- for (let i = 0; i < response.data.list.length; i++) {
- console.log(response.data.list[i].srcpath)
- console.log(response.data.list[i].picpath)
- console.log(process.env.VUE_APP_BASE_API + response.data.list[i].srcpath)
- if (response.data.list[i].srcpath !== null && response.data.list[i].picpath !== null && response.data.list[i].srcpath !== undefined && response.data.list[i].picpath !== undefined) {
- if (this.dialogStatusSee4 == 'see') {
- this.listSee4[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
- this.listSee4[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
- } else {
- this.listUpdate4[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
- this.listUpdate4[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
- }
- } else {
- this.listSee4[i].srcpath = ''
- this.listSee4[i].picpath = ''
- this.listUpdate4[i].srcpath = ''
- this.listUpdate4[i].picpath = ''
- }
- }
- }
- console.log('查看下方table数据', response.data.list)
- this.pageNum4 = response.data.pageNum
- this.pageSize4 = response.data.pageSize
- })
- },
- handleExamine(row) {
- if (row == undefined) {
- this.examineTemp = this.temp4
- this.$set(this.temp4, 'SHstatue', 1)
- this.$set(this.temp4, 'workflowNote', '')
- } else {
- this.examineTemp = Object.assign({}, row)
- this.$set(this.examineTemp, 'SHstatue', 1)
- this.$set(this.examineTemp, 'workflowNote', '')
- }
- this.dialogStatus_Examine = 'examine'
- this.dialogFormVisible_Examine = true
- this.statueReason = false
- },
- changeSHStatue(val) {
- if (val == 2) {
- this.statueReason = true
- } else {
- this.statueReason = false
- }
- },
- createExamineData() {
- console.log(this.examineTemp)
- this.$refs['examineTemp'].validate(valid => {
- if (valid) {
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 5000)
- if (this.examineTemp.SHstatue == 1) {
- console.log('通过')
- this.postDataPramas.common = { 'returnmap': '0' }
- this.postDataPramas.data = []
- this.postDataPramas.data[0] = { 'name': 'partdealCharge', 'type': 'e', 'parammaps': {
- 'id': this.examineTemp.id,
- 'statue': this.examineTemp.SHstatue,
- 'empId': Cookies.get('employeid'),
- 'workflowNote': this.examineTemp.workflowNote
- }}
- this.postDataPramas.data[1] = { 'name': 'updatebigbuydetailenable', 'type': 'e', 'parammaps': {
- 'matchCode': this.examineTemp.matchCode
- }}
- this.postDataPramas.data[2] = { 'name': 'updatebigbuydetailZero', 'type': 'e', 'parammaps': {
- 'matchCode': this.examineTemp.matchCode
- }}
- ExecDataByConfig(this.postDataPramas).then(response => {
- this.isokDisable = false
- console.log('审核保存发送参数', this.postDataPramas)
- if (response.msg === 'fail') {
- this.$notify({
- title: '审核失败',
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- } else {
- this.dialogFormVisible_Examine = false
- this.get_table_data4()
- this.$notify({
- title: '',
- message: '审核成功',
- type: 'success',
- duration: 2000
- })
- }
- })
- } else if (this.examineTemp.SHstatue == 2) {
- console.log('不通过')
- this.postDataPramas.common = { 'returnmap': '0' }
- this.postDataPramas.data = []
- this.postDataPramas.data[0] = { 'name': 'partdealCharge', 'type': 'e', 'parammaps': {
- 'id': this.examineTemp.id,
- 'statue': this.examineTemp.SHstatue,
- 'empId': Cookies.get('employeid'),
- 'workflowNote': this.examineTemp.workflowNote
- }}
- // this.postDataPramas.data[1] = { 'name': 'updatepartpurchase', 'type': 'e', 'parammaps': {
- // 'matchCode': this.examineTemp.matchCode
- // }}
- ExecDataByConfig(this.postDataPramas).then(response => {
- console.log('审核保存发送参数', this.postDataPramas)
- if (response.msg === 'fail') {
- this.$notify({
- title: '审核失败',
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- } else {
- this.dialogFormVisible_Examine = false
- this.get_table_data4()
- this.$notify({
- title: '',
- message: '审核成功',
- type: 'success',
- duration: 2000
- })
- }
- })
- }
- }
- })
- },
- form_edit(row) {
- this.dialogStatusUpdate4 = 'update'
- this.dialogFormVisibleUpdate4 = true
- this.getdataListSee4.parammaps.matchCode = row.matchCode
- this.updateTemp4 = Object.assign(row, {})
- this.getSeeList4()
- },
- edit_dialog_save() {
- this.$refs['updateTemp4'].validate(valid => {
- if (valid) {
- // for (let i = 0; i < this.listUpdate4.length; i++) {
- // var rulesAmount = /^\d+$/
- // if ((this.listUpdate4[i].amount == '' || this.listUpdate4[i].amount == undefined) && parseFloat(this.listUpdate4[i].amount) !== 0) {
- // this.$message({
- // type: 'error',
- // message: '采购数量不可为空',
- // duration: 2000
- // })
- // return false
- // } else if (!rulesAmount.test(parseFloat(this.listUpdate4[i].amount))) {
- // this.$message({
- // type: 'error',
- // message: '采购数量不可为空',
- // duration: 2000
- // })
- // return false
- // }
- // }
- for (let i = 0; i < this.listUpdate4.length; i++) {
- console.log(this.listUpdate4[i].amount)
- var rulesAmount = /^\d+$/
- if ((this.listUpdate4[i].amount == '' || this.listUpdate4[i].amount == undefined) && parseFloat(this.listUpdate4[i].amount) !== 0) {
- this.$message({
- type: 'error',
- message: '采购数量不可为空',
- duration: 2000
- })
- return false
- } else if (!rulesAmount.test(parseFloat(this.listUpdate4[i].amount))) {
- this.$message({
- type: 'error',
- message: '采购数量请输入大于等于0的整数',
- duration: 2000
- })
- return false
- } else {
- this.postDataPramas.common = { 'returnmap': '0' }
- this.postDataPramas.data = []
- this.postDataPramas.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listUpdate4 }}
- this.postDataPramas.data[0].children = []
- this.postDataPramas.data[0].children[0] = { 'name': 'updatePDbuydetail', 'type': 'e', 'parammaps': {
- amount: '@insertSpotList.amount',
- id: '@insertSpotList.id'
- }}
- this.postDataPramas.data[1] = { 'name': 'partdealCharge', 'type': 'e', 'parammaps': {
- id: this.updateTemp4.id,
- statue: '0',
- empId: Cookies.get('employeid')
- }}
- }
- }
- ExecDataByConfig(this.postDataPramas).then(response => {
- console.log('新增保存发送参数', this.postDataPramas)
- if (response.msg === 'fail') {
- this.$notify({
- title: '保存失败',
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- } else {
- this.dialogFormVisibleUpdate4 = false
- this.getdataListParm4.parammaps.inputDatetime = ''
- this.get_table_data4()
- this.$notify({
- title: '',
- message: '保存成功',
- type: 'success',
- duration: 2000
- })
- }
- })
- return true
- }
- })
- }
- }
- }
- </script>
- <style lang="scss" >
- .el-table .warning-row {
- background: red;
- }
- .el-table .color-row {
- background: #eee;
- }
- </style>
- <style lang="scss" scoped>
- .app-contentClose .el-form-item__content {
- margin-left: 0 !important;
- }
- </style>
- <style lang="scss" scoped>
- .app-contentConfirmationSheet {
- margin-bottom: 50px;
- }
- .app-content {
- background: #eee;
- margin-bottom: 50px;
- .title {
- line-height: 40px;
- div {
- float: left;
- margin-right: 50px;
- b {
- padding-left: 10px;
- }
- }
- }
- .total {
- margin-left: 80%;
- line-height: 30px;
- }
- }
- </style>
|