1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052 |
- <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 label="备件出库" name="first">
- <div class="filter-container">
- <el-select v-model="getdataListParm.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item" @change="changePastureName">
- <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
- </el-select>
- <el-input v-model="getdataListParm.parammaps.useForm" placeholder="出库单号" style="width: 200px;" class="filter-item" />
- <el-select v-model="getdataListParm.parammaps.useType" clearable placeholder="出库方式" class="filter-item" style="width: 120px;">
- <el-option v-for="item in useTypes" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- <el-select v-model="getdataListParm.parammaps.departmentId" style="width: 140px;" placeholder="领用部门" class="filter-item" clearable>
- <el-option v-for="item in findAllDepart" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- <!-- <el-select v-model="getdataListParm.parammaps.easStatus" style="width: 150px;" clearable placeholder="EAS同步状态" class="filter-item">
- <el-option v-for="item in easStatus.easStatusList" :key="item.id" :label="item.name" :value="item.id" />
- </el-select> -->
- <el-select v-model="getdataListParm.parammaps.sapStatus" style="width: 150px;" clearable placeholder="SAP上传状态" class="filter-item">
- <el-option v-for="item in easStatus.sapStatusList" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- <el-date-picker
- ref="inputDatetime"
- v-model="getdataListParm.parammaps.inputDatetime"
- clearable
- class="inputDatetime"
- type="datetimerange"
- style="width: 250px;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_search">搜索</el-button>
- <div>
- <el-button v-if="isOutStockAdd" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
- <el-button v-if="isReceiveTemplate" v-waves class="filter-item" type="info" icon="el-icon-download" @click="handleDownloadTemp"> 模板 </el-button>
- <el-upload style="display: inline-block;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImportExcel" :on-success="handleImportExcelSuccess">
- <el-button v-if="isOutStockImport" v-waves class="filter-item" type="warning" icon="el-icon-upload2">导入</el-button>
- </el-upload>
- <el-button v-if="isOutStockExport" class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-edit" @click="handleDownload">导出</el-button>
- <!-- <el-button class="filter-item" style="margin-left: 10px;" type="danger" icon="el-icon-upload2" @click="handleDownloadEas">导出EAS</el-button> -->
- <el-button class="filter-item" style="margin-left: 10px;" type="danger" icon="el-icon-upload2" @click="handleDownloadEas1">导出EAS</el-button>
- <el-button v-if="isEasSynchronization" class="filter-item" type="primary" style="float: right;" @click="handleEAS">EAS同步</el-button>
- <el-button v-if="isOutsap" class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-upload2" @click="sapUpload">SAP上传</el-button>
- </div>
- </div>
- <el-table
- :key="tableKey"
- v-loading="listLoading"
- element-loading-text="给我一点时间"
- :data="list"
- border
- fit
- highlight-current-row
- style="width: 100%;"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- @sort-change="tableSort"
- @selection-change="change_table_selection"
- @current-change="handleCurrentChange"
- >
- <el-table-column type="selection" :selectable="checkboxInit" align="center" width="50" />
- <el-table-column label="序号" align="center" type="index" width="50px">
- <template slot-scope="scope">
- <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="出库单号" align="center" min-width="150px">
- <template slot-scope="scope">
- <span>{{ scope.row.useForm }}</span>
- </template>
- </el-table-column>
- <el-table-column label="领用部门" min-width="100px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.departmentName }}</span><br>
- </template>
- </el-table-column>
- <el-table-column label="牧场" min-width="100px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.pastureName }}</span><br>
- </template>
- </el-table-column>
- <el-table-column sortable prop="partKind" label="备件种类数" align="center" min-width="100px">
- <template slot-scope="scope">
- <span>{{ scope.row.partKind }}</span>
- </template>
- </el-table-column>
- <el-table-column label="出库方式" align="center" min-width="100px" :formatter="useType" />
- <el-table-column label="录入人" min-width="100px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.empname }}</span><br>
- </template>
- </el-table-column>
- <el-table-column label="出库日期" sortable prop="creatTime" min-width="100px" align="center" />
- <el-table-column label="EAS同步状态" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.easStatus }}</span><br>
- </template>
- </el-table-column>
- <el-table-column prop="ProofCode" label="sap编码" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{scope.row.ProofCode}}</span>
- </template>
- </el-table-column>
- <el-table-column prop="ProofCode" label="sap上传状态" min-width="80px" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.ProofCode">已上传</span>
- <span v-else>未上传</span>
-
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width" fixed="right">
- <template slot-scope="{row}">
- <el-button v-if="isOutStockSee" type="primary" size="mini" @click="form_see(row)">查看</el-button>
- <!-- <el-button v-if="isStorageSee" type="success" size="mini" @click="form_edit(row)">编辑</el-button> -->
- <el-button v-if="isOutStockDelete && row.useType !== 4" style="display:inline-block" type="danger" size="mini" @click="handleDelate(row)">删除</el-button>
- <el-button v-else type="danger" size="mini" style="display:none" @click="handleDelate(row)">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="getList" />
- </el-tab-pane>
- <el-tab-pane label="出库记录" name="second">
- <div class="filter-container">
- <el-select v-model="getdataListParm2.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item">
- <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
- </el-select>
- <el-input v-model="getdataListParm2.parammaps.useForm" placeholder="出库单号" style="width: 200px;" class="filter-item" />
- <el-input v-model="getdataListParm2.parammaps.partCode" placeholder="备件编号" style="width: 200px;" class="filter-item" />
- <el-input v-model="getdataListParm2.parammaps.partName" placeholder="备件名称" style="width: 200px;" class="filter-item" />
- <el-select v-model="getdataListParm2.parammaps.providerId" filterable clearable style="width: 140px;" placeholder="供应商" class="filter-item">
- <el-option v-for="item in findAllProvider" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- <el-select v-model="getdataListParm2.parammaps.departmentId" style="width: 140px;" placeholder="领用部门" class="filter-item" clearable>
- <el-option v-for="item in findAllDepart" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- <tree-select
- class="typeSelect"
- :height="150"
- :width="250"
- size="small"
- clearable
- :data="parentType"
- :disabled="disabled2"
- :placeholder="placeholder"
- style="display:inline-block;"
- :default-props="defaultProps"
- :node-key="nodeKey"
- :checked-keys="defaultCheckedKeys"
- @popoverHide="popoverHide"
- />
- <el-input v-model="getdataListParm2.parammaps.eqName" placeholder="设备名称" style="width: 200px;" class="filter-item" />
- <el-date-picker ref="inputDatetime2" v-model="getdataListParm2.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 250px;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_search2">搜索</el-button>
- <el-button v-if="isOutStockExport" class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-edit" @click="handleDownload2">导出</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"
- @sort-change="tableSort"
- >
- <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="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.pastureName }}</span><br>
- </template>
- </el-table-column>
- <el-table-column label="出库单号" align="center" min-width="150px">
- <template slot-scope="scope">
- <span>{{ scope.row.useForm }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备件编号" min-width="150px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span><br>
- </template>
- </el-table-column>
- <el-table-column label="备件名称" align="center" min-width="150px">
- <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><br>
- </template>
- </el-table-column>
- <el-table-column label="备件品牌" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.brandName }}</span><br>
- </template>
- </el-table-column>
- <el-table-column label="计量单位" align="center" min-width="100px">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column label="供应商" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.providerName }}</span><br>
- </template>
- </el-table-column>
- <el-table-column label="设备名称" align="center" min-width="130px">
- <template slot-scope="scope">
- <span>{{ scope.row.eqName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="设备内部编号" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.eqCode }}</span><br>
- </template>
- </el-table-column>
- <el-table-column label="费用类型" align="center" min-width="130px">
- <template slot-scope="scope">
- <span>{{ scope.row.useTypeV }}</span>
- </template>
- </el-table-column>
- <el-table-column label="库位" align="center" min-width="130px">
- <template slot-scope="scope">
- <span>{{ scope.row.warehoseCode }}</span>
- </template>
- </el-table-column>
- <el-table-column label="期初库存" sortable prop="reportery" align="center" min-width="130px">
- <template slot-scope="scope">
- <span>{{ scope.row.reportery }}</span>
- </template>
- </el-table-column>
- <el-table-column label="出库数量" sortable prop="checkoutNumber" align="center" min-width="130px">
- <template slot-scope="scope">
- <span>{{ scope.row.checkoutNumber }}</span>
- </template>
- </el-table-column>
- <el-table-column label="单价" sortable prop="price" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.price }}</span><br>
- </template>
- </el-table-column>
- <el-table-column label="总价" sortable prop="sumPrice" min-width="90px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.sumPrice }}</span><br>
- </template>
- </el-table-column>
- <el-table-column label="领用部门" align="center" min-width="90px">
- <template slot-scope="scope">
- <span>{{ scope.row.departmentName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="领用人" align="center" min-width="90px">
- <template slot-scope="scope">
- <span>{{ scope.row.appliname }}</span>
- </template>
- </el-table-column>
- <el-table-column label="录入人" align="center" min-width="90px">
- <template slot-scope="scope">
- <span>{{ scope.row.empname }}</span>
- </template>
- </el-table-column>
- <el-table-column label="出库日期" sortable prop="creatTime" min-width="120px" align="center" />
- <el-table-column label="备注" min-width="130px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.note }}</span><br>
- </template>
- </el-table-column>
- </el-table>
- <pagination v-show="total2>0" :total="total2" :page.sync="getdataListParm2.offset" :limit.sync="getdataListParm2.pagecount" @pagination="getList2" />
- </el-tab-pane>
- </el-tabs>
- <!-- 弹出层新增or修改 -->
- <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="90%">
- <div class="app-add">
- <el-form
- ref="createTemp"
- :rules="rules"
- :model="createTemp"
- label-position="right"
- label-width="100px"
- style="width: 90%;margin:0 auto;"
- >
- <el-row>
- <el-col :span="8">
- <el-form-item label="出库单号:" prop="useForm">
- <el-input ref="useForm" v-model="createTemp.useForm" disabled />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="牧场:" prop="pastureId">
- <el-select v-model="createTemp.pastureId" placeholder="牧场" class="filter-item" style="width: 100%;" @change="changePasture">
- <el-option
- v-for="item in findAllPasture"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="录入人:" prop="empId">
- <el-select v-model="createTemp.empId" placeholder="录入人" class="filter-item" style="width: 100%;">
- <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="8">
- <el-form-item label="出库方式:" prop="useType">
- <el-radio-group v-model="createTemp.useType" @change="changeStorageType">
- <el-radio v-if="isOutStockMethod1" v-model="createTemp.useType" :label="0" checked>领用出库</el-radio>
- <el-radio v-if="isOutStockMethod2" v-model="createTemp.useType" :label="1">手动出库</el-radio>
- <el-radio v-if="isOutStockMethod3" v-model="createTemp.useType" :label="2">调拨出库</el-radio>
- <el-radio v-if="isOutStockMethod4" v-model="createTemp.useType" :label="5">报废出库</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-col>
- <el-col v-if="No1" :span="8">
- <el-form-item label="领用单号:" prop="applyCode">
- <el-autocomplete
- v-model="orderPart.applyCode"
- value-key="name"
- class="inline-input"
- :fetch-suggestions="getNumber"
- placeholder="请输入领用单号"
- style="width:100%"
- @select="changeApplyCode"
- >
- <template slot-scope="{ item }">
- <div class="name" style="display: inline;">{{ item.applyCode }}</div>
- <div class="name" style="display: inline;">{{ item.departmentName }}</div>
- </template>
- </el-autocomplete>
- </el-form-item>
- </el-col>
- <el-col v-if="No1" :span="8">
- <el-form-item label="领用部门:" prop="departmentId">
- <el-select v-model="createTemp.departmentId" placeholder="领用部门" class="filter-item" style="width:100%" disabled @change="changeDepart">
- <el-option
- v-for="item in createDepartList"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col v-if="No2" :span="8">
- <el-form-item label="领用部门:" prop="departmentId">
- <el-select v-model="createTemp.departmentId" placeholder="领用部门" class="filter-item" style="width:100%" @change="changeDepart">
- <el-option
- v-for="item in createDepartList"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col v-if="isReceiveTime2" :span="8">
- <el-form-item label="出库日期:" prop="receiveTime">
- <el-date-picker
- v-model="createTemp.receiveTime"
- :picker-options="pickerOptions2"
- type="date"
- placeholder="出库日期"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- style="width: 100%;"
- />
- </el-form-item>
- </el-col>
- <el-col v-if="isReceiveTime2" :span="8">
- <el-form-item label="备注:" prop="note">
- <el-input ref="note" v-model="createTemp.note" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col v-if="No1" :span="8">
- <el-form-item label="领用人:" prop="applicatId">
- <el-select ref="applicatId" v-model="createTemp.applicatId" filterable placeholder="领用人" class="filter-item" style="width:100%" disabled>
- <el-option
- v-for="item in findAllEmploye"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col v-if="No2" :span="8">
- <el-form-item label="领用人:" prop="applicatId">
- <el-select ref="applicatId" v-model="createTemp.applicatId" filterable placeholder="领用人" class="filter-item" style="width:100%">
- <el-option
- v-for="item in findAllEmploye"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col v-if="isReceiveTime" :span="8">
- <el-form-item label="出库日期:" prop="receiveTime">
- <el-date-picker
- v-model="createTemp.receiveTime"
- :picker-options="pickerOptions1"
- type="date"
- placeholder="出库日期"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- style="width: 100%;"
- />
- </el-form-item>
- </el-col>
- <el-col v-if="isReceiveTime" :span="8">
- <el-form-item label="备注:" prop="note">
- <el-input ref="note" v-model="createTemp.note" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row v-if="No2">
- <el-col :span="10">
- <el-form-item label="备件:" prop="partCode">
- <el-autocomplete
- v-model="orderPart.partCode"
- value-key="name"
- class="inline-input"
- :fetch-suggestions="sparePartSearch"
- placeholder="请输入备件编号或备件名称或备件规格或供应商"
- style="width:500px"
- @select="handleSelectSparePart"
- >
- <template slot-scope="{ item }">
- <b>编号:</b><span class="name">{{ item.partCode }}</span>
- |<b>名称:</b><span class="addr">{{ item.partName }}</span>
- |<b>规格:</b><span class="addr">{{ item.specification }}</span><br>
- <b style="padding-left:3em;">品牌:</b><span class="addr">{{ item.brand }}</span>
- |<b>供应商:</b><span class="addr">{{ item.providerName }}</span>
- </template>
- </el-autocomplete>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row v-if="No3">
- <el-col :span="10">
- <el-form-item label="调拨单号:" prop="applyCode">
- <el-autocomplete
- v-model="createTemp.applyCode"
- value-key="name"
- class="inline-input"
- :fetch-suggestions="allocationSearch"
- placeholder="请输入调拨单号"
- style="width:500px"
- @select="handleSelectAllocation"
- >
- <template slot-scope="{ item }">
- <b>调拨单号:</b><span class="name">{{ item.applyCode }}</span>
- |<b>调入牧场:</b><span class="addr">{{ item.inPastureName }}</span>
- </template>
- </el-autocomplete>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <h5 style="float:right;">总金额:{{ TotalAmount }}</h5>
- <el-table
- :key="tableKey"
- v-loading="listLoading"
- element-loading-text="给我一点时间"
- :data="listAdd"
- border
- fit
- highlight-current-row
- style="width: 100%;margin-bottom:30px"
- :cell-style="tableCellStyle"
- class="elTable table-fixed"
- :row-style="rowStyle"
- >
- <!-- table表格 -->
- <el-table-column type="index" label="序号" align="center" width="50px" />
- <el-table-column :key="1" label="备件编号" min-width="90px" prop="partCode" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span>
- </template>
- </el-table-column>
- <el-table-column :key="2" label="备件名称" min-width="60px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partName }}</span><br>
- </template>
- </el-table-column>
- <el-table-column :key="3" label="备件规格" prop="specification" align="center" min-width="90">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column :key="4" label="备件图片" align="center" min-width="60">
- <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 :key="5" label="备件品牌" prop="brand" align="center" min-width="60">
- <template slot-scope="scope">
- <span>{{ scope.row.brand }}</span>
- </template>
- </el-table-column>
- <el-table-column :key="6" label="供应商" prop="providerName" align="center" min-width="60">
- <template slot-scope="scope">
- <span>{{ scope.row.providerName }}</span>
- </template>
- </el-table-column>
- <el-table-column :key="7" label="计量单位" prop="unit" align="center" min-width="60">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column v-if="allo" :key="19" label="调拨数量" prop="unit" align="center" min-width="60">
- <template slot-scope="scope">
- <span>{{ scope.row.amount }}</span>
- </template>
- </el-table-column>
- <el-table-column v-if="allo" :key="20" label="出库数量" prop="unit" align="center" min-width="60">
- <template slot-scope="scope">
- <span>{{ scope.row.amount }}</span>
- </template>
- </el-table-column>
- <el-table-column v-if="No1" :key="8" label="设备名称" prop="eqName" align="center" min-width="60">
- <template slot-scope="scope">
- <span>{{ scope.row.eqName }}</span>
- </template>
- </el-table-column>
- <el-table-column v-if="No2" :key="9" label="设备名称" prop="eqName" align="center" min-width="200">
- <template slot-scope="scope">
- <!-- @select="handleSelectEqName" -->
- <!-- @select="(value)={handleSelectEqName(value)}" -->
- <el-autocomplete
- ref="elautocomplete1"
- v-model="scope.row.eqName"
- :debounce="0"
- class="inline-input"
- :fetch-suggestions="querySearchEqName"
- value-key="eqName"
- placeholder="设备名称"
- @select="(value)=>
- {handleSelectEqName(value, scope.row)}"
- @blur="(value)=>
- {blurSelectEqName(value, scope.row)}"
- >
- <template slot-scope="{ item }">
- <span class="name">{{ item.eqName }}</span>
- <span class="addr" style="margin:0 0 0 5px">{{ item.eqCode }}</span>
- </template>
- </el-autocomplete>
- </template>
- </el-table-column>
- <el-table-column v-if="No1" :key="10" label="设备内部编号" prop="eqCode" align="center" min-width="60">
- <template slot-scope="scope">
- <span>{{ scope.row.eqCode }}</span>
- </template>
- </el-table-column>
- <el-table-column v-if="No2" :key="11" label="设备内部编号" prop="eqCode" align="center" min-width="150">
- <template slot-scope="scope">
- <el-autocomplete
- ref="elautocomplete2"
- v-model="scope.row.eqCode"
- :debounce="0"
- class="inline-input"
- :fetch-suggestions="querySearchCode"
- value-key="eqCode"
- placeholder="设备内部编号"
- @select="(value)=>
- {handleSelectEqCode(value, scope.row)}"
- @blur="(value)=>
- {blurSelectEqCode(value, scope.row)}"
- />
- </template>
- </el-table-column>
- <el-table-column v-if="No4" :key="12" label="费用类型" prop="useTypeV" align="center" min-width="110">
- <template slot-scope="scope">
- <el-select v-model="scope.row.useTypeV" filterable placeholder="费用类型">
- <el-option
- v-for="item in getDictByName"
- :key="item.id"
- :label="item.value"
- :value="item.value"
- />
- </el-select>
- </template>
- </el-table-column>
- <el-table-column v-if="No4" :key="13" label="库位" prop="location" align="center" min-width="80">
- <template slot-scope="scope">
- <span>{{ scope.row.location }}</span>
- </template>
- </el-table-column>
- <el-table-column v-if="No4" :key="14" label="库位库存数" prop="reportery" align="center" min-width="70">
- <template slot-scope="scope">
- <span>{{ scope.row.reportery }}</span>
- </template>
- </el-table-column>
- <el-table-column v-if="No1" :key="15" label="领用数量" min-width="90px" align="center">
- <template slot-scope="scope">
- <el-form :model="scope.row" :rules="rules">
- <el-form-item prop="amount">
- <el-input
- ref="amount"
- v-model="scope.row.amount"
- style="margin-top:15px"
- :disabled="disabled"
- @change="(value)=>
- {changeUseNumber(value, scope.row)}"
- />
- </el-form-item>
- </el-form>
- </template>
- </el-table-column>
- <el-table-column v-if="No4" :key="16" label="出库数量" min-width="110" align="center">
- <template slot-scope="scope">
- <el-form :model="scope.row" :rules="rules">
- <el-form-item prop="checkoutNumber">
- <el-input
- ref="checkoutNumber"
- v-model="scope.row.checkoutNumber"
- style="margin-top:15px"
- @change="(value)=> {changeCheckoutNumber(value, scope.row)}"
- @blur="(value)=> {blurCheckoutNumber(value, scope.row)}"
- />
- </el-form-item>
- </el-form>
- </template>
- </el-table-column>
- <el-table-column :key="17" label="单价" prop="price" align="center" min-width="60">
- <template slot-scope="scope">
- <span>{{ scope.row.price }}</span>
- </template>
- </el-table-column>
- <el-table-column v-if="No4" :key="18" label="总价" prop="totalPrice" align="center" min-width="70">
- <template slot-scope="scope">
- <span>{{ scope.row.price * parseFloat(scope.row.checkoutNumber) | keepTwoNum }}</span>
- </template>
- </el-table-column>
- <el-table-column v-if="allo" :key="21" label="总价" prop="totalPrice" align="center" min-width="70">
- <template slot-scope="scope">
- <span>{{ scope.row.sumPrice }}</span>
- </template>
- </el-table-column>
- <el-table-column v-if="allo" :key="22" label="费用类型" prop="useTypeV" align="center" min-width="110">
- <template slot-scope="scope">
- <el-select v-model="scope.row.useTypeV" filterable placeholder="费用类型" :disabled="createTemp.useType == 2">
- <el-option
- v-for="item in getDictByName"
- :key="item.id"
- :label="item.value"
- :value="item.value"
- />
- </el-select>
- </template>
- </el-table-column>
- <el-table-column :key="23" label="备注" prop="totalPrice" align="center" min-width="130">
- <template slot-scope="scope">
- <el-input v-model="scope.row.note" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" style="width:80%;padding:10px 0;" maxlength="32" />
- </template>
- </el-table-column>
- <el-table-column v-if="No4" label="操作" align="center" width="60" class-name="small-padding fixed-width" fixed="right">
- <template slot-scope="{row}">
- <a class="del" @click="partDelete(row)">删除</a>
- </template>
- </el-table-column>
- </el-table>
- <el-form
- ref="temp"
- :rules="rules"
- :model="temp"
- label-position="right"
- label-width="100px"
- style="width: 800px; margin-left:50px;"
- />
- <div slot="footer" class="dialog-footer" style="bottom:10px">
- <el-button type="primary" :disabled="isokDisable" @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()">保存并关闭</el-button>
- <el-button @click="dialogFormVisible = false;getList()">取消并关闭</el-button>
- </div>
- </div>
- </el-dialog>
- <!-- 查看-->
- <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_See" :close-on-click-modal="false" width="90%">
- <div class="app-see">
- <el-form
- ref="seeTemp"
- :rules="rules"
- :model="seeTemp"
- label-position="right"
- label-width="100px"
- style="width: 90%;margin:0 auto"
- >
- <el-row>
- <el-col :span="8">
- <el-form-item label="出库单号:" prop="useForm">
- <el-input ref="useForm" v-model="seeTemp.useForm" disabled />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="牧场:" prop="pastureName">
- <el-input ref="pastureName" v-model="seeTemp.pastureName" disabled />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="录入人:" prop="empname">
- <el-input ref="empname" v-model="seeTemp.empname" disabled />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="8">
- <el-form-item label="出库方式:" prop="useType">
- <el-radio-group v-if="seeTemp.useType == 0 ||seeTemp.useType == 1||seeTemp.useType == 4 " v-model="seeTemp.useType" disabled>
- <el-radio v-model="seeTemp.useType" :label="0" checked>领用出库</el-radio>
- <el-radio v-model="seeTemp.useType" :label="1">手动出库</el-radio>
- <el-radio v-model="seeTemp.useType" :label="4">调拨出库</el-radio>
- <el-radio v-model="seeTemp.useType" :label="5">报废出库</el-radio>
- </el-radio-group>
- <el-radio-group v-if="seeTemp.useType == 2" v-model="seeTemp.useType" disabled>
- <el-radio v-model="seeTemp.useType" :label="2" checked>领用出库</el-radio>
- <el-radio v-model="seeTemp.useType" :label="1">手动出库</el-radio>
- <el-radio v-model="seeTemp.useType" :label="4">调拨出库</el-radio>
- <el-radio v-model="seeTemp.useType" :label="5">报废出库</el-radio>
- </el-radio-group>
- <el-radio-group v-if="seeTemp.useType == 3" v-model="seeTemp.useType" disabled>
- <el-radio v-model="seeTemp.useType" :label="3" checked>领用出库</el-radio>
- <el-radio v-model="seeTemp.useType" :label="1">手动出库</el-radio>
- <el-radio v-model="seeTemp.useType" :label="4">调拨出库</el-radio>
- <el-radio v-model="seeTemp.useType" :label="5">报废出库</el-radio>
- </el-radio-group>
- <el-radio-group v-if="seeTemp.useType == 5" v-model="seeTemp.useType" disabled>
- <el-radio v-model="seeTemp.useType" :label="3">领用出库</el-radio>
- <el-radio v-model="seeTemp.useType" :label="1">手动出库</el-radio>
- <el-radio v-model="seeTemp.useType" :label="4">调拨出库</el-radio>
- <el-radio v-model="seeTemp.useType" :label="5" checked>报废出库</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item v-if="oddCodeAllo" label="领用单号:" prop="oddCode">
- <el-input ref="oddCode" v-model="seeTemp.oddCode" disabled />
- </el-form-item>
- </el-col>
- <el-col v-if="No5" :span="8">
- <el-form-item label="领用部门:" prop="departmentName">
- <el-input ref="departmentName" v-model="seeTemp.departmentName" disabled />
- </el-form-item>
- </el-col>
- <el-col v-if="isCreatTimeAllo" :span="8">
- <el-form-item label="出库日期:" prop="creatTime">
- <el-input ref="creatTime" v-model="seeTemp.creatTime" disabled />
- </el-form-item>
- </el-col>
- <el-col v-if="isCreatTimeAllo" :span="8">
- <el-form-item label="备注:" prop="note">
- <el-input ref="note" v-model="seeTemp.note" disabled />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row v-if="No5">
- <el-col :span="8">
- <el-form-item label="领用人:" prop="appliname">
- <el-input ref="appliname" v-model="seeTemp.appliname" disabled />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="出库日期:" prop="creatTime">
- <el-input ref="creatTime" v-model="seeTemp.creatTime" disabled />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="备注:" prop="note">
- <el-input ref="note" v-model="seeTemp.note" disabled />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row v-if="isTableAllo1">
- <el-col :span="12">
- <el-form-item label="调拨单号:" prop="oddCode">
- <el-input ref="oddCode" v-model="seeTemp.oddCode" disabled />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <h5 style="float:right;">总金额:{{ TotalAmount }}</h5>
- <el-table
- :key="tableKey"
- v-loading="listLoading"
- element-loading-text="给我一点时间"
- :data="listSee"
- border
- fit
- highlight-current-row
- style="width: 100%;margin-bottom:30px"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- @sort-change="tableSort2"
- >
- <el-table-column type="index" label="序号" align="center" width="50px" />
- <el-table-column :key="1" label="备件编号" min-width="150px" prop="partCode" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partCode }}</span>
- </template>
- </el-table-column>
- <el-table-column :key="2" label="备件名称" min-width="80px" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.partName }}</span><br>
- </template>
- </el-table-column>
- <el-table-column :key="3" label="备件规格" prop="specification" align="center" min-width="110">
- <template slot-scope="scope">
- <span>{{ scope.row.specification }}</span>
- </template>
- </el-table-column>
- <el-table-column :key="4" label="备件图片" prop="specifications" align="center" min-width="80">
- <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 :key="5" label="备件品牌" prop="brandName" align="center" min-width="110">
- <template slot-scope="scope">
- <span>{{ scope.row.brandName }}</span>
- </template>
- </el-table-column>
- <el-table-column :key="6" label="供应商" prop="providerName" align="center" min-width="100">
- <template slot-scope="scope">
- <span>{{ scope.row.providerName }}</span>
- </template>
- </el-table-column>
- <el-table-column :key="7" label="计量单位" prop="unit" align="center" min-width="80">
- <template slot-scope="scope">
- <span>{{ scope.row.unit }}</span>
- </template>
- </el-table-column>
- <el-table-column v-if="isTableAllo" :key="8" label="设备名称" prop="eqName" align="center" min-width="110">
- <template slot-scope="scope">
- <span>{{ scope.row.eqName }}</span>
- </template>
- </el-table-column>
- <el-table-column v-if="isTableAllo" :key="9" label="设备内部编号" prop="eqCode" align="center" min-width="110">
- <template slot-scope="scope">
- <span>{{ scope.row.eqCode }}</span>
- </template>
- </el-table-column>
- <el-table-column v-if="isTableAllo" :key="10" label="费用类型" prop="useTypeV" align="center" min-width="110">
- <template slot-scope="scope">
- <span>{{ scope.row.useTypeV }}</span>
- </template>
- </el-table-column>
- <el-table-column v-if="isTableAllo" :key="11" label="库位" prop="warehoseCode" align="center" min-width="110">
- <template slot-scope="scope">
- <span>{{ scope.row.warehoseCode }}</span>
- </template>
- </el-table-column>
- <el-table-column v-if="isTableAllo" :key="12" label="库位库存数" sortable prop="reportery" align="center" min-width="110">
- <template slot-scope="scope">
- <span>{{ scope.row.reportery }}</span>
- </template>
- </el-table-column>
- <el-table-column v-if="No1" :key="13" sortable prop="useNumber" label="领用数量" min-width="80" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.useNumber }}</span>
- </template>
- </el-table-column>
- <el-table-column v-if="isTableAllo1" :key="14" sortable prop="checkoutNumber" label="调拨数量" min-width="80" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.checkoutNumber }}</span>
- </template>
- </el-table-column>
- <el-table-column :key="15" label="出库数量" sortable prop="checkoutNumber" min-width="80" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.checkoutNumber }}</span>
- </template>
- </el-table-column>
- <el-table-column :key="16" label="单价" sortable prop="price" align="center" min-width="60">
- <template slot-scope="scope">
- <span>{{ scope.row.price }}</span>
- </template>
- </el-table-column>
- <el-table-column :key="17" label="总价" sortable prop="sumPrice" align="center" min-width="60">
- <template slot-scope="scope">
- <span>{{ scope.row.sumPrice }}</span>
- </template>
- </el-table-column>
- <el-table-column v-if="isTableAllo1" :key="18" label="费用类型" prop="sumPrice" align="center" min-width="80">
- <template slot-scope="scope">
- <span>{{ scope.row.useTypeV }}</span>
- </template>
- </el-table-column>
- <el-table-column :key="19" label="备注" prop="sumPrice" align="center" min-width="80">
- <template slot-scope="scope">
- <span>{{ scope.row.note }}</span>
- </template>
- </el-table-column>
- </el-table>
- <!-- <pagination
- v-show="totalSee>0"
- :total="totalSee"
- :page.sync="getdataListSee.offset"
- :limit.sync="getdataListSee.pagecount"
- @pagination="getSeeList"
- /> -->
- <div slot="footer" class="dialog-footer" style="margin-bottom:-25px;">
- <el-button @click="dialogFormVisible_See = false">关闭</el-button>
- </div>
- </div>
- </el-dialog>
- <!-- EAS同步 -->
- <el-dialog :title="textMap[easStatus.dialogStatus]" :visible.sync="easStatus.dialogFormVisible" :close-on-click-modal="false" width="80%">
- <div class="easStatus">
- <el-table
- :key="easStatus.tableKey"
- v-loading="easStatus.listLoading"
- element-loading-text="给我一点时间"
- :data="easStatus.list"
- border
- fit
- highlight-current-row
- style="width: 100%;"
- :row-style="rowStyle"
- :cell-style="cellStyle"
- class="elTable table-fixed"
- >
- <el-table-column label="序号" align="center" type="index" width="50px">
- <template slot-scope="scope">
- <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
- </template>
- </el-table-column>
- <el-table-column label="出库单号" min-width="110px" align="center" prop="useForm" />
- <el-table-column label="领用部门" min-width="110px" align="center" prop="departmentName" />
- <el-table-column label="牧场" min-width="110px" align="center" prop="pastureName" />
- <el-table-column label="录入人" min-width="110px" align="center" prop="empName" />
- <el-table-column label="出库日期" min-width="110px" align="center" prop="createTime" />
- <el-table-column label="失败原因" min-width="110px" align="center" prop="failReason" />
- <el-table-column label="操作" align="center" width="300px" class-name="small-padding fixed-width" fixed="right">
- <template slot-scope="{row}">
- <el-button v-if="isManualSynchronization" type="primary" size="mini" style="width:70px;" @click="handleManual(row)">手动同步</el-button>
- <el-button v-if="isCloseSynchronization" type="danger" size="mini" style="width:70px;" @click="handleClose(row)">关闭同步</el-button>
- <el-button v-if="isIgnoreSynchronization" type="danger" size="mini" style="width:70px;" @click="handleIgnore(row)">忽略同步</el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination v-show="easStatus.total>0" :total="easStatus.total" :page.sync="easStatus.getdataListParm.offset" :limit.sync="easStatus.getdataListParm.pagecount" @pagination="getListEasStatusLst" />
- </div>
- <div slot="footer" class="dialog-footer" style="bottom: 10px;">
- <el-button @click="easStatus.dialogFormVisible = false;getList()">关闭</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- // 引入
- import { GetDataByName, GetDataByNames, ExecDataByConfig, checkButtons, GetAccount, transData, PostDataByName, EasSync,SapUse } from '@/api/common'
- import waves from '@/directive/waves' // waves directive
- import { parseTime, sortChange } from '@/utils/index.js'
- // eslint-disable-next-line no-unused-vars
- import { validateEMail } from '@/utils/validate.js'
- import Pagination from '@/components/Pagination' // secondary package based on el-pagination
- import { MessageBox } from 'element-ui'
- import Cookies from 'js-cookie'
- import { getToken } from '@/utils/auth'
- import TreeSelect from '@/components/TreeSelect'
- export default {
- name: 'OutStock',
- components: { Pagination, TreeSelect },
- directives: { waves },
- filters: {
- keepTwoNum(value) {
- value = Number(value)
- return value.toFixed(2)
- }
- },
- data() {
- return {
- isSap:1,
- isSrm:1,
- selectList: [],
- currentRow:{},
- totalImportInfo: 0,
- listLoadingImportInfo: true,
- listImportInfo: [],
- isOutsap: [],
- // isReceiveImport: [],
- // isRetreatMuban: [],
- // isStorageAdd: [],
- // isStorageExport: [],
- // isStorageSee: [],
- tableKey: 0,
- useTypes: [{ id: '0', name: '领用出库' }, { id: '1', name: '手动出库' }, { id: '4', name: '调拨出库' }, { id: '5', name: '报废出库' }],
- // list2: [
- // {
- // orderNumber: '04.04.17.01.000069', stockName: '水箱', specifications: 'YC4E140-31', brand: '福田', supplier: '西安开泰门业有限', deviceName: '华农转盘机', equipmentNumber: '8.hnzpj004', unit: '个', storehouse: 'B-01-01', amount: '4', receivedQuantity: '3', currentStockQuantity: '1', price: '200', totalPrice: '600'
- // }
- // ],
- // 1-2:table&搜索传参
- getdataListParmImportInfo: {
- name: 'getImportStockLaidList',
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {
- pastureName: '',
- deptName: '',
- useForm: '',
- stockNumber: '',
- stockName: '',
- receiveTime: '',
- providerName: '',
- storageName: '',
- storageTime: ''
- }
- },
- getParmCreateNumber: {
- name: 'autoCreatCode',
- page: 0,
- offset: 0,
- pagecount: 0,
- returntype: 'Map',
- parammaps: {
- pastureId: Cookies.get('pastureid'),
- codeType: 'CK'
- }
- },
- // 2-3:下拉框请求后数据加入[]
- temp: { },
- storage: {
- inputDatetime: parseTime(new Date(), '{y}-{m}-{d}'),
- typeName: '',
- assTypeId: '',
- employeId: this.$store.state.user.employeid,
- departmentId: this.$store.state.user.departmentid,
- pastureId: this.$store.state.user.pastureid,
- laidNumber: ''
- },
- dialogPvVisible: false,
- // 校验规则
- // -----------------------------------------
- isOutStockAdd: [], isReceiveTemplate: [], isOutStockImport: [], isOutStockExport: [], isOutStockSee: [], isOutStockDelete: [], isOutStockMethod1: [], isOutStockMethod2: [], isOutStockMethod3: [],isOutStockMethod4:[],
- isEasSynchronization: [], isManualSynchronization: [], isCloseSynchronization: [], isIgnoreSynchronization: [],
- rules: {},
- rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
- cellStyle: { padding: 0 + 'px' },
- findAllProvider: [],
- findAllAssetType: [],
- findAllPasture: [],
- findAllDepart: [],
- findAllEmploye: [],
- getDictByName: [], createDepartList: [], edit: 0,
- // 2-1.请求下拉框接口
- requestParams: [
- { name: 'findAllProvider', offset: 0, pagecount: 0, params: [] },
- { name: 'findAllAssetType', offset: 0, pagecount: 0, params: [] },
- { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
- { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
- { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
- { name: 'getDictByName', offset: 0, pagecount: 0, params: ['耗用类别-父'] }
- ],
- getDepartParam: {
- name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }
- },
- pickerOptions1: {
- disabledDate(time) {
- return time.getTime() > Date.now()// 当天之前的时间可选
- }
- },
- pickerOptions2: {
- disabledDate(time) {
- return time.getTime() > Date.now()// 当天之前的时间可选
- }
- },
- No1: true,
- No2: false,
- No3: false,
- No4: true,
- isReceiveTime: true,
- isReceiveTime2: false,
- allo: false,
- disabled: true,
- isokDisable: false,
- total: 0,
- listLoading: true,
- dialogFormVisible: false,
- dialogFormVisible_See: false,
- dialogStatus: '',
- textMap: {
- see: '查看详情',
- update: '编辑',
- create: '新增',
- easStatus: 'EAS同步—同步失败数据'
- },
- getdataListParm: {
- name: 'getBigPartuseList',
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {
- pastureName: Cookies.get('pasturename'),
- departmentId: '',
- inputDatetime: '',
- useForm: '',
- useType: '',
- easStatus: '',
- sapStatus:''
- }
- },
- list: [],
- activeName: 'first',
- tableKey2: 0,
- listLoading2: true,
- total2: 0,
- list2: [],
- getdataListParm2: {
- name: 'getPartuseDetailList',
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {
- inputDatetime: '',
- useForm: '',
- startTime: '',
- stopTime: '',
- departmentId: '',
- partCode: '',
- partName: '',
- providerId: '',
- pastureName: Cookies.get('pasturename'),
- assetCode: '',
- eqName: ''
- }
- },
- requestParam: {
- name: 'downloadPartuseList',
- parammaps: {
- pastureName: Cookies.get('pasturename'),
- inputDatetime: ''
- }
- },
- downList: [],
- oddCodeAllo: true,
- No5: true,
- isCreatTimeAllo: false,
- isTableAllo: true,
- isTableAllo1: false,
- seeTemp: {},
- listSee: [],
- totalSee: 0,
- getdataListSee: {
- name: 'getpartUseListBybig',
- returntype: 'Map',
- parammaps: {}
- },
- createTemp: {
- useType: 0,
- empId: Cookies.get('employeid'),
- pastureId: Cookies.get('pastureid'),
- receiveTime: parseTime(new Date(), '{y}-{m}-{d}'),
- applicatId: Cookies.get('employeid'),
- departmentId: Cookies.get('departmentid')
- },
- requestSparePart: {
- name: 'getPartsListCK',
- page: 1,
- offset: 1,
- pagecount: 20,
- returntype: 'Map',
- parammaps: {
- pastureId: Cookies.get('pastureid')
- }
- },
- requestAllocation: {
- name: 'getTransferCodeCK',
- page: 1,
- offset: 1,
- pagecount: 20,
- returntype: 'Map',
- parammaps: {
- applyCode: '',
- pastureId: this.$store.state.user.pastureid
- }
- },
- getAllocationListParm: {
- name: 'getPartTransferbybigid',
- returntype: 'Map',
- parammaps: {}
- },
- orderPart: {},
- listAdd: [],
- EqNameList: [],
- requestEqName: {
- name: 'geteqbyNameCode',
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {
- pastureId: Cookies.get('pastureid')
- }
- },
- EqCodeList: [],
- requestUseForm: {
- name: 'getApplyCode',
- returntype: 'Map',
- parammaps: {
- pastureId: Cookies.get('pastureid')
- }
- },
- useForms: [],
- getParmCreateAdd: {
- name: 'getPartApplyByBig',
- returntype: 'Map',
- parammaps: {}
- },
- postDataPramas: {},
- selectedArr: [],
- buttons: [],
- TotalAmount: 0,
- isPercentage: false,
- percentage: 1,
- parentType: [],
- placeholder: '设备类别',
- disabled2: false,
- getParmType: {
- name: 'geteqclasslist'
- },
- defaultProps: {
- children: 'children',
- label: 'typeName'
- },
- nodeKey: 'id',
- defaultCheckedKeys: [],
- // EAS同步
- easStatus: {
- easStatusList: [{ name: '同步成功', id: '1' }, { name: '同步失败', id: '0' }, { name: '关闭同步', id: '2' }],
- sapStatusList: [ { name: '所有', id: '0' }, { name: '已上传', id: '1' }, { name: '未上传', id: '2' }],
- dialogStatus: '',
- dialogFormVisible: false,
- tableKey: 0,
- total: 0,
- listLoading: true,
- list: [],
- getdataListParm: {
- name: 'getbigpartuseSync',
- page: 1,
- offset: 1,
- pagecount: 10,
- returntype: 'Map',
- parammaps: {
- pastureid: Cookies.get('pastureid')
- }
- }
- }
- }
- },
- computed: {
- // 设置请求头
- headers() {
- return {
- // 设置token
- // eslint-disable-next-line no-undef
- token: getToken()
- }
- },
- uploadData() {
- return {
- name: 'importStockUse',
- importParams: '牧场,领用单编号,领用日期,物料编码,品名,规格型号,品牌,计量单位,实发数量,单价,总价,库位,供应商,名称,牧场设备编号,具体用处,领用类型,领用部门,领用人,SignColumn',
- sheetname: 'SheetJS'
- }
- },
- uploadData2() {
- return {
- name: 'importStockUseHistory',
- importParams: '牧场,领用单编号,领用日期,物料编码,品名,规格型号,品牌,计量单位,实发数量,单价,总价,库位,供应商,名称,牧场设备编号,具体用处,领用类型,领用部门,领用人,SignColumn',
- sheetname: 'SheetJS'
- }
- },
- // 设置上传地址
- uploadExcelUrl() {
- // process.env.VUE_APP_BASE_API是服务器的路径,也是axios的基本路径
- return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
- }
- },
- watch: {
-
- listAdd: {
- deep: true,
- handler: function (item) {
- this.listAdd.forEach(function(i){
- if(parseInt(i.checkoutNumber) > parseInt(i.amount)){
- i.checkoutNumber = i.amount
- }
- if(parseInt(i.checkoutNumber) > parseInt(i.reportery)){
- i.checkoutNumber = i.reportery
- }
-
- })
-
- }
- },
- },
- created() {
- const that = this
- GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
- that.buttons = response.data.list
- that.getButtons()
- })
- this.getDownList()
- this.getList()
- this.getTypeList()
- },
- methods: {
- tableSort(column) {
- if (this.activeName == 'first') {
- sortChange(column, this.list)
- } else if (this.activeName == 'second') {
- sortChange(column, this.list2)
- }
- },
- tableSort2(column) {
- sortChange(column, this.listSee)
- },
- handleCurrentChange(val) {
- this.currentRow = val;
- console.log("currentRow",this.currentRow)
- },
- checkboxInit(row,index){
- // console.log(row)
- if(row.ProofCode){ return 0 } else {return 1}
- },
- //监听 - 表格 - 勾选
- change_table_selection(val) {
- this.selectList = val
- console.log('勾选数据selectList', this.selectList)
- },
- sapUpload(){
- const that = this
- console.log("currentRow ProofCode",this.currentRow.ProofCode)
- 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
- SapUse(send_data).then(response => {
- console.log('response', response)
-
- if (response.msg !== 'fail') {
- that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
- that.selectList = []
- that.getList()
-
- } 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.ProofCode){
- // console.log("currentRow ProofCode 这个值说明已经上传了,不用上传")
- // //如果有这个值说明已经上传了,不用上传
- // } else {
- // console.log("currentRow ProofCode没有这个值")
- // console.log("currentRow ProofCode",this.currentRow.ProofCode)
- // const useForm = this.currentRow.useForm
- // const creatTime = this.currentRow.creatTime
- // console.log("useForm",useForm)
- // var send_data = {
- // "useForm":useForm,
- // "receiveTime":creatTime,
- // "pastureid":Cookies.get('pastureid')
-
- // }
- // SapUse(send_data).then(response => {
- // console.log('response', response)
-
- // if (response.msg !== 'fail') {
- // that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
- // that.getList()
-
- // } else {
- // that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
- // }
- // })
-
- // }
- },
- getButtons() {
- const Outsap = 'customs:outStock:sap'
- const isOutsap = checkButtons(this.$store.state.user.buttons, OutStockAdd)
- this.isOutsap = isOutsap
- const OutStockAdd = 'customs:outStock:add'
- const isOutStockAdd = checkButtons(this.$store.state.user.buttons, OutStockAdd)
- this.isOutStockAdd = isOutStockAdd
- const ReceiveTemplate = 'customs:outStock:template'
- const isReceiveTemplate = checkButtons(this.$store.state.user.buttons, ReceiveTemplate)
- this.isReceiveTemplate = isReceiveTemplate
- const OutStockImport = 'customs:outStock:import'
- const isOutStockImport = checkButtons(this.$store.state.user.buttons, OutStockImport)
- this.isOutStockImport = isOutStockImport
- const OutStockExport = 'customs:outStock:export'
- const isOutStockExport = checkButtons(this.$store.state.user.buttons, OutStockExport)
- this.isOutStockExport = isOutStockExport
- const OutStockSee = 'customs:outStock:see'
- const isOutStockSee = checkButtons(this.$store.state.user.buttons, OutStockSee)
- this.isOutStockSee = isOutStockSee
- const OutStockDelete = 'customs:outStock:delete'
- const isOutStockDelete = checkButtons(this.$store.state.user.buttons, OutStockDelete)
- this.isOutStockDelete = isOutStockDelete
- const OutStockMethod1 = 'customs:outStock:method1'
- const isOutStockMethod1 = checkButtons(this.$store.state.user.buttons, OutStockMethod1)
- this.isOutStockMethod1 = isOutStockMethod1
- const OutStockMethod2 = 'customs:outStock:method2'
- const isOutStockMethod2 = checkButtons(this.$store.state.user.buttons, OutStockMethod2)
- this.isOutStockMethod2 = isOutStockMethod2
- const OutStockMethod3 = 'customs:outStock:method3'
- const isOutStockMethod3 = checkButtons(this.$store.state.user.buttons, OutStockMethod3)
- this.isOutStockMethod3 = isOutStockMethod3
- const OutStockMethod4 = 'customs:outStock:method4'
- const isOutStockMethod4 = checkButtons(this.$store.state.user.buttons, OutStockMethod4)
- this.isOutStockMethod4 = isOutStockMethod4
- const EasSynchronization = 'customs:outStock:easSynchronization'
- const isEasSynchronization = checkButtons(this.$store.state.user.buttons, EasSynchronization)
- this.isEasSynchronization = isEasSynchronization
- const ManualSynchronization = 'customs:outStock:manualSynchronization'
- const isManualSynchronization = checkButtons(this.$store.state.user.buttons, ManualSynchronization)
- this.isManualSynchronization = isManualSynchronization
- const CloseSynchronization = 'customs:outStock:closeSynchronization'
- const isCloseSynchronization = checkButtons(this.$store.state.user.buttons, CloseSynchronization)
- this.isCloseSynchronization = isCloseSynchronization
- const IgnoreSynchronization = 'customs:outStock:ignoreSynchronization'
- const isIgnoreSynchronization = checkButtons(this.$store.state.user.buttons, IgnoreSynchronization)
- this.isIgnoreSynchronization = isIgnoreSynchronization
- },
- popoverHide(checkedIds, checkedData) {
- console.log('选中值', checkedIds, checkedData)
- // this.dataform.eqClassId = checkedIds
- // this.dataform.typeCode = checkedData.typeCode
- this.getdataListParm2.parammaps.assetCode = checkedData.typeCode
- },
- getTypeList() {
- GetDataByName(this.getParmType).then(response => {
- if (response.data.list !== null) {
- this.parentType = transData(response.data.list, 'id', 'pid', 'children')
- }
- })
- },
- querySearch(queryString, cb) {
- var restaurants = this.restaurants
- var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
- // 调用 callback 返回建议列表的数据
- cb(results)
- },
- createFilter(queryString) {
- return (restaurant) => {
- return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0)
- }
- },
- handleSelect(item) {
- console.log(item)
- },
- // ---------------------------------------------
- getDownList() {
- GetDataByNames(this.requestParams).then(response => {
- this.findAllProvider = response.data.findAllProvider.list
- this.findAllAssetType = response.data.findAllAssetType.list
- this.findAllPasture = response.data.findAllPasture.list
- this.findAllEmploye = response.data.findAllEmploye.list
- this.getDictByName = response.data.getDictByName.list
- this.getDepartDownList()
- })
- },
- getDepartDownList() {
- GetDataByName(this.getDepartParam).then(response => {
- this.findAllDepart = response.data.list
- })
- },
- changePastureName(item) {
- this.getDepartParam.parammaps.pastureId = this.findAllPasture.find(obj => obj.name == item).id
- this.getdataListParm.parammaps.departmentId = ''
- this.getDepartDownList()
- },
- getCreateDepartDownList() {
- GetDataByName(this.getDepartParam).then(response => {
- this.createDepartList = response.data.list
- if (this.edit == 1) {
- if (this.createDepartList.find(obj => obj.id == Cookies.get('departmentid'))) {
- this.createTemp.departmentId = parseInt(Cookies.get('departmentid'))
- this.createTemp.departmentName = this.createDepartList.find(obj => obj.id == Cookies.get('departmentid')).name
- } else {
- this.createTemp.departmentId = response.data.list[0].id
- this.createTemp.departmentName = response.data.list[0].name
- }
- console.log(this.createTemp.departmentName, 'this.createTemp.departmentName')
- }
- })
- },
- changePasture(item) {
- this.getDepartParam.parammaps.pastureId = item
- this.edit = 1
- this.getCreateDepartDownList()
- },
- changeDepart(item) {
- this.createTemp.departmentName = this.createDepartList.find(obj => obj.id == item).name
- },
- getList() {
- this.listLoading = true
- console.log(this.$refs['inputDatetime'])
- if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
- this.getdataListParm.parammaps.startTime = this.$refs['inputDatetime'].value[0]
- this.getdataListParm.parammaps.stopTime = this.$refs['inputDatetime'].value[1]
- } else {
- this.getdataListParm.parammaps.startTime = ''
- this.getdataListParm.parammaps.stopTime = ''
- }
- GetDataByName(this.getdataListParm).then(response => {
- console.log('table数据', response.data.list)
- this.list = response.data.list
- this.pageNum = response.data.pageNum
- this.pageSize = response.data.pageSize
- if (response.data.total) {
- this.total = response.data.total
- }
- // Just to simulate the time of the request
- setTimeout(() => {
- this.listLoading = false
- }, 100)
- })
- },
- handleClick(tab, event) {
- console.log(tab, event)
- if (tab.name === 'second') {
- this.getList2()
- } else {
- this.getList()
- }
- },
- getList2() {
- 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 = ''
- }
- 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
- }, 100)
- })
- },
- form_search2() {
- this.listLoading2 = true
- if (this.getdataListParm2.parammaps.inputDatetime === null) {
- this.getdataListParm2.parammaps.inputDatetime = ''
- }
- this.getdataListParm2.offset = 1
- this.getList2()
- },
- useType: function(cellValue) {
- // console.log(cellValue.isZeroStock)
- if (cellValue.useType === 0) {
- return '领用出库'
- } else if (cellValue.useType === 2) {
- return '领用出库'
- } else if (cellValue.useType === 3) {
- return '领用出库'
- } else if (cellValue.useType === 1) {
- return '手动出库'
- } else if (cellValue.useType === 4) {
- return '调拨出库'
- } else if (cellValue.useType === 5) {
- return '报废出库'
- }
- },
- form_search() {
- console.log('点击了table搜索')
- this.listLoading = true
- if (this.getdataListParm.parammaps.inputDatetime === null) {
- this.getdataListParm.parammaps.inputDatetime = ''
- }
- this.getdataListParm.offset = 1
- this.getList()
- },
- form_see(row) {
- this.seeTemp = Object.assign({}, row)
- console.log(this.seeTemp)
- // this.temp = Object.assign({}, row) // copy obj
- this.dialogStatus = 'see'
- this.dialogFormVisible_See = true
- this.getdataListSee.parammaps.id = row.id
- this.TotalAmount = 0
- this.getSeeList()
- if (this.seeTemp.useType == 0) {
- this.No1 = true
- this.oddCodeAllo = true
- this.isCreatTimeAllo = false
- this.No5 = true
- this.isTableAllo = true
- this.isTableAllo1 = false
- } else if (this.seeTemp.useType == 2) {
- this.No1 = true
- this.oddCodeAllo = true
- this.isCreatTimeAllo = false
- this.No5 = true
- this.isTableAllo = true
- this.isTableAllo1 = false
- } else if (this.seeTemp.useType == 3) {
- this.No1 = true
- this.oddCodeAllo = true
- this.isCreatTimeAllo = false
- this.No5 = true
- this.isTableAllo = true
- this.isTableAllo1 = false
- } else if (this.seeTemp.useType == 1) {
- this.No1 = false
- this.oddCodeAllo = false
- this.isTableAllo = true
- this.isTableAllo1 = false
- } else if (this.seeTemp.useType == 4) {
- this.oddCodeAllo = false
- this.isCreatTimeAllo = true
- this.No5 = false
- this.No1 = false
- this.isTableAllo = false
- this.isTableAllo1 = true
- } else if (this.seeTemp.useType == 5) {
- this.No1 = false
- this.oddCodeAllo = false
- this.isTableAllo = true
- this.isTableAllo1 = false
- }
- },
- getSeeList() {
- GetDataByName(this.getdataListSee).then(response => {
- console.log('查看下方table数据', response.data.list)
- this.listSee = response.data.list
- if (response.data.list !== null) {
- for (let i = 0; i < response.data.list.length; i++) {
- this.TotalAmount += parseFloat(response.data.list[i].sumPrice)
- 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.listSee[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
- this.listSee[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
- } else {
- this.listSee[i].srcpath = ''
- this.listSee[i].picpath = ''
- }
- }
- this.TotalAmount = this.TotalAmount.toFixed(2)
- }
- setTimeout(() => {
- this.listLoadingSee = false
- }, 100)
- })
- },
- resetCreateTemp() {
- this.createTemp.useType = 0
- this.createTemp.empId = parseInt(Cookies.get('employeid'))
- this.createTemp.pastureId = parseInt(Cookies.get('pastureid'))
- this.createTemp.receiveTime = parseTime(new Date(), '{y}-{m}-{d}')
- this.createTemp.departmentId = parseInt(Cookies.get('departmentid'))
- this.createTemp.applicatId = parseInt(Cookies.get('employeid'))
- this.listAdd = []
- this.createTemp.useForm = ''
- this.No1 = true
- this.No2 = false
- this.No3 = false
- this.orderPart = {}
- },
- form_add() {
- this.resetCreateTemp()
- this.edit = 1
- this.getDepartParam.parammaps.pastureId = this.createTemp.pastureId
- this.getCreateDepartDownList()
- this.dialogStatus = 'create'
- this.dialogFormVisible = true
- this.createTemp.useForm = ''
- this.createTemp.pastureName = Cookies.get('pasturename')
- this.createTemp.employeId = Cookies.get('employeid')
- this.TotalAmount = 0
- console.log(this.createTemp)
- this.$nextTick(() => {
- this.$refs['temp'].clearValidate()
- })
- this.getCreateNumber()
- },
- getCreateNumber() {
- GetDataByName(this.getParmCreateNumber).then(response => {
- this.$nextTick(() => {
- console.log('新增领用单号', response.data.list[0].orderCode)
- this.createTemp.useForm = response.data.list[0].orderCode
- })
- this.$forceUpdate()
- })
- },
- changeStorageType(val) {
- console.log(val)
- this.TotalAmount = 0
- if (val === 0) {
- this.No1 = true
- this.No2 = false
- this.No3 = false
- this.disabled = true
- this.listAdd = []
- this.isReceiveTime = true
- this.isReceiveTime2 = false
- this.No4 = true
- // 调拨数量/出库数量
- this.allo = false
- } else if (val === 1) {
- this.No1 = false
- this.No2 = true
- this.No3 = false
- this.disabled = false
- this.listAdd = []
- this.useForms = []
- this.isReceiveTime = true
- this.isReceiveTime2 = false
- this.No4 = true
- // 调拨数量/出库数量
- this.allo = false
- } else if (val === 2) {
- this.listAdd = []
- this.No1 = false
- this.No2 = false
- this.isReceiveTime = false
- this.isReceiveTime2 = true
- this.No3 = true
- // 调拨数量/出库数量显示
- this.allo = true
- this.No4 = false
- }else if(val === 5){
- // 报废出库
- this.No1 = false
- this.No2 = true
- this.No3 = false
- this.disabled = false
- this.listAdd = []
- this.useForms = []
- this.isReceiveTime = true
- this.isReceiveTime2 = false
- this.No4 = true
- // 调拨数量/出库数量
- this.allo = false
- }
- },
- getNumber(queryString, cb) {
- console.log('领用单号模糊查询输入值', queryString)
- this.requestUseForm.parammaps['applyCode'] = queryString
- GetDataByName(this.requestUseForm).then(response => {
- console.log('领用单号模糊查询搜索data', response.data.list)
- // this.useForms = response.data.list
- cb(response.data.list)
- })
- },
- changeApplyCode(item) {
- console.log('领用单号模糊查询选中值', item)
- this.getParmCreateAdd.parammaps.id = item.id
- this.getParmCreateAdd.parammaps.pastureId = Cookies.get('pastureid')
- this.createTemp.departmentId = item.departmentId
- this.createTemp.bid = item.id
- this.createTemp.applicatId = item.empId
- this.orderPart.applyCode = item.applyCode
- this.TotalAmount = 0
- this.getListAdd()
- },
- getListAdd() {
- GetDataByName(this.getParmCreateAdd).then(response => {
- console.log('领用单号list列表', response.data.list)
- this.createTemp.applyType = response.data.list[0].applyType
- this.listAdd = response.data.list
- this.TotalAmount = 0
- if (response.data.list !== null) {
- for (var i = 0; i < response.data.list.length; i++) {
- if (response.data.list[i].applyType == '非维保') {
- response.data.list[i].applyType = '物耗'
- this.getDictByName = [{ 'id': 61, 'label': '物耗', 'value': '物耗' }, { 'id': 62, 'label': '土建', 'value': '土建' }, { 'id': 229, 'label': '工具', 'value': '工具' }]
- } else {
- this.getDownList()
- }
- // response.data.list[i].useTypeV = response.data.list[i].applyType
- this.$set(response.data.list[i], 'useTypeV', response.data.list[i].applyType)
- if (response.data.list[i].price == '') {
- response.data.list[i].price = 0
- }
- if (response.data.list[i].checkoutNumber == null) {
- var checkoutNumberArray = []
- checkoutNumberArray.push(response.data.list[i].amount, response.data.list[i].reportery)
- response.data.list[i].minNumber = Math.min.apply(null, checkoutNumberArray)
- // response.data.list[i].checkoutNumber = response.data.list[i].minNumber
- this.$set(response.data.list[i], 'checkoutNumber', response.data.list[i].minNumber)
- // this.$set(response.data.list[i], 'sumPrice', parseFloat(response.data.list[i].sumPrice) * parseFloat(response.data.list[i].checkoutNumber))
- }
- console.log(response.data.list[i].sumPrice, '========= ==')
- this.TotalAmount += parseFloat(response.data.list[i].sumPrice)
- 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.listAdd[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
- this.listAdd[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
- } else {
- this.listAdd[i].srcpath = ''
- this.listAdd[i].picpath = ''
- }
- }
- this.TotalAmount = this.TotalAmount.toFixed(2)
- }
- })
- },
- sparePartSearch(queryString, cb) {
- console.log('备件模糊查询输入值', queryString)
- this.requestSparePart.parammaps['partCode'] = queryString
- GetDataByName(this.requestSparePart).then(response => {
- console.log('备件模糊查询搜索data', response.data.list)
- if (response.data.list == null) {
- cb([])
- } else {
- for (var i = 0; i < response.data.list.length; i++) {
- response.data.list[i].useTypeV = '维修'
- }
- cb(response.data.list)
- }
- })
- },
- handleSelectSparePart(item) {
- console.log('备件模糊查询选中值', item)
- this.TotalAmount = 0
- if (this.listAdd.length > 0) {
- // eslint-disable-next-line no-redeclare
- if (this.listAdd.find(obj => obj.id === item.id)) {
- this.$message({
- type: 'warning',
- message: '此备件已存在,请重新选择备件'
- })
- for (let i = 0; i < this.listAdd.length; i++) {
- this.TotalAmount += parseFloat(this.listAdd[i].checkoutNumber) * parseFloat(this.listAdd[i].price)
- }
- this.TotalAmount = this.TotalAmount.toFixed(2)
- } else {
- if (item.checkoutNumber == null) {
- this.$set(item, 'checkoutNumber', item.reportery)
- }
- this.TotalAmount = parseFloat(item.checkoutNumber) * parseFloat(item.price)
- 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.listAdd.unshift(item)
- this.TotalAmount = 0
- for (let i = 0; i < this.listAdd.length; i++) {
- this.TotalAmount += parseFloat(this.listAdd[i].checkoutNumber) * parseFloat(this.listAdd[i].price)
- }
- this.TotalAmount = this.TotalAmount.toFixed(2)
- }
- } else {
- if (item.checkoutNumber == null) {
- this.$set(item, 'checkoutNumber', 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.listAdd.unshift(item)
- this.$forceUpdate()
- this.TotalAmount = 0
- for (let i = 0; i < this.listAdd.length; i++) {
- this.TotalAmount += parseFloat(this.listAdd[i].checkoutNumber) * parseFloat(this.listAdd[i].price)
- }
- this.TotalAmount = this.TotalAmount.toFixed(2)
- }
- console.log(this.listAdd)
- // for (let i = 0; i < this.listAdd.length; i++) {
- // this.TotalAmount += parseFloat(this.listAdd[i].checkoutNumber) * parseFloat(this.listAdd[i].price)
- // }
- // this.TotalAmount = this.TotalAmount.toFixed(2)
- },
- allocationSearch(queryString, cb) {
- console.log(queryString)
- this.requestAllocation.parammaps.applyCode = queryString
- GetDataByName(this.requestAllocation).then(response => {
- console.log('调拨单号模糊查询搜索data', response.data.list)
- if (response.data.list !== null) {
- cb(response.data.list)
- } else {
- cb([])
- }
- })
- },
- handleSelectAllocation(item) {
- console.log('调拨单号模糊查询选中值', item)
- this.createTemp.id = item.id
- this.createTemp.oddCode = item.applyCode
- this.getAllocationListParm.parammaps.id = item.id
- this.TotalAmount = 0
- this.getAllocationList()
- },
- getAllocationList() {
- GetDataByName(this.getAllocationListParm).then(response => {
- console.log('调拨单号table-data', response.data.list)
- this.listAdd = response.data.list
- if (response.data.list !== null) {
- for (let i = 0; i < response.data.list.length; i++) {
- this.TotalAmount += parseFloat(response.data.list[i].sumPrice)
- this.$set(this.listAdd[i], 'warehoseCode', '')
- 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.listAdd[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
- this.listAdd[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
- } else {
- this.listAdd[i].srcpath = ''
- this.listAdd[i].picpath = ''
- }
- }
- }
- this.$forceUpdate()
- })
- },
- querySearchEqName(queryString, cb) {
- console.log('备件名称/设备内部编号模糊查询输入值', queryString)
- this.requestEqName.parammaps['eqName'] = queryString
- GetDataByName(this.requestEqName).then(response => {
- console.log('备件名称模糊查询搜索data', response.data.list)
- this.EqNameList = response.data.list
- cb(this.EqNameList)
- })
- },
- handleSelectEqName(item, row) {
- console.log('备件名称/设备内部编号模糊查询选中值', item)
- console.log('备件名称/设备内部编号模糊查询选中值所在行', row)
- this.$set(row, 'eqCode', item.eqCode)
- this.$forceUpdate()
- },
- querySearchCode(queryString, cb) {
- console.log('备件名称/设备内部编号模糊查询输入值', queryString)
- this.requestEqName.parammaps['eqCode'] = queryString
- GetDataByName(this.requestEqName).then(response => {
- console.log('备件名称模糊查询搜索data', response.data.list)
- this.EqNameList = response.data.list
- cb(this.EqNameList)
- })
- },
- // handleClear() {
- // this.activated = false
- // this.$emit('clear')
- // },
- handleSelectEqCode(item, row) {
- console.log('备件名称/设备内部编号模糊查询选中值', item)
- console.log('备件名称/设备内部编号模糊查询选中值所在行', row)
- this.$set(row, 'eqName', item.eqName)
- this.$forceUpdate()
- },
- blurSelectEqName(item, row) {
- this.$set(row, 'eqName', '')
- this.$set(row, 'eqCode', '')
- },
- blurSelectEqCode(item, row) {
- this.$set(row, 'eqName', '')
- this.$set(row, 'eqCode', '')
- },
- changeUseNumber(value, row) {
- console.log('领用数量', value)
- for (var i = 0; i < this.listAdd.length; i++) {
- console.log(this.listAdd[i].id)
- if (this.listAdd[i].id === row.id) {
- var useNumberArray = []
- useNumberArray.push(this.listAdd[i].reportery, parseInt(value))
- // this.listAdd[i].checkoutNumber = Math.min.apply(null,useNumberArray)
- }
- }
- },
- changeCheckoutNumber(value, row) {
- console.log('出库数量', value, row)
- for (var i = 0; i < this.listAdd.length; i++) {
- console.log(this.listAdd[i].id)
- console.log(this.listAdd[i])
- if (this.listAdd[i].id === row.id) {
- var checkoutNumberArray = []
- checkoutNumberArray.push(this.listAdd[i].reportery, parseInt(this.listAdd[i].amount), parseInt(value))
- this.listAdd[i].minNumber = Math.min.apply(null, checkoutNumberArray)
- this.$set(this.listAdd[i], 'sumPrice', parseFloat(this.listAdd[i].minNumber) * parseFloat(this.listAdd[i].price))
- // this.listAdd[i].sumPrice = parseFloat(this.listAdd[i].minNumber) * parseFloat(this.listAdd[i].price)
- console.log(this.rules)
- }
- }
- console.log(this.listAdd)
- },
- blurCheckoutNumber(value, row) {
- console.log(value, row)
- this.TotalAmount = 0
- this.$set(row, 'sumPrice', (parseFloat(row.price) * parseFloat(row.checkoutNumber)).toFixed(2))
- console.log(this.listAdd)
- for (let i = 0; i < this.listAdd.length; i++) {
- this.TotalAmount += parseFloat(this.listAdd[i].sumPrice)
- }
- this.TotalAmount = this.TotalAmount.toFixed(2)
- },
- partDelete(row) {
- console.log(this.listAdd)
- MessageBox.confirm('备件名称:' + row.partName, '确认删除?', {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.TotalAmount = 0
- for (var i = 0; i < this.listAdd.length; i++) {
- console.log(this.listAdd[i])
- if (this.listAdd[i].id === row.id) {
- var listAddIndex = this.listAdd.indexOf(this.listAdd[i])
- }
- if (listAddIndex > -1) {
- this.listAdd.splice(listAddIndex, 1)
- console.log(this.listAdd)
- for (let i = 0; i < this.listAdd.length; i++) {
- this.TotalAmount += parseFloat(this.listAdd[i].checkoutNumber) * parseFloat(this.listAdd[i].price)
- }
- return
- }
- }
- console.log(this.listAdd)
- this.TotalAmount = this.TotalAmount.toFixed(2)
- })
- },
- add_dialog_save() {
- this.isokDisable = true
- setTimeout(() => {
- this.isokDisable = false
- }, 1000)
- this.$refs['createTemp'].validate(valid => {
- if (valid) {
- if (this.createTemp.useForm == '' || this.createTemp.useForm == null || this.createTemp.useForm == undefined) {
- GetDataByName(this.getParmCreateNumber).then(response => {
- this.$nextTick(() => {
- console.log('新增领用单号', response.data.list[0].orderCode)
- this.createTemp.useForm = response.data.list[0].orderCode
- this.$forceUpdate()
- this.add_dialog_saveSave()
- })
- })
- } else {
- this.add_dialog_saveSave()
- }
- }
- })
- },
- add_dialog_saveSave() {
- if (this.listAdd.length !== 0) {
- if (this.createTemp.useType === 0) {
- // 领用出库
- this.postDataPramas.common = { 'returnmap': '0' }
- this.postDataPramas.data = []
- for (var j = 0; j < this.listAdd.length; j++) {
- if (this.listAdd[j].useTypeV == null || this.listAdd[j].checkoutNumber == null || this.listAdd[j].checkoutNumber == '') {
- this.$message({
- type: 'warning',
- message: '请检查费用类型或出库数量是否未填写',
- duration: 2000
- })
- return false
- } else {
- var rulesCheckoutNumber = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
- if (!rulesCheckoutNumber.test(parseFloat(this.listAdd[j].checkoutNumber))) {
- this.$message({
- type: 'error',
- message: '出库数量请输入正数,最多保留两位小数点',
- duration: 2000
- })
- return false
- } else {
- if (parseFloat(this.listAdd[j].checkoutNumber) > parseFloat(this.listAdd[j].amount) || parseFloat(this.listAdd[j].checkoutNumber) > parseFloat(this.listAdd[j].reportery)) {
- this.$message({
- type: 'warning',
- message: '出库数量不可大于领用数量或库位库存数',
- duration: 2000
- })
- return false
- }
- }
- this.$set(this.listAdd[j], 'checkoutNumber', (this.listAdd[j].checkoutNumber).toString())
- }
- }
- if (this.createTemp.applyType === '维修') {
- this.createTemp.useType = 0
- } else if (this.createTemp.applyType === '保养') {
- this.createTemp.useType = 2
- } else if (this.createTemp.applyType === '非维保') {
- this.createTemp.useType = 3
- }
- console.log(this.orderPart.applyCode)
- this.postDataPramas.data[0] = { 'name': 'insertBigPartUse', 'type': 'e', 'parammaps': {
- pastureId: this.createTemp.pastureId,
- departmentId: this.createTemp.departmentId,
- useForm: this.createTemp.useForm,
- oddCode: this.orderPart.applyCode,
- useType: this.createTemp.useType,
- applicatId: this.createTemp.applicatId,
- receiveTime: this.createTemp.receiveTime,
- empId: this.createTemp.empId,
- note: this.createTemp.note
- }}
- this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
- this.postDataPramas.data[1].children = []
- this.postDataPramas.data[1].children[0] = { 'name': 'insertPartUse', 'type': 'e', 'parammaps': {
- bigId: '@insertBigPartUse.LastInsertId',
- locationId: '@insertSpotList.locationId',
- departmentId: '@insertSpotList.departmentId',
- partId: '@insertSpotList.partId',
- partCode: '@insertSpotList.partCode',
- partName: '@insertSpotList.partName',
- specification: '@insertSpotList.specification',
- price: '@insertSpotList.price',
- unit: '@insertSpotList.unit',
- brandId: '@insertSpotList.brandId',
- contractId: '@insertSpotList.contractId',
- useNumber: '@insertSpotList.amount',
- checkoutNumber: '@insertSpotList.checkoutNumber',
- eqName: '@insertSpotList.eqName',
- eqCode: '@insertSpotList.eqCode',
- reportery: '@insertSpotList.reportery',
- useTypeV: '@insertSpotList.useTypeV',
- note: '@insertSpotList.note'
- }}
- this.postDataPramas.data[1].children[1] = { 'name': 'insertPartUseRepertory', 'type': 'e', 'parammaps': {
- checkoutNumber: '@insertSpotList.checkoutNumber',
- pastureId: '@insertSpotList.pastureId',
- locationId: '@insertSpotList.locationId',
- location: '@insertSpotList.location',
- partId: '@insertSpotList.partId',
- partCode: '@insertSpotList.partCode',
- partName: '@insertSpotList.partName',
- specification: '@insertSpotList.specification',
- providerId: '@insertSpotList.providerId',
- providerName: '@insertSpotList.providerName',
- brandId: '@insertSpotList.brandId',
- price: '@insertSpotList.price',
- unit: '@insertSpotList.unit',
- contractId: '@insertSpotList.contractId'
- }}
- this.postDataPramas.data[1].children[2] = { 'name': 'updatePartapplyuseAmount', 'type': 'e', 'parammaps': {
- paid: '@insertSpotList.paid',
- checkoutNumber: '@insertSpotList.checkoutNumber'
- }}
- this.postDataPramas.data[2] = { 'name': 'updateBigPartApplystatue', 'type': 'e', 'parammaps': {
- bid: this.createTemp.bid
- }}
- 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.getdataListParm.parammaps.inputDatetime = ''
- setTimeout(() => {
- this.getList()
- }, 1000)
- this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
- this.dialogFormVisible = false
- }
- })
- return true
- } else if (this.createTemp.useType === 1) {
- // 手动出库
- this.postDataPramas.common = { 'returnmap': '0' }
- this.postDataPramas.data = []
- for (var j = 0; j < this.listAdd.length; j++) {
- if (this.listAdd[j].eqName == '' || this.listAdd[j].eqCode == '' || this.listAdd[j].eqName == null || this.listAdd[j].useTypeV == null || this.listAdd[j].eqCode == null || this.listAdd[j].checkoutNumber == null || this.listAdd[j].checkoutNumber == '') {
- this.$message({
- type: 'warning',
- message: '请检查备件名称或设备内部编号或费用类型或出库数量是否未填写',
- duration: 2000
- })
- return false
- } else {
- // eslint-disable-next-line no-redeclare
- var rulesCheckoutNumber = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
- if (!rulesCheckoutNumber.test(parseFloat(this.listAdd[j].checkoutNumber))) {
- this.$message({
- type: 'error',
- message: '出库数量请输入正数,最多保留两位小数点',
- duration: 2000
- })
- return false
- } else {
- if (parseFloat(this.listAdd[j].checkoutNumber) > parseFloat(this.listAdd[j].reportery)) {
- this.$message({
- type: 'warning',
- message: '出库数量不能大于库位库存数',
- duration: 2000
- })
- this.$set(this.listAdd.find(obj => obj.checkoutNumber == this.listAdd[j].checkoutNumber), 'isNo', 'No')
- return false
- } else {
- this.$set(this.listAdd.find(obj => obj.checkoutNumber == this.listAdd[j].checkoutNumber), 'isNo', 'Yes')
- }
- }
- }
- }
- this.postDataPramas.data[0] = { 'name': 'insertBigPartUse', 'type': 'e', 'parammaps': {
- pastureId: this.createTemp.pastureId,
- departmentId: this.createTemp.departmentId,
- useForm: this.createTemp.useForm,
- useType: this.createTemp.useType,
- applicatId: this.createTemp.applicatId,
- receiveTime: this.createTemp.receiveTime,
- empId: this.createTemp.empId,
- note: this.createTemp.note
- }}
- this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
- this.postDataPramas.data[1].children = []
- this.postDataPramas.data[1].children[0] = { 'name': 'insertPartUse', 'type': 'e', 'parammaps': {
- bigId: '@insertBigPartUse.LastInsertId',
- locationId: '@insertSpotList.locationId',
- departmentId: '@insertSpotList.departmentId',
- partId: '@insertSpotList.partId',
- partCode: '@insertSpotList.partCode',
- partName: '@insertSpotList.partName',
- specification: '@insertSpotList.specification',
- price: '@insertSpotList.price',
- unit: '@insertSpotList.unit',
- brandId: '@insertSpotList.brandId',
- contractId: '@insertSpotList.contractId',
- useNumber: 0,
- checkoutNumber: '@insertSpotList.checkoutNumber',
- eqName: '@insertSpotList.eqName',
- eqCode: '@insertSpotList.eqCode',
- reportery: '@insertSpotList.reportery',
- useTypeV: '@insertSpotList.useTypeV',
- note: '@insertSpotList.note'
- }}
- this.postDataPramas.data[1].children[1] = { 'name': 'insertPartUseRepertory', 'type': 'e', 'parammaps': {
- checkoutNumber: '@insertSpotList.checkoutNumber',
- pastureId: '@insertSpotList.pastureId',
- locationId: '@insertSpotList.locationId',
- location: '@insertSpotList.location',
- partId: '@insertSpotList.partId',
- partCode: '@insertSpotList.partCode',
- partName: '@insertSpotList.partName',
- specification: '@insertSpotList.specification',
- providerId: '@insertSpotList.providerId',
- providerName: '@insertSpotList.providerName',
- brandId: '@insertSpotList.brandId',
- price: '@insertSpotList.price',
- unit: '@insertSpotList.unit',
- contractId: '@insertSpotList.contractId'
- }}
- 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.getdataListParm.parammaps.inputDatetime = ''
- setTimeout(() => {
- this.getList()
- }, 1000)
- this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
- this.dialogFormVisible = false
- }
- })
- return true
- } else if (this.createTemp.useType === 2) {
- // 调拨出库
- this.postDataPramas.common = { 'returnmap': '0' }
- this.postDataPramas.data = []
- // for (var j = 0; j < this.listAdd.length; j++) {
- // if (this.listAdd[j].useTypeV == null) {
- // this.$message({
- // type: 'warning',
- // message: '请检查备费用类型是否未填写',
- // duration: 2000
- // })
- // return false
- // }
- // }
- this.postDataPramas.data[0] = { 'name': 'insertBigPartUse', 'type': 'e', 'parammaps': {
- pastureId: this.createTemp.pastureId,
- departmentId: this.$store.state.user.departmentid,
- useForm: this.createTemp.useForm,
- useType: 4,
- applicatId: this.createTemp.applicatId,
- receiveTime: this.createTemp.receiveTime,
- empId: this.createTemp.empId,
- oddCode: this.createTemp.oddCode,
- note: this.createTemp.note
- }}
- this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
- this.postDataPramas.data[1].children = []
- this.postDataPramas.data[1].children[0] = { 'name': 'insertPartUse', 'type': 'e', 'parammaps': {
- bigId: '@insertBigPartUse.LastInsertId',
- locationId: -1,
- contractId: '@insertSpotList.contractId',
- providerName: '@insertSpotList.providerName',
- providerId: '@insertSpotList.providerId',
- departmentId: '@insertSpotList.departmentId',
- partId: '@insertSpotList.partId',
- partCode: '@insertSpotList.partCode',
- partName: '@insertSpotList.partName',
- specification: '@insertSpotList.specification',
- price: '@insertSpotList.price',
- unit: '@insertSpotList.unit',
- brandId: '@insertSpotList.brandId',
- useNumber: 0,
- checkoutNumber: '@insertSpotList.amount',
- eqName: '@insertSpotList.eqName',
- eqCode: '@insertSpotList.eqCode',
- reportery: 0,
- useTypeV: '@insertSpotList.useTypeV',
- note: '@insertSpotList.note'
- }}
- this.postDataPramas.data[1].children[1] = { 'name': 'updatePartUseRepertory', 'type': 'e', 'parammaps': {
- checkoutNumber: '@insertSpotList.amount',
- partRepId: '@insertSpotList.partRepId'
- }}
- this.postDataPramas.data[2] = { 'name': 'updateBigPartTransfer', 'type': 'e', 'parammaps': {
- id: this.createTemp.id,
- statue: 4,
- useCode: this.createTemp.useForm
- }}
- ExecDataByConfig(this.postDataPramas).then(response => {
- console.log(this.listAdd)
- console.log('新增保存发送参数', this.postDataPramas)
- if (response.msg === 'fail') {
- this.$notify({
- title: '保存失败',
- message: response.data,
- type: 'warning',
- duration: 2000
- })
- } else {
- this.getdataListParm.parammaps.inputDatetime = ''
- setTimeout(() => {
- this.getList()
- }, 1000)
- this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
- this.dialogFormVisible = false
- }
- })
- return true
- }else if(this.createTemp.useType === 5){
- // 报废出库
- this.postDataPramas.common = { 'returnmap': '0' }
- this.postDataPramas.data = []
- for (var j = 0; j < this.listAdd.length; j++) {
- if (this.listAdd[j].eqName == '' || this.listAdd[j].eqCode == '' || this.listAdd[j].eqName == null || this.listAdd[j].useTypeV == null || this.listAdd[j].eqCode == null || this.listAdd[j].checkoutNumber == null || this.listAdd[j].checkoutNumber == '') {
- this.$message({
- type: 'warning',
- message: '请检查备件名称或设备内部编号或费用类型或出库数量是否未填写',
- duration: 2000
- })
- return false
- } else {
- // eslint-disable-next-line no-redeclare
- var rulesCheckoutNumber = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
- if (!rulesCheckoutNumber.test(parseFloat(this.listAdd[j].checkoutNumber))) {
- this.$message({
- type: 'error',
- message: '出库数量请输入正数,最多保留两位小数点',
- duration: 2000
- })
- return false
- } else {
- if (parseFloat(this.listAdd[j].checkoutNumber) > parseFloat(this.listAdd[j].reportery)) {
- this.$message({
- type: 'warning',
- message: '出库数量不能大于库位库存数',
- duration: 2000
- })
- this.$set(this.listAdd.find(obj => obj.checkoutNumber == this.listAdd[j].checkoutNumber), 'isNo', 'No')
- return false
- } else {
- this.$set(this.listAdd.find(obj => obj.checkoutNumber == this.listAdd[j].checkoutNumber), 'isNo', 'Yes')
- }
- }
- }
- }
- this.postDataPramas.data[0] = { 'name': 'insertBigPartUse', 'type': 'e', 'parammaps': {
- pastureId: this.createTemp.pastureId,
- departmentId: this.createTemp.departmentId,
- useForm: this.createTemp.useForm,
- useType: this.createTemp.useType,
- applicatId: this.createTemp.applicatId,
- receiveTime: this.createTemp.receiveTime,
- empId: this.createTemp.empId,
- note: this.createTemp.note
- }}
- this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
- this.postDataPramas.data[1].children = []
- this.postDataPramas.data[1].children[0] = { 'name': 'insertPartUse', 'type': 'e', 'parammaps': {
- bigId: '@insertBigPartUse.LastInsertId',
- locationId: '@insertSpotList.locationId',
- departmentId: '@insertSpotList.departmentId',
- partId: '@insertSpotList.partId',
- partCode: '@insertSpotList.partCode',
- partName: '@insertSpotList.partName',
- specification: '@insertSpotList.specification',
- price: '@insertSpotList.price',
- unit: '@insertSpotList.unit',
- brandId: '@insertSpotList.brandId',
- contractId: '@insertSpotList.contractId',
- useNumber: 0,
- checkoutNumber: '@insertSpotList.checkoutNumber',
- eqName: '@insertSpotList.eqName',
- eqCode: '@insertSpotList.eqCode',
- reportery: '@insertSpotList.reportery',
- useTypeV: '@insertSpotList.useTypeV',
- note: '@insertSpotList.note'
- }}
- this.postDataPramas.data[1].children[1] = { 'name': 'insertPartUseRepertory', 'type': 'e', 'parammaps': {
- checkoutNumber: '@insertSpotList.checkoutNumber',
- pastureId: '@insertSpotList.pastureId',
- locationId: '@insertSpotList.locationId',
- location: '@insertSpotList.location',
- partId: '@insertSpotList.partId',
- partCode: '@insertSpotList.partCode',
- partName: '@insertSpotList.partName',
- specification: '@insertSpotList.specification',
- providerId: '@insertSpotList.providerId',
- providerName: '@insertSpotList.providerName',
- brandId: '@insertSpotList.brandId',
- price: '@insertSpotList.price',
- unit: '@insertSpotList.unit',
- contractId: '@insertSpotList.contractId'
- }}
- 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.getdataListParm.parammaps.inputDatetime = ''
- setTimeout(() => {
- this.getList()
- }, 1000)
- this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
- this.dialogFormVisible = false
- }
- })
- return true
- }
- } else {
- this.$notify({
- title: '',
- message: '请选择备件',
- type: 'warning',
- duration: 2000
- })
- return false
- }
- },
- tableCellStyle({ row, column, rowIndex, columnIndex }) {
- if (row.isNo == 'No' && columnIndex === 13) {
- return {
- background: 'red'
- }
- }
- return {
- background: ''
- }
- },
- // 导入
- beforeImportExcel(file) {
- const isLt2M = file.size / 1024 / 1024 < 10
- if (!isLt2M) {
- this.$message.error('上传文件大小不能超过 10MB!')
- }
- return isLt2M
- },
- handleImportExcelSuccess(res, file) {
- if (res.msg === 'ok') {
- this.$message({
- title: '成功',
- message: '导入成功:' + res.data.success + '条!',
- type: 'success',
- duration: 2000
- })
- if (res.data.err_count > 0) {
- this.$notify({
- title: '失败',
- message: '导入失败:' + res.data.err_count + '条!',
- type: 'danger',
- duration: 2000
- })
- import('@/vendor/Export2Excel').then(excel => {
- const list1 = res.data.result
- const tHeader = [
- '牧场', '领用单编号', '领用日期', '物料编码', '品名', '规格型号', '品牌', '计量单位', '实发数量', '单价', '总价', '库位', '供应商', '名称', '牧场设备编号', '具体用处', '领用类型', '领用部门', '领用人', 'SignColumn', '报错信息'
- ]
- const filterVal = [
- '牧场', '领用单编号', '领用日期', '物料编码', '品名', '规格型号', '品牌', '计量单位', '实发数量', '单价', '总价', '库位', '供应商', '名称', '牧场设备编号', '具体用处', '领用类型', '领用部门', '领用人', 'SignColumn', 'error_msg'
- ]
- const data1 = this.formatJson(filterVal, list1)
- excel.export_json_to_excel({
- header: tHeader,
- data: data1,
- filename: this.requestParam.parammaps.formType,
- autoWidth: true,
- bookType: 'xlsx'
- })
- })
- }
- } else {
- this.$notify({
- title: '失败',
- message: '上传失败',
- type: 'danger',
- duration: 2000
- })
- }
- },
- formatJsonTemp(filterVal, jsonData) {
- return jsonData.map(v =>
- filterVal.map(j => {
- if (j === 'timestamp') {
- return parseTime(v[j])
- } else {
- return v[j]
- }
- })
- )
- },
- // 导出
- handleDownload() {
- 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.requestParam.parammaps.formType = '备件出库信息'
- this.requestParam.parammaps.inputDatetime = this.getdataListParm.parammaps.inputDatetime
- this.requestParam.parammaps.pastureName = this.getdataListParm.parammaps.pastureName
- this.requestParam.parammaps.departmentId = this.getdataListParm.parammaps.departmentId
- this.requestParam.parammaps.useForm = this.getdataListParm.parammaps.useForm
- this.requestParam.parammaps.useType = this.getdataListParm.parammaps.useType
- this.requestParam.parammaps.startTime = this.getdataListParm.parammaps.startTime
- this.requestParam.parammaps.stopTime = this.getdataListParm.parammaps.stopTime
- GetAccount(this.requestParam).then(response => {
- this.$nextTick(() => {
- import('@/vendor/Export2Excel').then(excel => {
- const list1 = response.data.list
- if (response.data.list !== '') {
- this.percentage = 99
- setTimeout(() => {
- this.isPercentage = false
- }, 2000)
- }
- const tHeader = [
- '牧场', '领用单编号', '领用日期', '物料编码', '品名', '规格型号', '品牌', '计量单位', '实发数量', '单价', '总价', '库位', '供应商', '名称', '牧场设备编号', '领用类型', '领用部门', '领用人', '备注']
- const filterVal = [
- 'pastureName', 'useForm', 'creatTime', 'partCode', 'partName', 'specification', 'brandName', 'unit', 'checkoutNumber', 'price', 'sumPrice', 'warehoseCode', 'providerName', 'eqName', 'eqCode', 'useTypeV', 'departmentName', 'appliname', 'note'
- ]
- const data1 = this.formatJson(filterVal, list1)
- excel.export_json_to_excel({ header: tHeader, data: data1, filename: this.requestParam.parammaps.formType, autoWidth: true, bookType: 'xlsx' })
- })
- })
- })
- },
- handleDownload2() {
- 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.requestParam = {}
- this.requestParam.name = 'getPartuseDetailList'
- this.requestParam.parammaps = {}
- this.requestParam.parammaps.formType = '备件出库记录'
- this.requestParam.parammaps.inputDatetime = this.getdataListParm2.parammaps.inputDatetime
- this.requestParam.parammaps.pastureName = this.getdataListParm2.parammaps.pastureName
- this.requestParam.parammaps.departmentId = this.getdataListParm2.parammaps.departmentId
- this.requestParam.parammaps.startTime = this.getdataListParm2.parammaps.startTime
- this.requestParam.parammaps.stopTime = this.getdataListParm2.parammaps.stopTime
- this.requestParam.parammaps.useForm = this.getdataListParm2.parammaps.useForm
- this.requestParam.parammaps.partCode = this.getdataListParm2.parammaps.partCode
- this.requestParam.parammaps.partName = this.getdataListParm2.parammaps.partName
- this.requestParam.parammaps.providerId = this.getdataListParm2.parammaps.providerId
- GetAccount(this.requestParam).then(response => {
- this.$nextTick(() => {
- import('@/vendor/Export2Excel').then(excel => {
- const list1 = response.data.list
- if (response.data.list !== '') {
- this.percentage = 99
- setTimeout(() => {
- this.isPercentage = false
- }, 2000)
- }
- const tHeader = [
- '牧场', '出库单号', '备件编号', '备件名称', '备件规格', '备件品牌', '计量单位', ' 供应商', '设备名称', '设备内部编号', '费用类型', '库位', '期初库存', '出库数量', '单价', '总价 ', '领用部门 ', '领用人', '录入人 ', '出库 日期', '备注 '
- ]
- const filterVal = [
- 'pastureName', 'useForm', 'partCode', 'partName', 'specification', 'brandName', 'unit', 'providerName', 'eqName', 'eqCode', 'useTypeV', 'warehoseCode', 'reportery', 'checkoutNumber', 'price', 'sumPrice', 'departmentName', 'appliname', 'empname', 'creatTime', 'note'
- ]
- const data1 = this.formatJson(filterVal, list1)
- excel.export_json_to_excel({ header: tHeader, data: data1, filename: this.requestParam.parammaps.formType, autoWidth: true, bookType: 'xlsx' })
- })
- })
- })
- },
- handleDownloadEas() {
- this.$alert('备件出库EAS信息正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
- 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.requestParam.name = 'downloadPartUseEAS'
- this.requestParam.parammaps.inputDatetime = this.getdataListParm.parammaps.inputDatetime
- this.requestParam.parammaps.pastureName = this.getdataListParm.parammaps.pastureName
- this.requestParam.parammaps.departmentId = this.getdataListParm.parammaps.departmentId
- this.requestParam.parammaps.useForm = this.getdataListParm.parammaps.useForm
- this.requestParam.parammaps.useType = this.getdataListParm.parammaps.useType
- this.requestParam.parammaps.startTime = this.getdataListParm.parammaps.startTime
- this.requestParam.parammaps.stopTime = this.getdataListParm.parammaps.stopTime
- GetAccount(this.requestParam).then(response => {
- if (response.data.list !== '') {
- this.percentage = 99
- setTimeout(() => {
- this.isPercentage = false
- }, 2000)
- }
- this.$nextTick(() => {
- import('@/vendor/Export2Excel').then(excel => {
- const list1 = response.data.list
- const tHeader = [
- '*单据编号', '业务日期', '领料出库单明细$成本对象_名称_l2', '领料出库单明细$成本对象_编码', '领料出库单明细$仓库_编码', '领料出库单明细$库位_编码', '领料出库单明细$仓管员_编码', '领料出库单体$领料人_编码', '领料出库单明细_批次', '领料出库单明细_数量', '领料出库单明细_辅助数量', '领料出库单明细_单位实际成本', '领料出库单明细_实际成本', '领料出库单明细_生产日期', '领料出库单明细_到期日期', '领料出库单明细$物料_规格型号', '领料出库单明细$物料_名称_l2', '领料出库单明细$物料_编码', '领料出库单明细$辅助属性_编码', '领料出库单明细$计量单位_编码', '领料出库单明细$辅助计量单位_编码', '领料出库单明细_订单单号', '领料出库单明细_备注', '成本中心_编码', '需求方库存组织_编码', '需方库存组织_名称_l2', '部门_编码', '事务类型_名称_l2', '*事务类型_编码', '创建者_用户名', '创建时间', '领料出库单明细$生产线', '领料出库单明细$班组', '领料出库单明细$领料工序', '领料出库单明细$负责人', '领料出库单明细$成本对象组_单据编号', '领料出库单明细$成本对象组_名称_l2', '领料出库单明细$成本项目_编码', '领料出库单明细$成本项目_名称_l2', '领料出库单体$项目号_编码', '领料出库单体$跟踪号_编码', '摘要', '供应方库存组织_编码', '供应方财务组织_编码', '需求方财务组织_编码', '供方仓库_编码', '供方库位_编码', '结算价', '需方仓库_编码', '需方库位_编码', '仓管员_编码', '领料出库单明细$主制部门_编码', '领料出库单明细$主制部门_名称_l2', '领料出库单明细$成本中心_编码', '领料出库单明细$成本中心_名称_l2', '业务类型_编码', '业务类型_名称'
- ]
- const filterVal = [
- '*单据编号', '业务日期', '领料出库单明细$成本对象_名称_l2', '领料出库单明细$成本对象_编码', '领料出库单明细$仓库_编码', '领料出库单明细$库位_编码', '领料出库单明细$仓管员_编码', '领料出库单体$领料人_编码', '领料出库单明细_批次', '领料出库单明细_数量', '领料出库单明细_辅助数量', '领料出库单明细_单位实际成本', '领料出库单明细_实际成本', '领料出库单明细_生产日期', '领料出库单明细_到期日期', '领料出库单明细$物料_规格型号', '领料出库单明细$物料_名称_l2', '领料出库单明细$物料_编码', '领料出库单明细$辅助属性_编码', '领料出库单明细$计量单位_编码', '领料出库单明细$辅助计量单位_编码', '领料出库单明细_订单单号', '领料出库单明细_备注', '成本中心_编码', '需求方库存组织_编码', '需方库存组织_名称_l2', '部门_编码', '事务类型_名称_l2', '*事务类型_编码', '创建者_用户名', '创建时间', '领料出库单明细$生产线', '领料出库单明细$班组', '领料出库单明细$领料工序', '领料出库单明细$负责人', '领料出库单明细$成本对象组_单据编号', '领料出库单明细$成本对象组_名称_l2', '领料出库单明细$成本项目_编码', '领料出库单明细$成本项目_名称_l2', '领料出库单体$项目号_编码', '领料出库单体$跟踪号_编码', '摘要', '供应方库存组织_编码', '供应方财务组织_编码', '需求方财务组织_编码', '供方仓库_编码', '供方库位_编码', '结算价', '需方仓库_编码', '需方库位_编码', '仓管员_编码', '领料出库单明细$主制部门_编码', '领料出库单明细$主制部门_名称_l2', '领料出库单明细$成本中心_编码', '领料出库单明细$成本中心_名称_l2', '业务类型_编码', '业务类型_名称'
- ]
- const tmultiHeader = [['EAS', '7.5.0', '领料出库单',
- '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
- '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
- '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
- '', '', '', '', '', '', '', '', ''],
- ['MaterialReq', '领料出库单', '', '', '', '', '', '', '', '', '', '',
- '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
- '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
- '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''],
- ['FNumber', 'FBizDate', 'FEntry$costObject_name_l2', 'FEntry$costObject_number', 'FEntry$warehouse_number', 'FEntry$location_number', 'FEntry$stocker_number', 'FEntry$picker_number', 'FEntry_lot', 'FEntry_qty', 'FEntry_assistQty', 'FEntry_unitActualCost', 'FEntry_actualCost', 'FEntry_mfg', 'FEntry_exp', 'FEntry$material_model', 'FEntry$material_name_l2', 'FEntry$material_number', 'FEntry$assistProperty_number', 'FEntry$unit_number', 'FEntry$assistUnit_number', 'FEntry_OrderNumber', 'FEntry_remark', 'FCostCenterOrgUnit_number', 'FStorageOrgUnit_number', 'FStorageOrgUnit_name_l2', 'FAdminOrgUnit_number', 'FTransactionType_name_l2', 'FTransactionType_number', 'FCreator_number', 'FCreateTime', 'FEntry$ProductLine_number', 'FEntry$ClassGroup_number', 'FEntry$ProductLineWPEntry_number', 'FEntry$person_number', 'FEntry$costObjectSuite_number', 'FEntry$costObjectSuite_name_l2', 'FEntry$costItem_number', 'FEntry$costItem_name_l2', 'FEntry$project_number', 'FEntry$trackNumber_number', 'FDescription', 'FSupplyStoreOrgUnit_number', 'FSupplyCompanyOrgUnit_number', 'FDemandCompanyOrgUnit_number', 'FEntry$SupplyWarehouse_number', 'FEntry$SupplyLocation_number', 'FEntry$SettlePrice', 'FEntry$Warehouse_number', 'FEntry$Location_number', 'FEntry$Stocker_number', 'FEntry$AdminOrgUnit1_number', 'FEntry$AdminOrgUnit1_name', 'FEntry$CostCenterOrgUnit1_number', 'FEntry$CostCenterOrgUnit1_name', 'FBizType_number', 'FBizType_name_l2'
- ]]
- // const tmerges=['B1:D2']
- if (list1 !== null) {
- const data1 = this.formatJsonTemp(filterVal, list1)
- excel.export_json_to_excel({
- // merges: tmerges,
- multiHeader: tmultiHeader,
- header: tHeader,
- data: data1,
- filename: '备件出库EAS',
- autoWidth: true,
- bookType: 'xlsx'
- })
- } else {
- this.$notify({
- title: '',
- message: '无备件领用完成信息,无法导出!',
- type: 'warning',
- duration: 2000
- })
- }
- })
- })
- })
- },
- handleDownloadEas1() {
- this.$alert('备件出库EAS信息正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
- 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.requestParam.name = 'downloadPartUseEASYuan'
- this.requestParam.parammaps.inputDatetime = this.getdataListParm.parammaps.inputDatetime
- this.requestParam.parammaps.pastureName = this.getdataListParm.parammaps.pastureName
- this.requestParam.parammaps.departmentId = this.getdataListParm.parammaps.departmentId
- this.requestParam.parammaps.useForm = this.getdataListParm.parammaps.useForm
- this.requestParam.parammaps.useType = this.getdataListParm.parammaps.useType
- this.requestParam.parammaps.startTime = this.getdataListParm.parammaps.startTime
- this.requestParam.parammaps.stopTime = this.getdataListParm.parammaps.stopTime
- GetAccount(this.requestParam).then(response => {
- if (response.data.list !== '') {
- this.percentage = 99
- setTimeout(() => {
- this.isPercentage = false
- }, 2000)
- }
- this.$nextTick(() => {
- import('@/vendor/Export2Excel').then(excel => {
- const list1 = response.data.list
- const tHeader = [
- '领用部门', '牧场', '领用单编号', '领用日期', '供应商编码', '供应商名称', '出库人', '制单日期', '品名', '物料编码', '计量单位', '单价', '实发数量', '总价', '备注', '领用人', '费用类型'
- ]
- const filterVal = [
- '领用部门', '牧场', '领用单编号', '领用日期', '供应商编码', '供应商名称', '出库人', '制单日期', '品名', '物料编码', '计量单位', '单价', '实发数量', '总价', '备注', '领用人', '费用类型'
- ]
- // const tmerges=['B1:D2']
- if (list1 !== null) {
- const data1 = this.formatJsonTemp(filterVal, list1)
- excel.export_json_to_excel({
- // merges: tmerges,
- // multiHeader: tmultiHeader,
- header: tHeader,
- data: data1,
- filename: '备件出库EAS',
- autoWidth: true,
- bookType: 'xlsx'
- })
- } else {
- this.$notify({
- title: '',
- message: '无备件领用完成信息,无法导出!',
- type: 'warning',
- duration: 2000
- })
- }
- })
- })
- })
- },
- formatJson(filterVal, jsonData) {
- return jsonData.map(v =>
- filterVal.map(j => {
- if (j === 'timestamp') {
- return parseTime(v[j])
- } else {
- return v[j]
- }
- })
- )
- },
- handleDelate(row) {
- console.log('点击了删除')
- this.getdataListSee.parammaps.id = row.id
- this.getSeeList()
- MessageBox.confirm('确认删除此条信息?', {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.postDataPramas.common = { 'returnmap': '0' }
- this.postDataPramas.data = []
- this.postDataPramas.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listSee }}
- this.postDataPramas.data[0].children = []
- this.postDataPramas.data[0].children[0] = { 'name': 'updatePartRepertoryDelCK', 'type': 'e', 'parammaps': {
- id: '@insertSpotList.id',
- contractId: '@insertSpotList.contractId',
- partCode: '@insertSpotList.partCode',
- pastureId: row.pastureId
- }}
- this.postDataPramas.data[0].children[1] = { 'name': 'deletePartUse', 'type': 'e', 'parammaps': {
- id: '@insertSpotList.id'
- }}
- this.postDataPramas.data[1] = { 'name': 'updatePartApplyDel', 'type': 'e', 'parammaps': {
- applyCode: row.useForm
- }}
- this.postDataPramas.data[2] = { 'name': 'deleteBigPartUse', 'type': 'e', 'parammaps': {
- id: row.id
- }}
- ExecDataByConfig(this.postDataPramas).then(response => {
- this.getList()
- this.$notify({
- title: '成功',
- message: '删除成功',
- type: 'success',
- duration: 2000
- })
- })
- }).catch(() => {
- this.$message({ type: 'info', message: '已取消删除' })
- })
- },
- // ---------------------------------------
- // 编辑--- 修改保存
- edit_dialog_save() {
- console.log('编辑保存')
- },
- // 导出模板
- handleDownloadTemp() {
- this.requestParam.name = 'stockLaidDownTemp'
- GetDataByName(this.requestParam).then(response => {
- this.$nextTick(() => {
- import('@/vendor/Export2Excel').then(excel => {
- const list1 = response.data.list
- const tHeader = [
- '牧场', '领用单编号', '领用日期', '物料编码', '品名', '规格型号', '品牌', '计量单位', '实发数量', '单价', '总价', '库位', '供应商', '名称', '牧场设备编号', '具体用处', '领用类型', '领用部门', '领用人'
- ]
- const filterVal = [
- '牧场', '领用单编号', '领用日期', '物料编码', '品名', '规格型号', '品牌', '计量单位', '实发数量', '单价', '总价', '库位', '供应商', '名称', '牧场设备编号', '具体用处', '领用类型', '领用部门', '领用人'
- ]
- const data1 = this.formatJsonTemp(filterVal, list1)
- excel.export_json_to_excel({
- header: tHeader,
- data: data1,
- filename: '出库模板',
- autoWidth: true,
- bookType: 'xlsx'
- })
- })
- })
- })
- },
- handleEAS() {
- this.easStatus.dialogStatus = 'easStatus'
- this.easStatus.dialogFormVisible = true
- this.getListEasStatusLst()
- },
- getListEasStatusLst() {
- this.easStatus.listLoading = true
- GetDataByName(this.easStatus.getdataListParm).then(response => {
- if (response.data.list !== null) {
- this.easStatus.list = response.data.list
- } else {
- this.easStatus.list = []
- }
- this.easStatus.pageNum = response.data.pageNum
- this.easStatus.pageSize = response.data.pageSize
- if (response.data.total) {
- this.easStatus.total = response.data.total
- }
- })
- setTimeout(() => {
- this.easStatus.listLoading = false
- }, 100)
- },
- handleClose(row) {
- MessageBox.confirm('是否确认关闭同步此数据?', {
- confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
- }).then(() => {
- this.requestParam = {}
- this.requestParam.name = 'updatebigpartuseSync'
- this.requestParam.parammaps = {}
- this.requestParam.parammaps.issync = '2'
- this.requestParam.parammaps.id = row.id
- PostDataByName(this.requestParam).then((response) => {
- if (response.msg !== 'fail') {
- this.$notify({ title: '成功', message: '关闭同步成功', type: 'success', duration: 2000 })
- this.getListEasStatusLst()
- this.getList()
- } else {
- this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
- this.getListEasStatusLst()
- this.getList()
- }
- })
- }).catch(() => {
- this.$message({ type: 'info', message: '已取消关闭同步' })
- })
- },
- handleManual(row) {
- MessageBox.confirm('是否确认同步此数据至EAS?', {
- confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
- }).then(() => {
- this.requestParam = {}
- this.requestParam.typeIn = row.typeIn
- this.requestParam.billCode = row.billCode
- EasSync(this.requestParam).then((response) => {
- if (response.msg !== 'fail') {
- this.$notify({ title: '成功', message: '手动同步成功', type: 'success', duration: 2000 })
- this.getListEasStatusLst()
- this.getList()
- } else {
- this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
- this.getListEasStatusLst()
- this.getList()
- }
- })
- }).catch(() => {
- this.$message({ type: 'info', message: '已取消手动同步' })
- })
- },
- handleIgnore(row) {
- MessageBox.confirm('是否确认忽略同步此数据?', {
- confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
- }).then(() => {
- this.requestParam = {}
- this.requestParam.name = 'updatebigpartuseSync'
- this.requestParam.parammaps = {}
- this.requestParam.parammaps.issync = '3'
- this.requestParam.parammaps.id = row.id
- PostDataByName(this.requestParam).then((response) => {
- if (response.msg !== 'fail') {
- this.$notify({ title: '成功', message: '忽略同步成功', type: 'success', duration: 2000 })
- this.getListEasStatusLst()
- this.getList()
- } else {
- this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
- this.getListEasStatusLst()
- this.getList()
- }
- })
- }).catch(() => {
- this.$message({ type: 'info', message: '已取消忽略同步' })
- })
- }
- }
- }
- </script>
- <style lang="scss">
- .inputDatetime .el-range-separator{
- padding: 0;
- margin: 0 10px;
- }
- .el-radio__label{
- padding-left: 2px !important;
- }
- .el-form-item__error{padding-top: 0;}
- body .el-table th.gutter {
- display: table-cell !important;
- }
- .el-table{
- width:99.9%;
- }
- </style>
- <style lang="scss" scoped>
- .el-radio{
- margin-right: 5px;
- }
- .el-form-item__content{
- line-height: 0;
- }
- </style>
|