index.vue 148 KB

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