index.vue 147 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326
  1. <template>
  2. <div class="app-container">
  3. <div v-if="isPercentage" class="percentage" style="width: 210px;height: 90px;background: #fff;position: fixed;bottom: 0;left: 0;z-index: 9999999999999;">
  4. <h4 style="padding-left: 10px;line-height: 0;">导出进度:</h4>
  5. <el-progress style="padding-left: 10px;" :text-inside="true" :stroke-width="26" :percentage="percentage" />
  6. </div>
  7. <el-tabs v-model="activeName" @tab-click="handleClick">
  8. <el-tab-pane label="备件出库" name="first">
  9. <!-- <div class="el-icon-info" style="font-size: 30px;float: right;color: #009C69;" @click="handleDescription" /> -->
  10. <div class="el-icon-info" style="font-size: 30px;float: right;color: #409EFF;" @click="handleDescription"/>
  11. <div class="filter-container">
  12. <el-select v-model="getdataListParm.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item" @change="changePastureName">
  13. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
  14. </el-select>
  15. <el-input v-model="getdataListParm.parammaps.useForm" placeholder="出库单号" style="width: 200px;" class="filter-item" />
  16. <el-select v-model="getdataListParm.parammaps.useType" clearable placeholder="出库方式" class="filter-item" style="width: 120px;">
  17. <el-option v-for="item in useTypes" :key="item.id" :label="item.name" :value="item.id" />
  18. </el-select>
  19. <el-select v-model="getdataListParm.parammaps.departmentId" style="width: 140px;" placeholder="领用部门" class="filter-item" clearable>
  20. <el-option v-for="item in findAllDepart" :key="item.id" :label="item.name" :value="item.id" />
  21. </el-select>
  22. <!-- <el-select v-model="getdataListParm.parammaps.easStatus" style="width: 150px;" clearable placeholder="EAS同步状态" class="filter-item">
  23. <el-option v-for="item in easStatus.easStatusList" :key="item.id" :label="item.name" :value="item.id" />
  24. </el-select> -->
  25. <el-select v-model="getdataListParm.parammaps.sapStatus" style="width: 150px;" clearable placeholder="SAP上传状态" class="filter-item">
  26. <el-option v-for="item in easStatus.sapStatusList" :key="item.id" :label="item.name" :value="item.id" />
  27. </el-select>
  28. <el-date-picker
  29. ref="inputDatetime"
  30. v-model="getdataListParm.parammaps.inputDatetime"
  31. clearable
  32. class="inputDatetime"
  33. type="datetimerange"
  34. style="width: 250px;top:-3px;"
  35. format="yyyy-MM-dd"
  36. value-format="yyyy-MM-dd"
  37. range-separator="至"
  38. start-placeholder="开始日期"
  39. end-placeholder="结束日期"
  40. />
  41. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
  42. <div>
  43. <el-button v-if="isOutStockAdd" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
  44. <!-- <el-button v-if="isReceiveTemplate" v-waves class="filter-item" type="info" icon="el-icon-download" @click="handleDownloadTemp"> 模板 </el-button> -->
  45. <el-upload style="display: inline-block;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImportExcel" :on-success="handleImportExcelSuccess">
  46. <el-button v-if="isOutStockImport" v-waves class="filter-item" type="warning" icon="el-icon-upload2">导入</el-button>
  47. </el-upload>
  48. <el-button v-if="isOutStockExport" class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-edit" @click="handleDownload">导出</el-button>
  49. <!-- <el-button class="filter-item" style="margin-left: 10px;" type="danger" icon="el-icon-upload2" @click="handleDownloadEas">导出EAS</el-button> -->
  50. <!-- <el-button class="filter-item" style="margin-left: 10px;" type="danger" icon="el-icon-upload2" @click="handleDownloadEas1">导出EAS</el-button> -->
  51. <!-- <el-button v-if="isEasSynchronization" class="filter-item" type="primary" style="float: right;" @click="handleEAS">EAS同步</el-button> -->
  52. <el-button v-if="isOutsap" class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-upload2" @click="sapUpload">SAP上传</el-button>
  53. </div>
  54. </div>
  55. <el-table
  56. :key="tableKey"
  57. v-loading="listLoading"
  58. element-loading-text="给我一点时间"
  59. :data="list"
  60. border
  61. fit
  62. highlight-current-row
  63. style="width: 100%;"
  64. :row-style="rowStyle"
  65. :cell-style="cellStyle"
  66. class="elTable table-fixed"
  67. @sort-change="tableSort"
  68. @selection-change="change_table_selection"
  69. @current-change="handleCurrentChange"
  70. :max-height="myHeight"
  71. >
  72. <el-table-column type="selection" :selectable="checkboxInit" align="center" width="50" />
  73. <el-table-column label="序号" align="center" type="index" width="50px">
  74. <template slot-scope="scope">
  75. <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
  76. </template>
  77. </el-table-column>
  78. <el-table-column label="出库单号" align="center" min-width="150px">
  79. <template slot-scope="scope">
  80. <span>{{ scope.row.useForm }}</span>
  81. </template>
  82. </el-table-column>
  83. <el-table-column label="领用部门" min-width="100px" align="center">
  84. <template slot-scope="scope">
  85. <span>{{ scope.row.departmentName }}</span><br>
  86. </template>
  87. </el-table-column>
  88. <el-table-column label="牧场" min-width="100px" align="center">
  89. <template slot-scope="scope">
  90. <span>{{ scope.row.pastureName }}</span><br>
  91. </template>
  92. </el-table-column>
  93. <el-table-column sortable prop="partKind" label="备件种类数" align="center" min-width="100px">
  94. <template slot-scope="scope">
  95. <span>{{ scope.row.partKind }}</span>
  96. </template>
  97. </el-table-column>
  98. <el-table-column label="出库方式" align="center" min-width="100px" :formatter="useType" />
  99. <el-table-column label="录入人" min-width="100px" align="center">
  100. <template slot-scope="scope">
  101. <span>{{ scope.row.empname }}</span><br>
  102. </template>
  103. </el-table-column>
  104. <el-table-column label="出库日期" sortable prop="creatTime" min-width="100px" align="center" />
  105. <!-- <el-table-column label="EAS同步状态" min-width="130px" align="center">
  106. <template slot-scope="scope">
  107. <span>{{ scope.row.easStatus }}</span><br>
  108. </template>
  109. </el-table-column> -->
  110. <el-table-column prop="ProofCode" label="sap编码" min-width="80px" align="center">
  111. <template slot-scope="scope">
  112. <span>{{scope.row.ProofCode}}</span>
  113. </template>
  114. </el-table-column>
  115. <el-table-column prop="ProofCode" label="sap上传状态" min-width="80px" align="center">
  116. <template slot-scope="scope">
  117. <span v-if="scope.row.ProofCode">已上传</span>
  118. <span v-else>未上传</span>
  119. </template>
  120. </el-table-column>
  121. <el-table-column prop="sterilisation" label="冲销状态" min-width="80px" align="center">
  122. <template slot-scope="scope">
  123. <span v-if="scope.row.sterilisation == 1">已冲销</span>
  124. <span v-else>未冲销</span>
  125. </template>
  126. </el-table-column>
  127. <el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width" fixed="right">
  128. <template slot-scope="{row}">
  129. <el-button v-if="isOutStockSee" type="primary" size="mini" @click="form_see(row)">查看</el-button>
  130. <!-- <el-button v-if="isStorageSee" type="success" size="mini" @click="form_edit(row)">编辑</el-button> -->
  131. <el-button v-if="isOutStockDelete && row.useType !== 4" style="display:inline-block" type="danger" size="mini" @click="handleDelate(row)">删除</el-button>
  132. <el-button v-else type="danger" size="mini" style="display:none" @click="handleDelate(row)">删除</el-button>
  133. </template>
  134. </el-table-column>
  135. </el-table>
  136. <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="get_table_data" />
  137. </el-tab-pane>
  138. <el-tab-pane label="出库记录" name="second">
  139. <div class="filter-container">
  140. <el-select v-model="getdataListParm2.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item">
  141. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
  142. </el-select>
  143. <el-input v-model="getdataListParm2.parammaps.useForm" placeholder="出库单号" style="width: 200px;" class="filter-item" />
  144. <el-input v-model="getdataListParm2.parammaps.partCode" placeholder="备件编号" style="width: 200px;" class="filter-item" />
  145. <el-input v-model="getdataListParm2.parammaps.partName" placeholder="备件名称" style="width: 200px;" class="filter-item" />
  146. <el-select v-model="getdataListParm2.parammaps.providerId" filterable clearable style="width: 140px;" placeholder="供应商" class="filter-item">
  147. <el-option v-for="item in findAllProvider" :key="item.id" :label="item.name" :value="item.id" />
  148. </el-select>
  149. <el-select v-model="getdataListParm2.parammaps.departmentId" style="width: 140px;" placeholder="领用部门" class="filter-item" clearable>
  150. <el-option v-for="item in findAllDepart" :key="item.id" :label="item.name" :value="item.id" />
  151. </el-select>
  152. <tree-select
  153. class="typeSelect"
  154. :height="150"
  155. :width="250"
  156. size="small"
  157. clearable
  158. :data="parentType"
  159. :disabled="disabled2"
  160. :placeholder="placeholder"
  161. style="display:inline-block;"
  162. :default-props="defaultProps"
  163. :node-key="nodeKey"
  164. :checked-keys="defaultCheckedKeys"
  165. @popoverHide="popoverHide"
  166. />
  167. <el-input v-model="getdataListParm2.parammaps.eqName" placeholder="设备名称" style="width: 200px;" class="filter-item" />
  168. <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="结束日期" />
  169. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search2">搜索</el-button>
  170. <el-button v-if="isOutStockExport" class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-edit" @click="handleDownload2">导出</el-button>
  171. </div>
  172. <el-table
  173. :key="tableKey2"
  174. v-loading="listLoading2"
  175. element-loading-text="给我一点时间"
  176. :data="list2"
  177. border
  178. fit
  179. highlight-current-row
  180. style="width: 100%;"
  181. :row-style="rowStyle"
  182. :cell-style="cellStyle"
  183. class="elTable table-fixed"
  184. @sort-change="tableSort"
  185. :max-height="myHeight"
  186. >
  187. <el-table-column label="序号" align="center" type="index" width="50px">
  188. <template slot-scope="scope">
  189. <span>{{ scope.$index + (pageNum2-1) * pageSize2 + 1 }}</span>
  190. </template>
  191. </el-table-column>
  192. <el-table-column label="牧场" min-width="130px" align="center">
  193. <template slot-scope="scope">
  194. <span>{{ scope.row.pastureName }}</span><br>
  195. </template>
  196. </el-table-column>
  197. <el-table-column label="出库单号" align="center" min-width="150px">
  198. <template slot-scope="scope">
  199. <span>{{ scope.row.useForm }}</span>
  200. </template>
  201. </el-table-column>
  202. <el-table-column label="备件编号" min-width="150px" align="center">
  203. <template slot-scope="scope">
  204. <span>{{ scope.row.partCode }}</span><br>
  205. </template>
  206. </el-table-column>
  207. <el-table-column label="备件名称" align="center" min-width="150px">
  208. <template slot-scope="scope">
  209. <span>{{ scope.row.partName }}</span>
  210. </template>
  211. </el-table-column>
  212. <el-table-column label="备件规格" min-width="130px" align="center">
  213. <template slot-scope="scope">
  214. <span>{{ scope.row.specification }}</span><br>
  215. </template>
  216. </el-table-column>
  217. <el-table-column label="备件品牌" min-width="130px" align="center">
  218. <template slot-scope="scope">
  219. <span>{{ scope.row.brandName }}</span><br>
  220. </template>
  221. </el-table-column>
  222. <el-table-column label="计量单位" align="center" min-width="100px">
  223. <template slot-scope="scope">
  224. <span>{{ scope.row.unit }}</span>
  225. </template>
  226. </el-table-column>
  227. <el-table-column label="供应商" min-width="130px" align="center">
  228. <template slot-scope="scope">
  229. <span>{{ scope.row.providerName }}</span><br>
  230. </template>
  231. </el-table-column>
  232. <el-table-column label="设备名称" align="center" min-width="130px">
  233. <template slot-scope="scope">
  234. <span>{{ scope.row.eqName }}</span>
  235. </template>
  236. </el-table-column>
  237. <el-table-column label="设备内部编号" min-width="90px" align="center">
  238. <template slot-scope="scope">
  239. <span>{{ scope.row.eqCode }}</span><br>
  240. </template>
  241. </el-table-column>
  242. <el-table-column label="费用类型" align="center" min-width="130px">
  243. <template slot-scope="scope">
  244. <span>{{ scope.row.useTypeV }}</span>
  245. </template>
  246. </el-table-column>
  247. <el-table-column label="库位" align="center" min-width="130px">
  248. <template slot-scope="scope">
  249. <span>{{ scope.row.warehoseCode }}</span>
  250. </template>
  251. </el-table-column>
  252. <el-table-column label="期初库存" sortable prop="reportery" align="center" min-width="130px">
  253. <template slot-scope="scope">
  254. <span>{{ scope.row.reportery }}</span>
  255. </template>
  256. </el-table-column>
  257. <el-table-column label="出库数量" sortable prop="checkoutNumber" align="center" min-width="130px">
  258. <template slot-scope="scope">
  259. <span>{{ scope.row.checkoutNumber }}</span>
  260. </template>
  261. </el-table-column>
  262. <el-table-column label="单价" sortable prop="price" min-width="90px" align="center">
  263. <template slot-scope="scope">
  264. <span>{{ scope.row.price }}</span><br>
  265. </template>
  266. </el-table-column>
  267. <el-table-column label="总价" sortable prop="sumPrice" min-width="90px" align="center">
  268. <template slot-scope="scope">
  269. <span>{{ scope.row.sumPrice }}</span><br>
  270. </template>
  271. </el-table-column>
  272. <el-table-column label="领用部门" align="center" min-width="90px">
  273. <template slot-scope="scope">
  274. <span>{{ scope.row.departmentName }}</span>
  275. </template>
  276. </el-table-column>
  277. <el-table-column label="领用人" align="center" min-width="90px">
  278. <template slot-scope="scope">
  279. <span>{{ scope.row.appliname }}</span>
  280. </template>
  281. </el-table-column>
  282. <el-table-column label="录入人" align="center" min-width="90px">
  283. <template slot-scope="scope">
  284. <span>{{ scope.row.empname }}</span>
  285. </template>
  286. </el-table-column>
  287. <el-table-column label="出库日期" sortable prop="creatTime" min-width="120px" align="center" />
  288. <el-table-column label="备注" min-width="130px" align="center">
  289. <template slot-scope="scope">
  290. <span>{{ scope.row.note }}</span><br>
  291. </template>
  292. </el-table-column>
  293. </el-table>
  294. <pagination v-show="total2>0" :total="total2" :page.sync="getdataListParm2.offset" :limit.sync="getdataListParm2.pagecount" @pagination="get_table_data2" />
  295. </el-tab-pane>
  296. </el-tabs>
  297. <!-- 弹出层新增or修改 -->
  298. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" v-if ="dialogFormVisible" :close-on-click-modal="false" width="90%">
  299. <div class="app-add">
  300. <el-form
  301. ref="createTemp"
  302. :rules="rules"
  303. :model="createTemp"
  304. label-position="right"
  305. label-width="100px"
  306. style="width: 90%;margin:0 auto;"
  307. >
  308. <el-row>
  309. <el-col :span="8">
  310. <el-form-item label="出库单号:" prop="useForm">
  311. <el-input ref="useForm" v-model="createTemp.useForm" disabled />
  312. </el-form-item>
  313. </el-col>
  314. <el-col :span="8">
  315. <el-form-item label="牧场:" prop="pastureId">
  316. <el-select v-model="createTemp.pastureId" placeholder="牧场" class="filter-item" style="width: 100%;" @change="changePasture">
  317. <el-option
  318. v-for="item in findAllPasture"
  319. :key="item.id"
  320. :label="item.name"
  321. :value="item.id"
  322. />
  323. </el-select>
  324. </el-form-item>
  325. </el-col>
  326. <el-col :span="8">
  327. <el-form-item label="录入人:" prop="empId">
  328. <el-select v-model="createTemp.empId" placeholder="录入人" class="filter-item" style="width: 100%;">
  329. <el-option
  330. v-for="item in findAllEmploye"
  331. :key="item.id"
  332. :label="item.name"
  333. :value="item.id"
  334. />
  335. </el-select>
  336. </el-form-item>
  337. </el-col>
  338. </el-row>
  339. <el-row>
  340. <el-col :span="8">
  341. <el-form-item label="出库方式:" prop="useType">
  342. <el-radio-group v-model="createTemp.useType" @change="changeStorageType">
  343. <el-radio v-if="isOutStockMethod1" v-model="createTemp.useType" :label="0" checked>领用出库</el-radio>
  344. <el-radio v-if="isOutStockMethod2" v-model="createTemp.useType" :label="1">手动出库</el-radio>
  345. <el-radio v-if="isOutStockMethod3" v-model="createTemp.useType" :label="2">调拨出库</el-radio>
  346. <el-radio v-if="isOutStockMethod4" v-model="createTemp.useType" :label="5">报废出库</el-radio>
  347. <el-radio v-if="isOutStockMethod5" v-model="createTemp.useType" :label="6">青贮出库</el-radio>
  348. </el-radio-group>
  349. </el-form-item>
  350. </el-col>
  351. <el-col v-if="No1" :span="8">
  352. <el-form-item label="领用单号:" prop="applyCode">
  353. <el-autocomplete
  354. v-model="orderPart.applyCode"
  355. value-key="name"
  356. class="inline-input"
  357. :fetch-suggestions="getNumber"
  358. placeholder="请输入领用单号"
  359. style="width:100%"
  360. @select="changeApplyCode"
  361. >
  362. <template slot-scope="{ item }">
  363. <div class="name" style="display: inline;">{{ item.applyCode }}</div>
  364. <div class="name" style="display: inline;">{{ item.departmentName }}</div>
  365. </template>
  366. </el-autocomplete>
  367. </el-form-item>
  368. </el-col>
  369. <el-col v-if="No1" :span="8">
  370. <el-form-item label="领用部门:" prop="departmentId">
  371. <el-select v-model="createTemp.departmentId" placeholder="领用部门" class="filter-item" style="width:100%" disabled @change="changeDepart">
  372. <el-option
  373. v-for="item in createDepartList"
  374. :key="item.id"
  375. :label="item.name"
  376. :value="item.id"
  377. />
  378. </el-select>
  379. </el-form-item>
  380. </el-col>
  381. <el-col v-if="No2" :span="8">
  382. <el-form-item label="领用部门:" prop="departmentId">
  383. <el-select v-model="createTemp.departmentId" placeholder="领用部门" class="filter-item" style="width:100%" @change="changeDepart">
  384. <el-option
  385. v-for="item in createDepartList"
  386. :key="item.id"
  387. :label="item.name"
  388. :value="item.id"
  389. />
  390. </el-select>
  391. </el-form-item>
  392. </el-col>
  393. <!-- <el-col v-if="No2 && createTemp.useType == 6" :span="8">
  394. <el-form-item label="青贮单号:" prop="greenFodderNumber">
  395. <el-input ref="greenFodderNumber" v-model="createTemp.greenFodderNumber" maxlength="20" />
  396. </el-form-item>
  397. </el-col> -->
  398. <el-col v-if="isReceiveTime2" :span="8">
  399. <el-form-item label="出库日期:" prop="receiveTime">
  400. <el-date-picker
  401. v-model="createTemp.receiveTime"
  402. :picker-options="pickerOptions2"
  403. type="date"
  404. placeholder="出库日期"
  405. format="yyyy-MM-dd"
  406. value-format="yyyy-MM-dd"
  407. style="width: 100%;"
  408. />
  409. </el-form-item>
  410. </el-col>
  411. <el-col v-if="isReceiveTime2" :span="8">
  412. <el-form-item label="备注:" prop="note">
  413. <el-input ref="note" v-model="createTemp.note" />
  414. </el-form-item>
  415. </el-col>
  416. </el-row>
  417. <el-row>
  418. <el-col v-if="No1" :span="8">
  419. <el-form-item label="领用人:" prop="applicatId">
  420. <el-select ref="applicatId" v-model="createTemp.applicatId" filterable placeholder="领用人" class="filter-item" style="width:100%" disabled>
  421. <el-option
  422. v-for="item in findAllEmploye"
  423. :key="item.id"
  424. :label="item.name"
  425. :value="item.id"
  426. />
  427. </el-select>
  428. </el-form-item>
  429. </el-col>
  430. <el-col v-if="No2" :span="8">
  431. <el-form-item label="领用人:" prop="applicatId">
  432. <el-select ref="applicatId" v-model="createTemp.applicatId" filterable placeholder="领用人" class="filter-item" style="width:100%">
  433. <el-option
  434. v-for="item in findAllEmploye"
  435. :key="item.id"
  436. :label="item.name"
  437. :value="item.id"
  438. />
  439. </el-select>
  440. </el-form-item>
  441. </el-col>
  442. <el-col v-if="isReceiveTime" :span="8">
  443. <el-form-item label="出库日期:" prop="receiveTime">
  444. <el-date-picker
  445. v-model="createTemp.receiveTime"
  446. :picker-options="pickerOptions1"
  447. type="date"
  448. placeholder="出库日期"
  449. format="yyyy-MM-dd"
  450. value-format="yyyy-MM-dd"
  451. style="width: 100%;"
  452. />
  453. </el-form-item>
  454. </el-col>
  455. <el-col v-if="isReceiveTime" :span="8">
  456. <el-form-item label="备注:" prop="note">
  457. <el-input ref="note" v-model="createTemp.note" />
  458. </el-form-item>
  459. </el-col>
  460. </el-row>
  461. <el-row v-if="No2">
  462. <el-col :span="10">
  463. <el-form-item label="备件:" prop="partCode">
  464. <el-autocomplete
  465. v-model="orderPart.partCode"
  466. value-key="name"
  467. class="inline-input"
  468. :fetch-suggestions="sparePartSearch"
  469. placeholder="请输入备件编号或备件名称或备件规格或供应商"
  470. style="width:500px"
  471. @select="handleSelectSparePart"
  472. >
  473. <template slot-scope="{ item }">
  474. <b>编号:</b><span class="name">{{ item.partCode }}</span>
  475. |<b>名称:</b><span class="addr">{{ item.partName }}</span>
  476. |<b>规格:</b><span class="addr">{{ item.specification }}</span><br>
  477. <b style="padding-left:3em;">品牌:</b><span class="addr">{{ item.brand }}</span>
  478. |<b>供应商:</b><span class="addr">{{ item.providerName }}</span>
  479. </template>
  480. </el-autocomplete>
  481. </el-form-item>
  482. </el-col>
  483. </el-row>
  484. <el-row v-if="No3">
  485. <el-col :span="10">
  486. <el-form-item label="调拨单号:" prop="applyCode">
  487. <el-autocomplete
  488. v-model="createTemp.applyCode"
  489. value-key="name"
  490. class="inline-input"
  491. :fetch-suggestions="allocationSearch"
  492. placeholder="请输入调拨单号"
  493. style="width:500px"
  494. @select="handleSelectAllocation"
  495. >
  496. <template slot-scope="{ item }">
  497. <b>调拨单号:</b><span class="name">{{ item.applyCode }}</span>
  498. |<b>调入牧场:</b><span class="addr">{{ item.inPastureName }}</span>
  499. </template>
  500. </el-autocomplete>
  501. </el-form-item>
  502. </el-col>
  503. </el-row>
  504. </el-form>
  505. <h5 style="float:right;">总金额:{{ TotalAmount }}</h5>
  506. <el-table
  507. :key="tableKey"
  508. v-loading="listLoading"
  509. element-loading-text="给我一点时间"
  510. :data="listAdd"
  511. border
  512. fit
  513. highlight-current-row
  514. style="width: 100%;margin-bottom:30px"
  515. :cell-style="tableCellStyle"
  516. class="elTable table-fixed"
  517. :row-style="rowStyle"
  518. >
  519. <!-- table表格 -->
  520. <el-table-column type="index" label="序号" align="center" width="50px" />
  521. <el-table-column :key="1" label="备件编号" min-width="90px" prop="partCode" align="center">
  522. <template slot-scope="scope">
  523. <span>{{ scope.row.partCode }}</span>
  524. </template>
  525. </el-table-column>
  526. <el-table-column :key="2" label="备件名称" min-width="60px" align="center">
  527. <template slot-scope="scope">
  528. <span>{{ scope.row.partName }}</span><br>
  529. </template>
  530. </el-table-column>
  531. <el-table-column :key="3" label="备件规格" prop="specification" align="center" min-width="90">
  532. <template slot-scope="scope">
  533. <span>{{ scope.row.specification }}</span>
  534. </template>
  535. </el-table-column>
  536. <el-table-column :key="4" label="备件图片" align="center" min-width="60">
  537. <template slot-scope="scope">
  538. <el-popover placement="right" title="" trigger="hover">
  539. <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
  540. <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  541. </el-popover>
  542. </template>
  543. </el-table-column>
  544. <el-table-column :key="5" label="备件品牌" prop="brand" align="center" min-width="60">
  545. <template slot-scope="scope">
  546. <span>{{ scope.row.brand }}</span>
  547. </template>
  548. </el-table-column>
  549. <el-table-column :key="6" label="供应商" prop="providerName" align="center" min-width="60">
  550. <template slot-scope="scope">
  551. <span>{{ scope.row.providerName }}</span>
  552. </template>
  553. </el-table-column>
  554. <el-table-column :key="7" label="计量单位" prop="unit" align="center" min-width="60">
  555. <template slot-scope="scope">
  556. <span>{{ scope.row.unit }}</span>
  557. </template>
  558. </el-table-column>
  559. <el-table-column v-if="allo" :key="19" label="调拨数量" prop="unit" align="center" min-width="60">
  560. <template slot-scope="scope">
  561. <span>{{ scope.row.amount }}</span>
  562. </template>
  563. </el-table-column>
  564. <el-table-column v-if="allo" :key="20" label="出库数量" prop="unit" align="center" min-width="60">
  565. <template slot-scope="scope">
  566. <span>{{ scope.row.amount }}</span>
  567. </template>
  568. </el-table-column>
  569. <el-table-column v-if="No1" :key="8" label="设备名称" prop="eqName" align="center" min-width="60">
  570. <template slot-scope="scope">
  571. <span>{{ scope.row.eqName }}</span>
  572. </template>
  573. </el-table-column>
  574. <el-table-column v-if="No2" :key="9" label="设备名称" prop="eqName" align="center" min-width="200">
  575. <template slot-scope="scope">
  576. <!-- @select="handleSelectEqName" -->
  577. <!-- @select="(value)={handleSelectEqName(value)}" -->
  578. <el-autocomplete
  579. ref="elautocomplete1"
  580. v-model="scope.row.eqName"
  581. :debounce="0"
  582. class="inline-input"
  583. :fetch-suggestions="querySearchEqName"
  584. value-key="eqName"
  585. placeholder="设备名称"
  586. @select="(value)=>
  587. {handleSelectEqName(value, scope.row)}"
  588. @blur="(value)=>
  589. {blurSelectEqName(value, scope.row)}"
  590. >
  591. <template slot-scope="{ item }">
  592. <span class="name">{{ item.eqName }}</span>
  593. <span class="addr" style="margin:0 0 0 5px">{{ item.eqCode }}</span>
  594. </template>
  595. </el-autocomplete>
  596. </template>
  597. </el-table-column>
  598. <el-table-column v-if="No1" :key="10" label="设备内部编号" prop="eqCode" align="center" min-width="60">
  599. <template slot-scope="scope">
  600. <span>{{ scope.row.eqCode }}</span>
  601. </template>
  602. </el-table-column>
  603. <el-table-column v-if="No2" :key="11" label="设备内部编号" prop="eqCode" align="center" min-width="150">
  604. <template slot-scope="scope">
  605. <el-autocomplete
  606. ref="elautocomplete2"
  607. v-model="scope.row.eqCode"
  608. :debounce="0"
  609. class="inline-input"
  610. :fetch-suggestions="querySearchCode"
  611. value-key="eqCode"
  612. placeholder="设备内部编号"
  613. @select="(value)=>
  614. {handleSelectEqCode(value, scope.row)}"
  615. @blur="(value)=>
  616. {blurSelectEqCode(value, scope.row)}"
  617. />
  618. </template>
  619. </el-table-column>
  620. <el-table-column v-if="No4" :key="12" label="费用类型" prop="useTypeV" align="center" min-width="110">
  621. <template slot-scope="scope">
  622. <el-select v-model="scope.row.useTypeV" filterable placeholder="费用类型">
  623. <el-option
  624. v-for="item in getDictByName"
  625. :key="item.id"
  626. :label="item.value"
  627. :value="item.value"
  628. />
  629. </el-select>
  630. </template>
  631. </el-table-column>
  632. <el-table-column v-if="No4" :key="13" label="库位" prop="location" align="center" min-width="80">
  633. <template slot-scope="scope">
  634. <span>{{ scope.row.location }}</span>
  635. </template>
  636. </el-table-column>
  637. <el-table-column v-if="No4" :key="14" label="库位库存数" prop="reportery" align="center" min-width="70">
  638. <template slot-scope="scope">
  639. <span>{{ scope.row.reportery }}</span>
  640. </template>
  641. </el-table-column>
  642. <el-table-column v-if="No1" :key="15" label="领用数量" min-width="90px" align="center">
  643. <template slot-scope="scope">
  644. <el-form :model="scope.row" :rules="rules">
  645. <el-form-item prop="amount">
  646. <el-input
  647. ref="amount"
  648. v-model="scope.row.amount"
  649. style="margin-top:15px"
  650. :disabled="disabled"
  651. @change="(value)=>
  652. {changeUseNumber(value, scope.row)}"
  653. />
  654. </el-form-item>
  655. </el-form>
  656. </template>
  657. </el-table-column>
  658. <el-table-column v-if="No4" :key="16" label="出库数量" min-width="110" align="center">
  659. <template slot-scope="scope">
  660. <el-form :model="scope.row" :rules="rules">
  661. <el-form-item prop="checkoutNumber">
  662. <el-input
  663. ref="checkoutNumber"
  664. v-model="scope.row.checkoutNumber"
  665. style="margin-top:15px"
  666. @change="(value)=> {changeCheckoutNumber(value, scope.row)}"
  667. @blur="(value)=> {blurCheckoutNumber(value, scope.row)}"
  668. />
  669. </el-form-item>
  670. </el-form>
  671. </template>
  672. </el-table-column>
  673. <el-table-column :key="17" label="单价" prop="price" align="center" min-width="60">
  674. <template slot-scope="scope">
  675. <span>{{ scope.row.price }}</span>
  676. </template>
  677. </el-table-column>
  678. <el-table-column v-if="No4" :key="18" label="总价" prop="totalPrice" align="center" min-width="70">
  679. <template slot-scope="scope">
  680. <span>{{ scope.row.price * parseFloat(scope.row.checkoutNumber) | keepTwoNum }}</span>
  681. </template>
  682. </el-table-column>
  683. <el-table-column v-if="allo" :key="21" label="总价" prop="totalPrice" align="center" min-width="70">
  684. <template slot-scope="scope">
  685. <span>{{ scope.row.sumPrice }}</span>
  686. </template>
  687. </el-table-column>
  688. <el-table-column v-if="allo" :key="22" label="费用类型" prop="useTypeV" align="center" min-width="110">
  689. <template slot-scope="scope">
  690. <el-select v-model="scope.row.useTypeV" filterable placeholder="费用类型" :disabled="createTemp.useType == 2">
  691. <el-option
  692. v-for="item in getDictByName"
  693. :key="item.id"
  694. :label="item.value"
  695. :value="item.value"
  696. />
  697. </el-select>
  698. </template>
  699. </el-table-column>
  700. <el-table-column :key="23" label="备注" prop="totalPrice" align="center" min-width="130">
  701. <template slot-scope="scope">
  702. <el-input v-model="scope.row.note" type="textarea" :autosize="{ minRows: 1.3, maxRows: 4}" style="width:80%;padding:10px 0;" maxlength="32" />
  703. </template>
  704. </el-table-column>
  705. <el-table-column v-if="No4" label="操作" align="center" width="60" class-name="small-padding fixed-width" fixed="right">
  706. <template slot-scope="{row}">
  707. <a class="del" @click="partDelete(row)">删除</a>
  708. </template>
  709. </el-table-column>
  710. </el-table>
  711. <el-form
  712. ref="temp"
  713. :rules="rules"
  714. :model="temp"
  715. label-position="right"
  716. label-width="100px"
  717. style="width: 800px; margin-left:50px;"
  718. />
  719. <div slot="footer" class="dialog-footer" style="bottom:10px">
  720. <el-button type="primary" :disabled="isokDisable" @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()">保存并关闭</el-button>
  721. <el-button @click="dialogFormVisible = false;get_table_data()">取消并关闭</el-button>
  722. </div>
  723. </div>
  724. </el-dialog>
  725. <!-- 查看-->
  726. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_See" :close-on-click-modal="false" width="90%">
  727. <div class="app-see">
  728. <el-form
  729. ref="seeTemp"
  730. :rules="rules"
  731. :model="seeTemp"
  732. label-position="right"
  733. label-width="100px"
  734. style="width: 90%;margin:0 auto"
  735. >
  736. <el-row>
  737. <el-col :span="8">
  738. <el-form-item label="出库单号:" prop="useForm">
  739. <el-input ref="useForm" v-model="seeTemp.useForm" disabled />
  740. </el-form-item>
  741. </el-col>
  742. <el-col :span="8">
  743. <el-form-item label="牧场:" prop="pastureName">
  744. <el-input ref="pastureName" v-model="seeTemp.pastureName" disabled />
  745. </el-form-item>
  746. </el-col>
  747. <el-col :span="8">
  748. <el-form-item label="录入人:" prop="empname">
  749. <el-input ref="empname" v-model="seeTemp.empname" disabled />
  750. </el-form-item>
  751. </el-col>
  752. </el-row>
  753. <el-row>
  754. <el-col :span="8">
  755. <el-form-item label="出库方式:" prop="useType">
  756. <el-radio-group v-if="seeTemp.useType == 0 ||seeTemp.useType == 1||seeTemp.useType == 4 " v-model="seeTemp.useType" disabled>
  757. <el-radio v-model="seeTemp.useType" :label="0" checked>领用出库</el-radio>
  758. <el-radio v-model="seeTemp.useType" :label="1">手动出库</el-radio>
  759. <el-radio v-model="seeTemp.useType" :label="4">调拨出库</el-radio>
  760. <el-radio v-model="seeTemp.useType" :label="5">报废出库</el-radio>
  761. <el-radio v-model="seeTemp.useType" :label="6">青贮出库</el-radio>
  762. </el-radio-group>
  763. <el-radio-group v-if="seeTemp.useType == 2" v-model="seeTemp.useType" disabled>
  764. <el-radio v-model="seeTemp.useType" :label="2" checked>领用出库</el-radio>
  765. <el-radio v-model="seeTemp.useType" :label="1">手动出库</el-radio>
  766. <el-radio v-model="seeTemp.useType" :label="4">调拨出库</el-radio>
  767. <el-radio v-model="seeTemp.useType" :label="5">报废出库</el-radio>
  768. <el-radio v-model="seeTemp.useType" :label="6">青贮出库</el-radio>
  769. </el-radio-group>
  770. <el-radio-group v-if="seeTemp.useType == 3" v-model="seeTemp.useType" disabled>
  771. <el-radio v-model="seeTemp.useType" :label="3" checked>领用出库</el-radio>
  772. <el-radio v-model="seeTemp.useType" :label="1">手动出库</el-radio>
  773. <el-radio v-model="seeTemp.useType" :label="4">调拨出库</el-radio>
  774. <el-radio v-model="seeTemp.useType" :label="5">报废出库</el-radio>
  775. <el-radio v-model="seeTemp.useType" :label="6">青贮出库</el-radio>
  776. </el-radio-group>
  777. <el-radio-group v-if="seeTemp.useType == 5" v-model="seeTemp.useType" disabled>
  778. <el-radio v-model="seeTemp.useType" :label="3">领用出库</el-radio>
  779. <el-radio v-model="seeTemp.useType" :label="1">手动出库</el-radio>
  780. <el-radio v-model="seeTemp.useType" :label="4">调拨出库</el-radio>
  781. <el-radio v-model="seeTemp.useType" :label="5" checked>报废出库</el-radio>
  782. <el-radio v-model="seeTemp.useType" :label="6">青贮出库</el-radio>
  783. </el-radio-group>
  784. <el-radio-group v-if="seeTemp.useType == 6" v-model="seeTemp.useType" disabled>
  785. <el-radio v-model="seeTemp.useType" :label="3">领用出库</el-radio>
  786. <el-radio v-model="seeTemp.useType" :label="1">手动出库</el-radio>
  787. <el-radio v-model="seeTemp.useType" :label="4">调拨出库</el-radio>
  788. <el-radio v-model="seeTemp.useType" :label="5">报废出库</el-radio>
  789. <el-radio v-model="seeTemp.useType" :label="6" checked>青贮出库</el-radio>
  790. </el-radio-group>
  791. </el-form-item>
  792. </el-col>
  793. <!-- <el-col :span="8" v-if="seeTemp.useType == 6">
  794. <el-form-item v-if="oddCodeAllo" label="青贮单号:" prop="greenFodderNumber">
  795. <el-input ref="oddCode" v-model="seeTemp.greenFodderNumber" disabled />
  796. </el-form-item>
  797. </el-col> -->
  798. <el-col :span="8">
  799. <el-form-item v-if="oddCodeAllo" label="领用单号:" prop="oddCode">
  800. <el-input ref="oddCode" v-model="seeTemp.oddCode" disabled />
  801. </el-form-item>
  802. </el-col>
  803. <el-col v-if="No5" :span="8">
  804. <el-form-item label="领用部门:" prop="departmentName">
  805. <el-input ref="departmentName" v-model="seeTemp.departmentName" disabled />
  806. </el-form-item>
  807. </el-col>
  808. <el-col v-if="isCreatTimeAllo" :span="8">
  809. <el-form-item label="出库日期:" prop="creatTime">
  810. <el-input ref="creatTime" v-model="seeTemp.creatTime" disabled />
  811. </el-form-item>
  812. </el-col>
  813. <el-col v-if="isCreatTimeAllo" :span="8">
  814. <el-form-item label="备注:" prop="note">
  815. <el-input ref="note" v-model="seeTemp.note" disabled />
  816. </el-form-item>
  817. </el-col>
  818. </el-row>
  819. <el-row v-if="No5">
  820. <el-col :span="8">
  821. <el-form-item label="领用人:" prop="appliname">
  822. <el-input ref="appliname" v-model="seeTemp.appliname" disabled />
  823. </el-form-item>
  824. </el-col>
  825. <el-col :span="8">
  826. <el-form-item label="出库日期:" prop="creatTime">
  827. <el-input ref="creatTime" v-model="seeTemp.creatTime" disabled />
  828. </el-form-item>
  829. </el-col>
  830. <el-col :span="8">
  831. <el-form-item label="备注:" prop="note">
  832. <el-input ref="note" v-model="seeTemp.note" disabled />
  833. </el-form-item>
  834. </el-col>
  835. </el-row>
  836. <el-row v-if="isTableAllo1">
  837. <el-col :span="12">
  838. <el-form-item label="调拨单号:" prop="oddCode">
  839. <el-input ref="oddCode" v-model="seeTemp.oddCode" disabled />
  840. </el-form-item>
  841. </el-col>
  842. </el-row>
  843. </el-form>
  844. <h5 style="float:right;">总金额:{{ TotalAmount }}</h5>
  845. <el-table
  846. :key="tableKey"
  847. v-loading="listLoading"
  848. element-loading-text="给我一点时间"
  849. :data="listSee"
  850. border
  851. fit
  852. highlight-current-row
  853. style="width: 100%;margin-bottom:30px"
  854. :row-style="rowStyle"
  855. :cell-style="cellStyle"
  856. class="elTable table-fixed"
  857. @sort-change="tableSort2"
  858. >
  859. <el-table-column type="index" label="序号" align="center" width="50px" />
  860. <el-table-column :key="1" label="备件编号" min-width="150px" prop="partCode" align="center">
  861. <template slot-scope="scope">
  862. <span>{{ scope.row.partCode }}</span>
  863. </template>
  864. </el-table-column>
  865. <el-table-column :key="2" label="备件名称" min-width="80px" align="center">
  866. <template slot-scope="scope">
  867. <span>{{ scope.row.partName }}</span><br>
  868. </template>
  869. </el-table-column>
  870. <el-table-column :key="3" label="备件规格" prop="specification" align="center" min-width="110">
  871. <template slot-scope="scope">
  872. <span>{{ scope.row.specification }}</span>
  873. </template>
  874. </el-table-column>
  875. <el-table-column :key="4" label="备件图片" prop="specifications" align="center" min-width="80">
  876. <template slot-scope="scope">
  877. <el-popover placement="right" title="" trigger="hover">
  878. <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
  879. <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  880. </el-popover>
  881. </template>
  882. </el-table-column>
  883. <el-table-column :key="5" label="备件品牌" prop="brandName" align="center" min-width="110">
  884. <template slot-scope="scope">
  885. <span>{{ scope.row.brandName }}</span>
  886. </template>
  887. </el-table-column>
  888. <el-table-column :key="6" label="供应商" prop="providerName" align="center" min-width="100">
  889. <template slot-scope="scope">
  890. <span>{{ scope.row.providerName }}</span>
  891. </template>
  892. </el-table-column>
  893. <el-table-column :key="7" label="计量单位" prop="unit" align="center" min-width="80">
  894. <template slot-scope="scope">
  895. <span>{{ scope.row.unit }}</span>
  896. </template>
  897. </el-table-column>
  898. <el-table-column v-if="isTableAllo" :key="8" label="设备名称" prop="eqName" align="center" min-width="110">
  899. <template slot-scope="scope">
  900. <span>{{ scope.row.eqName }}</span>
  901. </template>
  902. </el-table-column>
  903. <el-table-column v-if="isTableAllo" :key="9" label="设备内部编号" prop="eqCode" align="center" min-width="110">
  904. <template slot-scope="scope">
  905. <span>{{ scope.row.eqCode }}</span>
  906. </template>
  907. </el-table-column>
  908. <el-table-column v-if="isTableAllo" :key="10" label="费用类型" prop="useTypeV" align="center" min-width="110">
  909. <template slot-scope="scope">
  910. <span>{{ scope.row.useTypeV }}</span>
  911. </template>
  912. </el-table-column>
  913. <el-table-column v-if="isTableAllo" :key="11" label="库位" prop="warehoseCode" align="center" min-width="110">
  914. <template slot-scope="scope">
  915. <span>{{ scope.row.warehoseCode }}</span>
  916. </template>
  917. </el-table-column>
  918. <el-table-column v-if="isTableAllo" :key="12" label="库位库存数" sortable prop="reportery" align="center" min-width="110">
  919. <template slot-scope="scope">
  920. <span>{{ scope.row.reportery }}</span>
  921. </template>
  922. </el-table-column>
  923. <el-table-column v-if="No1" :key="13" sortable prop="useNumber" label="领用数量" min-width="80" align="center">
  924. <template slot-scope="scope">
  925. <span>{{ scope.row.useNumber }}</span>
  926. </template>
  927. </el-table-column>
  928. <el-table-column v-if="isTableAllo1" :key="14" sortable prop="checkoutNumber" label="调拨数量" min-width="80" align="center">
  929. <template slot-scope="scope">
  930. <span>{{ scope.row.checkoutNumber }}</span>
  931. </template>
  932. </el-table-column>
  933. <el-table-column :key="15" label="出库数量" sortable prop="checkoutNumber" min-width="80" align="center">
  934. <template slot-scope="scope">
  935. <span>{{ scope.row.checkoutNumber }}</span>
  936. </template>
  937. </el-table-column>
  938. <el-table-column :key="16" label="单价" sortable prop="price" align="center" min-width="60">
  939. <template slot-scope="scope">
  940. <span>{{ scope.row.price }}</span>
  941. </template>
  942. </el-table-column>
  943. <el-table-column :key="17" label="总价" sortable prop="sumPrice" align="center" min-width="60">
  944. <template slot-scope="scope">
  945. <span>{{ scope.row.sumPrice }}</span>
  946. </template>
  947. </el-table-column>
  948. <el-table-column v-if="isTableAllo1" :key="18" label="费用类型" prop="sumPrice" align="center" min-width="80">
  949. <template slot-scope="scope">
  950. <span>{{ scope.row.useTypeV }}</span>
  951. </template>
  952. </el-table-column>
  953. <el-table-column :key="19" label="备注" prop="sumPrice" align="center" min-width="80">
  954. <template slot-scope="scope">
  955. <span>{{ scope.row.note }}</span>
  956. </template>
  957. </el-table-column>
  958. <el-table-column prop="dflag" label="冲销状态" min-width="80px" align="center">
  959. <template slot-scope="scope">
  960. <span v-if="scope.row.dflag == 1">已冲销</span>
  961. <span v-else>未冲销</span>
  962. </template>
  963. </el-table-column>
  964. </el-table>
  965. <!-- <pagination
  966. v-show="totalSee>0"
  967. :total="totalSee"
  968. :page.sync="getdataListSee.offset"
  969. :limit.sync="getdataListSee.pagecount"
  970. @pagination="getSeeList"
  971. /> -->
  972. <div slot="footer" class="dialog-footer" style="margin-bottom:-25px;">
  973. <el-button @click="dialogFormVisible_See = false">关闭</el-button>
  974. </div>
  975. </div>
  976. </el-dialog>
  977. <!-- EAS同步 -->
  978. <el-dialog :title="textMap[easStatus.dialogStatus]" :visible.sync="easStatus.dialogFormVisible" :close-on-click-modal="false" width="80%">
  979. <div class="easStatus">
  980. <el-table
  981. :key="easStatus.tableKey"
  982. v-loading="easStatus.listLoading"
  983. element-loading-text="给我一点时间"
  984. :data="easStatus.list"
  985. border
  986. fit
  987. highlight-current-row
  988. style="width: 100%;"
  989. :row-style="rowStyle"
  990. :cell-style="cellStyle"
  991. class="elTable table-fixed"
  992. >
  993. <el-table-column label="序号" align="center" type="index" width="50px">
  994. <template slot-scope="scope">
  995. <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
  996. </template>
  997. </el-table-column>
  998. <el-table-column label="出库单号" min-width="110px" align="center" prop="useForm" />
  999. <el-table-column label="领用部门" min-width="110px" align="center" prop="departmentName" />
  1000. <el-table-column label="牧场" min-width="110px" align="center" prop="pastureName" />
  1001. <el-table-column label="录入人" min-width="110px" align="center" prop="empName" />
  1002. <el-table-column label="出库日期" min-width="110px" align="center" prop="createTime" />
  1003. <el-table-column label="失败原因" min-width="110px" align="center" prop="failReason" />
  1004. <el-table-column label="操作" align="center" width="300px" class-name="small-padding fixed-width" fixed="right">
  1005. <template slot-scope="{row}">
  1006. <el-button v-if="isManualSynchronization" type="primary" size="mini" style="width:70px;" @click="handleManual(row)">手动同步</el-button>
  1007. <el-button v-if="isCloseSynchronization" type="danger" size="mini" style="width:70px;" @click="handleClose(row)">关闭同步</el-button>
  1008. <el-button v-if="isIgnoreSynchronization" type="danger" size="mini" style="width:70px;" @click="handleIgnore(row)">忽略同步</el-button>
  1009. </template>
  1010. </el-table-column>
  1011. </el-table>
  1012. <pagination v-show="easStatus.total>0" :total="easStatus.total" :page.sync="easStatus.getdataListParm.offset" :limit.sync="easStatus.getdataListParm.pagecount" @pagination="get_table_dataEasStatusLst" />
  1013. </div>
  1014. <div slot="footer" class="dialog-footer" style="bottom: 10px;">
  1015. <el-button @click="easStatus.dialogFormVisible = false;get_table_data()">关闭</el-button>
  1016. </div>
  1017. </el-dialog>
  1018. <el-dialog :title="textMap[description.dialogStatus]" :destroy-on-close="true" :visible.sync="description.dialogFormVisible" :close-on-click-modal="false" width="70%">
  1019. <b style="line-height: 28px;">常见问题1:出库保存报错</b>
  1020. <br>
  1021. <div class="app-description dialogMinHeight">
  1022. <div class="content">
  1023. 报错原因1: 请求超时
  1024. <br>
  1025. 报错原因2:牧场在SAP已出库
  1026. <br>
  1027. 解决方案:请在SAP冲销相应的未同步的出库。
  1028. <br>
  1029. </div>
  1030. </div>
  1031. <div slot="footer" class="dialog-footer">
  1032. <el-button class="cancelClose" @click="description.dialogFormVisible = false; ">关闭</el-button>
  1033. </div>
  1034. </el-dialog>
  1035. </div>
  1036. </template>
  1037. <script>
  1038. // 引入
  1039. import { GetDataByName, GetDataByNames, ExecDataByConfig, checkButtons, GetAccount, transData, PostDataByName, EasSync,SapUse } from '@/api/common'
  1040. import waves from '@/directive/waves' // waves directive
  1041. import { parseTime, sortChange } from '@/utils/index.js'
  1042. // eslint-disable-next-line no-unused-vars
  1043. import { validateEMail } from '@/utils/validate.js'
  1044. import Pagination from '@/components/Pagination' // secondary package based on el-pagination
  1045. import { MessageBox } from 'element-ui'
  1046. import Cookies from 'js-cookie'
  1047. import { getToken } from '@/utils/auth'
  1048. import TreeSelect from '@/components/TreeSelect'
  1049. export default {
  1050. name: 'OutStock',
  1051. components: { Pagination, TreeSelect },
  1052. directives: { waves },
  1053. filters: {
  1054. keepTwoNum(value) {
  1055. value = Number(value)
  1056. return value.toFixed(2)
  1057. }
  1058. },
  1059. data() {
  1060. return {
  1061. myHeight:document.documentElement.clientHeight - 85- 250,
  1062. isSap:1,
  1063. isSrm:1,
  1064. selectList: [],
  1065. currentRow:{},
  1066. totalImportInfo: 0,
  1067. listLoadingImportInfo: true,
  1068. listImportInfo: [],
  1069. isOutsap: [],
  1070. // isReceiveImport: [],
  1071. // isRetreatMuban: [],
  1072. // isStorageAdd: [],
  1073. // isStorageExport: [],
  1074. // isStorageSee: [],
  1075. tableKey: 0,
  1076. useTypes: [{ id: '0', name: '领用出库' }, { id: '1', name: '手动出库' }, { id: '4', name: '调拨出库' }, { id: '5', name: '报废出库' }],
  1077. // list2: [
  1078. // {
  1079. // 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'
  1080. // }
  1081. // ],
  1082. // 1-2:table&搜索传参
  1083. getdataListParmImportInfo: {
  1084. name: 'getImportStockLaidList',
  1085. page: 1,
  1086. offset: 1,
  1087. pagecount: 10,
  1088. returntype: 'Map',
  1089. parammaps: {
  1090. pastureName: '',
  1091. deptName: '',
  1092. useForm: '',
  1093. stockNumber: '',
  1094. stockName: '',
  1095. receiveTime: '',
  1096. providerName: '',
  1097. storageName: '',
  1098. storageTime: ''
  1099. }
  1100. },
  1101. getParmCreateNumber: {
  1102. name: 'autoCreatCode',
  1103. page: 0,
  1104. offset: 0,
  1105. pagecount: 0,
  1106. returntype: 'Map',
  1107. parammaps: {
  1108. pastureId: Cookies.get('pastureid'),
  1109. codeType: 'CK'
  1110. }
  1111. },
  1112. // 2-3:下拉框请求后数据加入[]
  1113. temp: { },
  1114. storage: {
  1115. inputDatetime: parseTime(new Date(), '{y}-{m}-{d}'),
  1116. typeName: '',
  1117. assTypeId: '',
  1118. employeId: this.$store.state.user.employeid,
  1119. departmentId: this.$store.state.user.departmentid,
  1120. pastureId: this.$store.state.user.pastureid,
  1121. laidNumber: ''
  1122. },
  1123. dialogPvVisible: false,
  1124. // 校验规则
  1125. // -----------------------------------------
  1126. isOutStockAdd: [], isReceiveTemplate: [], isOutStockImport: [], isOutStockExport: [], isOutStockSee: [], isOutStockDelete: [], isOutStockMethod1: [], isOutStockMethod2: [], isOutStockMethod3: [],isOutStockMethod4:[],isOutStockMethod5:[],
  1127. isEasSynchronization: [], isManualSynchronization: [], isCloseSynchronization: [], isIgnoreSynchronization: [],
  1128. rules: {},
  1129. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  1130. cellStyle: { padding: 0 + 'px' },
  1131. findAllProvider: [],
  1132. findAllAssetType: [],
  1133. findAllPasture: [],
  1134. findAllDepart: [],
  1135. findAllEmploye: [],
  1136. getDictByName: [], createDepartList: [], edit: 0,
  1137. // 2-1.请求下拉框接口
  1138. requestParams: [
  1139. { name: 'findAllProvider', offset: 0, pagecount: 0, params: [] },
  1140. { name: 'findAllAssetType', offset: 0, pagecount: 0, params: [] },
  1141. { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
  1142. { name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
  1143. { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
  1144. { name: 'getDictByName', offset: 0, pagecount: 0, params: ['耗用类别-父'] }
  1145. ],
  1146. getDepartParam: {
  1147. name: 'findAllDepart', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }
  1148. },
  1149. pickerOptions1: {
  1150. disabledDate(time) {
  1151. return time.getTime() > Date.now()// 当天之前的时间可选
  1152. }
  1153. },
  1154. pickerOptions2: {
  1155. disabledDate(time) {
  1156. return time.getTime() > Date.now()// 当天之前的时间可选
  1157. }
  1158. },
  1159. No1: true,
  1160. No2: false,
  1161. No3: false,
  1162. No4: true,
  1163. isReceiveTime: true,
  1164. isReceiveTime2: false,
  1165. allo: false,
  1166. disabled: true,
  1167. isokDisable: false,
  1168. total: 0,
  1169. listLoading: true,
  1170. dialogFormVisible: false,
  1171. dialogFormVisible_See: false,
  1172. dialogStatus: '',
  1173. textMap: {
  1174. see: '查看详情',
  1175. update: '编辑',
  1176. create: '新增',
  1177. easStatus: 'EAS同步—同步失败数据',
  1178. description: '常见问题说明'
  1179. },
  1180. getdataListParm: {
  1181. name: 'getBigPartuseList',
  1182. page: 1,
  1183. offset: 1,
  1184. pagecount: 10,
  1185. returntype: 'Map',
  1186. parammaps: {
  1187. pastureName: Cookies.get('pasturename'),
  1188. departmentId: '',
  1189. inputDatetime: '',
  1190. useForm: '',
  1191. useType: '',
  1192. easStatus: '',
  1193. sapStatus:''
  1194. }
  1195. },
  1196. list: [],
  1197. activeName: 'first',
  1198. tableKey2: 0,
  1199. listLoading2: true,
  1200. total2: 0,
  1201. list2: [],
  1202. getdataListParm2: {
  1203. name: 'getPartuseDetailList',
  1204. page: 1,
  1205. offset: 1,
  1206. pagecount: 10,
  1207. returntype: 'Map',
  1208. parammaps: {
  1209. inputDatetime: '',
  1210. useForm: '',
  1211. startTime: '',
  1212. stopTime: '',
  1213. departmentId: '',
  1214. partCode: '',
  1215. partName: '',
  1216. providerId: '',
  1217. pastureName: Cookies.get('pasturename'),
  1218. assetCode: '',
  1219. eqName: ''
  1220. }
  1221. },
  1222. requestParam: {
  1223. name: 'downloadPartuseList',
  1224. parammaps: {
  1225. pastureName: Cookies.get('pasturename'),
  1226. inputDatetime: ''
  1227. }
  1228. },
  1229. downList: [],
  1230. oddCodeAllo: true,
  1231. No5: true,
  1232. isCreatTimeAllo: false,
  1233. isTableAllo: true,
  1234. isTableAllo1: false,
  1235. seeTemp: {},
  1236. listSee: [],
  1237. totalSee: 0,
  1238. getdataListSee: {
  1239. name: 'getpartUseListBybig',
  1240. returntype: 'Map',
  1241. parammaps: {}
  1242. },
  1243. createTemp: {
  1244. useType: 0,
  1245. empId: Cookies.get('employeid'),
  1246. pastureId: Cookies.get('pastureid'),
  1247. receiveTime: parseTime(new Date(), '{y}-{m}-{d}'),
  1248. applicatId: Cookies.get('employeid'),
  1249. departmentId: Cookies.get('departmentid'),
  1250. greenFodderNumber:'',
  1251. note:''
  1252. },
  1253. requestSparePart: {
  1254. name: 'getPartsListCK',
  1255. page: 1,
  1256. offset: 1,
  1257. pagecount: 20,
  1258. returntype: 'Map',
  1259. parammaps: {
  1260. pastureId: Cookies.get('pastureid')
  1261. }
  1262. },
  1263. requestAllocation: {
  1264. name: 'getTransferCodeCK',
  1265. page: 1,
  1266. offset: 1,
  1267. pagecount: 20,
  1268. returntype: 'Map',
  1269. parammaps: {
  1270. applyCode: '',
  1271. pastureId: this.$store.state.user.pastureid
  1272. }
  1273. },
  1274. getAllocationListParm: {
  1275. name: 'getPartTransferbybigid',
  1276. returntype: 'Map',
  1277. parammaps: {}
  1278. },
  1279. orderPart: {},
  1280. listAdd: [],
  1281. EqNameList: [],
  1282. requestEqName: {
  1283. name: 'geteqbyNameCode',
  1284. page: 1,
  1285. offset: 1,
  1286. pagecount: 10,
  1287. returntype: 'Map',
  1288. parammaps: {
  1289. pastureId: Cookies.get('pastureid')
  1290. }
  1291. },
  1292. EqCodeList: [],
  1293. requestUseForm: {
  1294. name: 'getApplyCode',
  1295. returntype: 'Map',
  1296. parammaps: {
  1297. pastureId: Cookies.get('pastureid')
  1298. }
  1299. },
  1300. useForms: [],
  1301. getParmCreateAdd: {
  1302. name: 'getPartApplyByBig',
  1303. returntype: 'Map',
  1304. parammaps: {}
  1305. },
  1306. postDataPramas: {},
  1307. selectedArr: [],
  1308. buttons: [],
  1309. TotalAmount: 0,
  1310. isPercentage: false,
  1311. percentage: 1,
  1312. parentType: [],
  1313. placeholder: '设备类别',
  1314. disabled2: false,
  1315. getParmType: {
  1316. name: 'geteqclasslist'
  1317. },
  1318. defaultProps: {
  1319. children: 'children',
  1320. label: 'typeName'
  1321. },
  1322. nodeKey: 'id',
  1323. defaultCheckedKeys: [],
  1324. // EAS同步
  1325. easStatus: {
  1326. easStatusList: [{ name: '同步成功', id: '1' }, { name: '同步失败', id: '0' }, { name: '关闭同步', id: '2' }],
  1327. sapStatusList: [ { name: '所有', id: '0' }, { name: '已上传', id: '1' }, { name: '未上传', id: '2' }],
  1328. dialogStatus: '',
  1329. dialogFormVisible: false,
  1330. tableKey: 0,
  1331. total: 0,
  1332. listLoading: true,
  1333. list: [],
  1334. getdataListParm: {
  1335. name: 'getbigpartuseSync',
  1336. page: 1,
  1337. offset: 1,
  1338. pagecount: 10,
  1339. returntype: 'Map',
  1340. parammaps: {
  1341. pastureid: Cookies.get('pastureid')
  1342. }
  1343. }
  1344. },
  1345. description: {
  1346. dialogFormVisible: false,
  1347. dialogStatus: ''
  1348. },
  1349. }
  1350. },
  1351. computed: {
  1352. // 设置请求头
  1353. headers() {
  1354. return {
  1355. // 设置token
  1356. // eslint-disable-next-line no-undef
  1357. token: getToken()
  1358. }
  1359. },
  1360. uploadData() {
  1361. return {
  1362. name: 'importStockUse',
  1363. importParams: '牧场,领用单编号,领用日期,物料编码,品名,规格型号,品牌,计量单位,实发数量,单价,总价,库位,供应商,名称,牧场设备编号,具体用处,领用类型,领用部门,领用人,SignColumn',
  1364. sheetname: 'SheetJS'
  1365. }
  1366. },
  1367. uploadData2() {
  1368. return {
  1369. name: 'importStockUseHistory',
  1370. importParams: '牧场,领用单编号,领用日期,物料编码,品名,规格型号,品牌,计量单位,实发数量,单价,总价,库位,供应商,名称,牧场设备编号,具体用处,领用类型,领用部门,领用人,SignColumn',
  1371. sheetname: 'SheetJS'
  1372. }
  1373. },
  1374. // 设置上传地址
  1375. uploadExcelUrl() {
  1376. // process.env.VUE_APP_BASE_API是服务器的路径,也是axios的基本路径
  1377. return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
  1378. }
  1379. },
  1380. watch: {
  1381. listAdd: {
  1382. deep: true,
  1383. handler: function (item) {
  1384. this.listAdd.forEach(function(i){
  1385. if(parseInt(i.checkoutNumber) > parseInt(i.amount)){
  1386. i.checkoutNumber = i.amount
  1387. }
  1388. if(parseInt(i.checkoutNumber) > parseInt(i.reportery)){
  1389. i.checkoutNumber = i.reportery
  1390. }
  1391. })
  1392. }
  1393. },
  1394. },
  1395. created() {
  1396. const that = this
  1397. GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
  1398. that.buttons = response.data.list
  1399. that.get_auto_buttons()
  1400. })
  1401. this.get_select_list()
  1402. this.get_table_data()
  1403. this.getTypeList()
  1404. },
  1405. methods: {
  1406. tableSort(column) {
  1407. if (this.activeName == 'first') {
  1408. sortChange(column, this.list)
  1409. } else if (this.activeName == 'second') {
  1410. sortChange(column, this.list2)
  1411. }
  1412. },
  1413. tableSort2(column) {
  1414. sortChange(column, this.listSee)
  1415. },
  1416. handleCurrentChange(val) {
  1417. this.currentRow = val;
  1418. console.log("currentRow",this.currentRow)
  1419. },
  1420. checkboxInit(row,index){
  1421. // console.log(row)
  1422. if(row.ProofCode){
  1423. return 0
  1424. } else {
  1425. var data1 = new Date(row.creatTime)
  1426. var data2 = new Date('2022-10-25')
  1427. if(data1 > data2){ return 1 } else {return 0}
  1428. }
  1429. },
  1430. //监听 - 表格 - 勾选
  1431. change_table_selection(val) {
  1432. this.selectList = val
  1433. console.log('勾选数据selectList', this.selectList)
  1434. },
  1435. sapUpload(){
  1436. const that = this
  1437. console.log("currentRow ProofCode",this.currentRow.ProofCode)
  1438. var send_data = this.selectList
  1439. if(send_data.length == 0){
  1440. that.$notify({ title: '失败', message: '请勾选数据!' , type: 'error', duration: 2000 })
  1441. return false
  1442. }
  1443. console.log(that.isSap)
  1444. if(that.isSap == 1){
  1445. that.isSap = 0
  1446. SapUse(send_data).then(response => {
  1447. console.log('response', response)
  1448. if (response.msg !== 'fail') {
  1449. that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
  1450. that.selectList = []
  1451. that.get_table_data()
  1452. } else {
  1453. that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
  1454. }
  1455. })
  1456. } else {
  1457. that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击' , type: 'error', duration: 2000 })
  1458. }
  1459. setTimeout(() => {
  1460. that.isSap = 1
  1461. }, 3000)
  1462. // if(this.currentRow.ProofCode){
  1463. // console.log("currentRow ProofCode 这个值说明已经上传了,不用上传")
  1464. // //如果有这个值说明已经上传了,不用上传
  1465. // } else {
  1466. // console.log("currentRow ProofCode没有这个值")
  1467. // console.log("currentRow ProofCode",this.currentRow.ProofCode)
  1468. // const useForm = this.currentRow.useForm
  1469. // const creatTime = this.currentRow.creatTime
  1470. // console.log("useForm",useForm)
  1471. // var send_data = {
  1472. // "useForm":useForm,
  1473. // "receiveTime":creatTime,
  1474. // "pastureid":Cookies.get('pastureid')
  1475. // }
  1476. // SapUse(send_data).then(response => {
  1477. // console.log('response', response)
  1478. // if (response.msg !== 'fail') {
  1479. // that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
  1480. // that.get_table_data()
  1481. // } else {
  1482. // that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
  1483. // }
  1484. // })
  1485. // }
  1486. },
  1487. get_auto_buttons() {
  1488. const Outsap = 'customs:outStock:sap'
  1489. const isOutsap = checkButtons(this.$store.state.user.buttons, OutStockAdd)
  1490. this.isOutsap = isOutsap
  1491. const OutStockAdd = 'customs:outStock:add'
  1492. const isOutStockAdd = checkButtons(this.$store.state.user.buttons, OutStockAdd)
  1493. this.isOutStockAdd = isOutStockAdd
  1494. const ReceiveTemplate = 'customs:outStock:template'
  1495. const isReceiveTemplate = checkButtons(this.$store.state.user.buttons, ReceiveTemplate)
  1496. this.isReceiveTemplate = isReceiveTemplate
  1497. const OutStockImport = 'customs:outStock:import'
  1498. const isOutStockImport = checkButtons(this.$store.state.user.buttons, OutStockImport)
  1499. this.isOutStockImport = isOutStockImport
  1500. const OutStockExport = 'customs:outStock:export'
  1501. const isOutStockExport = checkButtons(this.$store.state.user.buttons, OutStockExport)
  1502. this.isOutStockExport = isOutStockExport
  1503. const OutStockSee = 'customs:outStock:see'
  1504. const isOutStockSee = checkButtons(this.$store.state.user.buttons, OutStockSee)
  1505. this.isOutStockSee = isOutStockSee
  1506. const OutStockDelete = 'customs:outStock:delete'
  1507. const isOutStockDelete = checkButtons(this.$store.state.user.buttons, OutStockDelete)
  1508. this.isOutStockDelete = isOutStockDelete
  1509. const OutStockMethod1 = 'customs:outStock:method1'
  1510. const isOutStockMethod1 = checkButtons(this.$store.state.user.buttons, OutStockMethod1)
  1511. this.isOutStockMethod1 = isOutStockMethod1
  1512. const OutStockMethod2 = 'customs:outStock:method2'
  1513. const isOutStockMethod2 = checkButtons(this.$store.state.user.buttons, OutStockMethod2)
  1514. this.isOutStockMethod2 = isOutStockMethod2
  1515. const OutStockMethod3 = 'customs:outStock:method3'
  1516. const isOutStockMethod3 = checkButtons(this.$store.state.user.buttons, OutStockMethod3)
  1517. this.isOutStockMethod3 = isOutStockMethod3
  1518. const OutStockMethod4 = 'customs:outStock:method4'
  1519. const isOutStockMethod4 = checkButtons(this.$store.state.user.buttons, OutStockMethod4)
  1520. this.isOutStockMethod4 = isOutStockMethod4
  1521. const OutStockMethod5 = 'customs:outStock:method5'
  1522. const isOutStockMethod5 = checkButtons(this.$store.state.user.buttons, OutStockMethod5)
  1523. this.isOutStockMethod5 = isOutStockMethod5
  1524. const EasSynchronization = 'customs:outStock:easSynchronization'
  1525. const isEasSynchronization = checkButtons(this.$store.state.user.buttons, EasSynchronization)
  1526. this.isEasSynchronization = isEasSynchronization
  1527. const ManualSynchronization = 'customs:outStock:manualSynchronization'
  1528. const isManualSynchronization = checkButtons(this.$store.state.user.buttons, ManualSynchronization)
  1529. this.isManualSynchronization = isManualSynchronization
  1530. const CloseSynchronization = 'customs:outStock:closeSynchronization'
  1531. const isCloseSynchronization = checkButtons(this.$store.state.user.buttons, CloseSynchronization)
  1532. this.isCloseSynchronization = isCloseSynchronization
  1533. const IgnoreSynchronization = 'customs:outStock:ignoreSynchronization'
  1534. const isIgnoreSynchronization = checkButtons(this.$store.state.user.buttons, IgnoreSynchronization)
  1535. this.isIgnoreSynchronization = isIgnoreSynchronization
  1536. },
  1537. popoverHide(checkedIds, checkedData) {
  1538. console.log('选中值', checkedIds, checkedData)
  1539. // this.dataform.eqClassId = checkedIds
  1540. // this.dataform.typeCode = checkedData.typeCode
  1541. this.getdataListParm2.parammaps.assetCode = checkedData.typeCode
  1542. },
  1543. getTypeList() {
  1544. GetDataByName(this.getParmType).then(response => {
  1545. if (response.data.list !== null) {
  1546. this.parentType = transData(response.data.list, 'id', 'pid', 'children')
  1547. }
  1548. })
  1549. },
  1550. querySearch(queryString, cb) {
  1551. var restaurants = this.restaurants
  1552. var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
  1553. // 调用 callback 返回建议列表的数据
  1554. cb(results)
  1555. },
  1556. createFilter(queryString) {
  1557. return (restaurant) => {
  1558. return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0)
  1559. }
  1560. },
  1561. handleSelect(item) {
  1562. console.log(item)
  1563. },
  1564. // ---------------------------------------------
  1565. get_select_list() {
  1566. GetDataByNames(this.requestParams).then(response => {
  1567. this.findAllProvider = response.data.findAllProvider.list
  1568. this.findAllAssetType = response.data.findAllAssetType.list
  1569. this.findAllPasture = response.data.findAllPasture.list
  1570. this.findAllEmploye = response.data.findAllEmploye.list
  1571. this.getDictByName = response.data.getDictByName.list
  1572. this.getDepartDownList()
  1573. })
  1574. },
  1575. getDepartDownList() {
  1576. GetDataByName(this.getDepartParam).then(response => {
  1577. this.findAllDepart = response.data.list
  1578. })
  1579. },
  1580. changePastureName(item) {
  1581. this.getDepartParam.parammaps.pastureId = this.findAllPasture.find(obj => obj.name == item).id
  1582. this.getdataListParm.parammaps.departmentId = ''
  1583. this.getDepartDownList()
  1584. },
  1585. getCreateDepartDownList() {
  1586. GetDataByName(this.getDepartParam).then(response => {
  1587. this.createDepartList = response.data.list
  1588. if (this.edit == 1) {
  1589. if (this.createDepartList.find(obj => obj.id == Cookies.get('departmentid'))) {
  1590. this.createTemp.departmentId = parseInt(Cookies.get('departmentid'))
  1591. this.createTemp.departmentName = this.createDepartList.find(obj => obj.id == Cookies.get('departmentid')).name
  1592. } else {
  1593. this.createTemp.departmentId = response.data.list[0].id
  1594. this.createTemp.departmentName = response.data.list[0].name
  1595. }
  1596. console.log(this.createTemp.departmentName, 'this.createTemp.departmentName')
  1597. }
  1598. })
  1599. },
  1600. changePasture(item) {
  1601. this.getDepartParam.parammaps.pastureId = item
  1602. this.edit = 1
  1603. this.getCreateDepartDownList()
  1604. },
  1605. changeDepart(item) {
  1606. this.createTemp.departmentName = this.createDepartList.find(obj => obj.id == item).name
  1607. },
  1608. get_table_data() {
  1609. this.listLoading = true
  1610. console.log(this.$refs['inputDatetime'])
  1611. if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
  1612. this.getdataListParm.parammaps.startTime = this.$refs['inputDatetime'].value[0]
  1613. this.getdataListParm.parammaps.stopTime = this.$refs['inputDatetime'].value[1]
  1614. } else {
  1615. this.getdataListParm.parammaps.startTime = ''
  1616. this.getdataListParm.parammaps.stopTime = ''
  1617. }
  1618. GetDataByName(this.getdataListParm).then(response => {
  1619. console.log('table数据', response.data.list)
  1620. this.list = response.data.list
  1621. this.pageNum = response.data.pageNum
  1622. this.pageSize = response.data.pageSize
  1623. if (response.data.total) {
  1624. this.total = response.data.total
  1625. }
  1626. // Just to simulate the time of the request
  1627. setTimeout(() => {
  1628. this.listLoading = false
  1629. }, 100)
  1630. })
  1631. },
  1632. handleClick(tab, event) {
  1633. console.log(tab, event)
  1634. if (tab.name === 'second') {
  1635. this.get_table_data2()
  1636. } else {
  1637. this.get_table_data()
  1638. }
  1639. },
  1640. get_table_data2() {
  1641. this.listLoading2 = true
  1642. if (this.$refs['inputDatetime2'] !== undefined && this.$refs['inputDatetime2'].value !== null) {
  1643. this.getdataListParm2.parammaps.startTime = this.$refs['inputDatetime2'].value[0]
  1644. this.getdataListParm2.parammaps.stopTime = this.$refs['inputDatetime2'].value[1]
  1645. } else {
  1646. this.getdataListParm2.parammaps.startTime = ''
  1647. this.getdataListParm2.parammaps.stopTime = ''
  1648. }
  1649. GetDataByName(this.getdataListParm2).then(response => {
  1650. this.list2 = response.data.list
  1651. this.pageNum2 = response.data.pageNum
  1652. this.pageSize2 = response.data.pageSize
  1653. if (response.data.total) {
  1654. this.total2 = response.data.total
  1655. }
  1656. // Just to simulate the time of the request
  1657. setTimeout(() => {
  1658. this.listLoading2 = false
  1659. }, 100)
  1660. })
  1661. },
  1662. form_search2() {
  1663. this.listLoading2 = true
  1664. if (this.getdataListParm2.parammaps.inputDatetime === null) {
  1665. this.getdataListParm2.parammaps.inputDatetime = ''
  1666. }
  1667. this.getdataListParm2.offset = 1
  1668. this.get_table_data2()
  1669. },
  1670. useType: function(cellValue) {
  1671. // console.log(cellValue.isZeroStock)
  1672. if (cellValue.useType === 0) {
  1673. return '领用出库'
  1674. } else if (cellValue.useType === 2) {
  1675. return '领用出库'
  1676. } else if (cellValue.useType === 3) {
  1677. return '领用出库'
  1678. } else if (cellValue.useType === 1) {
  1679. return '手动出库'
  1680. } else if (cellValue.useType === 4) {
  1681. return '调拨出库'
  1682. } else if (cellValue.useType === 5) {
  1683. return '报废出库'
  1684. } else if (cellValue.useType === 6) {
  1685. return '青贮出库'
  1686. }
  1687. },
  1688. form_search() {
  1689. console.log('点击了table搜索')
  1690. this.listLoading = true
  1691. if (this.getdataListParm.parammaps.inputDatetime === null) {
  1692. this.getdataListParm.parammaps.inputDatetime = ''
  1693. }
  1694. this.getdataListParm.offset = 1
  1695. this.get_table_data()
  1696. },
  1697. form_see(row) {
  1698. this.seeTemp = Object.assign({}, row)
  1699. console.log(this.seeTemp)
  1700. // this.temp = Object.assign({}, row) // copy obj
  1701. this.dialogStatus = 'see'
  1702. this.dialogFormVisible_See = true
  1703. this.getdataListSee.parammaps.id = row.id
  1704. this.TotalAmount = 0
  1705. this.getSeeList()
  1706. if (this.seeTemp.useType == 0) {
  1707. this.No1 = true
  1708. this.oddCodeAllo = true
  1709. this.isCreatTimeAllo = false
  1710. this.No5 = true
  1711. this.isTableAllo = true
  1712. this.isTableAllo1 = false
  1713. } else if (this.seeTemp.useType == 2) {
  1714. this.No1 = true
  1715. this.oddCodeAllo = true
  1716. this.isCreatTimeAllo = false
  1717. this.No5 = true
  1718. this.isTableAllo = true
  1719. this.isTableAllo1 = false
  1720. } else if (this.seeTemp.useType == 3) {
  1721. this.No1 = true
  1722. this.oddCodeAllo = true
  1723. this.isCreatTimeAllo = false
  1724. this.No5 = true
  1725. this.isTableAllo = true
  1726. this.isTableAllo1 = false
  1727. } else if (this.seeTemp.useType == 1) {
  1728. this.No1 = false
  1729. this.oddCodeAllo = false
  1730. this.isTableAllo = true
  1731. this.isTableAllo1 = false
  1732. } else if (this.seeTemp.useType == 4) {
  1733. this.oddCodeAllo = false
  1734. this.isCreatTimeAllo = true
  1735. this.No5 = false
  1736. this.No1 = false
  1737. this.isTableAllo = false
  1738. this.isTableAllo1 = true
  1739. } else if (this.seeTemp.useType == 5) {
  1740. this.No1 = false
  1741. this.oddCodeAllo = false
  1742. this.isTableAllo = true
  1743. this.isTableAllo1 = false
  1744. }
  1745. },
  1746. getSeeList() {
  1747. GetDataByName(this.getdataListSee).then(response => {
  1748. console.log('查看下方table数据', response.data.list)
  1749. this.listSee = response.data.list
  1750. if (response.data.list !== null) {
  1751. for (let i = 0; i < response.data.list.length; i++) {
  1752. this.TotalAmount += parseFloat(response.data.list[i].sumPrice)
  1753. 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) {
  1754. this.listSee[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  1755. this.listSee[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  1756. } else {
  1757. this.listSee[i].srcpath = ''
  1758. this.listSee[i].picpath = ''
  1759. }
  1760. }
  1761. this.TotalAmount = this.TotalAmount.toFixed(2)
  1762. }
  1763. setTimeout(() => {
  1764. this.listLoadingSee = false
  1765. }, 100)
  1766. })
  1767. },
  1768. resetCreateTemp() {
  1769. this.createTemp.useType = 0
  1770. this.createTemp.empId = parseInt(Cookies.get('employeid'))
  1771. this.createTemp.pastureId = parseInt(Cookies.get('pastureid'))
  1772. this.createTemp.receiveTime = parseTime(new Date(), '{y}-{m}-{d}')
  1773. this.createTemp.departmentId = parseInt(Cookies.get('departmentid'))
  1774. this.createTemp.applicatId = parseInt(Cookies.get('employeid'))
  1775. this.listAdd = []
  1776. this.createTemp.useForm = ''
  1777. this.createTemp.greenFodderNumber = ''
  1778. this.createTemp.note = ''
  1779. this.No1 = true
  1780. this.No2 = false
  1781. this.No3 = false
  1782. this.orderPart = {}
  1783. },
  1784. form_add() {
  1785. this.resetCreateTemp()
  1786. this.edit = 1
  1787. this.getDepartParam.parammaps.pastureId = this.createTemp.pastureId
  1788. this.getCreateDepartDownList()
  1789. this.dialogStatus = 'create'
  1790. this.dialogFormVisible = true
  1791. this.createTemp.useForm = ''
  1792. this.createTemp.pastureName = Cookies.get('pasturename')
  1793. this.createTemp.employeId = Cookies.get('employeid')
  1794. this.TotalAmount = 0
  1795. console.log(this.createTemp)
  1796. this.$nextTick(() => {
  1797. this.$refs['temp'].clearValidate()
  1798. })
  1799. this.getCreateNumber()
  1800. },
  1801. getCreateNumber() {
  1802. GetDataByName(this.getParmCreateNumber).then(response => {
  1803. this.$nextTick(() => {
  1804. console.log('新增领用单号', response.data.list[0].orderCode)
  1805. this.createTemp.useForm = response.data.list[0].orderCode
  1806. })
  1807. this.$forceUpdate()
  1808. })
  1809. },
  1810. changeStorageType(val) {
  1811. console.log(val)
  1812. this.TotalAmount = 0
  1813. if (val === 0) {
  1814. this.No1 = true
  1815. this.No2 = false
  1816. this.No3 = false
  1817. this.disabled = true
  1818. this.listAdd = []
  1819. this.isReceiveTime = true
  1820. this.isReceiveTime2 = false
  1821. this.No4 = true
  1822. // 调拨数量/出库数量
  1823. this.allo = false
  1824. } else if (val === 1) {
  1825. this.No1 = false
  1826. this.No2 = true
  1827. this.No3 = false
  1828. this.disabled = false
  1829. this.listAdd = []
  1830. this.useForms = []
  1831. this.isReceiveTime = true
  1832. this.isReceiveTime2 = false
  1833. this.No4 = true
  1834. // 调拨数量/出库数量
  1835. this.allo = false
  1836. } else if (val === 2) {
  1837. this.listAdd = []
  1838. this.No1 = false
  1839. this.No2 = false
  1840. this.isReceiveTime = false
  1841. this.isReceiveTime2 = true
  1842. this.No3 = true
  1843. // 调拨数量/出库数量显示
  1844. this.allo = true
  1845. this.No4 = false
  1846. }else if(val === 5){
  1847. // 报废出库
  1848. this.No1 = false
  1849. this.No2 = true
  1850. this.No3 = false
  1851. this.disabled = false
  1852. this.listAdd = []
  1853. this.useForms = []
  1854. this.isReceiveTime = true
  1855. this.isReceiveTime2 = false
  1856. this.No4 = true
  1857. // 调拨数量/出库数量
  1858. this.allo = false
  1859. }else if(val === 6){
  1860. // 报废出库
  1861. this.No1 = false
  1862. this.No2 = true
  1863. this.No3 = false
  1864. this.disabled = false
  1865. this.listAdd = []
  1866. this.useForms = []
  1867. this.isReceiveTime = true
  1868. this.isReceiveTime2 = false
  1869. this.No4 = true
  1870. // 调拨数量/出库数量
  1871. this.allo = false
  1872. }
  1873. },
  1874. getNumber(queryString, cb) {
  1875. console.log('领用单号模糊查询输入值', queryString)
  1876. this.requestUseForm.parammaps['applyCode'] = queryString
  1877. GetDataByName(this.requestUseForm).then(response => {
  1878. console.log('领用单号模糊查询搜索data', response.data.list)
  1879. // this.useForms = response.data.list
  1880. cb(response.data.list)
  1881. })
  1882. },
  1883. changeApplyCode(item) {
  1884. console.log('领用单号模糊查询选中值', item)
  1885. this.getParmCreateAdd.parammaps.id = item.id
  1886. this.getParmCreateAdd.parammaps.pastureId = Cookies.get('pastureid')
  1887. // this.createTemp.departmentId = item.departmentId
  1888. this.$set(this.createTemp, "departmentId", item.departmentId)
  1889. this.createTemp.bid = item.id
  1890. this.createTemp.applicatId = item.empId
  1891. this.orderPart.applyCode = item.applyCode
  1892. this.TotalAmount = 0
  1893. this.get_table_dataAdd()
  1894. },
  1895. get_table_dataAdd() {
  1896. GetDataByName(this.getParmCreateAdd).then(response => {
  1897. console.log('领用单号list列表', response.data.list)
  1898. this.createTemp.applyType = response.data.list[0].applyType
  1899. this.listAdd = response.data.list
  1900. this.TotalAmount = 0
  1901. if (response.data.list !== null) {
  1902. for (var i = 0; i < response.data.list.length; i++) {
  1903. if (response.data.list[i].applyType == '非维保') {
  1904. response.data.list[i].applyType = '物耗'
  1905. this.getDictByName = [{ 'id': 61, 'label': '物耗', 'value': '物耗' }, { 'id': 62, 'label': '土建', 'value': '土建' }, { 'id': 229, 'label': '工具', 'value': '工具' }]
  1906. } else {
  1907. this.get_select_list()
  1908. }
  1909. // response.data.list[i].useTypeV = response.data.list[i].applyType
  1910. this.$set(response.data.list[i], 'useTypeV', response.data.list[i].applyType)
  1911. if (response.data.list[i].price == '') {
  1912. response.data.list[i].price = 0
  1913. }
  1914. if (response.data.list[i].checkoutNumber == null) {
  1915. var checkoutNumberArray = []
  1916. checkoutNumberArray.push(response.data.list[i].amount, response.data.list[i].reportery)
  1917. response.data.list[i].minNumber = Math.min.apply(null, checkoutNumberArray)
  1918. // response.data.list[i].checkoutNumber = response.data.list[i].minNumber
  1919. this.$set(response.data.list[i], 'checkoutNumber', response.data.list[i].minNumber)
  1920. // this.$set(response.data.list[i], 'sumPrice', parseFloat(response.data.list[i].sumPrice) * parseFloat(response.data.list[i].checkoutNumber))
  1921. }
  1922. console.log(response.data.list[i].sumPrice, '========= ==')
  1923. this.TotalAmount += parseFloat(response.data.list[i].sumPrice)
  1924. 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) {
  1925. this.listAdd[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  1926. this.listAdd[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  1927. } else {
  1928. this.listAdd[i].srcpath = ''
  1929. this.listAdd[i].picpath = ''
  1930. }
  1931. }
  1932. this.TotalAmount = this.TotalAmount.toFixed(2)
  1933. }
  1934. })
  1935. },
  1936. sparePartSearch(queryString, cb) {
  1937. console.log('备件模糊查询输入值', queryString)
  1938. this.requestSparePart.parammaps['partCode'] = queryString
  1939. GetDataByName(this.requestSparePart).then(response => {
  1940. console.log('备件模糊查询搜索data', response.data.list)
  1941. if (response.data.list == null) {
  1942. cb([])
  1943. } else {
  1944. for (var i = 0; i < response.data.list.length; i++) {
  1945. response.data.list[i].useTypeV = '维修'
  1946. }
  1947. cb(response.data.list)
  1948. }
  1949. })
  1950. },
  1951. handleSelectSparePart(item) {
  1952. console.log('备件模糊查询选中值', item)
  1953. this.TotalAmount = 0
  1954. if (this.listAdd.length > 0) {
  1955. // eslint-disable-next-line no-redeclare
  1956. if (this.listAdd.find(obj => obj.id === item.id)) {
  1957. this.$message({
  1958. type: 'warning',
  1959. message: '此备件已存在,请重新选择备件'
  1960. })
  1961. for (let i = 0; i < this.listAdd.length; i++) {
  1962. this.TotalAmount += parseFloat(this.listAdd[i].checkoutNumber) * parseFloat(this.listAdd[i].price)
  1963. }
  1964. this.TotalAmount = this.TotalAmount.toFixed(2)
  1965. } else {
  1966. if (item.checkoutNumber == null) {
  1967. this.$set(item, 'checkoutNumber', item.reportery)
  1968. }
  1969. this.TotalAmount = parseFloat(item.checkoutNumber) * parseFloat(item.price)
  1970. if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  1971. this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  1972. this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  1973. } else {
  1974. item.srcpath = ''
  1975. item.picpath = ''
  1976. }
  1977. this.listAdd.unshift(item)
  1978. this.TotalAmount = 0
  1979. for (let i = 0; i < this.listAdd.length; i++) {
  1980. this.TotalAmount += parseFloat(this.listAdd[i].checkoutNumber) * parseFloat(this.listAdd[i].price)
  1981. }
  1982. this.TotalAmount = this.TotalAmount.toFixed(2)
  1983. }
  1984. } else {
  1985. if (item.checkoutNumber == null) {
  1986. this.$set(item, 'checkoutNumber', item.reportery)
  1987. }
  1988. if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  1989. this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  1990. this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  1991. } else {
  1992. item.srcpath = ''
  1993. item.picpath = ''
  1994. }
  1995. this.listAdd.unshift(item)
  1996. this.$forceUpdate()
  1997. this.TotalAmount = 0
  1998. for (let i = 0; i < this.listAdd.length; i++) {
  1999. this.TotalAmount += parseFloat(this.listAdd[i].checkoutNumber) * parseFloat(this.listAdd[i].price)
  2000. }
  2001. this.TotalAmount = this.TotalAmount.toFixed(2)
  2002. }
  2003. console.log(this.listAdd)
  2004. // for (let i = 0; i < this.listAdd.length; i++) {
  2005. // this.TotalAmount += parseFloat(this.listAdd[i].checkoutNumber) * parseFloat(this.listAdd[i].price)
  2006. // }
  2007. // this.TotalAmount = this.TotalAmount.toFixed(2)
  2008. },
  2009. allocationSearch(queryString, cb) {
  2010. console.log(queryString)
  2011. this.requestAllocation.parammaps.applyCode = queryString
  2012. GetDataByName(this.requestAllocation).then(response => {
  2013. console.log('调拨单号模糊查询搜索data', response.data.list)
  2014. if (response.data.list !== null) {
  2015. cb(response.data.list)
  2016. } else {
  2017. cb([])
  2018. }
  2019. })
  2020. },
  2021. handleSelectAllocation(item) {
  2022. console.log('调拨单号模糊查询选中值', item)
  2023. this.createTemp.id = item.id
  2024. this.createTemp.oddCode = item.applyCode
  2025. this.getAllocationListParm.parammaps.id = item.id
  2026. this.TotalAmount = 0
  2027. this.getAllocationList()
  2028. },
  2029. getAllocationList() {
  2030. GetDataByName(this.getAllocationListParm).then(response => {
  2031. console.log('调拨单号table-data', response.data.list)
  2032. this.listAdd = response.data.list
  2033. if (response.data.list !== null) {
  2034. for (let i = 0; i < response.data.list.length; i++) {
  2035. this.TotalAmount += parseFloat(response.data.list[i].sumPrice)
  2036. this.$set(this.listAdd[i], 'warehoseCode', '')
  2037. 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) {
  2038. this.listAdd[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  2039. this.listAdd[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  2040. } else {
  2041. this.listAdd[i].srcpath = ''
  2042. this.listAdd[i].picpath = ''
  2043. }
  2044. }
  2045. }
  2046. this.$forceUpdate()
  2047. })
  2048. },
  2049. querySearchEqName(queryString, cb) {
  2050. console.log('备件名称/设备内部编号模糊查询输入值', queryString)
  2051. this.requestEqName.parammaps['eqName'] = queryString
  2052. GetDataByName(this.requestEqName).then(response => {
  2053. console.log('备件名称模糊查询搜索data', response.data.list)
  2054. this.EqNameList = response.data.list
  2055. cb(this.EqNameList)
  2056. })
  2057. },
  2058. handleSelectEqName(item, row) {
  2059. console.log('备件名称/设备内部编号模糊查询选中值', item)
  2060. console.log('备件名称/设备内部编号模糊查询选中值所在行', row)
  2061. this.$set(row, 'eqCode', item.eqCode)
  2062. this.$forceUpdate()
  2063. },
  2064. querySearchCode(queryString, cb) {
  2065. console.log('备件名称/设备内部编号模糊查询输入值', queryString)
  2066. this.requestEqName.parammaps['eqCode'] = queryString
  2067. GetDataByName(this.requestEqName).then(response => {
  2068. console.log('备件名称模糊查询搜索data', response.data.list)
  2069. this.EqNameList = response.data.list
  2070. cb(this.EqNameList)
  2071. })
  2072. },
  2073. // handleClear() {
  2074. // this.activated = false
  2075. // this.$emit('clear')
  2076. // },
  2077. handleSelectEqCode(item, row) {
  2078. console.log('备件名称/设备内部编号模糊查询选中值', item)
  2079. console.log('备件名称/设备内部编号模糊查询选中值所在行', row)
  2080. this.$set(row, 'eqName', item.eqName)
  2081. this.$forceUpdate()
  2082. },
  2083. blurSelectEqName(item, row) {
  2084. this.$set(row, 'eqName', '')
  2085. this.$set(row, 'eqCode', '')
  2086. },
  2087. blurSelectEqCode(item, row) {
  2088. this.$set(row, 'eqName', '')
  2089. this.$set(row, 'eqCode', '')
  2090. },
  2091. changeUseNumber(value, row) {
  2092. console.log('领用数量', value)
  2093. for (var i = 0; i < this.listAdd.length; i++) {
  2094. console.log(this.listAdd[i].id)
  2095. if (this.listAdd[i].id === row.id) {
  2096. var useNumberArray = []
  2097. useNumberArray.push(this.listAdd[i].reportery, parseInt(value))
  2098. // this.listAdd[i].checkoutNumber = Math.min.apply(null,useNumberArray)
  2099. }
  2100. }
  2101. },
  2102. changeCheckoutNumber(value, row) {
  2103. console.log('出库数量', value, row)
  2104. for (var i = 0; i < this.listAdd.length; i++) {
  2105. console.log(this.listAdd[i].id)
  2106. console.log(this.listAdd[i])
  2107. if (this.listAdd[i].id === row.id) {
  2108. var checkoutNumberArray = []
  2109. checkoutNumberArray.push(this.listAdd[i].reportery, parseInt(this.listAdd[i].amount), parseInt(value))
  2110. this.listAdd[i].minNumber = Math.min.apply(null, checkoutNumberArray)
  2111. this.$set(this.listAdd[i], 'sumPrice', parseFloat(this.listAdd[i].minNumber) * parseFloat(this.listAdd[i].price))
  2112. // this.listAdd[i].sumPrice = parseFloat(this.listAdd[i].minNumber) * parseFloat(this.listAdd[i].price)
  2113. console.log(this.rules)
  2114. }
  2115. }
  2116. console.log(this.listAdd)
  2117. },
  2118. blurCheckoutNumber(value, row) {
  2119. console.log(value, row)
  2120. this.TotalAmount = 0
  2121. this.$set(row, 'sumPrice', (parseFloat(row.price) * parseFloat(row.checkoutNumber)).toFixed(2))
  2122. console.log(this.listAdd)
  2123. for (let i = 0; i < this.listAdd.length; i++) {
  2124. this.TotalAmount += parseFloat(this.listAdd[i].sumPrice)
  2125. }
  2126. this.TotalAmount = this.TotalAmount.toFixed(2)
  2127. },
  2128. partDelete(row) {
  2129. console.log(this.listAdd)
  2130. MessageBox.confirm('备件名称:' + row.partName, '确认删除?', {
  2131. confirmButtonText: '确认',
  2132. cancelButtonText: '取消',
  2133. type: 'warning'
  2134. }).then(() => {
  2135. this.TotalAmount = 0
  2136. for (var i = 0; i < this.listAdd.length; i++) {
  2137. console.log(this.listAdd[i])
  2138. if (this.listAdd[i].id === row.id) {
  2139. var listAddIndex = this.listAdd.indexOf(this.listAdd[i])
  2140. }
  2141. if (listAddIndex > -1) {
  2142. this.listAdd.splice(listAddIndex, 1)
  2143. console.log(this.listAdd)
  2144. for (let i = 0; i < this.listAdd.length; i++) {
  2145. this.TotalAmount += parseFloat(this.listAdd[i].checkoutNumber) * parseFloat(this.listAdd[i].price)
  2146. }
  2147. return
  2148. }
  2149. }
  2150. console.log(this.listAdd)
  2151. this.TotalAmount = this.TotalAmount.toFixed(2)
  2152. })
  2153. },
  2154. add_dialog_save() {
  2155. this.isokDisable = true
  2156. setTimeout(() => {
  2157. this.isokDisable = false
  2158. }, 1000)
  2159. this.$refs['createTemp'].validate(valid => {
  2160. if (valid) {
  2161. if (this.createTemp.useForm == '' || this.createTemp.useForm == null || this.createTemp.useForm == undefined) {
  2162. GetDataByName(this.getParmCreateNumber).then(response => {
  2163. this.$nextTick(() => {
  2164. console.log('新增领用单号', response.data.list[0].orderCode)
  2165. this.createTemp.useForm = response.data.list[0].orderCode
  2166. this.$forceUpdate()
  2167. this.add_dialog_saveSave()
  2168. })
  2169. })
  2170. } else {
  2171. this.add_dialog_saveSave()
  2172. }
  2173. }
  2174. })
  2175. },
  2176. add_dialog_saveSave() {
  2177. if (this.listAdd.length !== 0) {
  2178. if (this.createTemp.useType === 0) {
  2179. // 领用出库
  2180. this.postDataPramas.common = { 'returnmap': '0' }
  2181. this.postDataPramas.data = []
  2182. for (var j = 0; j < this.listAdd.length; j++) {
  2183. if (this.listAdd[j].useTypeV == null || this.listAdd[j].checkoutNumber == null || this.listAdd[j].checkoutNumber == '') {
  2184. this.$message({
  2185. type: 'warning',
  2186. message: '请检查费用类型或出库数量是否未填写',
  2187. duration: 2000
  2188. })
  2189. return false
  2190. } else {
  2191. var rulesCheckoutNumber = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
  2192. if (!rulesCheckoutNumber.test(parseFloat(this.listAdd[j].checkoutNumber))) {
  2193. this.$message({
  2194. type: 'error',
  2195. message: '出库数量请输入正数,最多保留两位小数点',
  2196. duration: 2000
  2197. })
  2198. return false
  2199. } else {
  2200. if (parseFloat(this.listAdd[j].checkoutNumber) > parseFloat(this.listAdd[j].amount) || parseFloat(this.listAdd[j].checkoutNumber) > parseFloat(this.listAdd[j].reportery)) {
  2201. this.$message({
  2202. type: 'warning',
  2203. message: '出库数量不可大于领用数量或库位库存数',
  2204. duration: 2000
  2205. })
  2206. return false
  2207. }
  2208. }
  2209. this.$set(this.listAdd[j], 'checkoutNumber', (this.listAdd[j].checkoutNumber).toString())
  2210. }
  2211. }
  2212. if (this.createTemp.applyType === '维修') {
  2213. this.createTemp.useType = 0
  2214. } else if (this.createTemp.applyType === '保养') {
  2215. this.createTemp.useType = 2
  2216. } else if (this.createTemp.applyType === '非维保') {
  2217. this.createTemp.useType = 3
  2218. }
  2219. console.log(this.orderPart.applyCode)
  2220. this.postDataPramas.data[0] = { 'name': 'insertBigPartUse', 'type': 'e', 'parammaps': {
  2221. pastureId: this.createTemp.pastureId,
  2222. departmentId: this.createTemp.departmentId,
  2223. useForm: this.createTemp.useForm,
  2224. oddCode: this.orderPart.applyCode,
  2225. useType: this.createTemp.useType,
  2226. applicatId: this.createTemp.applicatId,
  2227. receiveTime: this.createTemp.receiveTime,
  2228. empId: this.createTemp.empId,
  2229. note: this.createTemp.note
  2230. }}
  2231. if(this.createTemp.oddCode == ""){
  2232. this.$notify({
  2233. title: '保存失败',
  2234. message: '领用单号不得为空',
  2235. type: 'warning',
  2236. duration: 2000
  2237. })
  2238. return false
  2239. }
  2240. this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
  2241. this.postDataPramas.data[1].children = []
  2242. this.postDataPramas.data[1].children[0] = { 'name': 'insertPartUse', 'type': 'e', 'parammaps': {
  2243. bigId: '@insertBigPartUse.LastInsertId',
  2244. locationId: '@insertSpotList.locationId',
  2245. departmentId: '@insertSpotList.departmentId',
  2246. partId: '@insertSpotList.partId',
  2247. partCode: '@insertSpotList.partCode',
  2248. partName: '@insertSpotList.partName',
  2249. specification: '@insertSpotList.specification',
  2250. price: '@insertSpotList.price',
  2251. unit: '@insertSpotList.unit',
  2252. brandId: '@insertSpotList.brandId',
  2253. contractId: '@insertSpotList.contractId',
  2254. useNumber: '@insertSpotList.amount',
  2255. checkoutNumber: '@insertSpotList.checkoutNumber',
  2256. eqName: '@insertSpotList.eqName',
  2257. eqCode: '@insertSpotList.eqCode',
  2258. reportery: '@insertSpotList.reportery',
  2259. useTypeV: '@insertSpotList.useTypeV',
  2260. note: '@insertSpotList.note'
  2261. }}
  2262. this.postDataPramas.data[1].children[1] = { 'name': 'insertPartUseRepertory', 'type': 'e', 'parammaps': {
  2263. checkoutNumber: '@insertSpotList.checkoutNumber',
  2264. pastureId: '@insertSpotList.pastureId',
  2265. locationId: '@insertSpotList.locationId',
  2266. location: '@insertSpotList.location',
  2267. partId: '@insertSpotList.partId',
  2268. partCode: '@insertSpotList.partCode',
  2269. partName: '@insertSpotList.partName',
  2270. specification: '@insertSpotList.specification',
  2271. providerId: '@insertSpotList.providerId',
  2272. providerName: '@insertSpotList.providerName',
  2273. brandId: '@insertSpotList.brandId',
  2274. price: '@insertSpotList.price',
  2275. unit: '@insertSpotList.unit',
  2276. contractId: '@insertSpotList.contractId'
  2277. }}
  2278. this.postDataPramas.data[1].children[2] = { 'name': 'updatePartapplyuseAmount', 'type': 'e', 'parammaps': {
  2279. paid: '@insertSpotList.paid',
  2280. checkoutNumber: '@insertSpotList.checkoutNumber'
  2281. }}
  2282. this.postDataPramas.data[2] = { 'name': 'updateBigPartApplystatue', 'type': 'e', 'parammaps': {
  2283. bid: this.createTemp.bid
  2284. }}
  2285. ExecDataByConfig(this.postDataPramas).then(response => {
  2286. console.log('新增保存发送参数', this.postDataPramas)
  2287. if (response.msg === 'fail') {
  2288. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  2289. } else {
  2290. this.getdataListParm.parammaps.inputDatetime = ''
  2291. setTimeout(() => {
  2292. this.get_table_data()
  2293. }, 1000)
  2294. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  2295. this.dialogFormVisible = false
  2296. }
  2297. })
  2298. return true
  2299. } else if (this.createTemp.useType === 1) {
  2300. // 手动出库
  2301. this.postDataPramas.common = { 'returnmap': '0' }
  2302. this.postDataPramas.data = []
  2303. for (var j = 0; j < this.listAdd.length; j++) {
  2304. 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 == '') {
  2305. this.$message({
  2306. type: 'warning',
  2307. message: '请检查备件名称或设备内部编号或费用类型或出库数量是否未填写',
  2308. duration: 2000
  2309. })
  2310. return false
  2311. } else {
  2312. // eslint-disable-next-line no-redeclare
  2313. var rulesCheckoutNumber = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
  2314. if (!rulesCheckoutNumber.test(parseFloat(this.listAdd[j].checkoutNumber))) {
  2315. this.$message({
  2316. type: 'error',
  2317. message: '出库数量请输入正数,最多保留两位小数点',
  2318. duration: 2000
  2319. })
  2320. return false
  2321. } else {
  2322. if (parseFloat(this.listAdd[j].checkoutNumber) > parseFloat(this.listAdd[j].reportery)) {
  2323. this.$message({
  2324. type: 'warning',
  2325. message: '出库数量不能大于库位库存数',
  2326. duration: 2000
  2327. })
  2328. this.$set(this.listAdd.find(obj => obj.checkoutNumber == this.listAdd[j].checkoutNumber), 'isNo', 'No')
  2329. return false
  2330. } else {
  2331. this.$set(this.listAdd.find(obj => obj.checkoutNumber == this.listAdd[j].checkoutNumber), 'isNo', 'Yes')
  2332. }
  2333. }
  2334. }
  2335. }
  2336. this.postDataPramas.data[0] = { 'name': 'insertBigPartUse', 'type': 'e', 'parammaps': {
  2337. pastureId: this.createTemp.pastureId,
  2338. departmentId: this.createTemp.departmentId,
  2339. useForm: this.createTemp.useForm,
  2340. useType: this.createTemp.useType,
  2341. applicatId: this.createTemp.applicatId,
  2342. receiveTime: this.createTemp.receiveTime,
  2343. empId: this.createTemp.empId,
  2344. note: this.createTemp.note
  2345. }}
  2346. this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
  2347. this.postDataPramas.data[1].children = []
  2348. this.postDataPramas.data[1].children[0] = { 'name': 'insertPartUse', 'type': 'e', 'parammaps': {
  2349. bigId: '@insertBigPartUse.LastInsertId',
  2350. locationId: '@insertSpotList.locationId',
  2351. departmentId: '@insertSpotList.departmentId',
  2352. partId: '@insertSpotList.partId',
  2353. partCode: '@insertSpotList.partCode',
  2354. partName: '@insertSpotList.partName',
  2355. specification: '@insertSpotList.specification',
  2356. price: '@insertSpotList.price',
  2357. unit: '@insertSpotList.unit',
  2358. brandId: '@insertSpotList.brandId',
  2359. contractId: '@insertSpotList.contractId',
  2360. useNumber: 0,
  2361. checkoutNumber: '@insertSpotList.checkoutNumber',
  2362. eqName: '@insertSpotList.eqName',
  2363. eqCode: '@insertSpotList.eqCode',
  2364. reportery: '@insertSpotList.reportery',
  2365. useTypeV: '@insertSpotList.useTypeV',
  2366. note: '@insertSpotList.note'
  2367. }}
  2368. this.postDataPramas.data[1].children[1] = { 'name': 'insertPartUseRepertory', 'type': 'e', 'parammaps': {
  2369. checkoutNumber: '@insertSpotList.checkoutNumber',
  2370. pastureId: '@insertSpotList.pastureId',
  2371. locationId: '@insertSpotList.locationId',
  2372. location: '@insertSpotList.location',
  2373. partId: '@insertSpotList.partId',
  2374. partCode: '@insertSpotList.partCode',
  2375. partName: '@insertSpotList.partName',
  2376. specification: '@insertSpotList.specification',
  2377. providerId: '@insertSpotList.providerId',
  2378. providerName: '@insertSpotList.providerName',
  2379. brandId: '@insertSpotList.brandId',
  2380. price: '@insertSpotList.price',
  2381. unit: '@insertSpotList.unit',
  2382. contractId: '@insertSpotList.contractId'
  2383. }}
  2384. ExecDataByConfig(this.postDataPramas).then(response => {
  2385. console.log('新增保存发送参数', this.postDataPramas)
  2386. if (response.msg === 'fail') {
  2387. this.$notify({
  2388. title: '保存失败',
  2389. message: response.data,
  2390. type: 'warning',
  2391. duration: 2000
  2392. })
  2393. } else {
  2394. this.getdataListParm.parammaps.inputDatetime = ''
  2395. setTimeout(() => {
  2396. this.get_table_data()
  2397. }, 1000)
  2398. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  2399. this.dialogFormVisible = false
  2400. }
  2401. })
  2402. return true
  2403. } else if (this.createTemp.useType === 2) {
  2404. // 调拨出库
  2405. this.postDataPramas.common = { 'returnmap': '0' }
  2406. this.postDataPramas.data = []
  2407. // for (var j = 0; j < this.listAdd.length; j++) {
  2408. // if (this.listAdd[j].useTypeV == null) {
  2409. // this.$message({
  2410. // type: 'warning',
  2411. // message: '请检查备费用类型是否未填写',
  2412. // duration: 2000
  2413. // })
  2414. // return false
  2415. // }
  2416. // }
  2417. this.postDataPramas.data[0] = { 'name': 'insertBigPartUse', 'type': 'e', 'parammaps': {
  2418. pastureId: this.createTemp.pastureId,
  2419. departmentId: this.$store.state.user.departmentid,
  2420. useForm: this.createTemp.useForm,
  2421. useType: 4,
  2422. applicatId: this.createTemp.applicatId,
  2423. receiveTime: this.createTemp.receiveTime,
  2424. empId: this.createTemp.empId,
  2425. oddCode: this.createTemp.oddCode,
  2426. note: this.createTemp.note
  2427. }}
  2428. if(this.createTemp.oddCode == ""){
  2429. this.$notify({
  2430. title: '保存失败',
  2431. message: '领用单号不得为空',
  2432. type: 'warning',
  2433. duration: 2000
  2434. })
  2435. return false
  2436. }
  2437. this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
  2438. this.postDataPramas.data[1].children = []
  2439. this.postDataPramas.data[1].children[0] = { 'name': 'insertPartUse', 'type': 'e', 'parammaps': {
  2440. bigId: '@insertBigPartUse.LastInsertId',
  2441. locationId: -1,
  2442. contractId: '@insertSpotList.contractId',
  2443. providerName: '@insertSpotList.providerName',
  2444. providerId: '@insertSpotList.providerId',
  2445. departmentId: '@insertSpotList.departmentId',
  2446. partId: '@insertSpotList.partId',
  2447. partCode: '@insertSpotList.partCode',
  2448. partName: '@insertSpotList.partName',
  2449. specification: '@insertSpotList.specification',
  2450. price: '@insertSpotList.price',
  2451. unit: '@insertSpotList.unit',
  2452. brandId: '@insertSpotList.brandId',
  2453. useNumber: 0,
  2454. checkoutNumber: '@insertSpotList.amount',
  2455. eqName: '@insertSpotList.eqName',
  2456. eqCode: '@insertSpotList.eqCode',
  2457. reportery: 0,
  2458. useTypeV: '@insertSpotList.useTypeV',
  2459. note: '@insertSpotList.note'
  2460. }}
  2461. // this.postDataPramas.data[1].children[1] = { 'name': 'updatePartUseRepertory', 'type': 'e', 'parammaps': {
  2462. // checkoutNumber: '@insertSpotList.amount',
  2463. // partRepId: '@insertSpotList.partRepId'
  2464. // }}
  2465. this.postDataPramas.data[2] = { 'name': 'updateBigPartTransfer', 'type': 'e', 'parammaps': {
  2466. id: this.createTemp.id,
  2467. statue: 4,
  2468. useCode: this.createTemp.useForm
  2469. }}
  2470. ExecDataByConfig(this.postDataPramas).then(response => {
  2471. console.log(this.listAdd)
  2472. console.log('新增保存发送参数', this.postDataPramas)
  2473. if (response.msg === 'fail') {
  2474. this.$notify({
  2475. title: '保存失败',
  2476. message: response.data,
  2477. type: 'warning',
  2478. duration: 2000
  2479. })
  2480. } else {
  2481. this.getdataListParm.parammaps.inputDatetime = ''
  2482. setTimeout(() => {
  2483. this.get_table_data()
  2484. }, 1000)
  2485. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  2486. this.dialogFormVisible = false
  2487. }
  2488. })
  2489. return true
  2490. }else if(this.createTemp.useType === 5){
  2491. console.log('baofei',this.createTemp.oddCode)
  2492. // 报废出库
  2493. this.postDataPramas.common = { 'returnmap': '0' }
  2494. this.postDataPramas.data = []
  2495. for (var j = 0; j < this.listAdd.length; j++) {
  2496. 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 == '') {
  2497. this.$message({
  2498. type: 'warning',
  2499. message: '请检查备件名称或设备内部编号或费用类型或出库数量是否未填写',
  2500. duration: 2000
  2501. })
  2502. return false
  2503. } else {
  2504. // eslint-disable-next-line no-redeclare
  2505. var rulesCheckoutNumber = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
  2506. if (!rulesCheckoutNumber.test(parseFloat(this.listAdd[j].checkoutNumber))) {
  2507. this.$message({
  2508. type: 'error',
  2509. message: '出库数量请输入正数,最多保留两位小数点',
  2510. duration: 2000
  2511. })
  2512. return false
  2513. } else {
  2514. if (parseFloat(this.listAdd[j].checkoutNumber) > parseFloat(this.listAdd[j].reportery)) {
  2515. this.$message({
  2516. type: 'warning',
  2517. message: '出库数量不能大于库位库存数',
  2518. duration: 2000
  2519. })
  2520. this.$set(this.listAdd.find(obj => obj.checkoutNumber == this.listAdd[j].checkoutNumber), 'isNo', 'No')
  2521. return false
  2522. } else {
  2523. this.$set(this.listAdd.find(obj => obj.checkoutNumber == this.listAdd[j].checkoutNumber), 'isNo', 'Yes')
  2524. }
  2525. }
  2526. }
  2527. }
  2528. this.postDataPramas.data[0] = { 'name': 'insertBigPartUse', 'type': 'e', 'parammaps': {
  2529. pastureId: this.createTemp.pastureId,
  2530. departmentId: this.createTemp.departmentId,
  2531. useForm: this.createTemp.useForm,
  2532. useType: this.createTemp.useType,
  2533. applicatId: this.createTemp.applicatId,
  2534. receiveTime: this.createTemp.receiveTime,
  2535. empId: this.createTemp.empId,
  2536. note: this.createTemp.note
  2537. }}
  2538. if(this.createTemp.oddCode == ""){
  2539. this.$notify({
  2540. title: '保存失败',
  2541. message: '领用单号不得为空',
  2542. type: 'warning',
  2543. duration: 2000
  2544. })
  2545. return false
  2546. }
  2547. this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
  2548. this.postDataPramas.data[1].children = []
  2549. this.postDataPramas.data[1].children[0] = { 'name': 'insertPartUse', 'type': 'e', 'parammaps': {
  2550. bigId: '@insertBigPartUse.LastInsertId',
  2551. locationId: '@insertSpotList.locationId',
  2552. departmentId: '@insertSpotList.departmentId',
  2553. partId: '@insertSpotList.partId',
  2554. partCode: '@insertSpotList.partCode',
  2555. partName: '@insertSpotList.partName',
  2556. specification: '@insertSpotList.specification',
  2557. price: '@insertSpotList.price',
  2558. unit: '@insertSpotList.unit',
  2559. brandId: '@insertSpotList.brandId',
  2560. contractId: '@insertSpotList.contractId',
  2561. useNumber: 0,
  2562. checkoutNumber: '@insertSpotList.checkoutNumber',
  2563. eqName: '@insertSpotList.eqName',
  2564. eqCode: '@insertSpotList.eqCode',
  2565. reportery: '@insertSpotList.reportery',
  2566. useTypeV: '@insertSpotList.useTypeV',
  2567. note: '@insertSpotList.note'
  2568. }}
  2569. this.postDataPramas.data[1].children[1] = { 'name': 'insertPartUseRepertory', 'type': 'e', 'parammaps': {
  2570. checkoutNumber: '@insertSpotList.checkoutNumber',
  2571. pastureId: '@insertSpotList.pastureId',
  2572. locationId: '@insertSpotList.locationId',
  2573. location: '@insertSpotList.location',
  2574. partId: '@insertSpotList.partId',
  2575. partCode: '@insertSpotList.partCode',
  2576. partName: '@insertSpotList.partName',
  2577. specification: '@insertSpotList.specification',
  2578. providerId: '@insertSpotList.providerId',
  2579. providerName: '@insertSpotList.providerName',
  2580. brandId: '@insertSpotList.brandId',
  2581. price: '@insertSpotList.price',
  2582. unit: '@insertSpotList.unit',
  2583. contractId: '@insertSpotList.contractId'
  2584. }}
  2585. ExecDataByConfig(this.postDataPramas).then(response => {
  2586. console.log('新增保存发送参数', this.postDataPramas)
  2587. if (response.msg === 'fail') {
  2588. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  2589. } else {
  2590. this.getdataListParm.parammaps.inputDatetime = ''
  2591. setTimeout(() => {
  2592. this.get_table_data()
  2593. }, 1000)
  2594. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  2595. this.dialogFormVisible = false
  2596. }
  2597. })
  2598. return true
  2599. }else if(this.createTemp.useType === 6){
  2600. // 青贮出库
  2601. this.postDataPramas.common = { 'returnmap': '0' }
  2602. this.postDataPramas.data = []
  2603. for (var j = 0; j < this.listAdd.length; j++) {
  2604. 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 == '') {
  2605. this.$message({
  2606. type: 'warning',
  2607. message: '请检查备件名称或设备内部编号或费用类型或出库数量是否未填写',
  2608. duration: 2000
  2609. })
  2610. return false
  2611. } else {
  2612. // eslint-disable-next-line no-redeclare
  2613. var rulesCheckoutNumber = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
  2614. if (!rulesCheckoutNumber.test(parseFloat(this.listAdd[j].checkoutNumber))) {
  2615. this.$message({
  2616. type: 'error',
  2617. message: '出库数量请输入正数,最多保留两位小数点',
  2618. duration: 2000
  2619. })
  2620. return false
  2621. } else {
  2622. if (parseFloat(this.listAdd[j].checkoutNumber) > parseFloat(this.listAdd[j].reportery)) {
  2623. this.$message({
  2624. type: 'warning',
  2625. message: '出库数量不能大于库位库存数',
  2626. duration: 2000
  2627. })
  2628. this.$set(this.listAdd.find(obj => obj.checkoutNumber == this.listAdd[j].checkoutNumber), 'isNo', 'No')
  2629. return false
  2630. } else {
  2631. this.$set(this.listAdd.find(obj => obj.checkoutNumber == this.listAdd[j].checkoutNumber), 'isNo', 'Yes')
  2632. }
  2633. }
  2634. }
  2635. }
  2636. this.postDataPramas.data[0] = { 'name': 'insertBigPartUse', 'type': 'e', 'parammaps': {
  2637. pastureId: this.createTemp.pastureId,
  2638. departmentId: this.createTemp.departmentId,
  2639. useForm: this.createTemp.useForm,
  2640. useType: this.createTemp.useType,
  2641. applicatId: this.createTemp.applicatId,
  2642. receiveTime: this.createTemp.receiveTime,
  2643. empId: this.createTemp.empId,
  2644. note: this.createTemp.note,
  2645. greenFodderNumber:this.createTemp.greenFodderNumber
  2646. }}
  2647. // if(this.createTemp.oddCode == ""){
  2648. // this.$notify({
  2649. // title: '保存失败',
  2650. // message: '领用单号不得为空',
  2651. // type: 'warning',
  2652. // duration: 2000
  2653. // })
  2654. // return false
  2655. // }
  2656. this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
  2657. this.postDataPramas.data[1].children = []
  2658. this.postDataPramas.data[1].children[0] = { 'name': 'insertPartUse', 'type': 'e', 'parammaps': {
  2659. bigId: '@insertBigPartUse.LastInsertId',
  2660. locationId: '@insertSpotList.locationId',
  2661. departmentId: '@insertSpotList.departmentId',
  2662. partId: '@insertSpotList.partId',
  2663. partCode: '@insertSpotList.partCode',
  2664. partName: '@insertSpotList.partName',
  2665. specification: '@insertSpotList.specification',
  2666. price: '@insertSpotList.price',
  2667. unit: '@insertSpotList.unit',
  2668. brandId: '@insertSpotList.brandId',
  2669. contractId: '@insertSpotList.contractId',
  2670. useNumber: 0,
  2671. checkoutNumber: '@insertSpotList.checkoutNumber',
  2672. eqName: '@insertSpotList.eqName',
  2673. eqCode: '@insertSpotList.eqCode',
  2674. reportery: '@insertSpotList.reportery',
  2675. useTypeV: '@insertSpotList.useTypeV',
  2676. note: '@insertSpotList.note'
  2677. }}
  2678. this.postDataPramas.data[1].children[1] = { 'name': 'insertPartUseRepertory', 'type': 'e', 'parammaps': {
  2679. checkoutNumber: '@insertSpotList.checkoutNumber',
  2680. pastureId: '@insertSpotList.pastureId',
  2681. locationId: '@insertSpotList.locationId',
  2682. location: '@insertSpotList.location',
  2683. partId: '@insertSpotList.partId',
  2684. partCode: '@insertSpotList.partCode',
  2685. partName: '@insertSpotList.partName',
  2686. specification: '@insertSpotList.specification',
  2687. providerId: '@insertSpotList.providerId',
  2688. providerName: '@insertSpotList.providerName',
  2689. brandId: '@insertSpotList.brandId',
  2690. price: '@insertSpotList.price',
  2691. unit: '@insertSpotList.unit',
  2692. contractId: '@insertSpotList.contractId'
  2693. }}
  2694. ExecDataByConfig(this.postDataPramas).then(response => {
  2695. console.log('新增保存发送参数', this.postDataPramas)
  2696. if (response.msg === 'fail') {
  2697. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  2698. } else {
  2699. this.getdataListParm.parammaps.inputDatetime = ''
  2700. setTimeout(() => {
  2701. this.get_table_data()
  2702. }, 1000)
  2703. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  2704. this.dialogFormVisible = false
  2705. }
  2706. })
  2707. return true
  2708. }
  2709. } else {
  2710. this.$notify({
  2711. title: '',
  2712. message: '请选择备件',
  2713. type: 'warning',
  2714. duration: 2000
  2715. })
  2716. return false
  2717. }
  2718. },
  2719. tableCellStyle({ row, column, rowIndex, columnIndex }) {
  2720. if (row.isNo == 'No' && columnIndex === 13) {
  2721. return {
  2722. background: 'red'
  2723. }
  2724. }
  2725. return {
  2726. background: ''
  2727. }
  2728. },
  2729. // 导入
  2730. beforeImportExcel(file) {
  2731. const isLt2M = file.size / 1024 / 1024 < 10
  2732. if (!isLt2M) {
  2733. this.$message.error('上传文件大小不能超过 10MB!')
  2734. }
  2735. return isLt2M
  2736. },
  2737. handleImportExcelSuccess(res, file) {
  2738. if (res.msg === 'ok') {
  2739. this.$message({
  2740. title: '成功',
  2741. message: '导入成功:' + res.data.success + '条!',
  2742. type: 'success',
  2743. duration: 2000
  2744. })
  2745. if (res.data.err_count > 0) {
  2746. this.$notify({
  2747. title: '失败',
  2748. message: '导入失败:' + res.data.err_count + '条!',
  2749. type: 'danger',
  2750. duration: 2000
  2751. })
  2752. import('@/vendor/Export2Excel').then(excel => {
  2753. const list1 = res.data.result
  2754. const tHeader = [
  2755. '牧场', '领用单编号', '领用日期', '物料编码', '品名', '规格型号', '品牌', '计量单位', '实发数量', '单价', '总价', '库位', '供应商', '名称', '牧场设备编号', '具体用处', '领用类型', '领用部门', '领用人', 'SignColumn', '报错信息'
  2756. ]
  2757. const filterVal = [
  2758. '牧场', '领用单编号', '领用日期', '物料编码', '品名', '规格型号', '品牌', '计量单位', '实发数量', '单价', '总价', '库位', '供应商', '名称', '牧场设备编号', '具体用处', '领用类型', '领用部门', '领用人', 'SignColumn', 'error_msg'
  2759. ]
  2760. const data1 = this.formatJson(filterVal, list1)
  2761. excel.export_json_to_excel({
  2762. header: tHeader,
  2763. data: data1,
  2764. filename: this.requestParam.parammaps.formType,
  2765. autoWidth: true,
  2766. bookType: 'xlsx'
  2767. })
  2768. })
  2769. }
  2770. } else {
  2771. this.$notify({
  2772. title: '失败',
  2773. message: '上传失败',
  2774. type: 'danger',
  2775. duration: 2000
  2776. })
  2777. }
  2778. },
  2779. formatJsonTemp(filterVal, jsonData) {
  2780. return jsonData.map(v =>
  2781. filterVal.map(j => {
  2782. if (j === 'timestamp') {
  2783. return parseTime(v[j])
  2784. } else {
  2785. return v[j]
  2786. }
  2787. })
  2788. )
  2789. },
  2790. // 导出
  2791. handleDownload() {
  2792. this.$alert('备件出库信息正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  2793. this.isPercentage = true
  2794. this.percentage = 1
  2795. var timer = setInterval(() => {
  2796. this.percentage += 5
  2797. if (this.percentage > 95) {
  2798. this.percentage = 99
  2799. clearInterval(timer)
  2800. }
  2801. this.percentage = this.percentage
  2802. }, 1000)
  2803. this.requestParam.parammaps.formType = '备件出库信息'
  2804. this.requestParam.parammaps.inputDatetime = this.getdataListParm.parammaps.inputDatetime
  2805. this.requestParam.parammaps.pastureName = this.getdataListParm.parammaps.pastureName
  2806. this.requestParam.parammaps.departmentId = this.getdataListParm.parammaps.departmentId
  2807. this.requestParam.parammaps.useForm = this.getdataListParm.parammaps.useForm
  2808. this.requestParam.parammaps.useType = this.getdataListParm.parammaps.useType
  2809. this.requestParam.parammaps.startTime = this.getdataListParm.parammaps.startTime
  2810. this.requestParam.parammaps.stopTime = this.getdataListParm.parammaps.stopTime
  2811. GetAccount(this.requestParam).then(response => {
  2812. this.$nextTick(() => {
  2813. import('@/vendor/Export2Excel').then(excel => {
  2814. if (response.data.list !== null) {
  2815. for (let i = 0; i < response.data.list.length; i++) {
  2816. if(response.data.list[i].sterilisation == 1){
  2817. this.$set(response.data.list[i], 'sterilisation', "已冲销")
  2818. } else {
  2819. this.$set(response.data.list[i], 'sterilisation', "未冲销")
  2820. }
  2821. }
  2822. }
  2823. const list1 = response.data.list
  2824. if (response.data.list !== '') {
  2825. this.percentage = 99
  2826. setTimeout(() => {
  2827. this.isPercentage = false
  2828. }, 2000)
  2829. }
  2830. const tHeader = [
  2831. '牧场', '领用单编号', '领用日期', '物料编码', '品名', '规格型号', '品牌', '计量单位', '实发数量', '单价', '总价', '库位', '供应商', '名称', '牧场设备编号','资产品牌', '费用类型', '领用部门', '领用人', '备注', '冲销状态']
  2832. const filterVal = [
  2833. 'pastureName', 'useForm', 'creatTime', 'partCode', 'partName', 'specification', 'brandName', 'unit', 'checkoutNumber', 'price', 'sumPrice', 'warehoseCode', 'providerName', 'eqName', 'eqCode', 'eqBrand','useTypeV', 'departmentName', 'appliname', 'note', 'sterilisation'
  2834. ]
  2835. const data1 = this.formatJson(filterVal, list1)
  2836. excel.export_json_to_excel({ header: tHeader, data: data1, filename: this.requestParam.parammaps.formType, autoWidth: true, bookType: 'xlsx' })
  2837. })
  2838. })
  2839. })
  2840. },
  2841. handleDownload2() {
  2842. this.$alert('备件出库记录正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  2843. this.isPercentage = true
  2844. this.percentage = 1
  2845. var timer = setInterval(() => {
  2846. this.percentage += 5
  2847. if (this.percentage > 95) {
  2848. this.percentage = 99
  2849. clearInterval(timer)
  2850. }
  2851. this.percentage = this.percentage
  2852. }, 1000)
  2853. this.requestParam = {}
  2854. this.requestParam.name = 'getPartuseDetailList'
  2855. this.requestParam.parammaps = {}
  2856. this.requestParam.parammaps.formType = '备件出库记录'
  2857. this.requestParam.parammaps.inputDatetime = this.getdataListParm2.parammaps.inputDatetime
  2858. this.requestParam.parammaps.pastureName = this.getdataListParm2.parammaps.pastureName
  2859. this.requestParam.parammaps.departmentId = this.getdataListParm2.parammaps.departmentId
  2860. this.requestParam.parammaps.startTime = this.getdataListParm2.parammaps.startTime
  2861. this.requestParam.parammaps.stopTime = this.getdataListParm2.parammaps.stopTime
  2862. this.requestParam.parammaps.useForm = this.getdataListParm2.parammaps.useForm
  2863. this.requestParam.parammaps.partCode = this.getdataListParm2.parammaps.partCode
  2864. this.requestParam.parammaps.partName = this.getdataListParm2.parammaps.partName
  2865. this.requestParam.parammaps.providerId = this.getdataListParm2.parammaps.providerId
  2866. GetAccount(this.requestParam).then(response => {
  2867. this.$nextTick(() => {
  2868. import('@/vendor/Export2Excel').then(excel => {
  2869. const list1 = response.data.list
  2870. if (response.data.list !== '') {
  2871. this.percentage = 99
  2872. setTimeout(() => {
  2873. this.isPercentage = false
  2874. }, 2000)
  2875. }
  2876. const tHeader = [
  2877. '牧场', '出库单号', '备件编号', '备件名称', '备件规格', '备件品牌', '计量单位', ' 供应商', '设备名称', '设备内部编号', '费用类型', '库位', '期初库存', '出库数量', '单价', '总价 ', '领用部门 ', '领用人', '录入人 ', '出库 日期', '备注 '
  2878. ]
  2879. const filterVal = [
  2880. 'pastureName', 'useForm', 'partCode', 'partName', 'specification', 'brandName', 'unit', 'providerName', 'eqName', 'eqCode', 'useTypeV', 'warehoseCode', 'reportery', 'checkoutNumber', 'price', 'sumPrice', 'departmentName', 'appliname', 'empname', 'creatTime', 'note'
  2881. ]
  2882. const data1 = this.formatJson(filterVal, list1)
  2883. excel.export_json_to_excel({ header: tHeader, data: data1, filename: this.requestParam.parammaps.formType, autoWidth: true, bookType: 'xlsx' })
  2884. })
  2885. })
  2886. })
  2887. },
  2888. handleDownloadEas() {
  2889. this.$alert('备件出库EAS信息正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  2890. this.isPercentage = true
  2891. this.percentage = 1
  2892. var timer = setInterval(() => {
  2893. this.percentage += 5
  2894. if (this.percentage > 95) {
  2895. this.percentage = 99
  2896. clearInterval(timer)
  2897. }
  2898. this.percentage = this.percentage
  2899. }, 1000)
  2900. this.requestParam.name = 'downloadPartUseEAS'
  2901. this.requestParam.parammaps.inputDatetime = this.getdataListParm.parammaps.inputDatetime
  2902. this.requestParam.parammaps.pastureName = this.getdataListParm.parammaps.pastureName
  2903. this.requestParam.parammaps.departmentId = this.getdataListParm.parammaps.departmentId
  2904. this.requestParam.parammaps.useForm = this.getdataListParm.parammaps.useForm
  2905. this.requestParam.parammaps.useType = this.getdataListParm.parammaps.useType
  2906. this.requestParam.parammaps.startTime = this.getdataListParm.parammaps.startTime
  2907. this.requestParam.parammaps.stopTime = this.getdataListParm.parammaps.stopTime
  2908. GetAccount(this.requestParam).then(response => {
  2909. if (response.data.list !== '') {
  2910. this.percentage = 99
  2911. setTimeout(() => {
  2912. this.isPercentage = false
  2913. }, 2000)
  2914. }
  2915. this.$nextTick(() => {
  2916. import('@/vendor/Export2Excel').then(excel => {
  2917. const list1 = response.data.list
  2918. const tHeader = [
  2919. '*单据编号', '业务日期', '领料出库单明细$成本对象_名称_l2', '领料出库单明细$成本对象_编码', '领料出库单明细$仓库_编码', '领料出库单明细$库位_编码', '领料出库单明细$仓管员_编码', '领料出库单体$领料人_编码', '领料出库单明细_批次', '领料出库单明细_数量', '领料出库单明细_辅助数量', '领料出库单明细_单位实际成本', '领料出库单明细_实际成本', '领料出库单明细_生产日期', '领料出库单明细_到期日期', '领料出库单明细$物料_规格型号', '领料出库单明细$物料_名称_l2', '领料出库单明细$物料_编码', '领料出库单明细$辅助属性_编码', '领料出库单明细$计量单位_编码', '领料出库单明细$辅助计量单位_编码', '领料出库单明细_订单单号', '领料出库单明细_备注', '成本中心_编码', '需求方库存组织_编码', '需方库存组织_名称_l2', '部门_编码', '事务类型_名称_l2', '*事务类型_编码', '创建者_用户名', '创建时间', '领料出库单明细$生产线', '领料出库单明细$班组', '领料出库单明细$领料工序', '领料出库单明细$负责人', '领料出库单明细$成本对象组_单据编号', '领料出库单明细$成本对象组_名称_l2', '领料出库单明细$成本项目_编码', '领料出库单明细$成本项目_名称_l2', '领料出库单体$项目号_编码', '领料出库单体$跟踪号_编码', '摘要', '供应方库存组织_编码', '供应方财务组织_编码', '需求方财务组织_编码', '供方仓库_编码', '供方库位_编码', '结算价', '需方仓库_编码', '需方库位_编码', '仓管员_编码', '领料出库单明细$主制部门_编码', '领料出库单明细$主制部门_名称_l2', '领料出库单明细$成本中心_编码', '领料出库单明细$成本中心_名称_l2', '业务类型_编码', '业务类型_名称'
  2920. ]
  2921. const filterVal = [
  2922. '*单据编号', '业务日期', '领料出库单明细$成本对象_名称_l2', '领料出库单明细$成本对象_编码', '领料出库单明细$仓库_编码', '领料出库单明细$库位_编码', '领料出库单明细$仓管员_编码', '领料出库单体$领料人_编码', '领料出库单明细_批次', '领料出库单明细_数量', '领料出库单明细_辅助数量', '领料出库单明细_单位实际成本', '领料出库单明细_实际成本', '领料出库单明细_生产日期', '领料出库单明细_到期日期', '领料出库单明细$物料_规格型号', '领料出库单明细$物料_名称_l2', '领料出库单明细$物料_编码', '领料出库单明细$辅助属性_编码', '领料出库单明细$计量单位_编码', '领料出库单明细$辅助计量单位_编码', '领料出库单明细_订单单号', '领料出库单明细_备注', '成本中心_编码', '需求方库存组织_编码', '需方库存组织_名称_l2', '部门_编码', '事务类型_名称_l2', '*事务类型_编码', '创建者_用户名', '创建时间', '领料出库单明细$生产线', '领料出库单明细$班组', '领料出库单明细$领料工序', '领料出库单明细$负责人', '领料出库单明细$成本对象组_单据编号', '领料出库单明细$成本对象组_名称_l2', '领料出库单明细$成本项目_编码', '领料出库单明细$成本项目_名称_l2', '领料出库单体$项目号_编码', '领料出库单体$跟踪号_编码', '摘要', '供应方库存组织_编码', '供应方财务组织_编码', '需求方财务组织_编码', '供方仓库_编码', '供方库位_编码', '结算价', '需方仓库_编码', '需方库位_编码', '仓管员_编码', '领料出库单明细$主制部门_编码', '领料出库单明细$主制部门_名称_l2', '领料出库单明细$成本中心_编码', '领料出库单明细$成本中心_名称_l2', '业务类型_编码', '业务类型_名称'
  2923. ]
  2924. const tmultiHeader = [['EAS', '7.5.0', '领料出库单',
  2925. '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
  2926. '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
  2927. '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
  2928. '', '', '', '', '', '', '', '', ''],
  2929. ['MaterialReq', '领料出库单', '', '', '', '', '', '', '', '', '', '',
  2930. '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
  2931. '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
  2932. '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''],
  2933. ['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'
  2934. ]]
  2935. // const tmerges=['B1:D2']
  2936. if (list1 !== null) {
  2937. const data1 = this.formatJsonTemp(filterVal, list1)
  2938. excel.export_json_to_excel({
  2939. // merges: tmerges,
  2940. multiHeader: tmultiHeader,
  2941. header: tHeader,
  2942. data: data1,
  2943. filename: '备件出库EAS',
  2944. autoWidth: true,
  2945. bookType: 'xlsx'
  2946. })
  2947. } else {
  2948. this.$notify({
  2949. title: '',
  2950. message: '无备件领用完成信息,无法导出!',
  2951. type: 'warning',
  2952. duration: 2000
  2953. })
  2954. }
  2955. })
  2956. })
  2957. })
  2958. },
  2959. handleDownloadEas1() {
  2960. this.$alert('备件出库EAS信息正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  2961. this.isPercentage = true
  2962. this.percentage = 1
  2963. var timer = setInterval(() => {
  2964. this.percentage += 5
  2965. if (this.percentage > 95) {
  2966. this.percentage = 99
  2967. clearInterval(timer)
  2968. }
  2969. this.percentage = this.percentage
  2970. }, 1000)
  2971. this.requestParam.name = 'downloadPartUseEASYuan'
  2972. this.requestParam.parammaps.inputDatetime = this.getdataListParm.parammaps.inputDatetime
  2973. this.requestParam.parammaps.pastureName = this.getdataListParm.parammaps.pastureName
  2974. this.requestParam.parammaps.departmentId = this.getdataListParm.parammaps.departmentId
  2975. this.requestParam.parammaps.useForm = this.getdataListParm.parammaps.useForm
  2976. this.requestParam.parammaps.useType = this.getdataListParm.parammaps.useType
  2977. this.requestParam.parammaps.startTime = this.getdataListParm.parammaps.startTime
  2978. this.requestParam.parammaps.stopTime = this.getdataListParm.parammaps.stopTime
  2979. GetAccount(this.requestParam).then(response => {
  2980. if (response.data.list !== '') {
  2981. this.percentage = 99
  2982. setTimeout(() => {
  2983. this.isPercentage = false
  2984. }, 2000)
  2985. }
  2986. this.$nextTick(() => {
  2987. import('@/vendor/Export2Excel').then(excel => {
  2988. const list1 = response.data.list
  2989. const tHeader = [
  2990. '领用部门', '牧场', '领用单编号', '领用日期', '供应商编码', '供应商名称', '出库人', '制单日期', '品名', '物料编码', '计量单位', '单价', '实发数量', '总价', '备注', '领用人', '费用类型'
  2991. ]
  2992. const filterVal = [
  2993. '领用部门', '牧场', '领用单编号', '领用日期', '供应商编码', '供应商名称', '出库人', '制单日期', '品名', '物料编码', '计量单位', '单价', '实发数量', '总价', '备注', '领用人', '费用类型'
  2994. ]
  2995. // const tmerges=['B1:D2']
  2996. if (list1 !== null) {
  2997. const data1 = this.formatJsonTemp(filterVal, list1)
  2998. excel.export_json_to_excel({
  2999. // merges: tmerges,
  3000. // multiHeader: tmultiHeader,
  3001. header: tHeader,
  3002. data: data1,
  3003. filename: '备件出库EAS',
  3004. autoWidth: true,
  3005. bookType: 'xlsx'
  3006. })
  3007. } else {
  3008. this.$notify({
  3009. title: '',
  3010. message: '无备件领用完成信息,无法导出!',
  3011. type: 'warning',
  3012. duration: 2000
  3013. })
  3014. }
  3015. })
  3016. })
  3017. })
  3018. },
  3019. formatJson(filterVal, jsonData) {
  3020. return jsonData.map(v =>
  3021. filterVal.map(j => {
  3022. if (j === 'timestamp') {
  3023. return parseTime(v[j])
  3024. } else {
  3025. return v[j]
  3026. }
  3027. })
  3028. )
  3029. },
  3030. handleDelate(row) {
  3031. console.log('点击了删除')
  3032. this.getdataListSee.parammaps.id = row.id
  3033. this.getSeeList()
  3034. MessageBox.confirm('确认删除此条信息?', {
  3035. confirmButtonText: '确认',
  3036. cancelButtonText: '取消',
  3037. type: 'warning'
  3038. }).then(() => {
  3039. this.postDataPramas.common = { 'returnmap': '0' }
  3040. this.postDataPramas.data = []
  3041. this.postDataPramas.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listSee }}
  3042. this.postDataPramas.data[0].children = []
  3043. this.postDataPramas.data[0].children[0] = { 'name': 'updatePartRepertoryDelCK', 'type': 'e', 'parammaps': {
  3044. id: '@insertSpotList.id',
  3045. contractId: '@insertSpotList.contractId',
  3046. partCode: '@insertSpotList.partCode',
  3047. pastureId: row.pastureId
  3048. }}
  3049. this.postDataPramas.data[0].children[1] = { 'name': 'deletePartUse', 'type': 'e', 'parammaps': {
  3050. id: '@insertSpotList.id'
  3051. }}
  3052. this.postDataPramas.data[1] = { 'name': 'updatePartApplyDel', 'type': 'e', 'parammaps': {
  3053. applyCode: row.useForm
  3054. }}
  3055. this.postDataPramas.data[2] = { 'name': 'deleteBigPartUse', 'type': 'e', 'parammaps': {
  3056. id: row.id
  3057. }}
  3058. ExecDataByConfig(this.postDataPramas).then(response => {
  3059. this.get_table_data()
  3060. this.$notify({
  3061. title: '成功',
  3062. message: '删除成功',
  3063. type: 'success',
  3064. duration: 2000
  3065. })
  3066. })
  3067. }).catch(() => {
  3068. this.$message({ type: 'info', message: '已取消删除' })
  3069. })
  3070. },
  3071. // ---------------------------------------
  3072. // 编辑--- 修改保存
  3073. edit_dialog_save() {
  3074. console.log('编辑保存')
  3075. },
  3076. // 导出模板
  3077. handleDownloadTemp() {
  3078. this.requestParam.name = 'stockLaidDownTemp'
  3079. GetDataByName(this.requestParam).then(response => {
  3080. this.$nextTick(() => {
  3081. import('@/vendor/Export2Excel').then(excel => {
  3082. const list1 = response.data.list
  3083. const tHeader = [
  3084. '牧场', '领用单编号', '领用日期', '物料编码', '品名', '规格型号', '品牌', '计量单位', '实发数量', '单价', '总价', '库位', '供应商', '名称', '牧场设备编号', '具体用处', '领用类型', '领用部门', '领用人'
  3085. ]
  3086. const filterVal = [
  3087. '牧场', '领用单编号', '领用日期', '物料编码', '品名', '规格型号', '品牌', '计量单位', '实发数量', '单价', '总价', '库位', '供应商', '名称', '牧场设备编号', '具体用处', '领用类型', '领用部门', '领用人'
  3088. ]
  3089. const data1 = this.formatJsonTemp(filterVal, list1)
  3090. excel.export_json_to_excel({
  3091. header: tHeader,
  3092. data: data1,
  3093. filename: '出库模板',
  3094. autoWidth: true,
  3095. bookType: 'xlsx'
  3096. })
  3097. })
  3098. })
  3099. })
  3100. },
  3101. handleEAS() {
  3102. this.easStatus.dialogStatus = 'easStatus'
  3103. this.easStatus.dialogFormVisible = true
  3104. this.get_table_dataEasStatusLst()
  3105. },
  3106. get_table_dataEasStatusLst() {
  3107. this.easStatus.listLoading = true
  3108. GetDataByName(this.easStatus.getdataListParm).then(response => {
  3109. if (response.data.list !== null) {
  3110. this.easStatus.list = response.data.list
  3111. } else {
  3112. this.easStatus.list = []
  3113. }
  3114. this.easStatus.pageNum = response.data.pageNum
  3115. this.easStatus.pageSize = response.data.pageSize
  3116. if (response.data.total) {
  3117. this.easStatus.total = response.data.total
  3118. }
  3119. })
  3120. setTimeout(() => {
  3121. this.easStatus.listLoading = false
  3122. }, 100)
  3123. },
  3124. handleClose(row) {
  3125. MessageBox.confirm('是否确认关闭同步此数据?', {
  3126. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  3127. }).then(() => {
  3128. this.requestParam = {}
  3129. this.requestParam.name = 'updatebigpartuseSync'
  3130. this.requestParam.parammaps = {}
  3131. this.requestParam.parammaps.issync = '2'
  3132. this.requestParam.parammaps.id = row.id
  3133. PostDataByName(this.requestParam).then((response) => {
  3134. if (response.msg !== 'fail') {
  3135. this.$notify({ title: '成功', message: '关闭同步成功', type: 'success', duration: 2000 })
  3136. this.get_table_dataEasStatusLst()
  3137. this.get_table_data()
  3138. } else {
  3139. this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
  3140. this.get_table_dataEasStatusLst()
  3141. this.get_table_data()
  3142. }
  3143. })
  3144. }).catch(() => {
  3145. this.$message({ type: 'info', message: '已取消关闭同步' })
  3146. })
  3147. },
  3148. handleManual(row) {
  3149. MessageBox.confirm('是否确认同步此数据至EAS?', {
  3150. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  3151. }).then(() => {
  3152. this.requestParam = {}
  3153. this.requestParam.typeIn = row.typeIn
  3154. this.requestParam.billCode = row.billCode
  3155. EasSync(this.requestParam).then((response) => {
  3156. if (response.msg !== 'fail') {
  3157. this.$notify({ title: '成功', message: '手动同步成功', type: 'success', duration: 2000 })
  3158. this.get_table_dataEasStatusLst()
  3159. this.get_table_data()
  3160. } else {
  3161. this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
  3162. this.get_table_dataEasStatusLst()
  3163. this.get_table_data()
  3164. }
  3165. })
  3166. }).catch(() => {
  3167. this.$message({ type: 'info', message: '已取消手动同步' })
  3168. })
  3169. },
  3170. handleIgnore(row) {
  3171. MessageBox.confirm('是否确认忽略同步此数据?', {
  3172. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  3173. }).then(() => {
  3174. this.requestParam = {}
  3175. this.requestParam.name = 'updatebigpartuseSync'
  3176. this.requestParam.parammaps = {}
  3177. this.requestParam.parammaps.issync = '3'
  3178. this.requestParam.parammaps.id = row.id
  3179. PostDataByName(this.requestParam).then((response) => {
  3180. if (response.msg !== 'fail') {
  3181. this.$notify({ title: '成功', message: '忽略同步成功', type: 'success', duration: 2000 })
  3182. this.get_table_dataEasStatusLst()
  3183. this.get_table_data()
  3184. } else {
  3185. this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
  3186. this.get_table_dataEasStatusLst()
  3187. this.get_table_data()
  3188. }
  3189. })
  3190. }).catch(() => {
  3191. this.$message({ type: 'info', message: '已取消忽略同步' })
  3192. })
  3193. },
  3194. handleDescription() {
  3195. this.description.dialogStatus = 'description'
  3196. this.description.dialogFormVisible = true
  3197. }
  3198. }
  3199. }
  3200. </script>
  3201. <style lang="scss">
  3202. .inputDatetime .el-range-separator{
  3203. padding: 0;
  3204. margin: 0 10px;
  3205. }
  3206. .el-radio__label{
  3207. padding-left: 2px !important;
  3208. }
  3209. .el-form-item__error{padding-top: 0;}
  3210. body .el-table th.gutter {
  3211. display: table-cell !important;
  3212. }
  3213. .el-table{
  3214. width:99.9%;
  3215. }
  3216. </style>
  3217. <style lang="scss" scoped>
  3218. .el-radio{
  3219. margin: 10px 10px;
  3220. }
  3221. .el-form-item__content{
  3222. line-height: 0;
  3223. }
  3224. .app-description{
  3225. display:flex; justify-content: left; align-items: left;font-size: 14px;line-height: 28px;height: 300px;
  3226. .content{
  3227. display:flex;
  3228. }
  3229. }
  3230. </style>