index.vue 136 KB

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