index.vue 136 KB

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