index.vue 136 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052
  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" :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.getButtons()
  1337. })
  1338. this.getDownList()
  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){ return 0 } else {return 1}
  1360. },
  1361. //监听 - 表格 - 勾选
  1362. change_table_selection(val) {
  1363. this.selectList = val
  1364. console.log('勾选数据selectList', this.selectList)
  1365. },
  1366. sapUpload(){
  1367. const that = this
  1368. console.log("currentRow ProofCode",this.currentRow.ProofCode)
  1369. var send_data = this.selectList
  1370. if(send_data.length == 0){
  1371. that.$notify({ title: '失败', message: '请勾选数据!' , type: 'error', duration: 2000 })
  1372. return false
  1373. }
  1374. console.log(that.isSap)
  1375. if(that.isSap == 1){
  1376. that.isSap = 0
  1377. SapUse(send_data).then(response => {
  1378. console.log('response', response)
  1379. if (response.msg !== 'fail') {
  1380. that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
  1381. that.selectList = []
  1382. that.getList()
  1383. } else {
  1384. that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
  1385. }
  1386. })
  1387. } else {
  1388. that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击' , type: 'error', duration: 2000 })
  1389. }
  1390. setTimeout(() => {
  1391. that.isSap = 1
  1392. }, 3000)
  1393. // if(this.currentRow.ProofCode){
  1394. // console.log("currentRow ProofCode 这个值说明已经上传了,不用上传")
  1395. // //如果有这个值说明已经上传了,不用上传
  1396. // } else {
  1397. // console.log("currentRow ProofCode没有这个值")
  1398. // console.log("currentRow ProofCode",this.currentRow.ProofCode)
  1399. // const useForm = this.currentRow.useForm
  1400. // const creatTime = this.currentRow.creatTime
  1401. // console.log("useForm",useForm)
  1402. // var send_data = {
  1403. // "useForm":useForm,
  1404. // "receiveTime":creatTime,
  1405. // "pastureid":Cookies.get('pastureid')
  1406. // }
  1407. // SapUse(send_data).then(response => {
  1408. // console.log('response', response)
  1409. // if (response.msg !== 'fail') {
  1410. // that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
  1411. // that.getList()
  1412. // } else {
  1413. // that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
  1414. // }
  1415. // })
  1416. // }
  1417. },
  1418. getButtons() {
  1419. const Outsap = 'customs:outStock:sap'
  1420. const isOutsap = checkButtons(this.$store.state.user.buttons, OutStockAdd)
  1421. this.isOutsap = isOutsap
  1422. const OutStockAdd = 'customs:outStock:add'
  1423. const isOutStockAdd = checkButtons(this.$store.state.user.buttons, OutStockAdd)
  1424. this.isOutStockAdd = isOutStockAdd
  1425. const ReceiveTemplate = 'customs:outStock:template'
  1426. const isReceiveTemplate = checkButtons(this.$store.state.user.buttons, ReceiveTemplate)
  1427. this.isReceiveTemplate = isReceiveTemplate
  1428. const OutStockImport = 'customs:outStock:import'
  1429. const isOutStockImport = checkButtons(this.$store.state.user.buttons, OutStockImport)
  1430. this.isOutStockImport = isOutStockImport
  1431. const OutStockExport = 'customs:outStock:export'
  1432. const isOutStockExport = checkButtons(this.$store.state.user.buttons, OutStockExport)
  1433. this.isOutStockExport = isOutStockExport
  1434. const OutStockSee = 'customs:outStock:see'
  1435. const isOutStockSee = checkButtons(this.$store.state.user.buttons, OutStockSee)
  1436. this.isOutStockSee = isOutStockSee
  1437. const OutStockDelete = 'customs:outStock:delete'
  1438. const isOutStockDelete = checkButtons(this.$store.state.user.buttons, OutStockDelete)
  1439. this.isOutStockDelete = isOutStockDelete
  1440. const OutStockMethod1 = 'customs:outStock:method1'
  1441. const isOutStockMethod1 = checkButtons(this.$store.state.user.buttons, OutStockMethod1)
  1442. this.isOutStockMethod1 = isOutStockMethod1
  1443. const OutStockMethod2 = 'customs:outStock:method2'
  1444. const isOutStockMethod2 = checkButtons(this.$store.state.user.buttons, OutStockMethod2)
  1445. this.isOutStockMethod2 = isOutStockMethod2
  1446. const OutStockMethod3 = 'customs:outStock:method3'
  1447. const isOutStockMethod3 = checkButtons(this.$store.state.user.buttons, OutStockMethod3)
  1448. this.isOutStockMethod3 = isOutStockMethod3
  1449. const OutStockMethod4 = 'customs:outStock:method4'
  1450. const isOutStockMethod4 = checkButtons(this.$store.state.user.buttons, OutStockMethod4)
  1451. this.isOutStockMethod4 = isOutStockMethod4
  1452. const EasSynchronization = 'customs:outStock:easSynchronization'
  1453. const isEasSynchronization = checkButtons(this.$store.state.user.buttons, EasSynchronization)
  1454. this.isEasSynchronization = isEasSynchronization
  1455. const ManualSynchronization = 'customs:outStock:manualSynchronization'
  1456. const isManualSynchronization = checkButtons(this.$store.state.user.buttons, ManualSynchronization)
  1457. this.isManualSynchronization = isManualSynchronization
  1458. const CloseSynchronization = 'customs:outStock:closeSynchronization'
  1459. const isCloseSynchronization = checkButtons(this.$store.state.user.buttons, CloseSynchronization)
  1460. this.isCloseSynchronization = isCloseSynchronization
  1461. const IgnoreSynchronization = 'customs:outStock:ignoreSynchronization'
  1462. const isIgnoreSynchronization = checkButtons(this.$store.state.user.buttons, IgnoreSynchronization)
  1463. this.isIgnoreSynchronization = isIgnoreSynchronization
  1464. },
  1465. popoverHide(checkedIds, checkedData) {
  1466. console.log('选中值', checkedIds, checkedData)
  1467. // this.dataform.eqClassId = checkedIds
  1468. // this.dataform.typeCode = checkedData.typeCode
  1469. this.getdataListParm2.parammaps.assetCode = checkedData.typeCode
  1470. },
  1471. getTypeList() {
  1472. GetDataByName(this.getParmType).then(response => {
  1473. if (response.data.list !== null) {
  1474. this.parentType = transData(response.data.list, 'id', 'pid', 'children')
  1475. }
  1476. })
  1477. },
  1478. querySearch(queryString, cb) {
  1479. var restaurants = this.restaurants
  1480. var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
  1481. // 调用 callback 返回建议列表的数据
  1482. cb(results)
  1483. },
  1484. createFilter(queryString) {
  1485. return (restaurant) => {
  1486. return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0)
  1487. }
  1488. },
  1489. handleSelect(item) {
  1490. console.log(item)
  1491. },
  1492. // ---------------------------------------------
  1493. getDownList() {
  1494. GetDataByNames(this.requestParams).then(response => {
  1495. this.findAllProvider = response.data.findAllProvider.list
  1496. this.findAllAssetType = response.data.findAllAssetType.list
  1497. this.findAllPasture = response.data.findAllPasture.list
  1498. this.findAllEmploye = response.data.findAllEmploye.list
  1499. this.getDictByName = response.data.getDictByName.list
  1500. this.getDepartDownList()
  1501. })
  1502. },
  1503. getDepartDownList() {
  1504. GetDataByName(this.getDepartParam).then(response => {
  1505. this.findAllDepart = response.data.list
  1506. })
  1507. },
  1508. changePastureName(item) {
  1509. this.getDepartParam.parammaps.pastureId = this.findAllPasture.find(obj => obj.name == item).id
  1510. this.getdataListParm.parammaps.departmentId = ''
  1511. this.getDepartDownList()
  1512. },
  1513. getCreateDepartDownList() {
  1514. GetDataByName(this.getDepartParam).then(response => {
  1515. this.createDepartList = response.data.list
  1516. if (this.edit == 1) {
  1517. if (this.createDepartList.find(obj => obj.id == Cookies.get('departmentid'))) {
  1518. this.createTemp.departmentId = parseInt(Cookies.get('departmentid'))
  1519. this.createTemp.departmentName = this.createDepartList.find(obj => obj.id == Cookies.get('departmentid')).name
  1520. } else {
  1521. this.createTemp.departmentId = response.data.list[0].id
  1522. this.createTemp.departmentName = response.data.list[0].name
  1523. }
  1524. console.log(this.createTemp.departmentName, 'this.createTemp.departmentName')
  1525. }
  1526. })
  1527. },
  1528. changePasture(item) {
  1529. this.getDepartParam.parammaps.pastureId = item
  1530. this.edit = 1
  1531. this.getCreateDepartDownList()
  1532. },
  1533. changeDepart(item) {
  1534. this.createTemp.departmentName = this.createDepartList.find(obj => obj.id == item).name
  1535. },
  1536. getList() {
  1537. this.listLoading = true
  1538. console.log(this.$refs['inputDatetime'])
  1539. if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
  1540. this.getdataListParm.parammaps.startTime = this.$refs['inputDatetime'].value[0]
  1541. this.getdataListParm.parammaps.stopTime = this.$refs['inputDatetime'].value[1]
  1542. } else {
  1543. this.getdataListParm.parammaps.startTime = ''
  1544. this.getdataListParm.parammaps.stopTime = ''
  1545. }
  1546. GetDataByName(this.getdataListParm).then(response => {
  1547. console.log('table数据', response.data.list)
  1548. this.list = response.data.list
  1549. this.pageNum = response.data.pageNum
  1550. this.pageSize = response.data.pageSize
  1551. if (response.data.total) {
  1552. this.total = response.data.total
  1553. }
  1554. // Just to simulate the time of the request
  1555. setTimeout(() => {
  1556. this.listLoading = false
  1557. }, 100)
  1558. })
  1559. },
  1560. handleClick(tab, event) {
  1561. console.log(tab, event)
  1562. if (tab.name === 'second') {
  1563. this.getList2()
  1564. } else {
  1565. this.getList()
  1566. }
  1567. },
  1568. getList2() {
  1569. this.listLoading2 = true
  1570. if (this.$refs['inputDatetime2'] !== undefined && this.$refs['inputDatetime2'].value !== null) {
  1571. this.getdataListParm2.parammaps.startTime = this.$refs['inputDatetime2'].value[0]
  1572. this.getdataListParm2.parammaps.stopTime = this.$refs['inputDatetime2'].value[1]
  1573. } else {
  1574. this.getdataListParm2.parammaps.startTime = ''
  1575. this.getdataListParm2.parammaps.stopTime = ''
  1576. }
  1577. GetDataByName(this.getdataListParm2).then(response => {
  1578. this.list2 = response.data.list
  1579. this.pageNum2 = response.data.pageNum
  1580. this.pageSize2 = response.data.pageSize
  1581. if (response.data.total) {
  1582. this.total2 = response.data.total
  1583. }
  1584. // Just to simulate the time of the request
  1585. setTimeout(() => {
  1586. this.listLoading2 = false
  1587. }, 100)
  1588. })
  1589. },
  1590. form_search2() {
  1591. this.listLoading2 = true
  1592. if (this.getdataListParm2.parammaps.inputDatetime === null) {
  1593. this.getdataListParm2.parammaps.inputDatetime = ''
  1594. }
  1595. this.getdataListParm2.offset = 1
  1596. this.getList2()
  1597. },
  1598. useType: function(cellValue) {
  1599. // console.log(cellValue.isZeroStock)
  1600. if (cellValue.useType === 0) {
  1601. return '领用出库'
  1602. } else if (cellValue.useType === 2) {
  1603. return '领用出库'
  1604. } else if (cellValue.useType === 3) {
  1605. return '领用出库'
  1606. } else if (cellValue.useType === 1) {
  1607. return '手动出库'
  1608. } else if (cellValue.useType === 4) {
  1609. return '调拨出库'
  1610. } else if (cellValue.useType === 5) {
  1611. return '报废出库'
  1612. }
  1613. },
  1614. form_search() {
  1615. console.log('点击了table搜索')
  1616. this.listLoading = true
  1617. if (this.getdataListParm.parammaps.inputDatetime === null) {
  1618. this.getdataListParm.parammaps.inputDatetime = ''
  1619. }
  1620. this.getdataListParm.offset = 1
  1621. this.getList()
  1622. },
  1623. form_see(row) {
  1624. this.seeTemp = Object.assign({}, row)
  1625. console.log(this.seeTemp)
  1626. // this.temp = Object.assign({}, row) // copy obj
  1627. this.dialogStatus = 'see'
  1628. this.dialogFormVisible_See = true
  1629. this.getdataListSee.parammaps.id = row.id
  1630. this.TotalAmount = 0
  1631. this.getSeeList()
  1632. if (this.seeTemp.useType == 0) {
  1633. this.No1 = true
  1634. this.oddCodeAllo = true
  1635. this.isCreatTimeAllo = false
  1636. this.No5 = true
  1637. this.isTableAllo = true
  1638. this.isTableAllo1 = false
  1639. } else if (this.seeTemp.useType == 2) {
  1640. this.No1 = true
  1641. this.oddCodeAllo = true
  1642. this.isCreatTimeAllo = false
  1643. this.No5 = true
  1644. this.isTableAllo = true
  1645. this.isTableAllo1 = false
  1646. } else if (this.seeTemp.useType == 3) {
  1647. this.No1 = true
  1648. this.oddCodeAllo = true
  1649. this.isCreatTimeAllo = false
  1650. this.No5 = true
  1651. this.isTableAllo = true
  1652. this.isTableAllo1 = false
  1653. } else if (this.seeTemp.useType == 1) {
  1654. this.No1 = false
  1655. this.oddCodeAllo = false
  1656. this.isTableAllo = true
  1657. this.isTableAllo1 = false
  1658. } else if (this.seeTemp.useType == 4) {
  1659. this.oddCodeAllo = false
  1660. this.isCreatTimeAllo = true
  1661. this.No5 = false
  1662. this.No1 = false
  1663. this.isTableAllo = false
  1664. this.isTableAllo1 = true
  1665. } else if (this.seeTemp.useType == 5) {
  1666. this.No1 = false
  1667. this.oddCodeAllo = false
  1668. this.isTableAllo = true
  1669. this.isTableAllo1 = false
  1670. }
  1671. },
  1672. getSeeList() {
  1673. GetDataByName(this.getdataListSee).then(response => {
  1674. console.log('查看下方table数据', response.data.list)
  1675. this.listSee = response.data.list
  1676. if (response.data.list !== null) {
  1677. for (let i = 0; i < response.data.list.length; i++) {
  1678. this.TotalAmount += parseFloat(response.data.list[i].sumPrice)
  1679. 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) {
  1680. this.listSee[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  1681. this.listSee[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  1682. } else {
  1683. this.listSee[i].srcpath = ''
  1684. this.listSee[i].picpath = ''
  1685. }
  1686. }
  1687. this.TotalAmount = this.TotalAmount.toFixed(2)
  1688. }
  1689. setTimeout(() => {
  1690. this.listLoadingSee = false
  1691. }, 100)
  1692. })
  1693. },
  1694. resetCreateTemp() {
  1695. this.createTemp.useType = 0
  1696. this.createTemp.empId = parseInt(Cookies.get('employeid'))
  1697. this.createTemp.pastureId = parseInt(Cookies.get('pastureid'))
  1698. this.createTemp.receiveTime = parseTime(new Date(), '{y}-{m}-{d}')
  1699. this.createTemp.departmentId = parseInt(Cookies.get('departmentid'))
  1700. this.createTemp.applicatId = parseInt(Cookies.get('employeid'))
  1701. this.listAdd = []
  1702. this.createTemp.useForm = ''
  1703. this.No1 = true
  1704. this.No2 = false
  1705. this.No3 = false
  1706. this.orderPart = {}
  1707. },
  1708. form_add() {
  1709. this.resetCreateTemp()
  1710. this.edit = 1
  1711. this.getDepartParam.parammaps.pastureId = this.createTemp.pastureId
  1712. this.getCreateDepartDownList()
  1713. this.dialogStatus = 'create'
  1714. this.dialogFormVisible = true
  1715. this.createTemp.useForm = ''
  1716. this.createTemp.pastureName = Cookies.get('pasturename')
  1717. this.createTemp.employeId = Cookies.get('employeid')
  1718. this.TotalAmount = 0
  1719. console.log(this.createTemp)
  1720. this.$nextTick(() => {
  1721. this.$refs['temp'].clearValidate()
  1722. })
  1723. this.getCreateNumber()
  1724. },
  1725. getCreateNumber() {
  1726. GetDataByName(this.getParmCreateNumber).then(response => {
  1727. this.$nextTick(() => {
  1728. console.log('新增领用单号', response.data.list[0].orderCode)
  1729. this.createTemp.useForm = response.data.list[0].orderCode
  1730. })
  1731. this.$forceUpdate()
  1732. })
  1733. },
  1734. changeStorageType(val) {
  1735. console.log(val)
  1736. this.TotalAmount = 0
  1737. if (val === 0) {
  1738. this.No1 = true
  1739. this.No2 = false
  1740. this.No3 = false
  1741. this.disabled = true
  1742. this.listAdd = []
  1743. this.isReceiveTime = true
  1744. this.isReceiveTime2 = false
  1745. this.No4 = true
  1746. // 调拨数量/出库数量
  1747. this.allo = false
  1748. } else if (val === 1) {
  1749. this.No1 = false
  1750. this.No2 = true
  1751. this.No3 = false
  1752. this.disabled = false
  1753. this.listAdd = []
  1754. this.useForms = []
  1755. this.isReceiveTime = true
  1756. this.isReceiveTime2 = false
  1757. this.No4 = true
  1758. // 调拨数量/出库数量
  1759. this.allo = false
  1760. } else if (val === 2) {
  1761. this.listAdd = []
  1762. this.No1 = false
  1763. this.No2 = false
  1764. this.isReceiveTime = false
  1765. this.isReceiveTime2 = true
  1766. this.No3 = true
  1767. // 调拨数量/出库数量显示
  1768. this.allo = true
  1769. this.No4 = false
  1770. }else if(val === 5){
  1771. // 报废出库
  1772. this.No1 = false
  1773. this.No2 = true
  1774. this.No3 = false
  1775. this.disabled = false
  1776. this.listAdd = []
  1777. this.useForms = []
  1778. this.isReceiveTime = true
  1779. this.isReceiveTime2 = false
  1780. this.No4 = true
  1781. // 调拨数量/出库数量
  1782. this.allo = false
  1783. }
  1784. },
  1785. getNumber(queryString, cb) {
  1786. console.log('领用单号模糊查询输入值', queryString)
  1787. this.requestUseForm.parammaps['applyCode'] = queryString
  1788. GetDataByName(this.requestUseForm).then(response => {
  1789. console.log('领用单号模糊查询搜索data', response.data.list)
  1790. // this.useForms = response.data.list
  1791. cb(response.data.list)
  1792. })
  1793. },
  1794. changeApplyCode(item) {
  1795. console.log('领用单号模糊查询选中值', item)
  1796. this.getParmCreateAdd.parammaps.id = item.id
  1797. this.getParmCreateAdd.parammaps.pastureId = Cookies.get('pastureid')
  1798. this.createTemp.departmentId = item.departmentId
  1799. this.createTemp.bid = item.id
  1800. this.createTemp.applicatId = item.empId
  1801. this.orderPart.applyCode = item.applyCode
  1802. this.TotalAmount = 0
  1803. this.getListAdd()
  1804. },
  1805. getListAdd() {
  1806. GetDataByName(this.getParmCreateAdd).then(response => {
  1807. console.log('领用单号list列表', response.data.list)
  1808. this.createTemp.applyType = response.data.list[0].applyType
  1809. this.listAdd = response.data.list
  1810. this.TotalAmount = 0
  1811. if (response.data.list !== null) {
  1812. for (var i = 0; i < response.data.list.length; i++) {
  1813. if (response.data.list[i].applyType == '非维保') {
  1814. response.data.list[i].applyType = '物耗'
  1815. this.getDictByName = [{ 'id': 61, 'label': '物耗', 'value': '物耗' }, { 'id': 62, 'label': '土建', 'value': '土建' }, { 'id': 229, 'label': '工具', 'value': '工具' }]
  1816. } else {
  1817. this.getDownList()
  1818. }
  1819. // response.data.list[i].useTypeV = response.data.list[i].applyType
  1820. this.$set(response.data.list[i], 'useTypeV', response.data.list[i].applyType)
  1821. if (response.data.list[i].price == '') {
  1822. response.data.list[i].price = 0
  1823. }
  1824. if (response.data.list[i].checkoutNumber == null) {
  1825. var checkoutNumberArray = []
  1826. checkoutNumberArray.push(response.data.list[i].amount, response.data.list[i].reportery)
  1827. response.data.list[i].minNumber = Math.min.apply(null, checkoutNumberArray)
  1828. // response.data.list[i].checkoutNumber = response.data.list[i].minNumber
  1829. this.$set(response.data.list[i], 'checkoutNumber', response.data.list[i].minNumber)
  1830. // this.$set(response.data.list[i], 'sumPrice', parseFloat(response.data.list[i].sumPrice) * parseFloat(response.data.list[i].checkoutNumber))
  1831. }
  1832. console.log(response.data.list[i].sumPrice, '========= ==')
  1833. this.TotalAmount += parseFloat(response.data.list[i].sumPrice)
  1834. 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) {
  1835. this.listAdd[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  1836. this.listAdd[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  1837. } else {
  1838. this.listAdd[i].srcpath = ''
  1839. this.listAdd[i].picpath = ''
  1840. }
  1841. }
  1842. this.TotalAmount = this.TotalAmount.toFixed(2)
  1843. }
  1844. })
  1845. },
  1846. sparePartSearch(queryString, cb) {
  1847. console.log('备件模糊查询输入值', queryString)
  1848. this.requestSparePart.parammaps['partCode'] = queryString
  1849. GetDataByName(this.requestSparePart).then(response => {
  1850. console.log('备件模糊查询搜索data', response.data.list)
  1851. if (response.data.list == null) {
  1852. cb([])
  1853. } else {
  1854. for (var i = 0; i < response.data.list.length; i++) {
  1855. response.data.list[i].useTypeV = '维修'
  1856. }
  1857. cb(response.data.list)
  1858. }
  1859. })
  1860. },
  1861. handleSelectSparePart(item) {
  1862. console.log('备件模糊查询选中值', item)
  1863. this.TotalAmount = 0
  1864. if (this.listAdd.length > 0) {
  1865. // eslint-disable-next-line no-redeclare
  1866. if (this.listAdd.find(obj => obj.id === item.id)) {
  1867. this.$message({
  1868. type: 'warning',
  1869. message: '此备件已存在,请重新选择备件'
  1870. })
  1871. for (let i = 0; i < this.listAdd.length; i++) {
  1872. this.TotalAmount += parseFloat(this.listAdd[i].checkoutNumber) * parseFloat(this.listAdd[i].price)
  1873. }
  1874. this.TotalAmount = this.TotalAmount.toFixed(2)
  1875. } else {
  1876. if (item.checkoutNumber == null) {
  1877. this.$set(item, 'checkoutNumber', item.reportery)
  1878. }
  1879. this.TotalAmount = parseFloat(item.checkoutNumber) * parseFloat(item.price)
  1880. if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  1881. this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  1882. this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  1883. } else {
  1884. item.srcpath = ''
  1885. item.picpath = ''
  1886. }
  1887. this.listAdd.unshift(item)
  1888. this.TotalAmount = 0
  1889. for (let i = 0; i < this.listAdd.length; i++) {
  1890. this.TotalAmount += parseFloat(this.listAdd[i].checkoutNumber) * parseFloat(this.listAdd[i].price)
  1891. }
  1892. this.TotalAmount = this.TotalAmount.toFixed(2)
  1893. }
  1894. } else {
  1895. if (item.checkoutNumber == null) {
  1896. this.$set(item, 'checkoutNumber', item.reportery)
  1897. }
  1898. if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  1899. this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  1900. this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  1901. } else {
  1902. item.srcpath = ''
  1903. item.picpath = ''
  1904. }
  1905. this.listAdd.unshift(item)
  1906. this.$forceUpdate()
  1907. this.TotalAmount = 0
  1908. for (let i = 0; i < this.listAdd.length; i++) {
  1909. this.TotalAmount += parseFloat(this.listAdd[i].checkoutNumber) * parseFloat(this.listAdd[i].price)
  1910. }
  1911. this.TotalAmount = this.TotalAmount.toFixed(2)
  1912. }
  1913. console.log(this.listAdd)
  1914. // for (let i = 0; i < this.listAdd.length; i++) {
  1915. // this.TotalAmount += parseFloat(this.listAdd[i].checkoutNumber) * parseFloat(this.listAdd[i].price)
  1916. // }
  1917. // this.TotalAmount = this.TotalAmount.toFixed(2)
  1918. },
  1919. allocationSearch(queryString, cb) {
  1920. console.log(queryString)
  1921. this.requestAllocation.parammaps.applyCode = queryString
  1922. GetDataByName(this.requestAllocation).then(response => {
  1923. console.log('调拨单号模糊查询搜索data', response.data.list)
  1924. if (response.data.list !== null) {
  1925. cb(response.data.list)
  1926. } else {
  1927. cb([])
  1928. }
  1929. })
  1930. },
  1931. handleSelectAllocation(item) {
  1932. console.log('调拨单号模糊查询选中值', item)
  1933. this.createTemp.id = item.id
  1934. this.createTemp.oddCode = item.applyCode
  1935. this.getAllocationListParm.parammaps.id = item.id
  1936. this.TotalAmount = 0
  1937. this.getAllocationList()
  1938. },
  1939. getAllocationList() {
  1940. GetDataByName(this.getAllocationListParm).then(response => {
  1941. console.log('调拨单号table-data', response.data.list)
  1942. this.listAdd = response.data.list
  1943. if (response.data.list !== null) {
  1944. for (let i = 0; i < response.data.list.length; i++) {
  1945. this.TotalAmount += parseFloat(response.data.list[i].sumPrice)
  1946. this.$set(this.listAdd[i], 'warehoseCode', '')
  1947. 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) {
  1948. this.listAdd[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  1949. this.listAdd[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  1950. } else {
  1951. this.listAdd[i].srcpath = ''
  1952. this.listAdd[i].picpath = ''
  1953. }
  1954. }
  1955. }
  1956. this.$forceUpdate()
  1957. })
  1958. },
  1959. querySearchEqName(queryString, cb) {
  1960. console.log('备件名称/设备内部编号模糊查询输入值', queryString)
  1961. this.requestEqName.parammaps['eqName'] = queryString
  1962. GetDataByName(this.requestEqName).then(response => {
  1963. console.log('备件名称模糊查询搜索data', response.data.list)
  1964. this.EqNameList = response.data.list
  1965. cb(this.EqNameList)
  1966. })
  1967. },
  1968. handleSelectEqName(item, row) {
  1969. console.log('备件名称/设备内部编号模糊查询选中值', item)
  1970. console.log('备件名称/设备内部编号模糊查询选中值所在行', row)
  1971. this.$set(row, 'eqCode', item.eqCode)
  1972. this.$forceUpdate()
  1973. },
  1974. querySearchCode(queryString, cb) {
  1975. console.log('备件名称/设备内部编号模糊查询输入值', queryString)
  1976. this.requestEqName.parammaps['eqCode'] = queryString
  1977. GetDataByName(this.requestEqName).then(response => {
  1978. console.log('备件名称模糊查询搜索data', response.data.list)
  1979. this.EqNameList = response.data.list
  1980. cb(this.EqNameList)
  1981. })
  1982. },
  1983. // handleClear() {
  1984. // this.activated = false
  1985. // this.$emit('clear')
  1986. // },
  1987. handleSelectEqCode(item, row) {
  1988. console.log('备件名称/设备内部编号模糊查询选中值', item)
  1989. console.log('备件名称/设备内部编号模糊查询选中值所在行', row)
  1990. this.$set(row, 'eqName', item.eqName)
  1991. this.$forceUpdate()
  1992. },
  1993. blurSelectEqName(item, row) {
  1994. this.$set(row, 'eqName', '')
  1995. this.$set(row, 'eqCode', '')
  1996. },
  1997. blurSelectEqCode(item, row) {
  1998. this.$set(row, 'eqName', '')
  1999. this.$set(row, 'eqCode', '')
  2000. },
  2001. changeUseNumber(value, row) {
  2002. console.log('领用数量', value)
  2003. for (var i = 0; i < this.listAdd.length; i++) {
  2004. console.log(this.listAdd[i].id)
  2005. if (this.listAdd[i].id === row.id) {
  2006. var useNumberArray = []
  2007. useNumberArray.push(this.listAdd[i].reportery, parseInt(value))
  2008. // this.listAdd[i].checkoutNumber = Math.min.apply(null,useNumberArray)
  2009. }
  2010. }
  2011. },
  2012. changeCheckoutNumber(value, row) {
  2013. console.log('出库数量', value, row)
  2014. for (var i = 0; i < this.listAdd.length; i++) {
  2015. console.log(this.listAdd[i].id)
  2016. console.log(this.listAdd[i])
  2017. if (this.listAdd[i].id === row.id) {
  2018. var checkoutNumberArray = []
  2019. checkoutNumberArray.push(this.listAdd[i].reportery, parseInt(this.listAdd[i].amount), parseInt(value))
  2020. this.listAdd[i].minNumber = Math.min.apply(null, checkoutNumberArray)
  2021. this.$set(this.listAdd[i], 'sumPrice', parseFloat(this.listAdd[i].minNumber) * parseFloat(this.listAdd[i].price))
  2022. // this.listAdd[i].sumPrice = parseFloat(this.listAdd[i].minNumber) * parseFloat(this.listAdd[i].price)
  2023. console.log(this.rules)
  2024. }
  2025. }
  2026. console.log(this.listAdd)
  2027. },
  2028. blurCheckoutNumber(value, row) {
  2029. console.log(value, row)
  2030. this.TotalAmount = 0
  2031. this.$set(row, 'sumPrice', (parseFloat(row.price) * parseFloat(row.checkoutNumber)).toFixed(2))
  2032. console.log(this.listAdd)
  2033. for (let i = 0; i < this.listAdd.length; i++) {
  2034. this.TotalAmount += parseFloat(this.listAdd[i].sumPrice)
  2035. }
  2036. this.TotalAmount = this.TotalAmount.toFixed(2)
  2037. },
  2038. partDelete(row) {
  2039. console.log(this.listAdd)
  2040. MessageBox.confirm('备件名称:' + row.partName, '确认删除?', {
  2041. confirmButtonText: '确认',
  2042. cancelButtonText: '取消',
  2043. type: 'warning'
  2044. }).then(() => {
  2045. this.TotalAmount = 0
  2046. for (var i = 0; i < this.listAdd.length; i++) {
  2047. console.log(this.listAdd[i])
  2048. if (this.listAdd[i].id === row.id) {
  2049. var listAddIndex = this.listAdd.indexOf(this.listAdd[i])
  2050. }
  2051. if (listAddIndex > -1) {
  2052. this.listAdd.splice(listAddIndex, 1)
  2053. console.log(this.listAdd)
  2054. for (let i = 0; i < this.listAdd.length; i++) {
  2055. this.TotalAmount += parseFloat(this.listAdd[i].checkoutNumber) * parseFloat(this.listAdd[i].price)
  2056. }
  2057. return
  2058. }
  2059. }
  2060. console.log(this.listAdd)
  2061. this.TotalAmount = this.TotalAmount.toFixed(2)
  2062. })
  2063. },
  2064. add_dialog_save() {
  2065. this.isokDisable = true
  2066. setTimeout(() => {
  2067. this.isokDisable = false
  2068. }, 1000)
  2069. this.$refs['createTemp'].validate(valid => {
  2070. if (valid) {
  2071. if (this.createTemp.useForm == '' || this.createTemp.useForm == null || this.createTemp.useForm == undefined) {
  2072. GetDataByName(this.getParmCreateNumber).then(response => {
  2073. this.$nextTick(() => {
  2074. console.log('新增领用单号', response.data.list[0].orderCode)
  2075. this.createTemp.useForm = response.data.list[0].orderCode
  2076. this.$forceUpdate()
  2077. this.add_dialog_saveSave()
  2078. })
  2079. })
  2080. } else {
  2081. this.add_dialog_saveSave()
  2082. }
  2083. }
  2084. })
  2085. },
  2086. add_dialog_saveSave() {
  2087. if (this.listAdd.length !== 0) {
  2088. if (this.createTemp.useType === 0) {
  2089. // 领用出库
  2090. this.postDataPramas.common = { 'returnmap': '0' }
  2091. this.postDataPramas.data = []
  2092. for (var j = 0; j < this.listAdd.length; j++) {
  2093. if (this.listAdd[j].useTypeV == null || this.listAdd[j].checkoutNumber == null || this.listAdd[j].checkoutNumber == '') {
  2094. this.$message({
  2095. type: 'warning',
  2096. message: '请检查费用类型或出库数量是否未填写',
  2097. duration: 2000
  2098. })
  2099. return false
  2100. } else {
  2101. var rulesCheckoutNumber = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
  2102. if (!rulesCheckoutNumber.test(parseFloat(this.listAdd[j].checkoutNumber))) {
  2103. this.$message({
  2104. type: 'error',
  2105. message: '出库数量请输入正数,最多保留两位小数点',
  2106. duration: 2000
  2107. })
  2108. return false
  2109. } else {
  2110. if (parseFloat(this.listAdd[j].checkoutNumber) > parseFloat(this.listAdd[j].amount) || parseFloat(this.listAdd[j].checkoutNumber) > parseFloat(this.listAdd[j].reportery)) {
  2111. this.$message({
  2112. type: 'warning',
  2113. message: '出库数量不可大于领用数量或库位库存数',
  2114. duration: 2000
  2115. })
  2116. return false
  2117. }
  2118. }
  2119. this.$set(this.listAdd[j], 'checkoutNumber', (this.listAdd[j].checkoutNumber).toString())
  2120. }
  2121. }
  2122. if (this.createTemp.applyType === '维修') {
  2123. this.createTemp.useType = 0
  2124. } else if (this.createTemp.applyType === '保养') {
  2125. this.createTemp.useType = 2
  2126. } else if (this.createTemp.applyType === '非维保') {
  2127. this.createTemp.useType = 3
  2128. }
  2129. console.log(this.orderPart.applyCode)
  2130. this.postDataPramas.data[0] = { 'name': 'insertBigPartUse', 'type': 'e', 'parammaps': {
  2131. pastureId: this.createTemp.pastureId,
  2132. departmentId: this.createTemp.departmentId,
  2133. useForm: this.createTemp.useForm,
  2134. oddCode: this.orderPart.applyCode,
  2135. useType: this.createTemp.useType,
  2136. applicatId: this.createTemp.applicatId,
  2137. receiveTime: this.createTemp.receiveTime,
  2138. empId: this.createTemp.empId,
  2139. note: this.createTemp.note
  2140. }}
  2141. this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
  2142. this.postDataPramas.data[1].children = []
  2143. this.postDataPramas.data[1].children[0] = { 'name': 'insertPartUse', 'type': 'e', 'parammaps': {
  2144. bigId: '@insertBigPartUse.LastInsertId',
  2145. locationId: '@insertSpotList.locationId',
  2146. departmentId: '@insertSpotList.departmentId',
  2147. partId: '@insertSpotList.partId',
  2148. partCode: '@insertSpotList.partCode',
  2149. partName: '@insertSpotList.partName',
  2150. specification: '@insertSpotList.specification',
  2151. price: '@insertSpotList.price',
  2152. unit: '@insertSpotList.unit',
  2153. brandId: '@insertSpotList.brandId',
  2154. contractId: '@insertSpotList.contractId',
  2155. useNumber: '@insertSpotList.amount',
  2156. checkoutNumber: '@insertSpotList.checkoutNumber',
  2157. eqName: '@insertSpotList.eqName',
  2158. eqCode: '@insertSpotList.eqCode',
  2159. reportery: '@insertSpotList.reportery',
  2160. useTypeV: '@insertSpotList.useTypeV',
  2161. note: '@insertSpotList.note'
  2162. }}
  2163. this.postDataPramas.data[1].children[1] = { 'name': 'insertPartUseRepertory', 'type': 'e', 'parammaps': {
  2164. checkoutNumber: '@insertSpotList.checkoutNumber',
  2165. pastureId: '@insertSpotList.pastureId',
  2166. locationId: '@insertSpotList.locationId',
  2167. location: '@insertSpotList.location',
  2168. partId: '@insertSpotList.partId',
  2169. partCode: '@insertSpotList.partCode',
  2170. partName: '@insertSpotList.partName',
  2171. specification: '@insertSpotList.specification',
  2172. providerId: '@insertSpotList.providerId',
  2173. providerName: '@insertSpotList.providerName',
  2174. brandId: '@insertSpotList.brandId',
  2175. price: '@insertSpotList.price',
  2176. unit: '@insertSpotList.unit',
  2177. contractId: '@insertSpotList.contractId'
  2178. }}
  2179. this.postDataPramas.data[1].children[2] = { 'name': 'updatePartapplyuseAmount', 'type': 'e', 'parammaps': {
  2180. paid: '@insertSpotList.paid',
  2181. checkoutNumber: '@insertSpotList.checkoutNumber'
  2182. }}
  2183. this.postDataPramas.data[2] = { 'name': 'updateBigPartApplystatue', 'type': 'e', 'parammaps': {
  2184. bid: this.createTemp.bid
  2185. }}
  2186. ExecDataByConfig(this.postDataPramas).then(response => {
  2187. console.log('新增保存发送参数', this.postDataPramas)
  2188. if (response.msg === 'fail') {
  2189. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  2190. } else {
  2191. this.getdataListParm.parammaps.inputDatetime = ''
  2192. setTimeout(() => {
  2193. this.getList()
  2194. }, 1000)
  2195. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  2196. this.dialogFormVisible = false
  2197. }
  2198. })
  2199. return true
  2200. } else if (this.createTemp.useType === 1) {
  2201. // 手动出库
  2202. this.postDataPramas.common = { 'returnmap': '0' }
  2203. this.postDataPramas.data = []
  2204. for (var j = 0; j < this.listAdd.length; j++) {
  2205. 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 == '') {
  2206. this.$message({
  2207. type: 'warning',
  2208. message: '请检查备件名称或设备内部编号或费用类型或出库数量是否未填写',
  2209. duration: 2000
  2210. })
  2211. return false
  2212. } else {
  2213. // eslint-disable-next-line no-redeclare
  2214. var rulesCheckoutNumber = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
  2215. if (!rulesCheckoutNumber.test(parseFloat(this.listAdd[j].checkoutNumber))) {
  2216. this.$message({
  2217. type: 'error',
  2218. message: '出库数量请输入正数,最多保留两位小数点',
  2219. duration: 2000
  2220. })
  2221. return false
  2222. } else {
  2223. if (parseFloat(this.listAdd[j].checkoutNumber) > parseFloat(this.listAdd[j].reportery)) {
  2224. this.$message({
  2225. type: 'warning',
  2226. message: '出库数量不能大于库位库存数',
  2227. duration: 2000
  2228. })
  2229. this.$set(this.listAdd.find(obj => obj.checkoutNumber == this.listAdd[j].checkoutNumber), 'isNo', 'No')
  2230. return false
  2231. } else {
  2232. this.$set(this.listAdd.find(obj => obj.checkoutNumber == this.listAdd[j].checkoutNumber), 'isNo', 'Yes')
  2233. }
  2234. }
  2235. }
  2236. }
  2237. this.postDataPramas.data[0] = { 'name': 'insertBigPartUse', 'type': 'e', 'parammaps': {
  2238. pastureId: this.createTemp.pastureId,
  2239. departmentId: this.createTemp.departmentId,
  2240. useForm: this.createTemp.useForm,
  2241. useType: this.createTemp.useType,
  2242. applicatId: this.createTemp.applicatId,
  2243. receiveTime: this.createTemp.receiveTime,
  2244. empId: this.createTemp.empId,
  2245. note: this.createTemp.note
  2246. }}
  2247. this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
  2248. this.postDataPramas.data[1].children = []
  2249. this.postDataPramas.data[1].children[0] = { 'name': 'insertPartUse', 'type': 'e', 'parammaps': {
  2250. bigId: '@insertBigPartUse.LastInsertId',
  2251. locationId: '@insertSpotList.locationId',
  2252. departmentId: '@insertSpotList.departmentId',
  2253. partId: '@insertSpotList.partId',
  2254. partCode: '@insertSpotList.partCode',
  2255. partName: '@insertSpotList.partName',
  2256. specification: '@insertSpotList.specification',
  2257. price: '@insertSpotList.price',
  2258. unit: '@insertSpotList.unit',
  2259. brandId: '@insertSpotList.brandId',
  2260. contractId: '@insertSpotList.contractId',
  2261. useNumber: 0,
  2262. checkoutNumber: '@insertSpotList.checkoutNumber',
  2263. eqName: '@insertSpotList.eqName',
  2264. eqCode: '@insertSpotList.eqCode',
  2265. reportery: '@insertSpotList.reportery',
  2266. useTypeV: '@insertSpotList.useTypeV',
  2267. note: '@insertSpotList.note'
  2268. }}
  2269. this.postDataPramas.data[1].children[1] = { 'name': 'insertPartUseRepertory', 'type': 'e', 'parammaps': {
  2270. checkoutNumber: '@insertSpotList.checkoutNumber',
  2271. pastureId: '@insertSpotList.pastureId',
  2272. locationId: '@insertSpotList.locationId',
  2273. location: '@insertSpotList.location',
  2274. partId: '@insertSpotList.partId',
  2275. partCode: '@insertSpotList.partCode',
  2276. partName: '@insertSpotList.partName',
  2277. specification: '@insertSpotList.specification',
  2278. providerId: '@insertSpotList.providerId',
  2279. providerName: '@insertSpotList.providerName',
  2280. brandId: '@insertSpotList.brandId',
  2281. price: '@insertSpotList.price',
  2282. unit: '@insertSpotList.unit',
  2283. contractId: '@insertSpotList.contractId'
  2284. }}
  2285. ExecDataByConfig(this.postDataPramas).then(response => {
  2286. console.log('新增保存发送参数', this.postDataPramas)
  2287. if (response.msg === 'fail') {
  2288. this.$notify({
  2289. title: '保存失败',
  2290. message: response.data,
  2291. type: 'warning',
  2292. duration: 2000
  2293. })
  2294. } else {
  2295. this.getdataListParm.parammaps.inputDatetime = ''
  2296. setTimeout(() => {
  2297. this.getList()
  2298. }, 1000)
  2299. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  2300. this.dialogFormVisible = false
  2301. }
  2302. })
  2303. return true
  2304. } else if (this.createTemp.useType === 2) {
  2305. // 调拨出库
  2306. this.postDataPramas.common = { 'returnmap': '0' }
  2307. this.postDataPramas.data = []
  2308. // for (var j = 0; j < this.listAdd.length; j++) {
  2309. // if (this.listAdd[j].useTypeV == null) {
  2310. // this.$message({
  2311. // type: 'warning',
  2312. // message: '请检查备费用类型是否未填写',
  2313. // duration: 2000
  2314. // })
  2315. // return false
  2316. // }
  2317. // }
  2318. this.postDataPramas.data[0] = { 'name': 'insertBigPartUse', 'type': 'e', 'parammaps': {
  2319. pastureId: this.createTemp.pastureId,
  2320. departmentId: this.$store.state.user.departmentid,
  2321. useForm: this.createTemp.useForm,
  2322. useType: 4,
  2323. applicatId: this.createTemp.applicatId,
  2324. receiveTime: this.createTemp.receiveTime,
  2325. empId: this.createTemp.empId,
  2326. oddCode: this.createTemp.oddCode,
  2327. note: this.createTemp.note
  2328. }}
  2329. this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
  2330. this.postDataPramas.data[1].children = []
  2331. this.postDataPramas.data[1].children[0] = { 'name': 'insertPartUse', 'type': 'e', 'parammaps': {
  2332. bigId: '@insertBigPartUse.LastInsertId',
  2333. locationId: -1,
  2334. contractId: '@insertSpotList.contractId',
  2335. providerName: '@insertSpotList.providerName',
  2336. providerId: '@insertSpotList.providerId',
  2337. departmentId: '@insertSpotList.departmentId',
  2338. partId: '@insertSpotList.partId',
  2339. partCode: '@insertSpotList.partCode',
  2340. partName: '@insertSpotList.partName',
  2341. specification: '@insertSpotList.specification',
  2342. price: '@insertSpotList.price',
  2343. unit: '@insertSpotList.unit',
  2344. brandId: '@insertSpotList.brandId',
  2345. useNumber: 0,
  2346. checkoutNumber: '@insertSpotList.amount',
  2347. eqName: '@insertSpotList.eqName',
  2348. eqCode: '@insertSpotList.eqCode',
  2349. reportery: 0,
  2350. useTypeV: '@insertSpotList.useTypeV',
  2351. note: '@insertSpotList.note'
  2352. }}
  2353. this.postDataPramas.data[1].children[1] = { 'name': 'updatePartUseRepertory', 'type': 'e', 'parammaps': {
  2354. checkoutNumber: '@insertSpotList.amount',
  2355. partRepId: '@insertSpotList.partRepId'
  2356. }}
  2357. this.postDataPramas.data[2] = { 'name': 'updateBigPartTransfer', 'type': 'e', 'parammaps': {
  2358. id: this.createTemp.id,
  2359. statue: 4,
  2360. useCode: this.createTemp.useForm
  2361. }}
  2362. ExecDataByConfig(this.postDataPramas).then(response => {
  2363. console.log(this.listAdd)
  2364. console.log('新增保存发送参数', this.postDataPramas)
  2365. if (response.msg === 'fail') {
  2366. this.$notify({
  2367. title: '保存失败',
  2368. message: response.data,
  2369. type: 'warning',
  2370. duration: 2000
  2371. })
  2372. } else {
  2373. this.getdataListParm.parammaps.inputDatetime = ''
  2374. setTimeout(() => {
  2375. this.getList()
  2376. }, 1000)
  2377. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  2378. this.dialogFormVisible = false
  2379. }
  2380. })
  2381. return true
  2382. }else if(this.createTemp.useType === 5){
  2383. // 报废出库
  2384. this.postDataPramas.common = { 'returnmap': '0' }
  2385. this.postDataPramas.data = []
  2386. for (var j = 0; j < this.listAdd.length; j++) {
  2387. 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 == '') {
  2388. this.$message({
  2389. type: 'warning',
  2390. message: '请检查备件名称或设备内部编号或费用类型或出库数量是否未填写',
  2391. duration: 2000
  2392. })
  2393. return false
  2394. } else {
  2395. // eslint-disable-next-line no-redeclare
  2396. var rulesCheckoutNumber = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
  2397. if (!rulesCheckoutNumber.test(parseFloat(this.listAdd[j].checkoutNumber))) {
  2398. this.$message({
  2399. type: 'error',
  2400. message: '出库数量请输入正数,最多保留两位小数点',
  2401. duration: 2000
  2402. })
  2403. return false
  2404. } else {
  2405. if (parseFloat(this.listAdd[j].checkoutNumber) > parseFloat(this.listAdd[j].reportery)) {
  2406. this.$message({
  2407. type: 'warning',
  2408. message: '出库数量不能大于库位库存数',
  2409. duration: 2000
  2410. })
  2411. this.$set(this.listAdd.find(obj => obj.checkoutNumber == this.listAdd[j].checkoutNumber), 'isNo', 'No')
  2412. return false
  2413. } else {
  2414. this.$set(this.listAdd.find(obj => obj.checkoutNumber == this.listAdd[j].checkoutNumber), 'isNo', 'Yes')
  2415. }
  2416. }
  2417. }
  2418. }
  2419. this.postDataPramas.data[0] = { 'name': 'insertBigPartUse', 'type': 'e', 'parammaps': {
  2420. pastureId: this.createTemp.pastureId,
  2421. departmentId: this.createTemp.departmentId,
  2422. useForm: this.createTemp.useForm,
  2423. useType: this.createTemp.useType,
  2424. applicatId: this.createTemp.applicatId,
  2425. receiveTime: this.createTemp.receiveTime,
  2426. empId: this.createTemp.empId,
  2427. note: this.createTemp.note
  2428. }}
  2429. this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
  2430. this.postDataPramas.data[1].children = []
  2431. this.postDataPramas.data[1].children[0] = { 'name': 'insertPartUse', 'type': 'e', 'parammaps': {
  2432. bigId: '@insertBigPartUse.LastInsertId',
  2433. locationId: '@insertSpotList.locationId',
  2434. departmentId: '@insertSpotList.departmentId',
  2435. partId: '@insertSpotList.partId',
  2436. partCode: '@insertSpotList.partCode',
  2437. partName: '@insertSpotList.partName',
  2438. specification: '@insertSpotList.specification',
  2439. price: '@insertSpotList.price',
  2440. unit: '@insertSpotList.unit',
  2441. brandId: '@insertSpotList.brandId',
  2442. contractId: '@insertSpotList.contractId',
  2443. useNumber: 0,
  2444. checkoutNumber: '@insertSpotList.checkoutNumber',
  2445. eqName: '@insertSpotList.eqName',
  2446. eqCode: '@insertSpotList.eqCode',
  2447. reportery: '@insertSpotList.reportery',
  2448. useTypeV: '@insertSpotList.useTypeV',
  2449. note: '@insertSpotList.note'
  2450. }}
  2451. this.postDataPramas.data[1].children[1] = { 'name': 'insertPartUseRepertory', 'type': 'e', 'parammaps': {
  2452. checkoutNumber: '@insertSpotList.checkoutNumber',
  2453. pastureId: '@insertSpotList.pastureId',
  2454. locationId: '@insertSpotList.locationId',
  2455. location: '@insertSpotList.location',
  2456. partId: '@insertSpotList.partId',
  2457. partCode: '@insertSpotList.partCode',
  2458. partName: '@insertSpotList.partName',
  2459. specification: '@insertSpotList.specification',
  2460. providerId: '@insertSpotList.providerId',
  2461. providerName: '@insertSpotList.providerName',
  2462. brandId: '@insertSpotList.brandId',
  2463. price: '@insertSpotList.price',
  2464. unit: '@insertSpotList.unit',
  2465. contractId: '@insertSpotList.contractId'
  2466. }}
  2467. ExecDataByConfig(this.postDataPramas).then(response => {
  2468. console.log('新增保存发送参数', this.postDataPramas)
  2469. if (response.msg === 'fail') {
  2470. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  2471. } else {
  2472. this.getdataListParm.parammaps.inputDatetime = ''
  2473. setTimeout(() => {
  2474. this.getList()
  2475. }, 1000)
  2476. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  2477. this.dialogFormVisible = false
  2478. }
  2479. })
  2480. return true
  2481. }
  2482. } else {
  2483. this.$notify({
  2484. title: '',
  2485. message: '请选择备件',
  2486. type: 'warning',
  2487. duration: 2000
  2488. })
  2489. return false
  2490. }
  2491. },
  2492. tableCellStyle({ row, column, rowIndex, columnIndex }) {
  2493. if (row.isNo == 'No' && columnIndex === 13) {
  2494. return {
  2495. background: 'red'
  2496. }
  2497. }
  2498. return {
  2499. background: ''
  2500. }
  2501. },
  2502. // 导入
  2503. beforeImportExcel(file) {
  2504. const isLt2M = file.size / 1024 / 1024 < 10
  2505. if (!isLt2M) {
  2506. this.$message.error('上传文件大小不能超过 10MB!')
  2507. }
  2508. return isLt2M
  2509. },
  2510. handleImportExcelSuccess(res, file) {
  2511. if (res.msg === 'ok') {
  2512. this.$message({
  2513. title: '成功',
  2514. message: '导入成功:' + res.data.success + '条!',
  2515. type: 'success',
  2516. duration: 2000
  2517. })
  2518. if (res.data.err_count > 0) {
  2519. this.$notify({
  2520. title: '失败',
  2521. message: '导入失败:' + res.data.err_count + '条!',
  2522. type: 'danger',
  2523. duration: 2000
  2524. })
  2525. import('@/vendor/Export2Excel').then(excel => {
  2526. const list1 = res.data.result
  2527. const tHeader = [
  2528. '牧场', '领用单编号', '领用日期', '物料编码', '品名', '规格型号', '品牌', '计量单位', '实发数量', '单价', '总价', '库位', '供应商', '名称', '牧场设备编号', '具体用处', '领用类型', '领用部门', '领用人', 'SignColumn', '报错信息'
  2529. ]
  2530. const filterVal = [
  2531. '牧场', '领用单编号', '领用日期', '物料编码', '品名', '规格型号', '品牌', '计量单位', '实发数量', '单价', '总价', '库位', '供应商', '名称', '牧场设备编号', '具体用处', '领用类型', '领用部门', '领用人', 'SignColumn', 'error_msg'
  2532. ]
  2533. const data1 = this.formatJson(filterVal, list1)
  2534. excel.export_json_to_excel({
  2535. header: tHeader,
  2536. data: data1,
  2537. filename: this.requestParam.parammaps.formType,
  2538. autoWidth: true,
  2539. bookType: 'xlsx'
  2540. })
  2541. })
  2542. }
  2543. } else {
  2544. this.$notify({
  2545. title: '失败',
  2546. message: '上传失败',
  2547. type: 'danger',
  2548. duration: 2000
  2549. })
  2550. }
  2551. },
  2552. formatJsonTemp(filterVal, jsonData) {
  2553. return jsonData.map(v =>
  2554. filterVal.map(j => {
  2555. if (j === 'timestamp') {
  2556. return parseTime(v[j])
  2557. } else {
  2558. return v[j]
  2559. }
  2560. })
  2561. )
  2562. },
  2563. // 导出
  2564. handleDownload() {
  2565. this.$alert('备件出库信息正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  2566. this.isPercentage = true
  2567. this.percentage = 1
  2568. var timer = setInterval(() => {
  2569. this.percentage += 5
  2570. if (this.percentage > 95) {
  2571. this.percentage = 99
  2572. clearInterval(timer)
  2573. }
  2574. this.percentage = this.percentage
  2575. }, 1000)
  2576. this.requestParam.parammaps.formType = '备件出库信息'
  2577. this.requestParam.parammaps.inputDatetime = this.getdataListParm.parammaps.inputDatetime
  2578. this.requestParam.parammaps.pastureName = this.getdataListParm.parammaps.pastureName
  2579. this.requestParam.parammaps.departmentId = this.getdataListParm.parammaps.departmentId
  2580. this.requestParam.parammaps.useForm = this.getdataListParm.parammaps.useForm
  2581. this.requestParam.parammaps.useType = this.getdataListParm.parammaps.useType
  2582. this.requestParam.parammaps.startTime = this.getdataListParm.parammaps.startTime
  2583. this.requestParam.parammaps.stopTime = this.getdataListParm.parammaps.stopTime
  2584. GetAccount(this.requestParam).then(response => {
  2585. this.$nextTick(() => {
  2586. import('@/vendor/Export2Excel').then(excel => {
  2587. const list1 = response.data.list
  2588. if (response.data.list !== '') {
  2589. this.percentage = 99
  2590. setTimeout(() => {
  2591. this.isPercentage = false
  2592. }, 2000)
  2593. }
  2594. const tHeader = [
  2595. '牧场', '领用单编号', '领用日期', '物料编码', '品名', '规格型号', '品牌', '计量单位', '实发数量', '单价', '总价', '库位', '供应商', '名称', '牧场设备编号', '领用类型', '领用部门', '领用人', '备注']
  2596. const filterVal = [
  2597. 'pastureName', 'useForm', 'creatTime', 'partCode', 'partName', 'specification', 'brandName', 'unit', 'checkoutNumber', 'price', 'sumPrice', 'warehoseCode', 'providerName', 'eqName', 'eqCode', 'useTypeV', 'departmentName', 'appliname', 'note'
  2598. ]
  2599. const data1 = this.formatJson(filterVal, list1)
  2600. excel.export_json_to_excel({ header: tHeader, data: data1, filename: this.requestParam.parammaps.formType, autoWidth: true, bookType: 'xlsx' })
  2601. })
  2602. })
  2603. })
  2604. },
  2605. handleDownload2() {
  2606. this.$alert('备件出库记录正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  2607. this.isPercentage = true
  2608. this.percentage = 1
  2609. var timer = setInterval(() => {
  2610. this.percentage += 5
  2611. if (this.percentage > 95) {
  2612. this.percentage = 99
  2613. clearInterval(timer)
  2614. }
  2615. this.percentage = this.percentage
  2616. }, 1000)
  2617. this.requestParam = {}
  2618. this.requestParam.name = 'getPartuseDetailList'
  2619. this.requestParam.parammaps = {}
  2620. this.requestParam.parammaps.formType = '备件出库记录'
  2621. this.requestParam.parammaps.inputDatetime = this.getdataListParm2.parammaps.inputDatetime
  2622. this.requestParam.parammaps.pastureName = this.getdataListParm2.parammaps.pastureName
  2623. this.requestParam.parammaps.departmentId = this.getdataListParm2.parammaps.departmentId
  2624. this.requestParam.parammaps.startTime = this.getdataListParm2.parammaps.startTime
  2625. this.requestParam.parammaps.stopTime = this.getdataListParm2.parammaps.stopTime
  2626. this.requestParam.parammaps.useForm = this.getdataListParm2.parammaps.useForm
  2627. this.requestParam.parammaps.partCode = this.getdataListParm2.parammaps.partCode
  2628. this.requestParam.parammaps.partName = this.getdataListParm2.parammaps.partName
  2629. this.requestParam.parammaps.providerId = this.getdataListParm2.parammaps.providerId
  2630. GetAccount(this.requestParam).then(response => {
  2631. this.$nextTick(() => {
  2632. import('@/vendor/Export2Excel').then(excel => {
  2633. const list1 = response.data.list
  2634. if (response.data.list !== '') {
  2635. this.percentage = 99
  2636. setTimeout(() => {
  2637. this.isPercentage = false
  2638. }, 2000)
  2639. }
  2640. const tHeader = [
  2641. '牧场', '出库单号', '备件编号', '备件名称', '备件规格', '备件品牌', '计量单位', ' 供应商', '设备名称', '设备内部编号', '费用类型', '库位', '期初库存', '出库数量', '单价', '总价 ', '领用部门 ', '领用人', '录入人 ', '出库 日期', '备注 '
  2642. ]
  2643. const filterVal = [
  2644. 'pastureName', 'useForm', 'partCode', 'partName', 'specification', 'brandName', 'unit', 'providerName', 'eqName', 'eqCode', 'useTypeV', 'warehoseCode', 'reportery', 'checkoutNumber', 'price', 'sumPrice', 'departmentName', 'appliname', 'empname', 'creatTime', 'note'
  2645. ]
  2646. const data1 = this.formatJson(filterVal, list1)
  2647. excel.export_json_to_excel({ header: tHeader, data: data1, filename: this.requestParam.parammaps.formType, autoWidth: true, bookType: 'xlsx' })
  2648. })
  2649. })
  2650. })
  2651. },
  2652. handleDownloadEas() {
  2653. this.$alert('备件出库EAS信息正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  2654. this.isPercentage = true
  2655. this.percentage = 1
  2656. var timer = setInterval(() => {
  2657. this.percentage += 5
  2658. if (this.percentage > 95) {
  2659. this.percentage = 99
  2660. clearInterval(timer)
  2661. }
  2662. this.percentage = this.percentage
  2663. }, 1000)
  2664. this.requestParam.name = 'downloadPartUseEAS'
  2665. this.requestParam.parammaps.inputDatetime = this.getdataListParm.parammaps.inputDatetime
  2666. this.requestParam.parammaps.pastureName = this.getdataListParm.parammaps.pastureName
  2667. this.requestParam.parammaps.departmentId = this.getdataListParm.parammaps.departmentId
  2668. this.requestParam.parammaps.useForm = this.getdataListParm.parammaps.useForm
  2669. this.requestParam.parammaps.useType = this.getdataListParm.parammaps.useType
  2670. this.requestParam.parammaps.startTime = this.getdataListParm.parammaps.startTime
  2671. this.requestParam.parammaps.stopTime = this.getdataListParm.parammaps.stopTime
  2672. GetAccount(this.requestParam).then(response => {
  2673. if (response.data.list !== '') {
  2674. this.percentage = 99
  2675. setTimeout(() => {
  2676. this.isPercentage = false
  2677. }, 2000)
  2678. }
  2679. this.$nextTick(() => {
  2680. import('@/vendor/Export2Excel').then(excel => {
  2681. const list1 = response.data.list
  2682. const tHeader = [
  2683. '*单据编号', '业务日期', '领料出库单明细$成本对象_名称_l2', '领料出库单明细$成本对象_编码', '领料出库单明细$仓库_编码', '领料出库单明细$库位_编码', '领料出库单明细$仓管员_编码', '领料出库单体$领料人_编码', '领料出库单明细_批次', '领料出库单明细_数量', '领料出库单明细_辅助数量', '领料出库单明细_单位实际成本', '领料出库单明细_实际成本', '领料出库单明细_生产日期', '领料出库单明细_到期日期', '领料出库单明细$物料_规格型号', '领料出库单明细$物料_名称_l2', '领料出库单明细$物料_编码', '领料出库单明细$辅助属性_编码', '领料出库单明细$计量单位_编码', '领料出库单明细$辅助计量单位_编码', '领料出库单明细_订单单号', '领料出库单明细_备注', '成本中心_编码', '需求方库存组织_编码', '需方库存组织_名称_l2', '部门_编码', '事务类型_名称_l2', '*事务类型_编码', '创建者_用户名', '创建时间', '领料出库单明细$生产线', '领料出库单明细$班组', '领料出库单明细$领料工序', '领料出库单明细$负责人', '领料出库单明细$成本对象组_单据编号', '领料出库单明细$成本对象组_名称_l2', '领料出库单明细$成本项目_编码', '领料出库单明细$成本项目_名称_l2', '领料出库单体$项目号_编码', '领料出库单体$跟踪号_编码', '摘要', '供应方库存组织_编码', '供应方财务组织_编码', '需求方财务组织_编码', '供方仓库_编码', '供方库位_编码', '结算价', '需方仓库_编码', '需方库位_编码', '仓管员_编码', '领料出库单明细$主制部门_编码', '领料出库单明细$主制部门_名称_l2', '领料出库单明细$成本中心_编码', '领料出库单明细$成本中心_名称_l2', '业务类型_编码', '业务类型_名称'
  2684. ]
  2685. const filterVal = [
  2686. '*单据编号', '业务日期', '领料出库单明细$成本对象_名称_l2', '领料出库单明细$成本对象_编码', '领料出库单明细$仓库_编码', '领料出库单明细$库位_编码', '领料出库单明细$仓管员_编码', '领料出库单体$领料人_编码', '领料出库单明细_批次', '领料出库单明细_数量', '领料出库单明细_辅助数量', '领料出库单明细_单位实际成本', '领料出库单明细_实际成本', '领料出库单明细_生产日期', '领料出库单明细_到期日期', '领料出库单明细$物料_规格型号', '领料出库单明细$物料_名称_l2', '领料出库单明细$物料_编码', '领料出库单明细$辅助属性_编码', '领料出库单明细$计量单位_编码', '领料出库单明细$辅助计量单位_编码', '领料出库单明细_订单单号', '领料出库单明细_备注', '成本中心_编码', '需求方库存组织_编码', '需方库存组织_名称_l2', '部门_编码', '事务类型_名称_l2', '*事务类型_编码', '创建者_用户名', '创建时间', '领料出库单明细$生产线', '领料出库单明细$班组', '领料出库单明细$领料工序', '领料出库单明细$负责人', '领料出库单明细$成本对象组_单据编号', '领料出库单明细$成本对象组_名称_l2', '领料出库单明细$成本项目_编码', '领料出库单明细$成本项目_名称_l2', '领料出库单体$项目号_编码', '领料出库单体$跟踪号_编码', '摘要', '供应方库存组织_编码', '供应方财务组织_编码', '需求方财务组织_编码', '供方仓库_编码', '供方库位_编码', '结算价', '需方仓库_编码', '需方库位_编码', '仓管员_编码', '领料出库单明细$主制部门_编码', '领料出库单明细$主制部门_名称_l2', '领料出库单明细$成本中心_编码', '领料出库单明细$成本中心_名称_l2', '业务类型_编码', '业务类型_名称'
  2687. ]
  2688. const tmultiHeader = [['EAS', '7.5.0', '领料出库单',
  2689. '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
  2690. '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
  2691. '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
  2692. '', '', '', '', '', '', '', '', ''],
  2693. ['MaterialReq', '领料出库单', '', '', '', '', '', '', '', '', '', '',
  2694. '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
  2695. '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
  2696. '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''],
  2697. ['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'
  2698. ]]
  2699. // const tmerges=['B1:D2']
  2700. if (list1 !== null) {
  2701. const data1 = this.formatJsonTemp(filterVal, list1)
  2702. excel.export_json_to_excel({
  2703. // merges: tmerges,
  2704. multiHeader: tmultiHeader,
  2705. header: tHeader,
  2706. data: data1,
  2707. filename: '备件出库EAS',
  2708. autoWidth: true,
  2709. bookType: 'xlsx'
  2710. })
  2711. } else {
  2712. this.$notify({
  2713. title: '',
  2714. message: '无备件领用完成信息,无法导出!',
  2715. type: 'warning',
  2716. duration: 2000
  2717. })
  2718. }
  2719. })
  2720. })
  2721. })
  2722. },
  2723. handleDownloadEas1() {
  2724. this.$alert('备件出库EAS信息正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  2725. this.isPercentage = true
  2726. this.percentage = 1
  2727. var timer = setInterval(() => {
  2728. this.percentage += 5
  2729. if (this.percentage > 95) {
  2730. this.percentage = 99
  2731. clearInterval(timer)
  2732. }
  2733. this.percentage = this.percentage
  2734. }, 1000)
  2735. this.requestParam.name = 'downloadPartUseEASYuan'
  2736. this.requestParam.parammaps.inputDatetime = this.getdataListParm.parammaps.inputDatetime
  2737. this.requestParam.parammaps.pastureName = this.getdataListParm.parammaps.pastureName
  2738. this.requestParam.parammaps.departmentId = this.getdataListParm.parammaps.departmentId
  2739. this.requestParam.parammaps.useForm = this.getdataListParm.parammaps.useForm
  2740. this.requestParam.parammaps.useType = this.getdataListParm.parammaps.useType
  2741. this.requestParam.parammaps.startTime = this.getdataListParm.parammaps.startTime
  2742. this.requestParam.parammaps.stopTime = this.getdataListParm.parammaps.stopTime
  2743. GetAccount(this.requestParam).then(response => {
  2744. if (response.data.list !== '') {
  2745. this.percentage = 99
  2746. setTimeout(() => {
  2747. this.isPercentage = false
  2748. }, 2000)
  2749. }
  2750. this.$nextTick(() => {
  2751. import('@/vendor/Export2Excel').then(excel => {
  2752. const list1 = response.data.list
  2753. const tHeader = [
  2754. '领用部门', '牧场', '领用单编号', '领用日期', '供应商编码', '供应商名称', '出库人', '制单日期', '品名', '物料编码', '计量单位', '单价', '实发数量', '总价', '备注', '领用人', '费用类型'
  2755. ]
  2756. const filterVal = [
  2757. '领用部门', '牧场', '领用单编号', '领用日期', '供应商编码', '供应商名称', '出库人', '制单日期', '品名', '物料编码', '计量单位', '单价', '实发数量', '总价', '备注', '领用人', '费用类型'
  2758. ]
  2759. // const tmerges=['B1:D2']
  2760. if (list1 !== null) {
  2761. const data1 = this.formatJsonTemp(filterVal, list1)
  2762. excel.export_json_to_excel({
  2763. // merges: tmerges,
  2764. // multiHeader: tmultiHeader,
  2765. header: tHeader,
  2766. data: data1,
  2767. filename: '备件出库EAS',
  2768. autoWidth: true,
  2769. bookType: 'xlsx'
  2770. })
  2771. } else {
  2772. this.$notify({
  2773. title: '',
  2774. message: '无备件领用完成信息,无法导出!',
  2775. type: 'warning',
  2776. duration: 2000
  2777. })
  2778. }
  2779. })
  2780. })
  2781. })
  2782. },
  2783. formatJson(filterVal, jsonData) {
  2784. return jsonData.map(v =>
  2785. filterVal.map(j => {
  2786. if (j === 'timestamp') {
  2787. return parseTime(v[j])
  2788. } else {
  2789. return v[j]
  2790. }
  2791. })
  2792. )
  2793. },
  2794. handleDelate(row) {
  2795. console.log('点击了删除')
  2796. this.getdataListSee.parammaps.id = row.id
  2797. this.getSeeList()
  2798. MessageBox.confirm('确认删除此条信息?', {
  2799. confirmButtonText: '确认',
  2800. cancelButtonText: '取消',
  2801. type: 'warning'
  2802. }).then(() => {
  2803. this.postDataPramas.common = { 'returnmap': '0' }
  2804. this.postDataPramas.data = []
  2805. this.postDataPramas.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listSee }}
  2806. this.postDataPramas.data[0].children = []
  2807. this.postDataPramas.data[0].children[0] = { 'name': 'updatePartRepertoryDelCK', 'type': 'e', 'parammaps': {
  2808. id: '@insertSpotList.id',
  2809. contractId: '@insertSpotList.contractId',
  2810. partCode: '@insertSpotList.partCode',
  2811. pastureId: row.pastureId
  2812. }}
  2813. this.postDataPramas.data[0].children[1] = { 'name': 'deletePartUse', 'type': 'e', 'parammaps': {
  2814. id: '@insertSpotList.id'
  2815. }}
  2816. this.postDataPramas.data[1] = { 'name': 'updatePartApplyDel', 'type': 'e', 'parammaps': {
  2817. applyCode: row.useForm
  2818. }}
  2819. this.postDataPramas.data[2] = { 'name': 'deleteBigPartUse', 'type': 'e', 'parammaps': {
  2820. id: row.id
  2821. }}
  2822. ExecDataByConfig(this.postDataPramas).then(response => {
  2823. this.getList()
  2824. this.$notify({
  2825. title: '成功',
  2826. message: '删除成功',
  2827. type: 'success',
  2828. duration: 2000
  2829. })
  2830. })
  2831. }).catch(() => {
  2832. this.$message({ type: 'info', message: '已取消删除' })
  2833. })
  2834. },
  2835. // ---------------------------------------
  2836. // 编辑--- 修改保存
  2837. edit_dialog_save() {
  2838. console.log('编辑保存')
  2839. },
  2840. // 导出模板
  2841. handleDownloadTemp() {
  2842. this.requestParam.name = 'stockLaidDownTemp'
  2843. GetDataByName(this.requestParam).then(response => {
  2844. this.$nextTick(() => {
  2845. import('@/vendor/Export2Excel').then(excel => {
  2846. const list1 = response.data.list
  2847. const tHeader = [
  2848. '牧场', '领用单编号', '领用日期', '物料编码', '品名', '规格型号', '品牌', '计量单位', '实发数量', '单价', '总价', '库位', '供应商', '名称', '牧场设备编号', '具体用处', '领用类型', '领用部门', '领用人'
  2849. ]
  2850. const filterVal = [
  2851. '牧场', '领用单编号', '领用日期', '物料编码', '品名', '规格型号', '品牌', '计量单位', '实发数量', '单价', '总价', '库位', '供应商', '名称', '牧场设备编号', '具体用处', '领用类型', '领用部门', '领用人'
  2852. ]
  2853. const data1 = this.formatJsonTemp(filterVal, list1)
  2854. excel.export_json_to_excel({
  2855. header: tHeader,
  2856. data: data1,
  2857. filename: '出库模板',
  2858. autoWidth: true,
  2859. bookType: 'xlsx'
  2860. })
  2861. })
  2862. })
  2863. })
  2864. },
  2865. handleEAS() {
  2866. this.easStatus.dialogStatus = 'easStatus'
  2867. this.easStatus.dialogFormVisible = true
  2868. this.getListEasStatusLst()
  2869. },
  2870. getListEasStatusLst() {
  2871. this.easStatus.listLoading = true
  2872. GetDataByName(this.easStatus.getdataListParm).then(response => {
  2873. if (response.data.list !== null) {
  2874. this.easStatus.list = response.data.list
  2875. } else {
  2876. this.easStatus.list = []
  2877. }
  2878. this.easStatus.pageNum = response.data.pageNum
  2879. this.easStatus.pageSize = response.data.pageSize
  2880. if (response.data.total) {
  2881. this.easStatus.total = response.data.total
  2882. }
  2883. })
  2884. setTimeout(() => {
  2885. this.easStatus.listLoading = false
  2886. }, 100)
  2887. },
  2888. handleClose(row) {
  2889. MessageBox.confirm('是否确认关闭同步此数据?', {
  2890. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  2891. }).then(() => {
  2892. this.requestParam = {}
  2893. this.requestParam.name = 'updatebigpartuseSync'
  2894. this.requestParam.parammaps = {}
  2895. this.requestParam.parammaps.issync = '2'
  2896. this.requestParam.parammaps.id = row.id
  2897. PostDataByName(this.requestParam).then((response) => {
  2898. if (response.msg !== 'fail') {
  2899. this.$notify({ title: '成功', message: '关闭同步成功', type: 'success', duration: 2000 })
  2900. this.getListEasStatusLst()
  2901. this.getList()
  2902. } else {
  2903. this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
  2904. this.getListEasStatusLst()
  2905. this.getList()
  2906. }
  2907. })
  2908. }).catch(() => {
  2909. this.$message({ type: 'info', message: '已取消关闭同步' })
  2910. })
  2911. },
  2912. handleManual(row) {
  2913. MessageBox.confirm('是否确认同步此数据至EAS?', {
  2914. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  2915. }).then(() => {
  2916. this.requestParam = {}
  2917. this.requestParam.typeIn = row.typeIn
  2918. this.requestParam.billCode = row.billCode
  2919. EasSync(this.requestParam).then((response) => {
  2920. if (response.msg !== 'fail') {
  2921. this.$notify({ title: '成功', message: '手动同步成功', type: 'success', duration: 2000 })
  2922. this.getListEasStatusLst()
  2923. this.getList()
  2924. } else {
  2925. this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
  2926. this.getListEasStatusLst()
  2927. this.getList()
  2928. }
  2929. })
  2930. }).catch(() => {
  2931. this.$message({ type: 'info', message: '已取消手动同步' })
  2932. })
  2933. },
  2934. handleIgnore(row) {
  2935. MessageBox.confirm('是否确认忽略同步此数据?', {
  2936. confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
  2937. }).then(() => {
  2938. this.requestParam = {}
  2939. this.requestParam.name = 'updatebigpartuseSync'
  2940. this.requestParam.parammaps = {}
  2941. this.requestParam.parammaps.issync = '3'
  2942. this.requestParam.parammaps.id = row.id
  2943. PostDataByName(this.requestParam).then((response) => {
  2944. if (response.msg !== 'fail') {
  2945. this.$notify({ title: '成功', message: '忽略同步成功', type: 'success', duration: 2000 })
  2946. this.getListEasStatusLst()
  2947. this.getList()
  2948. } else {
  2949. this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
  2950. this.getListEasStatusLst()
  2951. this.getList()
  2952. }
  2953. })
  2954. }).catch(() => {
  2955. this.$message({ type: 'info', message: '已取消忽略同步' })
  2956. })
  2957. }
  2958. }
  2959. }
  2960. </script>
  2961. <style lang="scss">
  2962. .inputDatetime .el-range-separator{
  2963. padding: 0;
  2964. margin: 0 10px;
  2965. }
  2966. .el-radio__label{
  2967. padding-left: 2px !important;
  2968. }
  2969. .el-form-item__error{padding-top: 0;}
  2970. body .el-table th.gutter {
  2971. display: table-cell !important;
  2972. }
  2973. .el-table{
  2974. width:99.9%;
  2975. }
  2976. </style>
  2977. <style lang="scss" scoped>
  2978. .el-radio{
  2979. margin-right: 5px;
  2980. }
  2981. .el-form-item__content{
  2982. line-height: 0;
  2983. }
  2984. </style>