index.vue 148 KB

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