index.vue 116 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642
  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">
  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.laidCode" placeholder="入库单号" style="width: 200px;" class="filter-item" />
  14. <el-date-picker ref="inputDatetime" v-model="getdataListParm.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="结束日期" />
  15. <el-select v-model="getdataListParm.parammaps.laidType" clearable placeholder="入库方式" class="filter-item" style="width: 120px;">
  16. <el-option v-for="item in laidTypes" :key="item.id" :label="item.name" :value="item.id" />
  17. </el-select>
  18. <!-- <el-select v-model="getdataListParm.parammaps.easStatus" style="width: 150px;" clearable placeholder="EAS同步状态" class="filter-item">
  19. <el-option v-for="item in easStatus.easStatusList" :key="item.id" :label="item.name" :value="item.id" />
  20. </el-select> -->
  21. <el-select v-model="getdataListParm.parammaps.sapStatus" style="width: 150px;" clearable placeholder="SAP上传状态" class="filter-item">
  22. <el-option v-for="item in easStatus.sapStatusList" :key="item.id" :label="item.name" :value="item.id" />
  23. </el-select>
  24. <el-select v-model="getdataListParm.parammaps.purchase_type" clearable style="width: 140px;" placeholder="申购状态" class="filter-item">
  25. <el-option v-for="item in subscriptionStatusList" :key="item.id" :label="item.name" :value="item.id" />
  26. </el-select>
  27. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
  28. <div>
  29. <el-button v-if="isStorageAdd" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
  30. <!-- <el-button v-if="isStorageTemplate" v-waves class="filter-item" type="info" icon="el-icon-tickets" @click="handleDownloadTemp"> 模板 </el-button> -->
  31. <el-upload style="display: inline-block;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImportExcel" :on-success="handleImportExcelSuccess">
  32. <el-button v-if="isStorageImport" v-waves class="filter-item" type="warning" icon="el-icon-download">导入</el-button>
  33. </el-upload>
  34. <el-button v-if="isStorageExport" class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-upload2" @click="handleDownload">导出</el-button>
  35. <!-- <el-button v-if="isStorageExportEAS" class="filter-item" style="margin-left: 10px;" type="danger" icon="el-icon-upload2" @click="handleDownloadEas1">导出EAS</el-button> -->
  36. <!-- <el-button v-if="isEasSynchronization" class="filter-item" type="primary" style="float: right;" @click="handleEAS">EAS同步</el-button> -->
  37. <el-button v-if="isStorageSap" class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-upload2" @click="sapUpload">SAP上传</el-button>
  38. </div>
  39. </div>
  40. <el-table
  41. :key="tableKey"
  42. v-loading="listLoading"
  43. element-loading-text="给我一点时间"
  44. :data="list"
  45. border
  46. fit
  47. highlight-current-row
  48. style="width: 100%;"
  49. :row-style="rowStyle"
  50. :cell-style="cellStyle"
  51. class="elTable table-fixed"
  52. @selection-change="change_table_selection"
  53. @current-change="handleCurrentChange"
  54. :max-height="myHeight"
  55. >
  56. <el-table-column type="selection" :selectable="checkboxInit" align="center" width="50" />
  57. <el-table-column label="序号" align="center" type="index" width="50px">
  58. <template slot-scope="scope">
  59. <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
  60. </template>
  61. </el-table-column>
  62. <el-table-column label="入库单号" align="center" min-width="110px">
  63. <template slot-scope="scope">
  64. <span>{{ scope.row.laidCode }}</span>
  65. </template>
  66. </el-table-column>
  67. <el-table-column label="牧场" min-width="130px" align="center">
  68. <template slot-scope="scope">
  69. <span>{{ scope.row.pastureName }}</span><br>
  70. </template>
  71. </el-table-column>
  72. <el-table-column label="供应商" min-width="110px" align="center">
  73. <template slot-scope="scope">
  74. <span>{{ scope.row.providerName }}</span><br>
  75. </template>
  76. </el-table-column>
  77. <el-table-column label="备件种类数" sortable prop="partKind" align="center" min-width="110px">
  78. <template slot-scope="scope">
  79. <span>{{ scope.row.partKind }}</span>
  80. </template>
  81. </el-table-column>
  82. <el-table-column label="入库方式" align="center" min-width="110px" :formatter="laidType" />>
  83. <el-table-column label="录入人" min-width="130px" align="center">
  84. <template slot-scope="scope">
  85. <span>{{ scope.row.empname }}</span><br>
  86. </template>
  87. </el-table-column>
  88. <el-table-column label="入库日期" sortable prop="creatTime" min-width="110px" align="center" />
  89. <!-- <el-table-column label="EAS同步状态" min-width="120px" align="center">
  90. <template slot-scope="scope">
  91. <span>{{ scope.row.easStatus }}</span>
  92. </template>
  93. </el-table-column> -->
  94. <el-table-column prop="ProofCode" label="sap编码" min-width="80px" align="center">
  95. <template slot-scope="scope">
  96. <span>{{scope.row.ProofCode}}</span>
  97. </template>
  98. </el-table-column>
  99. <el-table-column prop="ProofCode" label="sap上传状态" min-width="80px" align="center">
  100. <template slot-scope="scope">
  101. <span v-if="scope.row.ProofCode">已上传</span>
  102. <span v-else>未上传</span>
  103. </template>
  104. </el-table-column>
  105. <el-table-column prop="sterilisation" label="冲销状态" min-width="80px" align="center">
  106. <template slot-scope="scope">
  107. <span v-if="scope.row.sterilisation == 1">已冲销</span>
  108. <span v-if="scope.row.sterilisation == 2">部分冲销</span>
  109. <span v-else>未冲销</span>
  110. </template>
  111. </el-table-column>
  112. <el-table-column label="申购状态" min-width="80px" align="center">
  113. <template slot-scope="scope">
  114. <span v-if="scope.row.purchase_type == 1">暂估</span>
  115. <span v-else-if="scope.row.purchase_type == 3">赠品</span>
  116. <span v-else>正常</span>
  117. </template>
  118. </el-table-column>
  119. <el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width" fixed="right">
  120. <template slot-scope="{row}">
  121. <el-button v-if="isStorageSee" type="primary" size="mini" @click="form_see(row)">查看</el-button>
  122. <!-- <el-button v-if="isStorageSee" type="success" size="mini" @click="form_edit(row)">编辑</el-button> -->
  123. <el-button v-if="isStorageDelete && row.laidType !== 2" style="display:inline-block" type="danger" size="mini" @click="handleDelate(row)">删除</el-button>
  124. <el-button v-else style="display:none" type="danger" size="mini" @click="handleDelate(row)">删除</el-button>
  125. </template>
  126. </el-table-column>
  127. </el-table>
  128. <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="get_table_data" />
  129. </el-tab-pane>
  130. <el-tab-pane label="入库记录" name="second">
  131. <div class="filter-container">
  132. <el-select v-model="getdataListParm2.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item">
  133. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
  134. </el-select>
  135. <el-input v-model="getdataListParm2.parammaps.laidCode" placeholder="入库单号" style="width: 200px;" class="filter-item" />
  136. <el-input v-model="getdataListParm2.parammaps.partCode" placeholder="备件编号" style="width: 200px;" class="filter-item" />
  137. <el-input v-model="getdataListParm2.parammaps.partName" placeholder="备件名称" style="width: 200px;" class="filter-item" />
  138. <el-select v-model="getdataListParm2.parammaps.providerId" filterable clearable style="width: 140px;" placeholder="供应商" class="filter-item">
  139. <el-option v-for="item in findAllProvider2" :key="item.id" :label="item.name" :value="item.id" />
  140. </el-select>
  141. <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="结束日期" />
  142. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search2">搜索</el-button>
  143. </div>
  144. <el-table
  145. :key="tableKey2"
  146. v-loading="listLoading2"
  147. element-loading-text="给我一点时间"
  148. :data="list2"
  149. border
  150. fit
  151. highlight-current-row
  152. style="width: 100%;"
  153. :row-style="rowStyle"
  154. :cell-style="cellStyle"
  155. class="elTable table-fixed"
  156. @sort-change="tableSort"
  157. :max-height="myHeight"
  158. >
  159. <el-table-column label="序号" align="center" type="index" width="50px">
  160. <template slot-scope="scope">
  161. <span>{{ scope.$index + (pageNum2-1) * pageSize2 + 1 }}</span>
  162. </template>
  163. </el-table-column>
  164. <el-table-column label="牧场" min-width="130px" align="center">
  165. <template slot-scope="scope">
  166. <span>{{ scope.row.pastureName }}</span><br>
  167. </template>
  168. </el-table-column>
  169. <el-table-column label="入库单号" align="center" min-width="150px">
  170. <template slot-scope="scope">
  171. <span>{{ scope.row.laidCode }}</span>
  172. </template>
  173. </el-table-column>
  174. <el-table-column label="备件编号" min-width="150px" align="center">
  175. <template slot-scope="scope">
  176. <span>{{ scope.row.partCode }}</span><br>
  177. </template>
  178. </el-table-column>
  179. <el-table-column label="备件名称" align="center" min-width="150px">
  180. <template slot-scope="scope">
  181. <span>{{ scope.row.partName }}</span>
  182. </template>
  183. </el-table-column>
  184. <el-table-column label="备件规格" min-width="130px" align="center">
  185. <template slot-scope="scope">
  186. <span>{{ scope.row.specification }}</span><br>
  187. </template>
  188. </el-table-column>
  189. <el-table-column label="备件品牌" min-width="130px" align="center">
  190. <template slot-scope="scope">
  191. <span>{{ scope.row.brandName }}</span><br>
  192. </template>
  193. </el-table-column>
  194. <el-table-column label="计量单位" align="center" min-width="100px">
  195. <template slot-scope="scope">
  196. <span>{{ scope.row.unit }}</span>
  197. </template>
  198. </el-table-column>
  199. <el-table-column label="供应商" min-width="130px" align="center">
  200. <template slot-scope="scope">
  201. <span>{{ scope.row.providerName }}</span><br>
  202. </template>
  203. </el-table-column>
  204. <el-table-column label="库位" align="center" min-width="130px">
  205. <template slot-scope="scope">
  206. <span>{{ scope.row.warehoseCode }}</span>
  207. </template>
  208. </el-table-column>
  209. <el-table-column sortable prop="storageAmount" label="入库数量" min-width="90px" align="center">
  210. <template slot-scope="scope">
  211. <span>{{ scope.row.storageAmount }}</span><br>
  212. </template>
  213. </el-table-column>
  214. <el-table-column sortable prop="price" label="单价" min-width="90px" align="center">
  215. <template slot-scope="scope">
  216. <span>{{ scope.row.price }}</span><br>
  217. </template>
  218. </el-table-column>
  219. <el-table-column sortable prop="sumPrice" label="总价" min-width="90px" align="center">
  220. <template slot-scope="scope">
  221. <span>{{ scope.row.sumPrice }}</span><br>
  222. </template>
  223. </el-table-column>
  224. <el-table-column label="录入人" align="center" min-width="90px">
  225. <template slot-scope="scope">
  226. <span>{{ scope.row.empname }}</span>
  227. </template>
  228. </el-table-column>
  229. <el-table-column label="入库日期" sortable prop="creatTime" min-width="120px" align="center" />
  230. </el-table>
  231. <pagination v-show="total2>0" :total="total2" :page.sync="getdataListParm2.offset" :limit.sync="getdataListParm2.pagecount" @pagination="get_table_data2" />
  232. </el-tab-pane>
  233. </el-tabs>
  234. <!-- 弹出层新增or修改 -->
  235. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="90%">
  236. <div class="app-add">
  237. <el-form
  238. ref="storage"
  239. :model="storage"
  240. :rules="rules"
  241. label-position="right"
  242. label-width="100px"
  243. style="width: 90%;margin:0 auto;"
  244. >
  245. <el-row>
  246. <el-col :span="8">
  247. <el-form-item label="入库单号:" prop="laidCode">
  248. <el-input ref="laidCode" v-model="storage.laidCode" disabled />
  249. </el-form-item>
  250. </el-col>
  251. <el-col :span="8">
  252. <el-form-item label="牧场:" prop="pastureId">
  253. <el-select v-model="storage.pastureId" placeholder="牧场" class="filter-item" style="width:100%">
  254. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
  255. </el-select>
  256. </el-form-item>
  257. </el-col>
  258. <el-col :span="8">
  259. <el-form-item label="录入人:" prop="employeId">
  260. <el-select v-model="storage.employeId" placeholder="录入人" class="filter-item" style="width:100%">
  261. <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.id" />
  262. </el-select>
  263. </el-form-item>
  264. </el-col>
  265. </el-row>
  266. <el-row>
  267. <el-col :span="8">
  268. <el-form-item label="入库方式:" prop="laidType">
  269. <el-radio-group v-model="storage.laidType" @change="changeStorageType">
  270. <el-radio v-if="isStorageMethod1" v-model="storage.laidType" :label="0" :disabled="dialogStatus==='update'">采购入库</el-radio>
  271. <el-radio v-if="isStorageMethod2" v-model="storage.laidType" :label="1" :disabled="dialogStatus==='update'">手动入库</el-radio>
  272. <el-radio v-if="isStorageMethod3" v-model="storage.laidType" :label="2" :disabled="dialogStatus==='update'">调拨入库</el-radio>
  273. </el-radio-group>
  274. </el-form-item>
  275. </el-col>
  276. <el-col v-if="isProvider" :span="8">
  277. <el-form-item label="供应商" prop="providerId">
  278. <el-select v-model="storage.providerId" filterable placeholder="请选择供应商" :disabled="dialogStatus==='update'" style="width:100%" @change="changeProvider">
  279. <el-option v-for="item in findAllProvider" :key="item.id" clearable :label="item.name" :value="item.id" :disabled="dialogStatus==='update'" />
  280. </el-select>
  281. </el-form-item>
  282. </el-col>
  283. <el-col :span="8">
  284. <el-form-item label="入库日期:" prop="storageTime">
  285. <el-date-picker v-model="storage.storageTime" :picker-options="pickerOptions" type="date" placeholder="入库日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" />
  286. </el-form-item>
  287. </el-col>
  288. </el-row>
  289. <el-row v-if="No1">
  290. <el-col :span="10">
  291. <el-form-item label="采购单号:" prop="buyeCode">
  292. <el-autocomplete ref="buyeCode" v-model="storage.buyeCode" value-key="name" class="inline-input" :fetch-suggestions="buyeCodeSearch" placeholder="请输入采购单号" style="width:550px" @select="handleSelectBuyeCode">
  293. <template slot-scope="{ item }">
  294. <span>{{ item.buyeCode }}</span>
  295. </template>
  296. </el-autocomplete>
  297. </el-form-item>
  298. </el-col>
  299. </el-row>
  300. <el-row v-if="No2">
  301. <el-col :span="16">
  302. <el-form-item label="备件:" prop="partCode">
  303. <el-autocomplete
  304. v-model="orderPart.partCode"
  305. value-key="name"
  306. class="inline-input"
  307. :fetch-suggestions="sparePartSearch"
  308. placeholder="请输入备件编号或备件名称或备件规格"
  309. style="width:100%"
  310. @select="handleSelectSparePart"
  311. >
  312. <template slot-scope="{ item }">
  313. <b>备件编号:</b><div class="name" style="display: inline;">{{ item.partCode }}</div>&nbsp;
  314. | &nbsp;<b>备件名称:</b><span class="addr">{{ item.partName }}</span>&nbsp;
  315. | &nbsp;<b>备件规格:</b><span class="addr">{{ item.specification }}</span>
  316. </template>
  317. </el-autocomplete>
  318. </el-form-item>
  319. </el-col>
  320. </el-row>
  321. <el-row v-if="No3">
  322. <el-col :span="10">
  323. <el-form-item label="调拨单号:" prop="applyCode">
  324. <el-autocomplete v-model="storage.applyCode" value-key="name" class="inline-input" :fetch-suggestions="allocationSearch" placeholder="请输入调拨单号" style="width:550px" @select="handleSelectAllocation">
  325. <template slot-scope="{ item }">
  326. <b>调拨单号:</b><div class="name" style="display: inline;">{{ item.applyCode }}</div>&nbsp;
  327. | &nbsp;<b>调出牧场:</b><span class="addr">{{ item.pastureName }}</span>
  328. </template>
  329. </el-autocomplete>
  330. </el-form-item>
  331. </el-col>
  332. </el-row>
  333. </el-form>
  334. <h5 style="float:right;margin-top:10px;margin-left:10px;">总金额:{{ TotalAmount }}</h5>
  335. <el-button v-if="storage.laidType == '0'" style="float:right;" type="danger" size="mini" @click="handleEmptySpareParts()">删除空备件</el-button>
  336. <el-table
  337. :key="tableKey"
  338. v-loading="listLoading"
  339. element-loading-text="给我一点时间"
  340. :data="listAdd"
  341. border
  342. fit
  343. highlight-current-row
  344. style="width: 100%;margin-bottom:30px"
  345. :row-style="rowStyle"
  346. :cell-style="cellStyle"
  347. class="elTable table-fixed"
  348. >
  349. <!-- table表格 -->
  350. <el-table-column type="index" label="序号" align="center" width="50px" />
  351. <el-table-column :key="1" label="备件编号" min-width="90px" prop="partCode" align="center">
  352. <template slot-scope="scope">
  353. <span>{{ scope.row.partCode }}</span>
  354. </template>
  355. </el-table-column>
  356. <el-table-column :key="2" label="备件名称" min-width="80px" align="center">
  357. <template slot-scope="scope">
  358. <span>{{ scope.row.partName }}</span><br>
  359. </template>
  360. </el-table-column>
  361. <el-table-column :key="3" label="备件规格" prop="specification" align="center" min-width="60">
  362. <template slot-scope="scope">
  363. <span>{{ scope.row.specification }}</span>
  364. </template>
  365. </el-table-column>
  366. <el-table-column :key="4" label="备件图片" prop="specifications" align="center" min-width="60">
  367. <template slot-scope="scope">
  368. <el-popover placement="right" title="" trigger="hover">
  369. <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
  370. <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  371. </el-popover>
  372. </template>
  373. </el-table-column>
  374. <el-table-column :key="5" label="备件品牌" prop="brand" align="center" min-width="80">
  375. <template slot-scope="scope">
  376. <span>{{ scope.row.brand }}</span>
  377. </template>
  378. </el-table-column>
  379. <el-table-column v-if="isWarehoseCodeAllo" :key="6" label="供应商" prop="brand" align="center" min-width="80">
  380. <template slot-scope="scope">
  381. <span>{{ scope.row.providerName }}</span>
  382. </template>
  383. </el-table-column>
  384. <el-table-column :key="7" label="计量单位" prop="unit" align="center" min-width="60">
  385. <template slot-scope="scope">
  386. <span>{{ scope.row.unit }}</span>
  387. </template>
  388. </el-table-column>
  389. <el-table-column v-if="isWarehoseCode" :key="8" label="库位" prop="warehoseCode" align="center" min-width="150">
  390. <template slot-scope="scope">
  391. <el-autocomplete
  392. v-model="scope.row.warehoseCode"
  393. class="inline-input"
  394. :fetch-suggestions="querySearchWarehoseCode"
  395. value-key="warehoseCode"
  396. placeholder="库位"
  397. @select="(value)=>
  398. {handleSelectWarehoseCode(value, scope.row)}"
  399. @blur="(value)=>{blurWarehoseCode(value, scope.row)}"
  400. />
  401. </template>
  402. </el-table-column>
  403. <el-table-column v-if="isWarehoseCodeAllo" :key="9" label="库位" prop="warehoseCode" align="center" min-width="150">
  404. <template slot-scope="scope">
  405. <el-autocomplete
  406. v-model="scope.row.warehoseCode"
  407. class="inline-input"
  408. :fetch-suggestions="querySearchWarehoseCodeAllo"
  409. value-key="warehoseCode"
  410. placeholder="库位"
  411. @select="(value)=>
  412. {handleSelectWarehoseCodeAllo(value, scope.row)}"
  413. @blur="(value)=>{blurWarehoseCodeAllo(value, scope.row)}"
  414. />
  415. </template>
  416. </el-table-column>
  417. <el-table-column v-if="No1" :key="10" label="采购数量" min-width="60px" align="center">
  418. <template slot-scope="scope">
  419. <span>{{ scope.row.amount }}</span>
  420. </template>
  421. </el-table-column>
  422. <el-table-column v-if="No1" :key="11" label="已入库数量" prop="receiveAmount" align="center" min-width="70">
  423. <template slot-scope="scope">
  424. <span>{{ scope.row.receiveAmount }}</span>
  425. </template>
  426. </el-table-column>
  427. <el-table-column v-if="No1" :key="12" valign="middle" label="本次入库数量" min-width="90px" align="center">
  428. <template slot-scope="scope">
  429. <el-form :model="scope.row" :rules="rules">
  430. <el-form-item prop="reportery">
  431. <el-input ref="reportery1" v-model="scope.row.reportery" style="margin-top:15px" @blur="blurReportery" />
  432. </el-form-item>
  433. </el-form>
  434. </template>
  435. </el-table-column>
  436. <el-table-column v-if="No2" :key="13" label="本次入库数量" valign="middle" min-width="90px" align="center">
  437. <template slot-scope="scope">
  438. <el-form :model="scope.row" :rules="rules">
  439. <el-form-item prop="reportery">
  440. <el-input ref="reportery" v-model="scope.row.reportery" style="margin-top:15px" @blur="blurReportery" />
  441. </el-form-item>
  442. </el-form>
  443. </template>
  444. </el-table-column>
  445. <el-table-column v-if="No3" :key="14" ref="price" valign="middle" label="调拨数量" prop="price" align="center" min-width="100">
  446. <template slot-scope="scope">
  447. <span>{{ scope.row.amount }}</span>
  448. </template>
  449. </el-table-column>
  450. <el-table-column v-if="No3" :key="15" ref="price" valign="middle" label="入库数量" prop="price" align="center" min-width="100">
  451. <template slot-scope="scope">
  452. <span>{{ scope.row.amount }}</span>
  453. </template>
  454. </el-table-column>
  455. <el-table-column :key="16" label="单价" prop="price" align="center" min-width="100">
  456. <template slot-scope="scope">
  457. <span >{{ scope.row.price }}</span>
  458. <!-- <el-form v-if="isPriceInput" :model="scope.row" :rules="rules">
  459. <el-form-item prop="price">
  460. <el-input ref="price" v-model="scope.row.price" :disabled="storage.laidType == 0" style="margin-top:15px" />
  461. <el-input ref="price" v-model="scope.row.price" style="margin-top:15px" />
  462. </el-form-item>
  463. </el-form> -->
  464. </template>
  465. </el-table-column>
  466. <el-table-column v-if="isSumPrice" :key="17" ref="sumPrice" label="总价" prop="sumPrice" align="center" min-width="70">
  467. <template slot-scope="scope">
  468. <span>{{ (scope.row.sumPrice = scope.row.price * parseFloat(scope.row.reportery)) | keepTwoNum }}</span>
  469. </template>
  470. </el-table-column>
  471. <el-table-column v-if="No3" :key="18" ref="sumPrice" label="总价" prop="sumPrice" align="center" min-width="70">
  472. <template slot-scope="scope">
  473. <span>{{ scope.row.sumPrice }}</span>
  474. </template>
  475. </el-table-column>
  476. <el-table-column v-if="isDel" label="操作" align="center" width="100" class-name="small-padding fixed-width" fixed="right">
  477. <template slot-scope="{row}">
  478. <a class="del" @click="partDelete(row)">删除</a>
  479. </template>
  480. </el-table-column>
  481. </el-table>
  482. <el-form
  483. ref="temp"
  484. :rules="rules"
  485. :model="temp"
  486. label-position="right"
  487. label-width="100px"
  488. style="width: 800px; margin-left:50px;"
  489. />
  490. <div slot="footer" class="dialog-footer" style="bottom:10px">
  491. <el-button type="primary" :disabled="isokDisable" @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()">保存并关闭</el-button>
  492. <el-button @click="dialogFormVisible = false;get_table_data()">取消并关闭</el-button>
  493. </div>
  494. </div>
  495. </el-dialog>
  496. <!-- 查看-->
  497. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_See" :close-on-click-modal="false" width="90%">
  498. <div class="app-see">
  499. <el-form ref="seeTemp" :rules="rules" :model="seeTemp" label-position="right" label-width="100px" style="width: 90%;margin:0 auto;">
  500. <el-row>
  501. <el-col :span="8">
  502. <el-form-item label="入库单号:" prop="laidCode">
  503. <el-input ref="laidCode" v-model="seeTemp.laidCode" disabled />
  504. </el-form-item>
  505. </el-col>
  506. <el-col :span="8">
  507. <el-form-item label="牧场:" prop="pastureName">
  508. <el-input ref="pastureName" v-model="seeTemp.pastureName" disabled />
  509. </el-form-item>
  510. </el-col>
  511. <el-col :span="8">
  512. <el-form-item label="录入人:" prop="employeId">
  513. <el-input ref="empname" v-model="seeTemp.empname" disabled />
  514. </el-form-item>
  515. </el-col>
  516. </el-row>
  517. <el-row>
  518. <el-col :span="8">
  519. <el-form-item label="入库方式:" prop="laidType">
  520. <el-radio-group v-model="seeTemp.laidType">
  521. <el-radio v-model="seeTemp.laidType" :label="0" disabled>采购入库</el-radio>
  522. <el-radio v-model="seeTemp.laidType" :label="1" disabled>手动入库</el-radio>
  523. <el-radio v-model="seeTemp.laidType" :label="2" disabled>调拨入库</el-radio>
  524. </el-radio-group>
  525. </el-form-item>
  526. </el-col>
  527. <el-col v-if="isProvider" :span="8">
  528. <el-form-item label="供应商:" prop="providerName">
  529. <el-input ref="providerName" v-model="seeTemp.providerName" disabled />
  530. </el-form-item>
  531. </el-col>
  532. <el-col :span="8">
  533. <el-form-item label="入库日期:" prop="seeTemp">
  534. <el-input ref="storageTime" v-model="seeTemp.creatTime" disabled />
  535. </el-form-item>
  536. </el-col>
  537. </el-row>
  538. <el-row>
  539. <el-col v-if="No1" :span="8">
  540. <el-form-item label="采购单号:" prop="purchaseId">
  541. <el-input ref="purchaseId" v-model="seeTemp.purchaseId" disabled />
  542. </el-form-item>
  543. </el-col>
  544. </el-row>
  545. </el-form>
  546. <h5 style="float:right;">总金额:{{ TotalAmount }}</h5>
  547. <el-table
  548. :key="tableKey"
  549. v-loading="listLoadingSee"
  550. element-loading-text="给我一点时间"
  551. :data="listSee"
  552. border
  553. fit
  554. highlight-current-row
  555. style="width: 100%;margin-bottom:30px"
  556. :row-style="rowStyle"
  557. :cell-style="cellStyle"
  558. class="elTable table-fixed"
  559. @sort-change="tableSort"
  560. >
  561. <el-table-column type="index" label="序号" align="center" width="50px" />
  562. <el-table-column label="备件编号" min-width="80px" prop="partCode" align="center">
  563. <template slot-scope="scope">
  564. <span>{{ scope.row.partCode }}</span>
  565. </template>
  566. </el-table-column>
  567. <el-table-column label="备件名称" min-width="60px" align="center">
  568. <template slot-scope="scope">
  569. <span>{{ scope.row.partName }}</span><br>
  570. </template>
  571. </el-table-column>
  572. <el-table-column label="备件规格" prop="specification" align="center" min-width="90">
  573. <template slot-scope="scope">
  574. <span>{{ scope.row.specification }}</span>
  575. </template>
  576. </el-table-column>
  577. <el-table-column label="备件图片" prop="specifications" align="center" min-width="110px">
  578. <template slot-scope="scope">
  579. <el-popover placement="right" title="" trigger="hover">
  580. <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
  581. <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  582. </el-popover>
  583. </template>
  584. </el-table-column>
  585. <el-table-column label="备件品牌" prop="brandName" align="center" min-width="80">
  586. <template slot-scope="scope">
  587. <span>{{ scope.row.brandName }}</span>
  588. </template>
  589. </el-table-column>
  590. <el-table-column v-if="isWarehoseCodeAllo" label="供应商" prop="brandName" align="center" min-width="80">
  591. <template slot-scope="scope">
  592. <span>{{ scope.row.providerName }}</span>
  593. </template>
  594. </el-table-column>
  595. <el-table-column label="计量单位" prop="unit" align="center" min-width="60">
  596. <template slot-scope="scope">
  597. <span>{{ scope.row.unit }}</span>
  598. </template>
  599. </el-table-column>
  600. <el-table-column label="库位" prop="warehoseCode" align="center" min-width="80">
  601. <template slot-scope="scope">
  602. <span>{{ scope.row.warehoseCode }}</span>
  603. </template>
  604. </el-table-column>
  605. <el-table-column v-if="No1" sortable prop="buyAmount" label="采购数量" min-width="60px" align="center">
  606. <template slot-scope="scope">
  607. <span>{{ scope.row.buyAmount }}</span>
  608. </template>
  609. </el-table-column>
  610. <el-table-column v-if="No1" sortable label="已入库数量" prop="receivedAmount" align="center" min-width="70">
  611. <template slot-scope="scope">
  612. <span>{{ scope.row.receivedAmount }}</span>
  613. </template>
  614. </el-table-column>
  615. <el-table-column v-if="No1" :key="5" sortable prop="storageAmount" label="本次入库数量" min-width="70px" align="center">
  616. <template slot-scope="scope">
  617. <span>{{ scope.row.storageAmount }}</span>
  618. </template>
  619. </el-table-column>
  620. <el-table-column v-if="No2" :key="6" sortable prop="storageAmount" label="本次入库数量" min-width="70px" align="center">
  621. <template slot-scope="scope">
  622. <span>{{ scope.row.storageAmount }}</span>
  623. </template>
  624. </el-table-column>
  625. <el-table-column v-if="No3" :key="7" ref="price" sortable prop="storageAmount" valign="middle" label="调拨数量" align="center" min-width="100">
  626. <template slot-scope="scope">
  627. <span>{{ scope.row.storageAmount }}</span>
  628. </template>
  629. </el-table-column>
  630. <el-table-column v-if="No3" :key="8" ref="price" sortable prop="storageAmount" valign="middle" label="入库数量" align="center" min-width="100">
  631. <template slot-scope="scope">
  632. <span>{{ scope.row.storageAmount }}</span>
  633. </template>
  634. </el-table-column>
  635. <el-table-column :key="9" sortable label="单价" prop="price" align="center" min-width="60">
  636. <template slot-scope="scope">
  637. <span>{{ scope.row.price }}</span>
  638. <!-- <el-input v-model="scope.row.price" style="margin-top:15px" disabled /> -->
  639. </template>
  640. </el-table-column>
  641. <el-table-column :key="10" sortable label="总价" prop="sumPrice" align="center" min-width="60">
  642. <template slot-scope="scope">
  643. <span>{{ scope.row.sumPrice }}</span>
  644. </template>
  645. </el-table-column>
  646. <el-table-column :key="11" prop="dflag" label="冲销状态" min-width="80px" align="center">
  647. <template slot-scope="scope">
  648. <span v-if="scope.row.dflag == 1">已冲销</span>
  649. <span v-else>未冲销</span>
  650. </template>
  651. </el-table-column>
  652. </el-table>
  653. <el-form
  654. ref="temp"
  655. :rules="rules"
  656. :model="temp"
  657. label-position="right"
  658. label-width="100px"
  659. style="width: 800px; margin-left:50px;"
  660. />
  661. <div slot="footer" class="dialog-footer" style="margin-bottom:-25px;">
  662. <el-button @click="dialogFormVisible_See = false">关闭</el-button>
  663. </div>
  664. </div>
  665. </el-dialog>
  666. <!-- EAS同步 -->
  667. <el-dialog :title="textMap[easStatus.dialogStatus]" :visible.sync="easStatus.dialogFormVisible" :close-on-click-modal="false" width="80%">
  668. <div class="easStatus">
  669. <el-table
  670. :key="easStatus.tableKey"
  671. v-loading="easStatus.listLoading"
  672. element-loading-text="给我一点时间"
  673. :data="easStatus.list"
  674. border
  675. fit
  676. highlight-current-row
  677. style="width: 100%;"
  678. :row-style="rowStyle"
  679. :cell-style="cellStyle"
  680. class="elTable table-fixed"
  681. >
  682. <el-table-column label="序号" align="center" type="index" width="50px">
  683. <template slot-scope="scope">
  684. <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
  685. </template>
  686. </el-table-column>
  687. <el-table-column label="入库单号" min-width="110px" align="center" prop="laidCode" />
  688. <el-table-column label="牧场" min-width="110px" align="center" prop="pastureName" />
  689. <el-table-column label="供应商" min-width="110px" align="center" prop="providerName" />
  690. <el-table-column label="录入人" min-width="110px" align="center" prop="empName" />
  691. <el-table-column label="入库日期" min-width="110px" align="center" prop="createTime" />
  692. <el-table-column label="失败原因" min-width="110px" align="center" prop="failReason" />
  693. <el-table-column label="操作" align="center" width="300px" class-name="small-padding fixed-width" fixed="right">
  694. <template slot-scope="{row}">
  695. <el-button v-if="isManualSynchronization" type="primary" size="mini" style="width:70px;" @click="handleManual(row)">手动同步</el-button>
  696. <el-button v-if="isCloseSynchronization" type="danger" size="mini" style="width:70px;" @click="handleClose(row)">关闭同步</el-button>
  697. <el-button v-if="isIgnoreSynchronization" type="danger" size="mini" style="width:70px;" @click="handleIgnore(row)">忽略同步</el-button>
  698. </template>
  699. </el-table-column>
  700. </el-table>
  701. <pagination v-show="easStatus.total>0" :total="easStatus.total" :page.sync="easStatus.getdataListParm.offset" :limit.sync="easStatus.getdataListParm.pagecount" @pagination="get_table_dataEasStatusLst" />
  702. </div>
  703. <div slot="footer" class="dialog-footer" style="bottom: 10px;">
  704. <el-button @click="easStatus.dialogFormVisible = false;get_table_data()">关闭</el-button>
  705. </div>
  706. </el-dialog>
  707. </div>
  708. </template>
  709. <script>
  710. // 引入
  711. // eslint-disable-next-line no-unused-vars
  712. import { GetDataByName, GetDataByNames, PostDataByName, ExecDataByConfig, checkButtons, GetAccount, EasSync,SapLaid } from '@/api/common'
  713. import waves from '@/directive/waves' // waves directive
  714. import { parseTime, sortChange, json2excel } from '@/utils/index.js'
  715. // eslint-disable-next-line no-unused-vars
  716. import { validateEMail } from '@/utils/validate.js'
  717. import Pagination from '@/components/Pagination' // secondary package based on el-pagination
  718. import { MessageBox } from 'element-ui'
  719. import Cookies from 'js-cookie'
  720. import { getToken } from '@/utils/auth'
  721. export default {
  722. name: 'Storage',
  723. components: { Pagination },
  724. directives: { waves },
  725. filters: {
  726. keepTwoNum(value) {
  727. value = Number(value)
  728. return value.toFixed(3)
  729. }
  730. },
  731. data() {
  732. return {
  733. myHeight:document.documentElement.clientHeight - 85- 250,
  734. isSap:1,
  735. isSrm:1,
  736. selectList: [],
  737. currentRow:{},
  738. orderAAA: {},
  739. temp: {},
  740. // 校验规则
  741. isStorageSap:[],
  742. // --------------------------------------
  743. isStorageAdd: [], isStorageTemplate: [], isStorageImport: [], isStorageExport: [], isStorageExportEAS: [], isStorageSee: [], isStorageDelete: [], isStorageMethod1: [], isStorageMethod2: [], isStorageMethod3: [],
  744. isEasSynchronization: [], isManualSynchronization: [], isCloseSynchronization: [], isIgnoreSynchronization: [],
  745. rules: {
  746. providerId: [{ required: true, message: '必填', trigger: 'blur' }]
  747. },
  748. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  749. cellStyle: { padding: 0 + 'px' },
  750. laidTypes: [{ id: '0', name: '采购入库' }, { id: '1', name: '手动入库' }, { id: '2', name: '调拨入库' }],
  751. findAllProvider: [],
  752. findAllProvider2: [],
  753. findAllPasture: [],
  754. findAllEmploye: [],
  755. getDictByName: [],
  756. requestParams: [
  757. { name: 'findAllProviderByCt', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
  758. { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
  759. { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
  760. { name: 'getDictByName', offset: 0, pagecount: 0, params: ['资产状态'] },
  761. { name: 'findAllProvider', offset: 0, pagecount: 0, params: [] }
  762. ],
  763. pickerOptions: {
  764. disabledDate(time) {
  765. return time.getTime() > Date.now()// 当天之前的时间可选
  766. }
  767. },
  768. subscriptionStatusList:[{id:0,name:'正常'},{id:1,name:'暂估'},{id:3,name:'赠品'}],//申购状态
  769. dialogFormVisible: false,
  770. dialogFormVisible_See: false,
  771. dialogStatus: '',
  772. textMap: {
  773. see: '查看详情',
  774. update: '编辑',
  775. create: '新增',
  776. easStatus: 'EAS同步—同步失败数据'
  777. },
  778. No1: true,
  779. No2: false,
  780. No3: false,
  781. isProvider: true,
  782. isDel: true,
  783. isWarehoseCode: true,
  784. isWarehoseCodeAllo: false,
  785. isSumPrice: true,
  786. requestAllocation: {
  787. name: 'getTransferCodeRK',
  788. returntype: 'Map',
  789. parammaps: {
  790. applyCode: '',
  791. pastureId: this.$store.state.user.pastureid
  792. }
  793. },
  794. getAllocationListParm: {
  795. name: 'getPartTransferbybigid',
  796. returntype: 'Map',
  797. parammaps: {}
  798. },
  799. disabled: false,
  800. isokDisable: false,
  801. tableKey: 0,
  802. total: 0,
  803. listLoading: true,
  804. list: [],
  805. getdataListParm: {
  806. name: 'getBigStockLaidList',
  807. page: 1,
  808. offset: 1,
  809. pagecount: 10,
  810. returntype: 'Map',
  811. parammaps: {
  812. laidNumber: '',
  813. inputDatetime: '',
  814. pastureName: Cookies.get('pasturename'),
  815. easStatus: '',
  816. sapStatus:'',
  817. purchase_type:''
  818. }
  819. },
  820. activeName: 'first',
  821. tableKey2: 0,
  822. listLoading2: true,
  823. total2: 0,
  824. list2: [],
  825. getdataListParm2: {
  826. name: 'getPartlaideDetailList',
  827. page: 1,
  828. offset: 1,
  829. pagecount: 10,
  830. returntype: 'Map',
  831. parammaps: {
  832. inputDatetime: '',
  833. laidCode: '',
  834. stopTime: '',
  835. startTime: '',
  836. partCode: '',
  837. partName: '',
  838. providerId: '',
  839. pastureName: Cookies.get('pasturename')
  840. }
  841. },
  842. requestParam: {
  843. name: 'downloadPartlaideList',
  844. parammaps: {
  845. pastureName: Cookies.get('pasturename'),
  846. inputDatetime: ''
  847. }
  848. },
  849. downList: [],
  850. listLoadingSee: true,
  851. listSee: [],
  852. totalSee: 0,
  853. seeTemp: {},
  854. getdataListSee: {
  855. name: 'getpartLaidListBybig',
  856. returntype: 'Map',
  857. parammaps: {}
  858. },
  859. getParmCreateNumber: {
  860. name: 'autoCreatCode',
  861. page: 0,
  862. offset: 0,
  863. pagecount: 0,
  864. returntype: 'Map',
  865. parammaps: {
  866. pastureId: Cookies.get('pastureid'),
  867. codeType: 'RK'
  868. }
  869. },
  870. storage: {
  871. inCount: 0,
  872. oldVal: 0,
  873. laidType: 0,
  874. providerId: '',
  875. storageTime: parseTime(new Date(), '{y}-{m}-{d}'),
  876. empId: this.$store.state.user.employeid,
  877. pastureId: this.$store.state.user.pastureid
  878. },
  879. TotalAmount: 0,
  880. orderPart: {},
  881. requestSparePart: {
  882. name: 'getPartListByProvider',
  883. page: 1,
  884. offset: 1,
  885. pagecount: 20,
  886. returntype: 'Map',
  887. parammaps: {
  888. pastureId: this.$store.state.user.pastureid
  889. }
  890. },
  891. orderCode: {},
  892. requestBuyeCode: {
  893. name: 'getBuyeCode',
  894. page: 1,
  895. offset: 1,
  896. pagecount: 20,
  897. returntype: 'Map',
  898. parammaps: {
  899. pastureId: Cookies.get('pastureid')
  900. }
  901. },
  902. getBuyDetailListParm: {
  903. name: 'getBuydetailByBig',
  904. returntype: 'Map',
  905. parammaps: {}
  906. },
  907. requeststoreHouse: {
  908. name: 'getWarehouseListByProvider',
  909. page: 1,
  910. offset: 1,
  911. pagecount: 10,
  912. returntype: 'Map',
  913. parammaps: {
  914. pastureId: Cookies.get('pastureid')
  915. }
  916. },
  917. requeststoreHouseAllo: {
  918. name: 'getWarehouselistDB',
  919. page: 1,
  920. offset: 1,
  921. pagecount: 10,
  922. returntype: 'Map',
  923. parammaps: {
  924. pastureId: Cookies.get('pastureid'),
  925. warehoseCode: ''
  926. }
  927. },
  928. warehoseCodeList: [],
  929. listAdd: [],
  930. isPrice: true,
  931. isPriceInput: false,
  932. postDataPramas: {},
  933. rowUpdateData: {},
  934. buttons: [],
  935. isPercentage: false,
  936. percentage: 1,
  937. // EAS同步
  938. easStatus: {
  939. easStatusList: [{ name: '同步成功', id: '1' }, { name: '同步失败', id: '0' }, { name: '关闭同步', id: '2' }],
  940. sapStatusList: [ { name: '所有', id: '0' }, { name: '已上传', id: '1' }, { name: '未上传', id: '2' }],
  941. dialogStatus: '',
  942. dialogFormVisible: false,
  943. tableKey: 0,
  944. total: 0,
  945. listLoading: true,
  946. list: [],
  947. getdataListParm: {
  948. name: 'getbigpartlaidSync',
  949. page: 1,
  950. offset: 1,
  951. pagecount: 10,
  952. returntype: 'Map',
  953. parammaps: {
  954. pastureid: Cookies.get('pastureid')
  955. }
  956. }
  957. }
  958. }
  959. },
  960. computed: {
  961. // 设置请求头
  962. headers() {
  963. return {
  964. // 设置token
  965. // eslint-disable-next-line no-undef
  966. token: getToken()
  967. }
  968. },
  969. uploadData() {
  970. return {
  971. name: 'importStockLaid',
  972. importParams: '牧场,入库单编号,入库日期,物料编码,品名,规格型号,品牌,计量单位,数量,单价,总价,库位,供应商',
  973. sheetname: 'SheetJS'
  974. }
  975. },
  976. // 设置上传地址
  977. uploadExcelUrl() {
  978. // process.env.VUE_APP_BASE_API是服务器的路径,也是axios的基本路径
  979. return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
  980. }
  981. },
  982. watch: {
  983. listAdd: {
  984. deep: true,
  985. handler: function (item) {
  986. this.listAdd.forEach(function(i){
  987. if(parseInt(i.reportery) > (parseInt(i.amount)-parseInt(i.receiveAmount))){
  988. i.reportery = parseInt(i.amount)-parseInt(i.receiveAmount)
  989. }
  990. })
  991. }
  992. },
  993. },
  994. created() {
  995. this.get_select_list()
  996. this.get_table_data()
  997. this.get_table_data2()
  998. const that = this
  999. GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
  1000. that.buttons = response.data.list
  1001. that.get_auto_buttons()
  1002. })
  1003. },
  1004. methods: {
  1005. tableSort(column) {
  1006. if (this.activeName == 'second') {
  1007. sortChange(column, this.list2)
  1008. } else if (this.activeName == 'first') {
  1009. sortChange(column, this.listSee)
  1010. }
  1011. },
  1012. get_auto_buttons() {
  1013. // 新增
  1014. const StorageSap = 'customs:storage:sap'
  1015. const isStorageSap = checkButtons(this.$store.state.user.buttons, StorageSap)
  1016. this.isStorageSap = isStorageSap
  1017. const StorageAdd = 'customs:storage:add'
  1018. const isStorageAdd = checkButtons(this.$store.state.user.buttons, StorageAdd)
  1019. this.isStorageAdd = isStorageAdd
  1020. const StorageTemplate = 'customs:storage:template'
  1021. const isStorageTemplate = checkButtons(this.$store.state.user.buttons, StorageTemplate)
  1022. this.isStorageTemplate = isStorageTemplate
  1023. const StorageImport = 'customs:storage:import'
  1024. const isStorageImport = checkButtons(this.$store.state.user.buttons, StorageImport)
  1025. this.isStorageImport = isStorageImport
  1026. const StorageExport = 'customs:storage:export'
  1027. const isStorageExport = checkButtons(this.$store.state.user.buttons, StorageExport)
  1028. this.isStorageExport = isStorageExport
  1029. const StorageExportEAS = 'customs:storage:exportEAS'
  1030. const isStorageExportEAS = checkButtons(this.$store.state.user.buttons, StorageExportEAS)
  1031. this.isStorageExportEAS = isStorageExportEAS
  1032. const StorageSee = 'customs:storage:see'
  1033. const isStorageSee = checkButtons(this.$store.state.user.buttons, StorageSee)
  1034. this.isStorageSee = isStorageSee
  1035. const StorageDelete = 'customs:storage:delete'
  1036. const isStorageDelete = checkButtons(this.$store.state.user.buttons, StorageDelete)
  1037. this.isStorageDelete = isStorageDelete
  1038. const StorageMethod1 = 'customs:storage:method1'
  1039. const isStorageMethod1 = checkButtons(this.$store.state.user.buttons, StorageMethod1)
  1040. this.isStorageMethod1 = isStorageMethod1
  1041. const StorageMethod2 = 'customs:storage:method2'
  1042. const isStorageMethod2 = checkButtons(this.$store.state.user.buttons, StorageMethod2)
  1043. this.isStorageMethod2 = isStorageMethod2
  1044. const StorageMethod3 = 'customs:storage:method3'
  1045. const isStorageMethod3 = checkButtons(this.$store.state.user.buttons, StorageMethod3)
  1046. this.isStorageMethod3 = isStorageMethod3
  1047. const EasSynchronization = 'customs:storage:easSynchronization'
  1048. const isEasSynchronization = checkButtons(this.$store.state.user.buttons, EasSynchronization)
  1049. this.isEasSynchronization = isEasSynchronization
  1050. const ManualSynchronization = 'customs:storage:manualSynchronization'
  1051. const isManualSynchronization = checkButtons(this.$store.state.user.buttons, ManualSynchronization)
  1052. this.isManualSynchronization = isManualSynchronization
  1053. const CloseSynchronization = 'customs:storage:closeSynchronization'
  1054. const isCloseSynchronization = checkButtons(this.$store.state.user.buttons, CloseSynchronization)
  1055. this.isCloseSynchronization = isCloseSynchronization
  1056. const IgnoreSynchronization = 'customs:storage:ignoreSynchronization'
  1057. const isIgnoreSynchronization = checkButtons(this.$store.state.user.buttons, IgnoreSynchronization)
  1058. this.isIgnoreSynchronization = isIgnoreSynchronization
  1059. },
  1060. get_select_list() {
  1061. GetDataByNames(this.requestParams).then(response => {
  1062. console.log('下拉框数据', response.data)
  1063. this.findAllProvider = response.data.findAllProviderByCt.list
  1064. this.findAllPasture = response.data.findAllPasture.list
  1065. this.findAllEmploye = response.data.findAllEmploye.list
  1066. this.getDictByName = response.data.getDictByName.list
  1067. this.findAllProvider2 = response.data.findAllProvider.list
  1068. })
  1069. },
  1070. get_table_data() {
  1071. this.listLoading = true
  1072. if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
  1073. this.getdataListParm.parammaps.startTime = this.$refs['inputDatetime'].value[0]
  1074. this.getdataListParm.parammaps.stopTime = this.$refs['inputDatetime'].value[1]
  1075. } else {
  1076. this.getdataListParm.parammaps.startTime = ''
  1077. this.getdataListParm.parammaps.stopTime = ''
  1078. }
  1079. GetDataByName(this.getdataListParm).then(response => {
  1080. console.log('table数据', response.data.list)
  1081. this.list = response.data.list
  1082. this.pageNum = response.data.pageNum
  1083. this.pageSize = response.data.pageSize
  1084. if (response.data.total) {
  1085. this.total = response.data.total
  1086. }
  1087. setTimeout(() => {
  1088. this.listLoading = false
  1089. }, 100)
  1090. })
  1091. },
  1092. handleClick(tab, event) {
  1093. console.log(tab, event)
  1094. if (tab.name === 'second') {
  1095. this.get_table_data2()
  1096. } else {
  1097. this.get_table_data()
  1098. }
  1099. },
  1100. get_table_data2() {
  1101. this.listLoading2 = true
  1102. if (this.$refs['inputDatetime2'] !== undefined && this.$refs['inputDatetime2'].value !== null) {
  1103. this.getdataListParm2.parammaps.startTime = this.$refs['inputDatetime2'].value[0]
  1104. this.getdataListParm2.parammaps.stopTime = this.$refs['inputDatetime2'].value[1]
  1105. } else {
  1106. this.getdataListParm2.parammaps.startTime = ''
  1107. this.getdataListParm2.parammaps.stopTime = ''
  1108. }
  1109. GetDataByName(this.getdataListParm2).then(response => {
  1110. console.log('table数据', response.data.list)
  1111. this.list2 = response.data.list
  1112. this.pageNum2 = response.data.pageNum
  1113. this.pageSize2 = response.data.pageSize
  1114. if (response.data.total) {
  1115. this.total2 = response.data.total
  1116. }
  1117. setTimeout(() => {
  1118. this.listLoading2 = false
  1119. }, 100)
  1120. })
  1121. },
  1122. form_search2() {
  1123. this.listLoading2 = true
  1124. if (this.getdataListParm2.parammaps.inputDatetime === null) {
  1125. this.getdataListParm2.parammaps.inputDatetime = ''
  1126. }
  1127. this.getdataListParm2.offset = 1
  1128. this.get_table_data2()
  1129. },
  1130. laidType: function(cellValue) {
  1131. // console.log(cellValue.isZeroStock)
  1132. if (cellValue.laidType === 0) {
  1133. return '采购入库'
  1134. } else if (cellValue.laidType === 1) {
  1135. return '手动入库'
  1136. } else if (cellValue.laidType === 2) {
  1137. return '调拨入库'
  1138. }
  1139. },
  1140. form_search() {
  1141. console.log('点击了table搜索')
  1142. this.listLoading = true
  1143. if (this.getdataListParm.parammaps.inputDatetime === null) {
  1144. this.getdataListParm.parammaps.inputDatetime = ''
  1145. }
  1146. this.getdataListParm.offset = 1
  1147. this.get_table_data()
  1148. },
  1149. // 查看详情
  1150. form_see(row) {
  1151. this.seeTemp = Object.assign({}, row)
  1152. this.TotalAmount = 0
  1153. console.log('查看上方数据(从table读取)', this.seeTemp)
  1154. this.dialogStatus = 'see'
  1155. this.dialogFormVisible_See = true
  1156. if (this.seeTemp.laidType === 0) {
  1157. this.No1 = true
  1158. this.No2 = false
  1159. this.No3 = false
  1160. this.isProvider = true
  1161. this.isWarehoseCode = true
  1162. this.isSumPrice = true
  1163. this.isWarehoseCodeAllo = false
  1164. this.isDel = true
  1165. } else if (this.seeTemp.laidType === 1) {
  1166. this.No1 = false
  1167. this.No2 = true
  1168. this.No3 = false
  1169. this.isProvider = true
  1170. this.isWarehoseCode = true
  1171. this.isSumPrice = true
  1172. this.isWarehoseCodeAllo = false
  1173. this.isDel = true
  1174. } else if (this.seeTemp.laidType === 2) {
  1175. this.No1 = false
  1176. this.No2 = false
  1177. this.No3 = true
  1178. this.isProvider = false
  1179. this.isWarehoseCode = false
  1180. this.isWarehoseCodeAllo = true
  1181. this.isSumPrice = false
  1182. this.isDel = false
  1183. }
  1184. this.getdataListSee.parammaps.id = row.id
  1185. this.getSeeList()
  1186. },
  1187. getSeeList() {
  1188. GetDataByName(this.getdataListSee).then(response => {
  1189. console.log('查看下方table数据', response.data.list)
  1190. this.listSee = response.data.list
  1191. if (response.data.list !== null) {
  1192. for (let i = 0; i < response.data.list.length; i++) {
  1193. this.TotalAmount += parseFloat(response.data.list[i].sumPrice)
  1194. 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) {
  1195. this.listSee[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  1196. this.listSee[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  1197. } else {
  1198. this.listSee[i].srcpath = ''
  1199. this.listSee[i].picpath = ''
  1200. }
  1201. }
  1202. this.TotalAmount = this.TotalAmount.toFixed(2)
  1203. }
  1204. setTimeout(() => {
  1205. this.listLoadingSee = false
  1206. }, 100)
  1207. })
  1208. },
  1209. resetCreateTemp() {
  1210. this.listAdd = []
  1211. this.storage.inCount = 0
  1212. this.storage.storageTime = parseTime(new Date(), '{y}-{m}-{d}')
  1213. this.storage.providerId = ''
  1214. this.storage.employeId = this.$store.state.user.employeid
  1215. this.storage.departmentId = this.$store.state.user.departmentid
  1216. this.storage.pastureId = this.$store.state.user.pastureid
  1217. this.storage.laidCode = ''
  1218. this.TotalAmount = 0
  1219. },
  1220. form_add() {
  1221. this.resetCreateTemp()
  1222. this.storage.laidCode = ''
  1223. this.dialogStatus = 'create'
  1224. this.dialogFormVisible = true
  1225. this.storage.pastureId = this.$store.state.user.pastureid
  1226. this.storage.employeId = this.$store.state.user.employeid
  1227. console.log(this.storage)
  1228. this.$nextTick(() => {
  1229. this.$refs['temp'].clearValidate()
  1230. })
  1231. this.getCreateNumber()
  1232. },
  1233. getCreateNumber() {
  1234. GetDataByName(this.getParmCreateNumber).then(response => {
  1235. this.$nextTick(() => {
  1236. console.log('入库单号', response.data.list[0].orderCode)
  1237. this.storage.laidCode = response.data.list[0].orderCode
  1238. this.$forceUpdate()
  1239. })
  1240. })
  1241. },
  1242. changeProvider(value) {
  1243. console.log(value)
  1244. this.storage.providerId = value
  1245. this.TotalAmount = 0
  1246. console.log(this.findAllProvider.find(obj => obj.id === value).flexPrice)
  1247. this.$set(this.storage, 'flexPrice', this.findAllProvider.find(obj => obj.id === value).flexPrice)
  1248. if (parseInt(this.findAllProvider.find(obj => obj.id === value).flexPrice) === 1) {
  1249. this.isPriceInput = true
  1250. this.isPrice = false
  1251. } else {
  1252. this.isPriceInput = false
  1253. this.isPrice = true
  1254. }
  1255. this.listAdd = []
  1256. },
  1257. buyeCodeSearch(queryString, cb) {
  1258. console.log('采购单号模糊查询输入值', queryString)
  1259. console.log(this.$refs['providerId'])
  1260. if (this.storage.providerId !== '') {
  1261. this.requestBuyeCode.parammaps['buyeCode'] = queryString
  1262. this.requestBuyeCode.parammaps['providerId'] = this.storage.providerId
  1263. GetDataByName(this.requestBuyeCode).then(response => {
  1264. console.log('采购单号模糊查询搜索data', response.data.list)
  1265. if (response.data.list === null) {
  1266. this.buyeCodeList = []
  1267. } else {
  1268. this.buyeCodeList = response.data.list
  1269. }
  1270. cb(response.data.list)
  1271. })
  1272. } else {
  1273. this.$notify({
  1274. title: '',
  1275. message: '请选择供应商',
  1276. type: 'warning',
  1277. duration: 2000
  1278. })
  1279. }
  1280. },
  1281. handleSelectBuyeCode(item) {
  1282. console.log('采购单号模糊查询选中值', item)
  1283. this.TotalAmount = 0
  1284. // this.listAdd.push(item)
  1285. this.storage.orderCode = item.buyeCode
  1286. this.storage.orderCodeId = item.id
  1287. this.getBuyDetailListParm.parammaps.id = item.id
  1288. this.getBuyDetailListParm.parammaps.pastureId = Cookies.get('pastureid')
  1289. this.getBuyDetailList()
  1290. },
  1291. getBuyDetailList() {
  1292. GetDataByName(this.getBuyDetailListParm).then(response => {
  1293. console.log('采购入库table-data', response.data.list)
  1294. this.listAdd = response.data.list
  1295. // this.listAdd.forEach(function(val) {
  1296. // val.warehoseCode = ''
  1297. // })
  1298. if (response.data.list !== null) {
  1299. for (let i = 0; i < response.data.list.length; i++) {
  1300. this.$set(this.listAdd[i], 'warehoseCode', response.data.list[i].warehoseCode)
  1301. this.$set(this.listAdd[i], 'locationId', response.data.list[i].warehoseCodeId)
  1302. 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) {
  1303. this.listAdd[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  1304. this.listAdd[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  1305. } else {
  1306. this.listAdd[i].srcpath = ''
  1307. this.listAdd[i].picpath = ''
  1308. }
  1309. }
  1310. }
  1311. this.$forceUpdate()
  1312. })
  1313. this.$forceUpdate()
  1314. },
  1315. sparePartSearch(queryString, cb) {
  1316. console.log('备件模糊查询输入值', queryString)
  1317. console.log(this.$refs['providerId'])
  1318. if (this.storage.providerId !== '') {
  1319. this.requestSparePart.parammaps['partCode'] = queryString
  1320. this.requestSparePart.parammaps['providerId'] = this.storage.providerId
  1321. GetDataByName(this.requestSparePart).then(response => {
  1322. console.log('备件模糊查询搜索data', response.data.list)
  1323. if (response.data.list !== null) {
  1324. cb(response.data.list)
  1325. } else {
  1326. cb([])
  1327. }
  1328. })
  1329. } else {
  1330. this.$notify({
  1331. title: '',
  1332. message: '请选择供应商',
  1333. type: 'warning',
  1334. duration: 2000
  1335. })
  1336. }
  1337. },
  1338. allocationSearch(queryString, cb) {
  1339. console.log(queryString)
  1340. this.requestAllocation.parammaps.applyCode = queryString
  1341. GetDataByName(this.requestAllocation).then(response => {
  1342. console.log('调拨单号模糊查询搜索data', response.data.list)
  1343. if (response.data.list !== null) {
  1344. cb(response.data.list)
  1345. } else {
  1346. cb([])
  1347. }
  1348. })
  1349. },
  1350. handleSelectAllocation(item) {
  1351. console.log('调拨单号模糊查询选中值', item)
  1352. this.storage.id = item.id
  1353. this.getAllocationListParm.parammaps.id = item.id
  1354. this.getAllocationList()
  1355. },
  1356. getAllocationList() {
  1357. GetDataByName(this.getAllocationListParm).then(response => {
  1358. console.log('调拨单号table-data', response.data.list)
  1359. this.listAdd = response.data.list
  1360. if (response.data.list !== null) {
  1361. for (let i = 0; i < response.data.list.length; i++) {
  1362. this.TotalAmount += parseFloat(response.data.list[i].sumPrice)
  1363. this.$set(this.listAdd[i], 'warehoseCode', '')
  1364. // this.$set(this.listAdd[i], 'locationId', response.data.list[i].warehoseCodeId)
  1365. // this.$set(this.listAdd[i], 'warehoseCode', response.data.list[i].warehoseCode)
  1366. this.$set(this.listAdd[i], 'contractId', '-' + response.data.list[i].pastureId + this.listAdd[i].partId)
  1367. 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) {
  1368. this.listAdd[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  1369. this.listAdd[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  1370. } else {
  1371. this.listAdd[i].srcpath = ''
  1372. this.listAdd[i].picpath = ''
  1373. }
  1374. }
  1375. this.TotalAmount = this.TotalAmount.toFixed(2)
  1376. }
  1377. this.$forceUpdate()
  1378. })
  1379. },
  1380. handleSelectSparePart(item) {
  1381. console.log('备件模糊查询选中值', item)
  1382. if (this.listAdd.length > 0) {
  1383. // eslint-disable-next-line no-redeclare
  1384. if (this.listAdd.find(obj => obj.id === item.id)) {
  1385. this.$message({
  1386. type: 'warning',
  1387. message: '此备件已存在,请重新选择备件'
  1388. })
  1389. } else {
  1390. if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  1391. this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  1392. this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  1393. } else {
  1394. item.srcpath = ''
  1395. item.picpath = ''
  1396. }
  1397. this.$set(item, 'locationId', item.warehoseCodeId)
  1398. this.$set(item, 'warehoseCode', item.warehoseCode)
  1399. this.listAdd.unshift(item)
  1400. }
  1401. } else {
  1402. if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  1403. this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  1404. this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  1405. } else {
  1406. item.srcpath = ''
  1407. item.picpath = ''
  1408. }
  1409. this.$set(item, 'locationId', item.warehoseCodeId)
  1410. this.$set(item, 'warehoseCode', item.warehoseCode)
  1411. this.listAdd.unshift(item)
  1412. }
  1413. },
  1414. querySearchWarehoseCode(queryString, cb) {
  1415. console.log('库位模糊查询输入值', queryString)
  1416. this.requeststoreHouse.parammaps['warehoseCode'] = queryString
  1417. this.requeststoreHouse.parammaps.providerId = this.storage.providerId
  1418. GetDataByName(this.requeststoreHouse).then(response => {
  1419. console.log('备件名称模糊查询搜索data', response.data.list)
  1420. this.warehoseCodeList = response.data.list
  1421. cb(this.warehoseCodeList)
  1422. })
  1423. this.$forceUpdate()
  1424. },
  1425. handleSelectWarehoseCode(item, row) {
  1426. console.log('库位模糊查询选中值', item)
  1427. console.log('库位模糊查询选中值所在行', row)
  1428. this.$set(row, 'locationId', item.id)
  1429. this.$set(row, 'warehoseCode', item.warehoseCode)
  1430. this.$forceUpdate()
  1431. },
  1432. blurWarehoseCode(item, row) {
  1433. console.log(item, row)
  1434. row.warehoseCode = ''
  1435. row.locationId = ''
  1436. },
  1437. querySearchWarehoseCodeAllo(queryString, cb) {
  1438. console.log('库位模糊查询输入值', queryString)
  1439. this.requeststoreHouseAllo.parammaps['warehoseCode'] = queryString
  1440. GetDataByName(this.requeststoreHouseAllo).then(response => {
  1441. console.log('备件名称模糊查询搜索data', response.data.list)
  1442. this.warehoseCodeList = response.data.list
  1443. cb(this.warehoseCodeList)
  1444. })
  1445. this.$forceUpdate()
  1446. },
  1447. handleSelectWarehoseCodeAllo(item, row) {
  1448. console.log('库位模糊查询选中值', item)
  1449. console.log('库位模糊查询选中值所在行', row)
  1450. this.$set(row, 'locationId', item.id)
  1451. this.$set(row, 'warehoseCode', item.warehoseCode)
  1452. this.$forceUpdate()
  1453. },
  1454. blurWarehoseCodeAllo(item, row) {
  1455. console.log(item, row)
  1456. row.warehoseCode = ''
  1457. row.locationId = ''
  1458. },
  1459. partDelete(row) {
  1460. console.log(this.listAdd)
  1461. MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
  1462. confirmButtonText: '确认',
  1463. cancelButtonText: '取消',
  1464. type: 'warning'
  1465. }).then(() => {
  1466. // console.log(this.list2)
  1467. this.TotalAmount = 0
  1468. console.log(row.id)
  1469. for (var i = 0; i < this.listAdd.length; i++) {
  1470. console.log(this.listAdd[i])
  1471. if (this.listAdd[i].id === row.id) {
  1472. var listAddIndex = this.listAdd.indexOf(this.listAdd[i])
  1473. }
  1474. if (listAddIndex > -1) {
  1475. this.listAdd.splice(listAddIndex, 1)
  1476. return
  1477. }
  1478. this.TotalAmount += parseFloat(this.listAdd[i].sumPrice)
  1479. }
  1480. this.TotalAmount = this.TotalAmount.toFixed(2)
  1481. })
  1482. },
  1483. blurReportery() {
  1484. console.log(this.listAdd)
  1485. this.TotalAmount = 0
  1486. for (let i = 0; i < this.listAdd.length; i++) {
  1487. console.log(this.listAdd[i].sumPrice)
  1488. // eslint-disable-next-line use-isnan
  1489. if (this.listAdd[i].reportery !== undefined && this.listAdd[i].reportery !== 'undefined') {
  1490. this.TotalAmount += parseFloat(this.listAdd[i].sumPrice)
  1491. }
  1492. }
  1493. this.TotalAmount = this.TotalAmount.toFixed(2)
  1494. },
  1495. handleEmptySpareParts() {
  1496. if (this.listAdd.length > 0) {
  1497. const arr = []
  1498. for (let i = 0; i < this.listAdd.length; i++) {
  1499. if (this.listAdd[i].reportery == undefined || this.listAdd[i].reportery == null || this.listAdd[i].reportery == '') {
  1500. arr.push(this.listAdd[i].id)
  1501. }
  1502. }
  1503. if (arr.length == 0) {
  1504. this.$message({ type: 'warning', message: '当前无备件需要清空', duration: 2000 })
  1505. return false
  1506. }
  1507. MessageBox.confirm('是否清空入库数量为空备件?', {
  1508. confirmButtonText: '确认',
  1509. cancelButtonText: '取消',
  1510. type: 'warning'
  1511. }).then(() => {
  1512. if (arr.length > 0) {
  1513. for (let i = 0; i < this.listAdd.length; i++) {
  1514. for (let j = 0; j < arr.length; j++) {
  1515. if (this.listAdd[i].id == arr[j]) {
  1516. this.listAdd.splice(i, 1)
  1517. }
  1518. }
  1519. }
  1520. this.$notify({ title: '成功', message: '清空成功', type: 'success', duration: 2000 })
  1521. }
  1522. }).catch(() => {
  1523. this.$message({ type: 'info', message: '已取消' })
  1524. })
  1525. } else {
  1526. this.$message({ type: 'warning', message: '当前无备件需要清空', duration: 2000 })
  1527. }
  1528. },
  1529. add_dialog_save() {
  1530. this.isokDisable = true
  1531. setTimeout(() => {
  1532. this.isokDisable = false
  1533. }, 1000)
  1534. this.$refs['storage'].validate(valid => {
  1535. if (valid) {
  1536. if (this.storage.laidCode == '' || this.storage.laidCode == null || this.storage.laidCode == undefined) {
  1537. GetDataByName(this.getParmCreateNumber).then(response => {
  1538. this.$nextTick(() => {
  1539. console.log('入库单号', response.data.list[0].orderCode)
  1540. this.storage.laidCode = response.data.list[0].orderCode
  1541. this.$forceUpdate()
  1542. this.add_dialog_saveSave()
  1543. })
  1544. })
  1545. } else {
  1546. this.add_dialog_saveSave()
  1547. }
  1548. }
  1549. })
  1550. },
  1551. add_dialog_saveSave() {
  1552. if (this.listAdd.length !== 0) {
  1553. if (this.storage.laidType === 0) {
  1554. // 采购
  1555. for (var j = 0; j < this.listAdd.length; j++) {
  1556. if (this.listAdd[j].locationId == null || this.listAdd[j].locationId == '' || this.listAdd[j].reportery == null || this.listAdd[j].reportery === '' || this.listAdd[j].price == null || this.listAdd[j].price == '') {
  1557. this.$message({
  1558. type: 'warning',
  1559. message: '请检查库位及本次入库数量是否未填写',
  1560. duration: 2000
  1561. })
  1562. return false
  1563. } else {
  1564. var rulesReportery = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
  1565. var rulesPrice = /(^[1-9](\d+)?(\.\d{1,5})?$)|(^\d\.\d{1,5}$)/
  1566. var maxReportery = parseFloat(this.listAdd[j].amount) - parseFloat(this.listAdd[j].receiveAmount)
  1567. if (!rulesReportery.test(this.listAdd[j].reportery)) {
  1568. this.$message({
  1569. type: 'error',
  1570. message: '本次入库请输入正数,最多保留两位小数点',
  1571. duration: 2000
  1572. })
  1573. return false
  1574. }
  1575. if (parseFloat(this.listAdd[j].reportery) > maxReportery) {
  1576. this.$message({
  1577. type: 'error',
  1578. message: '本次入库数量不可大于未入库数',
  1579. duration: 2000
  1580. })
  1581. return false
  1582. }
  1583. // if (!rulesPrice.test(this.listAdd[j].price)) {
  1584. // this.$message({
  1585. // type: 'error',
  1586. // message: '单价请输入正数,最多保留五位小数点',
  1587. // duration: 2000
  1588. // })
  1589. // return false
  1590. // }
  1591. }
  1592. }
  1593. for (var i = 0; i < this.listAdd.length; i++) {
  1594. this.listAdd[i].contractId = this.listAdd[i].id
  1595. this.listAdd[i].providerId = this.storage.providerId
  1596. }
  1597. this.postDataPramas.common = { 'returnmap': '0' }
  1598. this.postDataPramas.data = []
  1599. this.postDataPramas.data[0] = { 'name': 'insertBigPartlaid', 'type': 'e', 'parammaps': {
  1600. providerId: this.storage.providerId,
  1601. pastureId: this.storage.pastureId,
  1602. storageTime: this.storage.storageTime,
  1603. laidCode: this.storage.laidCode,
  1604. empId: this.storage.employeId,
  1605. No1Id: this.storage.orderCode,
  1606. laidType: this.storage.laidType,
  1607. purchaseId: this.storage.orderCode
  1608. }}
  1609. this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
  1610. this.postDataPramas.data[1].children = []
  1611. this.postDataPramas.data[1].children[0] = { 'name': 'insertPartlaid', 'type': 'e', 'parammaps': {
  1612. bigId: '@insertBigPartlaid.LastInsertId',
  1613. buydetailId: '@insertSpotList.bid',
  1614. pastureId: '@insertSpotList.pastureId',
  1615. locationId: '@insertSpotList.locationId',
  1616. buyAmount: '@insertSpotList.amount',
  1617. partId: '@insertSpotList.partId',
  1618. partCode: '@insertSpotList.partCode',
  1619. partName: '@insertSpotList.partName',
  1620. specification: '@insertSpotList.specification',
  1621. price: '@insertSpotList.price',
  1622. unit: '@insertSpotList.unit',
  1623. orderNumber: '@insertSpotList.orderNumber',
  1624. providerId: '@insertSpotList.providerId',
  1625. brandId: '@insertSpotList.brandId',
  1626. storageAmount: '@insertSpotList.reportery',
  1627. contractId: '@insertSpotList.contractId',
  1628. bigBuyerId: '@insertSpotList.id',
  1629. receivedAmount: '@insertSpotList.receiveAmount',
  1630. buyeCode: this.storage.orderCode,
  1631. reporteryQ: '@insertSpotList.reporteryQ'
  1632. }}
  1633. this.postDataPramas.data[1].children[1] = { 'name': 'insertPartRepertory', 'type': 'e', 'parammaps': {
  1634. reportery: '@insertSpotList.reportery',
  1635. pastureId: '@insertSpotList.pastureId',
  1636. locationId: '@insertSpotList.locationId',
  1637. partId: '@insertSpotList.partId',
  1638. partCode: '@insertSpotList.partCode',
  1639. partName: '@insertSpotList.partName',
  1640. providerId: '@insertSpotList.providerId',
  1641. providerName: '@insertSpotList.providerName',
  1642. brand: '@insertSpotList.brand',
  1643. brandId: '@insertSpotList.brandId',
  1644. specification: '@insertSpotList.specification',
  1645. price: '@insertSpotList.price',
  1646. unit: '@insertSpotList.unit',
  1647. contractId: '@insertSpotList.contractId',
  1648. flexPrice: this.storage.flexPrice
  1649. }}
  1650. this.postDataPramas.data[1].children[2] = { 'name': 'updateBuydetailAmount', 'type': 'e', 'parammaps': {
  1651. reportery: '@insertSpotList.reportery',
  1652. bid: '@insertSpotList.bid'
  1653. }}
  1654. this.postDataPramas.data[2] = { 'name': 'updateBuydetailAmountZero', 'type': 'e', 'parammaps': {
  1655. 'bigId': this.getBuyDetailListParm.parammaps.id
  1656. }}
  1657. ExecDataByConfig(this.postDataPramas).then(response => {
  1658. console.log('新增保存发送参数', this.postDataPramas)
  1659. if (response.msg === 'fail') {
  1660. this.$notify({
  1661. title: '保存失败',
  1662. message: response.data,
  1663. type: 'warning',
  1664. duration: 2000
  1665. })
  1666. } else {
  1667. this.getdataListParm.parammaps.inputDatetime = ''
  1668. this.get_table_data()
  1669. this.dialogFormVisible = false
  1670. this.$notify({
  1671. title: '',
  1672. message: '保存成功',
  1673. type: 'success',
  1674. duration: 2000
  1675. })
  1676. }
  1677. })
  1678. return true
  1679. } else if (this.storage.laidType === 1) {
  1680. for (var j = 0; j < this.listAdd.length; j++) {
  1681. if (this.listAdd[j].locationId == null || this.listAdd[j].reportery == null || this.listAdd[j].reportery === '') {
  1682. this.$message({
  1683. type: 'warning',
  1684. message: '请检查库位及本次入库数量是否未填写',
  1685. duration: 2000
  1686. })
  1687. return false
  1688. } else {
  1689. var rulesReportery1 = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
  1690. if (!rulesReportery1.test(this.listAdd[j].reportery)) {
  1691. this.$message({
  1692. type: 'error',
  1693. message: '本次入库请输入正数,最多保留两位小数点',
  1694. duration: 2000
  1695. })
  1696. return false
  1697. }
  1698. }
  1699. this.listAdd[j].storageAmount = 0
  1700. this.listAdd[j].bigBuyerId = 0
  1701. this.listAdd[j].receiveAmount = 0
  1702. this.listAdd[j].amount = 0
  1703. this.listAdd[j].buydetailId = -1
  1704. this.listAdd[j].contractId = this.listAdd[j].id
  1705. this.listAdd[j].providerId = this.storage.providerId
  1706. }
  1707. this.postDataPramas.common = { 'returnmap': '0' }
  1708. this.postDataPramas.data = []
  1709. this.postDataPramas.data[0] = { 'name': 'insertBigPartlaid', 'type': 'e', 'parammaps': {
  1710. providerId: this.storage.providerId,
  1711. pastureId: this.storage.pastureId,
  1712. storageTime: this.storage.storageTime,
  1713. laidCode: this.storage.laidCode,
  1714. empId: this.storage.employeId,
  1715. No1Id: this.storage.orderCode,
  1716. laidType: this.storage.laidType
  1717. }}
  1718. this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
  1719. this.postDataPramas.data[1].children = []
  1720. this.postDataPramas.data[1].children[0] = { 'name': 'insertPartlaid', 'type': 'e', 'parammaps': {
  1721. bigId: '@insertBigPartlaid.LastInsertId',
  1722. pastureId: '@insertSpotList.pastureId',
  1723. locationId: '@insertSpotList.locationId',
  1724. partId: '@insertSpotList.partId',
  1725. partCode: '@insertSpotList.partCode',
  1726. partName: '@insertSpotList.partName',
  1727. buyAmount: 0,
  1728. specification: '@insertSpotList.specification',
  1729. price: '@insertSpotList.price',
  1730. unit: '@insertSpotList.unit',
  1731. orderNumber: '@insertSpotList.orderNumber',
  1732. providerId: '@insertSpotList.providerId',
  1733. brandId: '@insertSpotList.brandId',
  1734. storageAmount: '@insertSpotList.reportery',
  1735. contractId: '@insertSpotList.contractId',
  1736. bigBuyerId: '@insertSpotList.bigBuyerId',
  1737. receivedAmount: '@insertSpotList.receiveAmount',
  1738. buydetailId: -1,
  1739. reporteryQ: '@insertSpotList.reporteryQ'
  1740. }}
  1741. this.postDataPramas.data[1].children[1] = { 'name': 'insertPartRepertory', 'type': 'e', 'parammaps': {
  1742. reportery: '@insertSpotList.reportery',
  1743. pastureId: '@insertSpotList.pastureId',
  1744. locationId: '@insertSpotList.locationId',
  1745. partId: '@insertSpotList.partId',
  1746. partCode: '@insertSpotList.partCode',
  1747. partName: '@insertSpotList.partName',
  1748. providerId: '@insertSpotList.providerId',
  1749. providerName: '@insertSpotList.providerName',
  1750. brand: '@insertSpotList.brand',
  1751. brandId: '@insertSpotList.brandId',
  1752. specification: '@insertSpotList.specification',
  1753. price: '@insertSpotList.price',
  1754. unit: '@insertSpotList.unit',
  1755. contractId: '@insertSpotList.contractId',
  1756. flexPrice: this.storage.flexPrice
  1757. }}
  1758. ExecDataByConfig(this.postDataPramas).then(response => {
  1759. console.log('新增保存发送参数', this.postDataPramas)
  1760. if (response.msg === 'fail') {
  1761. this.$notify({
  1762. title: '保存失败',
  1763. message: response.data,
  1764. type: 'warning',
  1765. duration: 2000
  1766. })
  1767. } else {
  1768. this.getdataListParm.parammaps.inputDatetime = ''
  1769. this.get_table_data()
  1770. this.dialogFormVisible = false
  1771. this.$notify({
  1772. title: '',
  1773. message: '保存成功',
  1774. type: 'success',
  1775. duration: 2000
  1776. })
  1777. }
  1778. })
  1779. return true
  1780. } else if (this.storage.laidType === 2) {
  1781. // 调拨入库
  1782. for (var j = 0; j < this.listAdd.length; j++) {
  1783. if (this.listAdd[j].locationId == null) {
  1784. this.$message({
  1785. type: 'warning',
  1786. message: '请检查库位是否未填写',
  1787. duration: 2000
  1788. })
  1789. return false
  1790. }
  1791. this.listAdd[j].storageAmount = 0
  1792. this.listAdd[j].bigBuyerId = 0
  1793. this.listAdd[j].receiveAmount = 0
  1794. this.listAdd[j].buydetailId = -1
  1795. this.listAdd[j].storageAmount = 0
  1796. this.listAdd[j].reporteryQ = 0
  1797. }
  1798. this.postDataPramas.common = { 'returnmap': '0' }
  1799. this.postDataPramas.data = []
  1800. this.postDataPramas.data[0] = { 'name': 'insertBigPartlaid', 'type': 'e', 'parammaps': {
  1801. providerId: this.storage.providerId,
  1802. pastureId: Cookies.get('pastureid'),
  1803. storageTime: this.storage.storageTime,
  1804. laidCode: this.storage.laidCode,
  1805. empId: this.storage.employeId,
  1806. No1Id: this.storage.orderCode,
  1807. laidType: this.storage.laidType
  1808. }}
  1809. this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
  1810. this.postDataPramas.data[1].children = []
  1811. this.postDataPramas.data[1].children[0] = { 'name': 'insertPartlaid', 'type': 'e', 'parammaps': {
  1812. bigId: '@insertBigPartlaid.LastInsertId',
  1813. pastureId: Cookies.get('pastureid'),
  1814. locationId: '@insertSpotList.locationId',
  1815. partId: '@insertSpotList.partId',
  1816. partCode: '@insertSpotList.partCode',
  1817. partName: '@insertSpotList.partName',
  1818. buyAmount: 0,
  1819. specification: '@insertSpotList.specification',
  1820. price: '@insertSpotList.price',
  1821. unit: '@insertSpotList.unit',
  1822. orderNumber: '@insertSpotList.orderNumber',
  1823. providerId: '@insertSpotList.providerId',
  1824. providerName: '@insertSpotList.providerName',
  1825. brandId: '@insertSpotList.brandId',
  1826. storageAmount: '@insertSpotList.amount',
  1827. contractId: '@insertSpotList.contractId',
  1828. bigBuyerId: '@insertSpotList.bigBuyerId',
  1829. receivedAmount: '@insertSpotList.receiveAmount',
  1830. buydetailId: -1,
  1831. reporteryQ: '@insertSpotList.reporteryQ'
  1832. }}
  1833. this.postDataPramas.data[1].children[1] = { 'name': 'insertPartRepertory', 'type': 'e', 'parammaps': {
  1834. reportery: '@insertSpotList.amount',
  1835. pastureId: Cookies.get('pastureid'),
  1836. locationId: '@insertSpotList.locationId',
  1837. partId: '@insertSpotList.partId',
  1838. partCode: '@insertSpotList.partCode',
  1839. partName: '@insertSpotList.partName',
  1840. providerId: '@insertSpotList.providerId',
  1841. providerName: '@insertSpotList.providerName',
  1842. brand: '@insertSpotList.brand',
  1843. brandId: '@insertSpotList.brandId',
  1844. specification: '@insertSpotList.specification',
  1845. price: '@insertSpotList.price',
  1846. unit: '@insertSpotList.unit',
  1847. contractId: '@insertSpotList.contractId'
  1848. }}
  1849. this.postDataPramas.data[2] = { 'name': 'updateBigPartTransfer', 'type': 'e', 'parammaps': {
  1850. id: this.storage.id,
  1851. statue: 1,
  1852. laidCode: this.storage.laidCode
  1853. }}
  1854. ExecDataByConfig(this.postDataPramas).then(response => {
  1855. console.log('新增保存发送参数', this.postDataPramas)
  1856. if (response.msg === 'fail') {
  1857. this.$notify({
  1858. title: '保存失败',
  1859. message: response.data,
  1860. type: 'warning',
  1861. duration: 2000
  1862. })
  1863. } else {
  1864. this.getdataListParm.parammaps.inputDatetime = ''
  1865. this.get_table_data()
  1866. this.dialogFormVisible = false
  1867. this.$notify({
  1868. title: '',
  1869. message: '保存成功',
  1870. type: 'success',
  1871. duration: 2000
  1872. })
  1873. }
  1874. })
  1875. return true
  1876. }
  1877. } else {
  1878. this.$notify({
  1879. title: '',
  1880. message: '请选择备件',
  1881. type: 'warning',
  1882. duration: 2000
  1883. })
  1884. return false
  1885. }
  1886. },
  1887. form_edit(row) {
  1888. this.storage = Object.assign({}, row) // copy obj
  1889. this.defaultCheckedKeys = [this.temp.eqClassId]
  1890. this.dialogStatus = 'update'
  1891. this.dialogFormVisible = true
  1892. this.$nextTick(() => {
  1893. // this.$refs['temp'].clearValidate()
  1894. })
  1895. },
  1896. edit_dialog_save() {
  1897. this.isokDisable = true
  1898. setTimeout(() => {
  1899. this.isokDisable = false
  1900. }, 1000)
  1901. this.$refs['storage'].validate(valid => {
  1902. if (valid) {
  1903. this.postDataPramas.common = { 'returnmap': '0' }
  1904. this.postDataPramas.data = []
  1905. this.postDataPramas.data[0] = { 'name': 'insertBigPartlaid', 'type': 'v', 'parammaps': {
  1906. pastureId: this.storage.providerId,
  1907. storageTime: this.storage.storageTime,
  1908. laidCode: this.storage.laidCode,
  1909. empId: this.storage.employeId,
  1910. No1Id: this.storage.No1Id,
  1911. laidType: this.storage.laidType
  1912. }}
  1913. // eslint-disable-next-line no-irregular-whitespace
  1914. this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
  1915. this.postDataPramas.data[1].children = []
  1916. this.postDataPramas.data[1].children[0] = { 'name': 'insertPartlaid', 'type': 'e', 'parammaps': {
  1917. bigId: '@insertSpotList.bigId',
  1918. pastureId: '@insertSpotList.pastureId',
  1919. locationId: '@insertSpotList.locationId',
  1920. partId: '@insertSpotList.partId',
  1921. partCode: '@insertSpotList.partCode',
  1922. partName: '@insertSpotList.partName',
  1923. specification: '@insertSpotList.specification',
  1924. price: '@insertSpotList.price',
  1925. unit: '@insertSpotList.unit',
  1926. orderNumber: '@insertSpotList.orderNumber',
  1927. providerId: '@insertSpotList.providerId',
  1928. brandId: '@insertSpotList.brandId',
  1929. storageAmount: '@insertSpotList.storageAmount',
  1930. contractId: '@insertSpotList.contractId',
  1931. bigBuyerId: '@insertSpotList.bigBuyerId',
  1932. receivedAmount: '@insertSpotList.receivedAmount'
  1933. }}
  1934. this.postDataPramas.data[1].children[2] = { 'name': 'insertPartRepertory', 'type': 'e', 'parammaps': {
  1935. reportery: '@insertSpotList.reportery',
  1936. pastureId: '@insertSpotList.pastureId',
  1937. locationId: '@insertSpotList.locationId',
  1938. partId: '@insertSpotList.partId',
  1939. partCode: '@insertSpotList.partCode',
  1940. partName: '@insertSpotList.partName',
  1941. providerId: '@insertSpotList.providerId',
  1942. providerName: '@insertSpotList.providerName',
  1943. brand: '@insertSpotList.brand',
  1944. brandId: '@insertSpotList.brandId',
  1945. specification: '@insertSpotList.specification',
  1946. price: '@insertSpotList.price',
  1947. unit: '@insertSpotList.unit',
  1948. contractId: '@insertSpotList.contractId'
  1949. }}
  1950. ExecDataByConfig(this.postDataPramas).then(response => {
  1951. console.log('编辑保存发送参数', this.postDataPramas)
  1952. if (response.msg === 'fail') {
  1953. this.$notify({
  1954. title: '保存失败',
  1955. message: response.data,
  1956. type: 'warning',
  1957. duration: 2000
  1958. })
  1959. } else {
  1960. this.get_table_data()
  1961. this.dialogFormVisible = false
  1962. this.$notify({
  1963. title: '',
  1964. message: '保存成功',
  1965. type: 'success',
  1966. duration: 2000
  1967. })
  1968. }
  1969. })
  1970. }
  1971. })
  1972. },
  1973. handleCurrentChange(val) {
  1974. this.currentRow = val;
  1975. console.log("currentRow",this.currentRow)
  1976. },
  1977. checkboxInit(row,index){
  1978. // console.log(row)
  1979. if(row.ProofCode){
  1980. return 0
  1981. } else {
  1982. var data1 = new Date(row.creatTime)
  1983. var data2 = new Date('2022-10-25')
  1984. if(data1 > data2){ return 1 } else {return 0}
  1985. }
  1986. },
  1987. //监听 - 表格 - 勾选
  1988. change_table_selection(val) {
  1989. this.selectList = val
  1990. console.log('勾选数据selectList', this.selectList)
  1991. },
  1992. sapUpload(){
  1993. const that = this
  1994. console.log("currentRow ProofCode",this.currentRow.ProofCode)
  1995. var send_data = this.selectList
  1996. if(send_data.length == 0){
  1997. that.$notify({ title: '失败', message: '请勾选数据!' , type: 'error', duration: 2000 })
  1998. return false
  1999. }
  2000. console.log(that.isSap)
  2001. if(that.isSap == 1){
  2002. that.isSap = 0
  2003. SapLaid(send_data).then(response => {
  2004. console.log('response', response)
  2005. if (response.msg !== 'fail') {
  2006. that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
  2007. that.selectList = []
  2008. that.get_table_data()
  2009. } else {
  2010. that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
  2011. }
  2012. })
  2013. console.log(that.isSap)
  2014. } else {
  2015. that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击' , type: 'error', duration: 2000 })
  2016. }
  2017. setTimeout(() => {
  2018. that.isSap = 1
  2019. }, 3000)
  2020. // // if(true){
  2021. // if(this.currentRow.ProofCode){
  2022. // //如果有这个值说明已经上传了,不用上传
  2023. // console.log("currentRow ProofCode 这个值说明已经上传了,不用上传")
  2024. // } else {
  2025. // console.log("currentRow ProofCode没有这个值")
  2026. // const laidCode = this.currentRow.laidCode
  2027. // const creatTime = this.currentRow.creatTime
  2028. // console.log("laidCode",laidCode)
  2029. // console.log("laidCode",laidCode)
  2030. // var send_data = {
  2031. // "laidCode":laidCode,
  2032. // "storageTime":creatTime,
  2033. // "pastureid":Cookies.get('pastureid')
  2034. // }
  2035. // SapLaid(send_data).then(response => {
  2036. // console.log('response', response)
  2037. // if (response.msg !== 'fail') {
  2038. // that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
  2039. // that.get_table_data()
  2040. // } else {
  2041. // that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
  2042. // }
  2043. // })
  2044. // }
  2045. },
  2046. handleDelate(row) {
  2047. console.log('点击了删除')
  2048. this.seeTemp = Object.assign({}, row)
  2049. this.getdataListSee.parammaps.id = this.seeTemp.id
  2050. this.getSeeList()
  2051. MessageBox.confirm('确认删除此条信息?', {
  2052. confirmButtonText: '确认',
  2053. cancelButtonText: '取消',
  2054. type: 'warning'
  2055. }).then(() => {
  2056. this.postDataPramas.common = { 'returnmap': '0' }
  2057. this.postDataPramas.data = []
  2058. this.postDataPramas.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listSee }}
  2059. this.postDataPramas.data[0].children = []
  2060. this.postDataPramas.data[0].children[0] = { 'name': 'updatePartRepertoryDel', 'type': 'e', 'parammaps': {
  2061. id: '@insertSpotList.id',
  2062. contractId: '@insertSpotList.contractId',
  2063. partCode: '@insertSpotList.partCode',
  2064. pastureId: row.pastureId
  2065. }}
  2066. this.postDataPramas.data[0].children[1] = { 'name': 'deletePartLaid', 'type': 'e', 'parammaps': {
  2067. id: '@insertSpotList.id'
  2068. }}
  2069. this.postDataPramas.data[0].children[2] = { 'name': 'updateBuydetailDel', 'type': 'e', 'parammaps': {
  2070. storageAmount: '@insertSpotList.storageAmount',
  2071. buydetailId: '@insertSpotList.buydetailId'
  2072. }}
  2073. this.postDataPramas.data[1] = { 'name': 'deleteBigPartLaid', 'type': 'e', 'parammaps': {
  2074. id: row.id
  2075. }}
  2076. ExecDataByConfig(this.postDataPramas).then(response => {
  2077. this.get_table_data()
  2078. this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
  2079. })
  2080. }).catch(() => {
  2081. this.$message({ type: 'info', message: '已取消删除' })
  2082. })
  2083. },
  2084. changeStorageType(val) {
  2085. console.log('入库方式', val)
  2086. this.TotalAmount = 0
  2087. if (val === 0) { // No1采购 No2 手动
  2088. this.No2 = false
  2089. this.No1 = true
  2090. this.No3 = false
  2091. this.disabled = true
  2092. this.listAdd = []
  2093. this.isProvider = true
  2094. this.isWarehoseCode = true
  2095. this.isWarehoseCodeAllo = false
  2096. this.isSumPrice = true
  2097. this.isDel = true
  2098. } else if (val === 1) {
  2099. this.No2 = true
  2100. this.No1 = false
  2101. this.No3 = false
  2102. this.disabled = false
  2103. this.listAdd = []
  2104. this.isProvider = true
  2105. this.isWarehoseCode = true
  2106. this.isWarehoseCodeAllo = false
  2107. this.isSumPrice = true
  2108. this.isDel = true
  2109. } else if (val === 2) {
  2110. this.No1 = false
  2111. this.No2 = false
  2112. this.No3 = true
  2113. this.listAdd = []
  2114. this.isProvider = false
  2115. this.isWarehoseCode = false
  2116. this.isWarehoseCodeAllo = true
  2117. this.isSumPrice = false
  2118. this.isDel = false
  2119. }
  2120. },
  2121. handleImportExcelSuccess(res, file) {
  2122. if (res.msg === 'ok') {
  2123. this.$message({
  2124. title: '成功',
  2125. message: '导入成功:' + res.data.success + '条!',
  2126. type: 'success',
  2127. duration: 2000
  2128. })
  2129. if (res.data.err_count > 0) {
  2130. this.$notify({
  2131. title: '失败',
  2132. message: '导入失败:' + res.data.err_count + '条!',
  2133. type: 'danger',
  2134. duration: 2000
  2135. })
  2136. import('@/vendor/Export2Excel').then(excel => {
  2137. const list1 = res.data.result
  2138. const tHeader = [
  2139. '牧场', '入库单编号', '入库日期', '物料编码', '品名', '规格型号', '品牌', '计量单位', '数量', '单价', '总价', '库位', '供应商', 'error_msg'
  2140. ]
  2141. const filterVal = [
  2142. '牧场', '入库单编号', '入库日期', '物料编码', '品名', '规格型号', '品牌', '计量单位', '数量', '单价', '总价', '库位', '供应商', 'error_msg'
  2143. ]
  2144. const data1 = this.formatJson(filterVal, list1)
  2145. excel.export_json_to_excel({
  2146. header: tHeader,
  2147. data: data1,
  2148. filename: this.requestParam.parammaps.formType,
  2149. autoWidth: true,
  2150. bookType: 'xlsx'
  2151. })
  2152. })
  2153. }
  2154. } else {
  2155. this.$notify({
  2156. title: '失败',
  2157. message: '上传失败',
  2158. type: 'danger',
  2159. duration: 2000
  2160. })
  2161. }
  2162. },
  2163. handleDownload() {
  2164. console.log('点击了导出')
  2165. this.$alert('备件入库信息正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  2166. this.isPercentage = true
  2167. this.percentage = 1
  2168. var timer = setInterval(() => {
  2169. this.percentage += 5
  2170. if (this.percentage > 95) {
  2171. this.percentage = 99
  2172. clearInterval(timer)
  2173. }
  2174. this.percentage = this.percentage
  2175. }, 1000)
  2176. this.requestParam.parammaps.formType = '备件入库信息'
  2177. this.requestParam.parammaps.inputDatetime = this.getdataListParm.parammaps.inputDatetime
  2178. this.requestParam.parammaps.pastureName = this.getdataListParm.parammaps.pastureName
  2179. this.requestParam.parammaps.laidCode = this.getdataListParm.parammaps.laidCode
  2180. this.requestParam.parammaps.laidType = this.getdataListParm.parammaps.laidType
  2181. this.requestParam.parammaps.startTime = this.getdataListParm.parammaps.startTime
  2182. this.requestParam.parammaps.stopTime = this.getdataListParm.parammaps.stopTime
  2183. GetAccount(this.requestParam).then(response => {
  2184. if (response.data.list !== '') {
  2185. this.percentage = 99
  2186. setTimeout(() => {
  2187. this.isPercentage = false
  2188. }, 2000)
  2189. }
  2190. if (response.data.list !== null) {
  2191. for (let i = 0; i < response.data.list.length; i++) {
  2192. this.$set(response.data.list[i], 'storageAmount', parseFloat(response.data.list[i].storageAmount))
  2193. this.$set(response.data.list[i], 'price', parseFloat(response.data.list[i].price))
  2194. this.$set(response.data.list[i], 'sumPrice', parseFloat(response.data.list[i].sumPrice))
  2195. if(response.data.list[i].sterilisation == 1){
  2196. this.$set(response.data.list[i], 'sterilisation', "已冲销")
  2197. } else {
  2198. this.$set(response.data.list[i], 'sterilisation', "未冲销")
  2199. }
  2200. }
  2201. }
  2202. this.$nextTick(() => {
  2203. const ExcelDatas = [
  2204. {
  2205. tHeader: ['牧场', '入库单编号', '入库日期', '物料编码', '品名', '规格型号', '品牌', '计量单位', '数量', '单价', '总价', '库位', '供应商','冲销状态', 'error_msg'],
  2206. filterVal: ['pastureName', 'laidCode', 'creatTime', 'partCode', 'partName', 'specification', 'brandName', 'unit', 'storageAmount', 'price', 'sumPrice', 'warehoseCode', 'providerName', 'sterilisation', ''],
  2207. tableDatas: response.data.list,
  2208. sheetName: '备件入库信息'
  2209. }
  2210. ]
  2211. json2excel(ExcelDatas, '备件入库信息', true, 'xlsx')
  2212. })
  2213. })
  2214. },
  2215. formatJson(filterVal, jsonData) {
  2216. return jsonData.map(v =>
  2217. filterVal.map(j => {
  2218. if (j === 'timestamp') {
  2219. return parseTime(v[j])
  2220. } else {
  2221. return v[j]
  2222. }
  2223. })
  2224. )
  2225. },
  2226. // -------------------------------------------
  2227. No1Search(queryString, cb) {
  2228. console.log('采购单号模糊查询输入值', queryString)
  2229. this.requestFilterParams.name = 'findPurchaseSolr'
  2230. this.requestFilterParams.parammaps = {}
  2231. this.requestFilterParams.parammaps['orderA'] = queryString
  2232. this.requestFilterParams.parammaps['pastureId'] = this.$store.state.user.pastureid
  2233. GetDataByName(this.requestFilterParams).then(response => {
  2234. // console.log(response.data.list)
  2235. cb(response.data.list)
  2236. })
  2237. },
  2238. handleSelectPurchase(item) {
  2239. console.log(item)
  2240. },
  2241. // 导出模板
  2242. handleDownloadTemp() {
  2243. this.requestParam.name = 'stockLaidDownTemp'
  2244. GetDataByName(this.requestParam).then(response => {
  2245. this.$nextTick(() => {
  2246. import('@/vendor/Export2Excel').then(excel => {
  2247. const list1 = response.data.list
  2248. const tHeader = [
  2249. '牧场', '入库单编号', '入库日期', '物料编码', '品名', '规格型号', '品牌', '计量单位', '数量', '单价', '总价', '库位', '供应商'
  2250. ]
  2251. const filterVal = [
  2252. '牧场', '入库单编号', '入库日期', '物料编码', '品名', '规格型号', '品牌', '计量单位', '数量', '单价', '总价', '库位', '供应商'
  2253. ]
  2254. const data1 = this.formatJsonTemp(filterVal, list1)
  2255. excel.export_json_to_excel({
  2256. header: tHeader,
  2257. data: data1,
  2258. filename: '入库模板',
  2259. autoWidth: true,
  2260. bookType: 'xlsx'
  2261. })
  2262. })
  2263. })
  2264. })
  2265. },
  2266. formatJsonTemp(filterVal, jsonData) {
  2267. return jsonData.map(v =>
  2268. filterVal.map(j => {
  2269. if (j === 'timestamp') {
  2270. return parseTime(v[j])
  2271. } else {
  2272. return v[j]
  2273. }
  2274. })
  2275. )
  2276. },
  2277. handleDownloadEas1() {
  2278. this.$alert('备件入库EAS信息正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  2279. this.isPercentage = true
  2280. this.percentage = 1
  2281. var timer = setInterval(() => {
  2282. this.percentage += 5
  2283. if (this.percentage > 95) {
  2284. this.percentage = 99
  2285. clearInterval(timer)
  2286. }
  2287. this.percentage = this.percentage
  2288. }, 1000)
  2289. this.requestParam.name = 'downloadPartLaidEASYuan'
  2290. this.requestParam.parammaps.inputDatetime = this.getdataListParm.parammaps.inputDatetime
  2291. this.requestParam.parammaps.pastureName = this.getdataListParm.parammaps.pastureName
  2292. this.requestParam.parammaps.laidCode = this.getdataListParm.parammaps.laidCode
  2293. this.requestParam.parammaps.laidType = this.getdataListParm.parammaps.laidType
  2294. this.requestParam.parammaps.startTime = this.getdataListParm.parammaps.startTime
  2295. this.requestParam.parammaps.stopTime = this.getdataListParm.parammaps.stopTime
  2296. GetAccount(this.requestParam).then(response => {
  2297. if (response.data.list !== '') {
  2298. this.percentage = 99
  2299. setTimeout(() => {
  2300. this.isPercentage = false
  2301. }, 2000)
  2302. }
  2303. this.$nextTick(() => {
  2304. import('@/vendor/Export2Excel').then(excel => {
  2305. if (response.data.list !== null) {
  2306. for (let i = 0; i < response.data.list.length; i++) {
  2307. this.$set(response.data.list[i], '数量', parseFloat(response.data.list[i]['数量']))
  2308. this.$set(response.data.list[i], '总价', parseFloat(response.data.list[i]['总价']))
  2309. this.$set(response.data.list[i], '单价', parseFloat(response.data.list[i]['单价']))
  2310. }
  2311. }
  2312. const list1 = response.data.list
  2313. console.log(list1)
  2314. const tHeader = [
  2315. '牧场', '入库单编号', '入库日期', '供应商编码', '供应商', '入库人', '制单日期', '品名', '物料编码', '计量单位', '单价', '数量', '总价', '备注'
  2316. ]
  2317. const filterVal = [
  2318. '牧场', '入库单编号', '入库日期', '供应商编码', '供应商', '入库人', '制单日期', '品名', '物料编码', '计量单位', '单价', '数量', '总价', '备注'
  2319. ]
  2320. // const tmerges=['B1:D2']
  2321. if (list1 !== null) {
  2322. const data1 = this.formatJsonTemp(filterVal, list1)
  2323. excel.export_json_to_excel({
  2324. // merges: tmerges,
  2325. // multiHeader: tmultiHeader,
  2326. header: tHeader,
  2327. data: data1,
  2328. filename: '备件入库EAS:',
  2329. autoWidth: true,
  2330. bookType: 'xlsx'
  2331. })
  2332. } else {
  2333. this.$notify({
  2334. title: '',
  2335. message: '无备件领用完成信息,无法导出!',
  2336. type: 'warning',
  2337. duration: 2000
  2338. })
  2339. }
  2340. })
  2341. })
  2342. })
  2343. },
  2344. // 导出
  2345. handleDownloadEas() {
  2346. this.$alert('备件入库EAS信息正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  2347. this.isPercentage = true
  2348. this.percentage = 1
  2349. var timer = setInterval(() => {
  2350. this.percentage += 5
  2351. if (this.percentage > 95) {
  2352. this.percentage = 99
  2353. clearInterval(timer)
  2354. }
  2355. this.percentage = this.percentage
  2356. }, 1000)
  2357. this.requestParam.name = 'downloadPartLaidEAS'
  2358. this.requestParam.parammaps.useForm = this.getdataListParm.parammaps.useForm
  2359. this.requestParam.parammaps.createTime = this.getdataListParm.parammaps.createTime
  2360. this.requestParam.parammaps.createTime = this.getdataListParm.parammaps.useStatus
  2361. GetAccount(this.requestParam).then(response => {
  2362. if (response.data.list !== '') {
  2363. this.percentage = 99
  2364. setTimeout(() => {
  2365. this.isPercentage = false
  2366. }, 2000)
  2367. }
  2368. this.$nextTick(() => {
  2369. import('@/vendor/Export2Excel').then(excel => {
  2370. const list1 = response.data.list
  2371. const tHeader = [
  2372. '*单据编号', '*业务日期', '*事务类型_编码', '事务类型_名称_l2', '付款方式_名称_l2', '*供应商_编码', '供应商_名称_l2', '创建者_用户名', '制单日期', '币别_编码', '*库存组织_编码', '库存组织_名称_l2', '成本中心_编码', '成本中心_名称_l2', '折算方式', '是否价外税', '是否含税', '是否是初始化单', '*汇率', '摘要', '部门_编码', '*采购入库单分录$仓库_编码', '采购入库单分录$仓管员_编码', '采购入库单分录$库位_编码', '采购入库单分录$物料_名称_l2', '*采购入库单分录$物料_编码', '*采购入库单分录$计量单位_编码', '采购入库单分录$辅助属性_编码', '采购入库单分录$采购员_编码', '采购入库单分录$采购组_编码', '*采购入库单分录$采购组织_编码', '采购入库单分录_供应商批次号', '采购入库单分录_单价', '采购入库单分录_实际单价', '*采购入库单分录_数量', '采购入库单分录_辅助数量', '采购入库单分录_单位材料成本', '采购入库单分录_单位采购成本', '采购入库单分录_含税单价', '采购入库单分录_金额', '采购入库单分录_税率', '采购入库单分录_税额', '采购入库单分录_价税合计', '采购入库单分录_实际含税单价', '采购入库单分录_实际成本', '采购入库单分录_采购成本', '采购入库单分录_采购费用', '采购入库单分录_材料成本', '采购入库单分录_本位币税额', '采购入库单分录_本位币价税合计', '采购入库单分录_批次', '采购入库单分录_生产日期', '采购入库单分录_到期日期', '采购入库单分录_折扣', '采购入库单分录_折扣率', '采购入库单分录_是否完全核销', '采购入库单分录_是否赠品', '采购入库单分录_备注', '采购入库单分录$项目号_编码', '采购入库单分录$跟踪号_编码', '业务类型_编码', '业务类型_名称'
  2373. ]
  2374. const filterVal = [
  2375. '*单据编号', '*业务日期', '*事务类型_编码', '事务类型_名称_l2', '付款方式_名称_l2', '*供应商_编码', '供应商_名称_l2', '创建者_用户名', '制单日期', '币别_编码', '*库存组织_编码', '库存组织_名称_l2', '成本中心_编码', '成本中心_名称_l2', '折算方式', '是否价外税', '是否含税', '是否是初始化单', '*汇率', '摘要', '部门_编码', '*采购入库单分录$仓库_编码', '采购入库单分录$仓管员_编码', '采购入库单分录$库位_编码', '采购入库单分录$物料_名称_l2', '*采购入库单分录$物料_编码', '*采购入库单分录$计量单位_编码', '采购入库单分录$辅助属性_编码', '采购入库单分录$采购员_编码', '采购入库单分录$采购组_编码', '*采购入库单分录$采购组织_编码', '采购入库单分录_供应商批次号', '采购入库单分录_单价', '采购入库单分录_实际单价', '*采购入库单分录_数量', '采购入库单分录_辅助数量', '采购入库单分录_单位材料成本', '采购入库单分录_单位采购成本', '采购入库单分录_含税单价', '采购入库单分录_金额', '采购入库单分录_税率', '采购入库单分录_税额', '采购入库单分录_价税合计', '采购入库单分录_实际含税单价', '采购入库单分录_实际成本', '采购入库单分录_采购成本', '采购入库单分录_采购费用', '采购入库单分录_材料成本', '采购入库单分录_本位币税额', '采购入库单分录_本位币价税合计', '采购入库单分录_批次', '采购入库单分录_生产日期', '采购入库单分录_到期日期', '采购入库单分录_折扣', '采购入库单分录_折扣率', '采购入库单分录_是否完全核销', '采购入库单分录_是否赠品', '采购入库单分录_备注', '采购入库单分录$项目号_编码', '采购入库单分录$跟踪号_编码', '业务类型_编码', '业务类型_名称'
  2376. ]
  2377. const tmultiHeader = [['EAS', '7.5.0', '采购(委外)入库单导入',
  2378. '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
  2379. '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
  2380. '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
  2381. '', '', '', '', '', '', '', '', '', '', '', '', '', ''],
  2382. ['purInWarehs', '采购(委外)入库单导入', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
  2383. '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
  2384. '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
  2385. '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''],
  2386. ['FNumber', 'FBizDate', 'FTransactionType_number', 'FTransactionType_name_l2', 'FPaymentType_name_l2', 'FSupplier_number', 'FSupplier_name_l2', 'FCreator_number', 'FCreateTime', 'FCurrency_number', 'FStorageOrgUnit_number', 'FStorageOrgUnit_name_l2', 'FCostCenterOrgUnit_number', 'FCostCenterOrgUnit_name_l2', 'FConvertMode', 'FIsPriceInTax', 'FIsInTax', 'FIsInitBill', 'FExchangeRate', 'FDescription', 'FAdminOrgUnit_number', 'FEntry$warehouse_number', 'FEntry$stocker_number', 'FEntry$location_number', 'FEntry$material_name_l2', 'FEntry$material_number', 'FEntry$unit_number', 'FEntry$assistProperty_number', 'FEntry$No1Person_number', 'FEntry$No1Group_number', 'FEntry$No1OrgUnit_number', 'FEntry_supplierLotNo', 'FEntry_price', 'FEntry_actualPrice', 'FEntry_qty', 'FEntry_assistQty', 'FEntry_unitMaterialCost', 'FEntry_unitPurchaseCost', 'FEntry_taxPrice', 'FEntry_amount', 'FEntry_taxRate', 'FEntry_tax', 'FEntry_taxAmount', 'FEntry_actualTaxPrice', 'FEntry_actualCost', 'FEntry_No1Cost', 'FEntry_No1Fee', 'FEntry_materialCost', 'FEntry_localTax', 'FEntry_localTaxAmount', 'FEntry_lot', 'FEntry_mfg', 'FEntry_exp', 'FEntry_discountAmount', 'FEntry_discountRate', 'FEntry_isFullWriteOff', 'FEntry_isPresent', 'FEntry_remark', 'FEntry$project_number', 'FEntry$trackNumber_number', 'FBizType_number', 'FBizType_name_l2'
  2387. ]]
  2388. // const tmerges=['B1:D2']
  2389. if (list1 !== null) {
  2390. const data1 = this.formatJsonTemp(filterVal, list1)
  2391. excel.export_json_to_excel({
  2392. // merges: tmerges,
  2393. multiHeader: tmultiHeader,
  2394. header: tHeader,
  2395. data: data1,
  2396. filename: '备件入库EAS:',
  2397. autoWidth: true,
  2398. bookType: 'xlsx'
  2399. })
  2400. } else {
  2401. this.$notify({
  2402. title: '',
  2403. message: '无备件领用完成信息,无法导出!',
  2404. type: 'warning',
  2405. duration: 2000
  2406. })
  2407. }
  2408. })
  2409. })
  2410. })
  2411. },
  2412. // 导出
  2413. // 导入
  2414. beforeImportExcel(file) {
  2415. const isLt2M = file.size / 1024 / 1024 < 10
  2416. if (!isLt2M) {
  2417. this.$message.error('上传文件大小不能超过 10MB!')
  2418. }
  2419. return isLt2M
  2420. },
  2421. handleformNameSelect(item) {
  2422. this.temp.assetName = item.assetName
  2423. this.temp.assetId = item.assetId
  2424. this.temp.deptName = item.deptName
  2425. this.temp.pastureName = item.pastureName
  2426. },
  2427. formNumberSearch(queryString, cb) {
  2428. this.requestFilterParams.name = 'findAssetM'
  2429. this.requestFilterParams.parammaps['pastureId'] = Cookies.get('pastureid')
  2430. this.requestFilterParams.parammaps['assetName'] = queryString
  2431. GetDataByName(this.requestFilterParams).then(response => {
  2432. if (response.data.list === null) {
  2433. this.formNumberSearchList = []
  2434. } else {
  2435. this.formNumberSearchList = response.data.list
  2436. }
  2437. console.log(this.formNumberSearchList)
  2438. var results = queryString ? this.formNumberSearchList.filter(this.createFilter(queryString)) : this.formNumberSearchList
  2439. cb(results)
  2440. })
  2441. },
  2442. handleEAS() {
  2443. this.easStatus.dialogStatus = 'easStatus'
  2444. this.easStatus.dialogFormVisible = true
  2445. this.get_table_dataEasStatusLst()
  2446. },
  2447. get_table_dataEasStatusLst() {
  2448. this.easStatus.listLoading = true
  2449. GetDataByName(this.easStatus.getdataListParm).then(response => {
  2450. if (response.data.list !== null) {
  2451. this.easStatus.list = response.data.list
  2452. } else {
  2453. this.easStatus.list = []
  2454. }
  2455. this.easStatus.pageNum = response.data.pageNum
  2456. this.easStatus.pageSize = response.data.pageSize
  2457. if (response.data.total) {
  2458. this.easStatus.total = response.data.total
  2459. }
  2460. })
  2461. setTimeout(() => {
  2462. this.easStatus.listLoading = false
  2463. }, 100)
  2464. },
  2465. handleClose(row) {
  2466. MessageBox.confirm('是否确认关闭同步此数据?', {
  2467. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  2468. }).then(() => {
  2469. this.requestParam = {}
  2470. this.requestPam.name = 'updatebigpartlaidSync'
  2471. this.requestPam.parammaps = {}
  2472. this.requestPam.parammaps.issync = '2'
  2473. this.requestPam.parammaps.id = row.id
  2474. PostDataByName(this.reestParam).then((response) => {
  2475. if (response.msg !== 'fl') {
  2476. this.$notify({ title: '成功', message: '关闭同步成功', type: 'success', duration: 2000 })
  2477. this.getLitEasStatusLs()
  2478. this.get_table_data()
  2479. } else {
  2480. this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
  2481. this.getLiEasStatusLst()
  2482. this.get_table_data()
  2483. }
  2484. })
  2485. }).catch(() => {
  2486. this.$message({ type: 'info', message: '已取消关闭同步' })
  2487. })
  2488. },
  2489. handleManual(row) {
  2490. MessageBox.confirm('是否确认同步此数据至EAS?', {
  2491. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  2492. }).then(() => {
  2493. this.requestParam = {}
  2494. this.requestParam.typeIn = row.typeIn
  2495. this.requestParam.billCode = row.billCode
  2496. EasSync(this.requestParam).then((response) => {
  2497. if (response.msg !== 'fail') {
  2498. this.$notify({ title: '成功', message: '手动同步成功', type: 'success', duration: 2000 })
  2499. this.get_table_dataEasStatusLst()
  2500. this.get_table_data()
  2501. } else {
  2502. this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
  2503. this.get_table_dataEasStatusLst()
  2504. this.get_table_data()
  2505. }
  2506. })
  2507. }).catch(() => {
  2508. this.$message({ type: 'info', message: '已取消手动同步' })
  2509. })
  2510. },
  2511. handleIgnore(row) {
  2512. MessageBox.confirm('是否确认忽略同步此数据?', {
  2513. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  2514. }).then(() => {
  2515. this.requestParam = {}
  2516. this.requestParam.name = 'updatebigpartlaidSync'
  2517. this.requestParam.parammaps = {}
  2518. this.requestParam.parammaps.issync = '3'
  2519. this.requestParam.parammaps.id = row.id
  2520. PostDataByName(this.requestParam).then((response) => {
  2521. if (response.msg !== 'fail') {
  2522. this.$notify({ title: '成功', message: '忽略同步成功', type: 'success', duration: 2000 })
  2523. this.get_table_dataEasStatusLst()
  2524. this.get_table_data()
  2525. } else {
  2526. this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
  2527. this.get_table_dataEasStatusLst()
  2528. this.get_table_data()
  2529. }
  2530. })
  2531. }).catch(() => {
  2532. this.$message({ type: 'info', message: '已取消忽略同步' })
  2533. })
  2534. }
  2535. }
  2536. }
  2537. </script>
  2538. <style lang="scss">
  2539. .inputDatetime .el-range-separator{
  2540. padding: 0;
  2541. margin: 0 10px;
  2542. }
  2543. .el-radio__label{
  2544. padding-left: 2px !important;
  2545. }
  2546. </style>
  2547. <style lang="scss" scoped>
  2548. .el-radio{
  2549. margin-right: 5px;
  2550. }
  2551. </style>