index.vue 115 KB

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