warehouseManagementList.vue 71 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223
  1. <!--仓库管理-->
  2. <template>
  3. <div class="container">
  4. <!-- 表格 -->
  5. <!-- <div class="top_form" v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.kan`">
  6. <div style='position:relative;' class="title">
  7. <span style="font-size:18px;font-weight: 600;margin-left:20px">今日储量明细</span><span style="color:#8890B1;font-size:16px">({{dateTime}})</span>
  8. <ws-button type="primary" v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.kan`" @click="handleall()" style="margin-left:20px;position:absolute;right:10px;top:50%;transform: translateY(-50%);">库存明细</ws-button>
  9. </div>
  10. <el-table :data="tableData" style="width: 100%;margin-top:20px">
  11. <el-table-column :prop="item" :label="item" show-overflow-tooltip v-for="(item, index) in tableHeader" :key="index"></el-table-column>
  12. </el-table>
  13. </div> -->
  14. <div class="flex">
  15. <div class="left" style="width:35%;">
  16. <el-form
  17. class="position"
  18. ref="deptBudgetList"
  19. :rules="rules"
  20. :model="deptBudgetList"
  21. >
  22. <div class="title"><span class="cangInfo">仓库信息</span></div>
  23. <!-- 仓储部负责人 -->
  24. <!-- <el-form-item label-width="120px" label="仓储部负责人" span="1" prop="acceptanceMethod">
  25. <el-input v-model="responsible" placeholder="暂无" maxlength="100" size="small" disabled/>
  26. </el-form-item> -->
  27. <!--仓库名称-->
  28. <el-form-item
  29. label-width="120px"
  30. label="仓库名"
  31. span="1"
  32. prop="warehouseName"
  33. >
  34. <el-select
  35. v-model="warehouseInfo.warehouseName"
  36. placeholder="请选择仓库名"
  37. filterable
  38. clearable
  39. @change="selectstaff"
  40. :filter-method="warehouseQuery"
  41. >
  42. <el-option
  43. v-for="item in warehouseXiaLa"
  44. :key="item.warehouseName"
  45. :label="item.warehouseName"
  46. :value="item.warehouseName"
  47. />
  48. </el-select>
  49. </el-form-item>
  50. <!--仓库所在地-->
  51. <el-form-item
  52. label-width="120px"
  53. label="仓库所在地"
  54. span="1"
  55. prop="acceptanceMethod"
  56. >
  57. <el-input
  58. v-model="warehouseInfo.warehouseLocation"
  59. placeholder="暂无"
  60. maxlength="100"
  61. size="small"
  62. disabled
  63. />
  64. </el-form-item>
  65. <!--详细地址-->
  66. <el-form-item
  67. label-width="120px"
  68. label="详细地址"
  69. span="1"
  70. prop="detailedAddress"
  71. class="readonly"
  72. >
  73. <el-input
  74. v-model="warehouseInfo.detailedAddress"
  75. placeholder="暂无"
  76. maxlength="100"
  77. size="small"
  78. disabled
  79. />
  80. </el-form-item>
  81. <!--总储量(吨)-->
  82. <el-form-item
  83. label-width="120px"
  84. label="最大容量(吨)"
  85. span="1"
  86. prop="settlementMethod"
  87. v-if="warehouseType == 1"
  88. >
  89. <el-input
  90. :readonly="true"
  91. v-model="warehouseInfo.maxReserves"
  92. maxlength="100"
  93. placeholder="暂无"
  94. size="small"
  95. disabled
  96. />
  97. </el-form-item>
  98. <!--负责人-->
  99. <el-form-item
  100. label-width="120px"
  101. label="负责人"
  102. span="1"
  103. prop="personCharge"
  104. >
  105. <el-input
  106. v-model="warehouseInfo.personCharge"
  107. placeholder="暂无"
  108. maxlength="100"
  109. size="small"
  110. disabled
  111. />
  112. </el-form-item>
  113. <!--其他负责人-->
  114. <el-form-item
  115. label-width="120px"
  116. label="其他驻库人员"
  117. span="1"
  118. prop="otherPersonCharge"
  119. >
  120. <!-- <el-select v-model="WarehouseInfo.otherPersonPhone" placeholder="暂无" @change="selectstaffOther" multiple filterable clearable collapse-tags disabled> -->
  121. <el-input
  122. v-model="warehouseInfo.otherPersonCharge"
  123. placeholder="暂无"
  124. maxlength="100"
  125. size="small"
  126. disabled
  127. />
  128. </el-form-item>
  129. </el-form>
  130. </div>
  131. <div class="right" style="width:70%">
  132. <div class="position">
  133. <div class="title"><span class="cangInfo">仓库储量</span></div>
  134. <div class="weight">
  135. <el-switch
  136. style="display: block"
  137. v-model="value"
  138. active-color="#13ce66"
  139. inactive-color="#409EFF"
  140. active-text="折算纯重"
  141. inactive-text="实际重量"
  142. active-value="1"
  143. inactive-value="0"
  144. @change="changeWeight"
  145. ></el-switch>
  146. <!-- <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.view` " @click="changeWeight(2)">实际重量</ws-button>
  147. <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.view` " @click="changeWeight(1)">折算纯重</ws-button> -->
  148. </div>
  149. <div class="color">
  150. <div v-for="(item, i) in totalReserves" :key="i" class="color_for">
  151. <div
  152. :style="{ background: lineColor[i] }"
  153. class="color_item"
  154. ></div>
  155. <div class="color_goodsName">{{ item.goodsName }}</div>
  156. </div>
  157. </div>
  158. <div
  159. v-for="(item, index) in totalReserves"
  160. :key="index"
  161. class="reservesInfo"
  162. >
  163. <div class="reservesInfo_item" v-if="warehouseType == '1'">
  164. <div class="reservesInfo_GoodsName">{{ item.goodsName }}</div>
  165. <span class="reservesInfo_Amount"
  166. >{{ item.stockNum == 0 ? '-' : item.stockNum }}(吨)</span
  167. ><br />
  168. <span
  169. v-if="item.stockNum && item.cost"
  170. class="reservesInfo_Amount"
  171. >{{ item.cost == 0 ? '-' : item.cost }}(元/吨)</span
  172. >
  173. <span v-else class="reservesInfo_Amount"
  174. >{{
  175. item.conversionCost == 0 ? '-' : item.conversionCost
  176. }}(元/吨)</span
  177. ><br />
  178. <div style="display:grid">
  179. <span
  180. v-if="item.cargoWeight && item.cargoWeight != 0"
  181. class="reservesInfo_Amount"
  182. >含转入:{{ item.cargoWeight }}(吨)</span
  183. >
  184. <span
  185. v-if="item.redemptionWeight && item.redemptionWeight != 0"
  186. class="reservesInfo_Amount"
  187. >待赎回:{{ item.redemptionWeight }}(吨)</span
  188. >
  189. </div>
  190. </div>
  191. <div class="reservesInfo_item" v-if="warehouseType == '2'">
  192. <div class="reservesInfo_GoodsName">{{ item.goodsName }}(吨)</div>
  193. <span class="reservesInfo_Amount">{{
  194. item.surplus == 0 ? '-' : item.surplus
  195. }}</span>
  196. </div>
  197. </div>
  198. <div
  199. ref="myEchart7"
  200. style="height: 250px; width:96%;border-radius: 4px; border:1px solid #D8DCE6; padding: 10px;"
  201. class="column"
  202. ></div>
  203. </div>
  204. </div>
  205. </div>
  206. <div class="position">
  207. <div class="title">
  208. <span style="font-size:18px;font-weight: 600;margin-left:20px"
  209. >当期储量</span
  210. >
  211. </div>
  212. <ws-button
  213. type="primary"
  214. @click="handleAdd()"
  215. v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.add`"
  216. style="margin-left:20px"
  217. >添加</ws-button
  218. >
  219. <!-- <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.view` " @click="handleLook()">查看</ws-button> -->
  220. <ws-button
  221. v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.edit`"
  222. @click="handleEdit()"
  223. >编辑</ws-button
  224. >
  225. <!-- <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.delete`" @click="handleDelete()">删除</ws-button> -->
  226. <ws-button
  227. v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.view`"
  228. @click="record()"
  229. >记录</ws-button
  230. >
  231. <!-- <ws-button v-if="warehouseType == '1'" v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.view`" @click="loss()">盘库</ws-button> -->
  232. <!-- <ws-button v-if="warehouseInfo.clearStatusFlag == 1 && warehouseType == '2'" @click="clearance()">清库</ws-button> -->
  233. <!-- <ws-button v-if="warehouseInfo.clearStatusFlag == 3 && warehouseType == '2'" disabled> 已清库</ws-button> -->
  234. <!-- createType 1手动创建 2 自动创建 -->
  235. <!-- <ws-button v-if='warehouseInfo.createType==1' v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.delete`" @click="indialog = true">入库量</ws-button> -->
  236. <!-- <ws-button v-if='list.length>0' @click="handlTask()">任务</ws-button> -->
  237. <ws-button
  238. v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.add`"
  239. @click="outData(1)"
  240. >导出</ws-button
  241. >
  242. <ws-button @click="outData(2)">打印</ws-button>
  243. <!-- <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.kan`" @click="exportHistoricalData()">导出历史库存记录</ws-button> -->
  244. <ws-button
  245. @click="transformation()"
  246. v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.view`"
  247. >折转</ws-button
  248. >
  249. <!-- <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.kan`" @click="handleall()">全部仓库</ws-button> -->
  250. <!-- <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.kan`" @click="handleMintor()">查看监控</ws-button> -->
  251. <ws-button @click="dryClick()">烘干入库</ws-button>
  252. <!-- <ws-button @click="materialInOut()">物料出入库</ws-button> -->
  253. <el-table
  254. ref="table"
  255. show-summary
  256. :summary-method="getSummaries"
  257. class="wenzi setUp_css"
  258. :data="warehouseList"
  259. style="width: 100%; margin-top: 20px"
  260. height="calc(100% - 45px)"
  261. v-if="warehouseType == '1'"
  262. >
  263. <el-table-column prop="warehouseName" label="仓库名"> </el-table-column>
  264. <el-table-column prop="binNumber" label="仓位编号"> </el-table-column>
  265. <el-table-column prop="capacity" label="容量(吨)">
  266. <template slot-scope="scope">
  267. <div
  268. v-if="scope.row.capacity != 'null' && scope.row.capacity != null"
  269. >
  270. {{ scope.row.capacity }}
  271. </div>
  272. </template>
  273. </el-table-column>
  274. <el-table-column label="货名">
  275. <template slot-scope="scope">
  276. <div
  277. style="height: 24px"
  278. v-for="(item, i) in scope.row.warehouseNumViewList"
  279. :key="i"
  280. >
  281. {{ item.goodsName }}
  282. </div>
  283. </template>
  284. </el-table-column>
  285. <el-table-column label="入库量(吨)">
  286. <template slot-scope="scope">
  287. <div
  288. style="height: 24px"
  289. v-for="(item, i) in scope.row.warehouseNumViewList"
  290. :key="i"
  291. >
  292. {{ item.inNetWeight }}
  293. </div>
  294. </template>
  295. </el-table-column>
  296. <el-table-column label="出库量(吨)">
  297. <template slot-scope="scope">
  298. <div
  299. style="height: 24px"
  300. v-for="(item, i) in scope.row.warehouseNumViewList"
  301. :key="i"
  302. >
  303. {{
  304. item.outNetWeight == 0
  305. ? '0'
  306. : Number(item.outNetWeight).toFixed(3)
  307. }}
  308. </div>
  309. </template>
  310. </el-table-column>
  311. <el-table-column label="应余量(吨)">
  312. <template slot-scope="scope">
  313. <div
  314. style="height: 24px"
  315. v-for="(item, i) in scope.row.warehouseNumViewList"
  316. :key="i"
  317. >
  318. {{ item.storage }}
  319. </div>
  320. </template>
  321. </el-table-column>
  322. </el-table>
  323. <!-- 临时库 -->
  324. <el-table
  325. class="wenzi"
  326. :data="warehouseList"
  327. style="width: 100%; margin-top: 20px"
  328. height="calc(100% - 45px)"
  329. v-if="warehouseType == '2'"
  330. >
  331. <el-table-column prop="warehouseName" label="仓库名"> </el-table-column>
  332. <el-table-column prop="binNumber" label="仓位编号"> </el-table-column>
  333. <el-table-column prop="capacity" label="容量(吨)">
  334. <template slot-scope="scope">
  335. <div
  336. v-if="scope.row.capacity != 'null' && scope.row.capacity != null"
  337. >
  338. {{ scope.row.capacity }}
  339. </div>
  340. </template>
  341. </el-table-column>
  342. <el-table-column label="货名">
  343. <template slot-scope="scope">
  344. <div
  345. style="height: 24px"
  346. v-for="(item, i) in scope.row.warehouseNumViewList"
  347. :key="i"
  348. >
  349. {{ item.goodsName }}
  350. </div>
  351. </template>
  352. </el-table-column>
  353. <el-table-column label="入库量(吨)">
  354. <template slot-scope="scope">
  355. <div
  356. style="height: 24px"
  357. v-for="(item, i) in scope.row.warehouseNumViewList"
  358. :key="i"
  359. >
  360. {{ item.inNetWeight }}
  361. </div>
  362. </template>
  363. </el-table-column>
  364. <el-table-column label="出库量(吨)">
  365. <template slot-scope="scope">
  366. <div
  367. style="height: 24px"
  368. v-for="(item, i) in scope.row.warehouseNumViewList"
  369. :key="i"
  370. >
  371. {{ item.outNetWeight }}
  372. </div>
  373. </template>
  374. </el-table-column>
  375. <el-table-column label="应余量(吨)">
  376. <template slot-scope="scope">
  377. <div
  378. style="height: 24px"
  379. v-for="(item, i) in scope.row.warehouseNumViewList"
  380. :key="i"
  381. >
  382. {{ item.surplus }}
  383. </div>
  384. </template>
  385. </el-table-column>
  386. </el-table>
  387. </div>
  388. <!-- <div class="map">
  389. <div class="title">
  390. <span style="font-size:18px;font-weight: 600;margin-left:20px">{{
  391. maptitle
  392. }}</span>
  393. </div>
  394. <div class="map_switch">
  395. <div :class="btnCss1" @click="mapChange(1)" v-if="warehouseType == '1'">
  396. 监控
  397. </div>
  398. <div :class="btnCss2" @click="mapChange(2)">定位</div>
  399. </div>
  400. <div
  401. class="map-item"
  402. v-if="mapshow && warehousePositioning.lat && warehousePositioning.lng"
  403. >
  404. <map-drag
  405. @marker="marker"
  406. ref="childMap"
  407. :isShowaddress="true"
  408. v-on:addressListen="getAddress"
  409. v-on:pickedAddress="searchAddress"
  410. :warehousePositioning="warehousePositioning"
  411. ></map-drag>
  412. </div>
  413. <div v-if="!mapshow && warehouseType == '1'" class="monitor">
  414. <div v-if="!monitorUrl1" class="video1">
  415. <img src="../../../public/img/quesheng@2x.png" alt="" class="img1" />
  416. <div>监控视频未连接</div>
  417. </div>
  418. <div v-else class="video1">
  419. <iframe
  420. :src="monitorUrl1"
  421. width="440"
  422. height="360"
  423. allowfullscreen="true"
  424. webkitallowfullscreen="true"
  425. mozallowfullscreen="true"
  426. allow="autoplay; fullscreen; microphone;"
  427. ></iframe>
  428. </div>
  429. <div v-if="!monitorUrl2" class="video1">
  430. <img src="../../../public/img/quesheng@2x.png" alt="" class="img1" />
  431. <div>监控视频未连接</div>
  432. </div>
  433. <div v-else class="video2">
  434. <iframe
  435. :src="monitorUrl2"
  436. width="440"
  437. height="360"
  438. allowfullscreen="true"
  439. webkitallowfullscreen="true"
  440. mozallowfullscreen="true"
  441. allow="autoplay; fullscreen; microphone;"
  442. ></iframe>
  443. </div>
  444. </div>
  445. </div> -->
  446. <el-dialog
  447. title="修改入库量"
  448. :visible.sync="indialog"
  449. width="30%"
  450. :before-close="handleClose"
  451. top="35vh"
  452. >
  453. <el-form>
  454. <el-form-item
  455. label-width="120px"
  456. label="入库量(吨)"
  457. span="1"
  458. prop="acceptanceMethod"
  459. >
  460. <el-input
  461. v-model="inWarehouse"
  462. placeholder="请输入入库量"
  463. maxlength="100"
  464. size="small"
  465. type="number"
  466. />
  467. </el-form-item>
  468. </el-form>
  469. <span slot="footer" class="dialog-footer">
  470. <el-button @click="handleClose">取 消</el-button>
  471. <el-button type="primary" @click="submit">确 定</el-button>
  472. </span>
  473. </el-dialog>
  474. <div class="mask" v-show="isShowPrintType"></div>
  475. <div class="print-type" v-show="isShowPrintType">
  476. <div class="print-type-content">
  477. <div class="print-type-title">{{ headerText }}</div>
  478. <div class="print-type-checkbox">
  479. <el-form ref="form" label-width="110px">
  480. <el-form-item label="类型">
  481. <el-radio-group v-model="parameter.radio">
  482. <el-radio :label="3">入库记录</el-radio>
  483. <el-radio :label="2">出库记录</el-radio>
  484. </el-radio-group>
  485. </el-form-item>
  486. <el-form-item label="起始日期">
  487. <el-date-picker
  488. type="datetime"
  489. @change="startDataChange"
  490. format="yyyy-MM-dd HH:mm:ss"
  491. value-format="yyyy-MM-dd HH:mm:ss"
  492. placeholder="请选择起始日期"
  493. v-model="parameter.printStartDate"
  494. default-time="00:00:00"
  495. ></el-date-picker>
  496. <!-- <el-date-picker v-model="value3" type="datetime" placeholder="选择日期时间" default-time="12:00:00"></el-date-picker> -->
  497. </el-form-item>
  498. <el-form-item label="截止日期">
  499. <el-date-picker
  500. type="datetime"
  501. @change="endDataChange"
  502. format="yyyy-MM-dd HH:mm:ss"
  503. value-format="yyyy-MM-dd HH:mm:ss"
  504. placeholder="请选择截止日期"
  505. v-model="parameter.printEndDate"
  506. default-time="00:00:00"
  507. >
  508. </el-date-picker>
  509. </el-form-item>
  510. <!-- <el-form-item label="截止日期1">
  511. <el-date-picker value-format="timestamp" type="date" placeholder="请选择截止日期" v-model="parameter.endDate1">
  512. </el-date-picker>
  513. </el-form-item> -->
  514. <!--仓库名称-->
  515. <el-form-item label="仓库名称" span="1" prop="warehouseName">
  516. <el-select
  517. @change="warehousechange"
  518. v-model="parameter.warehouseName"
  519. placeholder="请选择仓库名称"
  520. filterable
  521. clearable
  522. >
  523. <el-option
  524. v-if="headerText != '打印记录'"
  525. key=""
  526. label="全部仓库"
  527. value="全部仓库"
  528. />
  529. <el-option
  530. v-for="item in warehouseAllXiaLa"
  531. :key="item.warehouseName"
  532. :label="item.warehouseName"
  533. :value="item.warehouseName"
  534. />
  535. </el-select>
  536. </el-form-item>
  537. <el-form-item label="仓位编号" span="1" prop="warehouseName">
  538. <el-select
  539. v-model="parameter.binNumber"
  540. placeholder="请选择仓位编号"
  541. filterable
  542. clearable
  543. >
  544. <el-option
  545. v-for="item in typeList"
  546. :key="item.id"
  547. :label="item.binNumber"
  548. :value="item.binNumber"
  549. />
  550. </el-select>
  551. </el-form-item>
  552. <el-form-item
  553. v-if="headerText != '导出记录'"
  554. label="货名"
  555. span="1"
  556. prop="warehouseName"
  557. >
  558. <el-select
  559. v-model="parameter.goodsName"
  560. placeholder="请选择货名"
  561. filterable
  562. clearable
  563. >
  564. <el-option
  565. v-for="item in goodnameList"
  566. :key="item.constKey"
  567. :label="item.constValue"
  568. :value="item.constValue"
  569. />
  570. </el-select>
  571. </el-form-item>
  572. <!-- <el-form-item label="增量比例(%)" v-if="headerText == '打印记录'">
  573. <el-input placeholder="请输入增量比例" v-model="parameter.proportion" clearable class="proportion_css">
  574. </el-input>
  575. </el-form-item> -->
  576. </el-form>
  577. </div>
  578. </div>
  579. <div class="bottom-btn">
  580. <el-button @click="submitClick()">确定</el-button>
  581. <el-button @click="removePrint">取消</el-button>
  582. </div>
  583. </div>
  584. <div class="mask" v-show="isShowPrintType1"></div>
  585. <div class="print-type" v-show="isShowPrintType1">
  586. <div class="print-type-content">
  587. <div class="print-type-title">{{ headerText1 }}</div>
  588. <div class="print-type-checkbox">
  589. <el-form ref="form" label-width="110px">
  590. <el-form-item label="起始日期">
  591. <el-date-picker
  592. value-format="yyyy-MM-dd"
  593. type="date"
  594. placeholder="请选择起始日期"
  595. v-model="parameter.startDate"
  596. >
  597. </el-date-picker>
  598. </el-form-item>
  599. <el-form-item label="截止日期">
  600. <el-date-picker
  601. value-format="yyyy-MM-dd"
  602. type="date"
  603. placeholder="请选择截止日期"
  604. v-model="parameter.endDate"
  605. >
  606. </el-date-picker>
  607. </el-form-item>
  608. <!--仓库名称-->
  609. <el-form-item label="仓库名称" span="1" prop="warehouseName">
  610. <el-select
  611. v-model="parameter.warehouseName"
  612. placeholder="请选择仓库名称"
  613. filterable
  614. clearable
  615. >
  616. <el-option key="" label="全部仓库" value="全部仓库" />
  617. <el-option
  618. v-for="item in warehouseAllXiaLa"
  619. :key="item.warehouseName"
  620. :label="item.warehouseName"
  621. :value="item.warehouseName"
  622. />
  623. </el-select>
  624. </el-form-item>
  625. </el-form>
  626. </div>
  627. </div>
  628. <div class="bottom-btn">
  629. <el-button @click="submitClick1()">确定</el-button>
  630. <el-button @click="removePrint1">取消</el-button>
  631. </div>
  632. </div>
  633. </div>
  634. </template>
  635. <script>
  636. import { packList } from '@/model/contarct/index'
  637. import {
  638. getList,
  639. getsponsible,
  640. clearancee,
  641. xiala,
  642. getQualityZhe,
  643. getQualityReal,
  644. exportHistoricalInventory,
  645. postExport,
  646. addselectinfoList,
  647. printAdd,
  648. postExportOut,
  649. getreserves,
  650. getResponsible,
  651. deletewarehouse,
  652. postInWeight,
  653. getwarehousNameNew,
  654. getbintype,
  655. postExportjynin,
  656. postExportjynout
  657. } from '@/model/warehouse/index'
  658. import mapDrag from '@/components/mapdrag/warehouseMap'
  659. import { downloadFile } from '@/utils/batchDown'
  660. import { dayjs, EventBus } from 'base-core-lib'
  661. import Pagination from '@/components/Pagination'
  662. import WsUpload from '@/components/WsUpload'
  663. import axios from 'axios'
  664. export default {
  665. name: 'viewSpareMoney',
  666. components: {
  667. WsUpload,
  668. Pagination,
  669. mapDrag,
  670. axios
  671. },
  672. watch: {
  673. vesselId(val) {
  674. this.getList()
  675. },
  676. isShow(val) {
  677. this.showType = val
  678. }
  679. },
  680. data() {
  681. return {
  682. value: '0',
  683. compName: localStorage.getItem('ws-pf_compName'),
  684. rules: {},
  685. options: [],
  686. StartDate: '',
  687. compId: localStorage.getItem('ws-pf_compId'),
  688. deptBudgetList: {},
  689. dateTime: '',
  690. list: [],
  691. warehouseList: [],
  692. warehouseType: '1',
  693. totalStorage: 0,
  694. radio: 0,
  695. tableHeader: [],
  696. tableData: [],
  697. totalReserves: [],
  698. warehouseXiaLa: [],
  699. warehouseInfo: {
  700. warehouseName: ''
  701. },
  702. lineColor: [
  703. '#5878E8',
  704. '#50CAD4',
  705. '#FF9F24',
  706. '#E87C25',
  707. '#27727B',
  708. '#FE8463',
  709. '#9BCA63',
  710. '#FAD860',
  711. '#F3A43B',
  712. '#60C0DD',
  713. '#D7504B',
  714. '#C6E579',
  715. '#F4E001',
  716. '#F0805A',
  717. '#26C0C0'
  718. ],
  719. warehouseXiaLaCopy: [],
  720. warehouseAllXiaLa: [],
  721. responsible: '',
  722. maptitle: '库点监控',
  723. btnCss1: 'btn1',
  724. btnCss2: 'btn',
  725. mapshow: false,
  726. indialog: false,
  727. inWarehouse: '',
  728. parameter: {
  729. startDate: '',
  730. endDate: ''
  731. },
  732. EndDate: '',
  733. isShowPrintType: false, //打印
  734. headerText: '',
  735. typeList: [],
  736. isShowPrintType1: false,
  737. headerText1: '导出历史库存记录',
  738. date: {
  739. year: dayjs().format('YYYY'),
  740. month: dayjs().format('MM')
  741. },
  742. warehousePositioning: {},
  743. monitorUrl1: '',
  744. monitorUrl2: '',
  745. goodnameList: []
  746. }
  747. },
  748. activated() {
  749. this.tableData = []
  750. this.getList()
  751. // this.$refs.childMap.clearVal()
  752. this.showType = this.isShow
  753. },
  754. methods: {
  755. startDataChange(e) {
  756. var d = new Date(e)
  757. let year = d.getFullYear()
  758. let month = d.getMonth() + 1
  759. month = month < 10 ? '0' + month : month
  760. let date = d.getDate() < 10 ? '0' + d.getDate() : d.getDate()
  761. let hours = d.getHours() < 10 ? '0' + d.getHours() : d.getHours()
  762. let minutes = d.getMinutes() < 10 ? '0' + d.getMinutes() : d.getMinutes()
  763. let seconds = d.getSeconds() < 10 ? '0' + d.getSeconds() : d.getSeconds()
  764. this.parameter.printStartDate =
  765. year +
  766. '-' +
  767. month +
  768. '-' +
  769. date +
  770. ' ' +
  771. hours +
  772. ':' +
  773. minutes +
  774. ':' +
  775. seconds
  776. },
  777. endDataChange(e) {
  778. var d = new Date(e)
  779. let year = d.getFullYear()
  780. let month = d.getMonth() + 1
  781. month = month < 10 ? '0' + month : month
  782. let date = d.getDate() < 10 ? '0' + d.getDate() : d.getDate()
  783. let hours = d.getHours() < 10 ? '0' + d.getHours() : d.getHours()
  784. let minutes = d.getMinutes() < 10 ? '0' + d.getMinutes() : d.getMinutes()
  785. let seconds = d.getSeconds() < 10 ? '0' + d.getSeconds() : d.getSeconds()
  786. this.parameter.printEndDate =
  787. year +
  788. '-' +
  789. month +
  790. '-' +
  791. date +
  792. ' ' +
  793. hours +
  794. ':' +
  795. minutes +
  796. ':' +
  797. seconds
  798. },
  799. warehousechange(e) {
  800. for (let i = 0; i < this.warehouseAllXiaLa.length; i++) {
  801. if (this.warehouseAllXiaLa[i].warehouseName == e) {
  802. getbintype({ baseId: this.warehouseAllXiaLa[i].id })
  803. .toPromise()
  804. .then(response => {
  805. console.log(response)
  806. this.typeList = response
  807. })
  808. }
  809. }
  810. },
  811. downloadFile(url, fileName) {
  812. //fileurl文件地址(一般是接口返回) filename文件下载后的名字
  813. const x = new XMLHttpRequest()
  814. x.open('GET', url, true)
  815. x.responseType = 'blob'
  816. x.onload = function() {
  817. const url = window.URL.createObjectURL(x.response)
  818. const a = document.createElement('a')
  819. a.href = url
  820. a.download = fileName
  821. a.click()
  822. document.body.removeChild(a)
  823. // 然后移除
  824. }
  825. x.send()
  826. },
  827. //导出、打印EndDate
  828. outData(index) {
  829. if (index == 1) {
  830. this.headerText = '导出记录'
  831. } else if (index == 2) {
  832. this.headerText = '打印记录'
  833. let now = new Date()
  834. let tomorrow = new Date(now.getTime() + 24 * 60 * 60 * 1000)
  835. var year = tomorrow.getFullYear()
  836. var month = tomorrow.getMonth() + 1
  837. var strDate = tomorrow.getDate()
  838. if (strDate < 10) {
  839. strDate = '0' + strDate
  840. }
  841. var pastdate = new Date()
  842. this.StartDate =
  843. pastdate.getFullYear() +
  844. '-' +
  845. (pastdate.getMonth() + 1) +
  846. '-' +
  847. (pastdate.getDate() >= 10
  848. ? pastdate.getDate()
  849. : '0' + pastdate.getDate()) +
  850. ' 00:00:00'
  851. // this.StartDate = new Date(pastdate.getFullYear() + '-' + (pastdate.getMonth() + 1) + '-' + (pastdate.getDate()>10?pastdate.getDate():'0'+pastdate.getDate())+' 00:00:00')
  852. this.$set(this.parameter, 'printStartDate', this.StartDate)
  853. // parameter.printStartDate
  854. this.EndDate = '' + year + '-' + month + '-' + strDate + ' 00:00:00'
  855. this.$set(this.parameter, 'printEndDate', this.EndDate)
  856. }
  857. this.$forceUpdate()
  858. this.isShowPrintType = true
  859. },
  860. removePrint() {
  861. this.parameter.warehouseName = ''
  862. this.parameter.proportion = ''
  863. this.isShowPrintType = false
  864. },
  865. async submitClick() {
  866. if (!this.parameter.radio && this.headerText == '打印记录') {
  867. this.$message.error('请选择打印的类型')
  868. return
  869. }
  870. if (!this.parameter.printStartDate) {
  871. this.$message.error('请选择打印的起始日期')
  872. return
  873. }
  874. if (!this.parameter.printEndDate) {
  875. this.$message.error('请选择打印的截止日期')
  876. return
  877. }
  878. if (!this.parameter.warehouseName) {
  879. this.$message.error('请选择所要打印的仓库')
  880. return
  881. }
  882. if (this.parameter.warehouseName == '全部仓库') {
  883. this.parameter.warehouseName = ''
  884. }
  885. if (this.parameter.binNumber == '全部仓位') {
  886. this.parameter.binNumber = ''
  887. }
  888. // let enddate = new Date(this.parameter.endDate).toLocaleString()//将截止时间的时间戳转为时间
  889. // this.parameter.endDate = enddate.split(' ')[0].replace('/' ,'-').replace('/','-')
  890. this.parameter.warehouseName = this.parameter.warehouseName.replace(
  891. '(临)',
  892. ''
  893. )
  894. this.isShowPrintType = false
  895. if (this.headerText == '导出记录') {
  896. if (this.parameter.radio == 3) {
  897. if (this.compName == '辽宁佳屹农商贸有限公司') {
  898. const data = await postExportjynin({
  899. compId: localStorage.getItem('ws-pf_compId'),
  900. startDate: this.parameter.printStartDate,
  901. endDate: this.parameter.printEndDate,
  902. warehouseName: this.parameter.warehouseName
  903. }).toPromise()
  904. console.log(data)
  905. // window.open(data.data.data)
  906. this.downloadFile(
  907. data.data.data,
  908. `${this.date.year +
  909. (this.date.month ? `-${this.date.month}` : '')}导出出库记录`
  910. )
  911. } else {
  912. const { data } = await postExport(
  913. {
  914. startDate: this.parameter.printStartDate,
  915. endDate: this.parameter.printEndDate,
  916. warehouseName: this.parameter.warehouseName
  917. },
  918. {},
  919. {
  920. responseType: 'blob'
  921. }
  922. ).toPromise()
  923. downloadFile({
  924. res: data,
  925. fileName: `${this.date.year +
  926. (this.date.month ? `-${this.date.month}` : '')}导出入库记录`,
  927. type: 'xls'
  928. })
  929. }
  930. } else if (this.parameter.radio == 2) {
  931. if (this.compName == '辽宁佳屹农商贸有限公司') {
  932. const data = await postExportjynout({
  933. compId: localStorage.getItem('ws-pf_compId'),
  934. startDate: this.parameter.printStartDate,
  935. endDate: this.parameter.printEndDate,
  936. warehouseName: this.parameter.warehouseName
  937. }).toPromise()
  938. console.log(data)
  939. this.downloadFile(
  940. data.data.data,
  941. `${this.date.year +
  942. (this.date.month ? `-${this.date.month}` : '')}导出出库记录`
  943. )
  944. } else {
  945. const { data } = await postExportOut(
  946. {
  947. startDate: this.parameter.printStartDate,
  948. endDate: this.parameter.printEndDate,
  949. warehouseName: this.parameter.warehouseName
  950. },
  951. {},
  952. {
  953. responseType: 'blob'
  954. }
  955. ).toPromise()
  956. downloadFile({
  957. res: data,
  958. fileName: `${this.date.year +
  959. (this.date.month ? `-${this.date.month}` : '')}导出出库记录`,
  960. type: 'xls'
  961. })
  962. }
  963. }
  964. } else if (this.headerText == '打印记录') {
  965. if (this.parameter.binNumber == '全部仓位') {
  966. this.parameter.binNumber = ''
  967. }
  968. addselectinfoList({
  969. compId: localStorage.getItem('ws-pf_compId'),
  970. printStartDate: this.parameter.printStartDate,
  971. printEndDate: this.parameter.printEndDate,
  972. warehouseName: this.parameter.warehouseName,
  973. binNumber: this.parameter.binNumber,
  974. goodsName: this.parameter.goodsName,
  975. searchType: this.parameter.radio,
  976. printFlag: '1',
  977. currentPage: 1,
  978. pageSize: 999,
  979. statusFlag: 3
  980. })
  981. .toPromise()
  982. .then(response => {
  983. if (response.records.length == 0) {
  984. this.$message.warning('暂未查到所要打印的出入库信息')
  985. } else {
  986. var warehousePrint = response.records
  987. if (this.parameter.proportion) {
  988. var countWeight = 0
  989. for (let i = 0; i < warehousePrint.length; i++) {
  990. countWeight += Number(warehousePrint[i].netWeight)
  991. }
  992. var increment = (
  993. countWeight *
  994. (Number(this.parameter.proportion) / 100)
  995. ).toFixed(2) //所要增加的量
  996. printAdd()
  997. .toPromise()
  998. .then(response1 => {
  999. // setTimeout(function(){
  1000. for (let i = 0; i < response1.length; i++) {
  1001. increment = Number(increment)
  1002. if (increment > 0) {
  1003. let index = Math.abs(
  1004. Math.round(Math.random() * response1.length - 1)
  1005. )
  1006. let pro = response1[index] //取出假数据并设定值
  1007. pro.netWeight = Number(
  1008. (Math.random() * (70 - 10 + 1) + 10).toFixed(2)
  1009. )
  1010. pro.tare = Number(
  1011. (Math.random() * (20 - 10 + 1) + 10).toFixed(2)
  1012. )
  1013. // pro.grossWeight = Number((pro.tare + pro.netWeight).toFixed(2))
  1014. if (pro.netWeight < increment) {
  1015. //随机净重 小于 所要增量
  1016. increment = (increment - pro.netWeight).toFixed(2) //所要增的量
  1017. if (increment < 10 && pro.netWeight <= 60) {
  1018. pro.netWeight += Number(increment)
  1019. pro.grossWeight = Number(
  1020. (pro.tare + pro.netWeight).toFixed(2)
  1021. )
  1022. increment = 0
  1023. warehousePrint.push(pro)
  1024. } else {
  1025. increment -= pro.netWeight
  1026. pro.grossWeight = Number(
  1027. (pro.tare + pro.netWeight).toFixed(2)
  1028. )
  1029. warehousePrint.push(pro)
  1030. }
  1031. } else {
  1032. //随机净重 大于 所要增量
  1033. pro.netWeight = Number(increment.toFixed(2))
  1034. pro.grossWeight = Number(
  1035. (pro.tare + pro.netWeight).toFixed(2)
  1036. )
  1037. increment = 0
  1038. warehousePrint.push(pro)
  1039. }
  1040. response1.splice(index, 1) //删除已添加过得假数据车牌号
  1041. if (response1.length == 0) {
  1042. sessionStorage.setItem(
  1043. 'inOutWarehouse_Print',
  1044. JSON.stringify(warehousePrint)
  1045. )
  1046. let _canshu = ''
  1047. _canshu =
  1048. this.parameter.radio +
  1049. '&warehouseName=' +
  1050. this.parameter.warehouseName +
  1051. '&startDate=' +
  1052. this.parameter.printStartDate +
  1053. '&endDate=' +
  1054. this.parameter.printEndDate
  1055. window.open(
  1056. '../../../../../static/warehousePrint.html?type=' +
  1057. _canshu
  1058. )
  1059. }
  1060. } else {
  1061. //增量为0时
  1062. break
  1063. }
  1064. }
  1065. //跳转
  1066. sessionStorage.setItem(
  1067. 'inOutWarehouse_Print',
  1068. JSON.stringify(warehousePrint)
  1069. )
  1070. let _canshu = ''
  1071. _canshu =
  1072. this.parameter.radio +
  1073. '&warehouseName=' +
  1074. this.parameter.warehouseName +
  1075. '&startDate=' +
  1076. this.parameter.printStartDate +
  1077. '&endDate=' +
  1078. this.parameter.printEndDate
  1079. window.open(
  1080. '../../../../../static/warehousePrint.html?type=' +
  1081. _canshu
  1082. )
  1083. })
  1084. } else {
  1085. //没有增量比例的直接打印
  1086. sessionStorage.setItem(
  1087. 'inOutWarehouse_Print',
  1088. JSON.stringify(response.records)
  1089. )
  1090. let _canshu1 = ''
  1091. _canshu1 =
  1092. this.parameter.radio +
  1093. '&warehouseName=' +
  1094. this.parameter.warehouseName +
  1095. '&startDate=' +
  1096. this.parameter.printStartDate +
  1097. '&endDate=' +
  1098. this.parameter.printEndDate
  1099. window.open(
  1100. '../../../../../static/warehousePrint.html?type=' + _canshu1
  1101. )
  1102. }
  1103. }
  1104. })
  1105. }
  1106. },
  1107. //导出历史库存记录
  1108. exportHistoricalData() {
  1109. let date = new Date()
  1110. var year = date.getFullYear()
  1111. var month = date.getMonth() + 1
  1112. var strDate = date.getDate()
  1113. var pastdate = new Date(date.getTime() - 24 * 60 * 60 * 1000)
  1114. this.parameter.startDate =
  1115. pastdate.getFullYear() +
  1116. '-' +
  1117. (pastdate.getMonth() + 1) +
  1118. '-' +
  1119. pastdate.getDate()
  1120. this.parameter.endDate = '' + year + '-' + month + '-' + strDate
  1121. this.$forceUpdate()
  1122. this.isShowPrintType1 = true
  1123. },
  1124. removePrint1() {
  1125. this.parameter.warehouseName = ''
  1126. this.parameter.proportion = ''
  1127. this.isShowPrintType1 = false
  1128. },
  1129. async submitClick1() {
  1130. if (!this.parameter.startDate) {
  1131. this.$message.error('请选择打印的起始日期')
  1132. return
  1133. }
  1134. if (!this.parameter.endDate) {
  1135. this.$message.error('请选择打印的截止日期')
  1136. return
  1137. }
  1138. if (
  1139. new Date(this.parameter.endDate).getTime() <
  1140. new Date(this.parameter.startDate).getTime()
  1141. ) {
  1142. this.$message.error('截止日期输入错误')
  1143. return
  1144. }
  1145. if (this.parameter.warehouseName == '全部仓库') {
  1146. this.parameter.warehouseName = ''
  1147. }
  1148. if (this.parameter.binNumber == '全部仓位') {
  1149. this.parameter.binNumber = ''
  1150. }
  1151. const { data } = await exportHistoricalInventory(
  1152. {
  1153. startDate: this.parameter.startDate,
  1154. endDate: this.parameter.endDate,
  1155. warehouseName: this.parameter.warehouseName
  1156. },
  1157. {},
  1158. {
  1159. responseType: 'blob'
  1160. }
  1161. ).toPromise()
  1162. downloadFile({
  1163. res: data,
  1164. fileName: `${this.date.year +
  1165. (this.date.month ? `-${this.date.month}` : '')}导出历史库存记录`,
  1166. type: 'xls'
  1167. })
  1168. },
  1169. handleClose() {
  1170. this.indialog = false
  1171. },
  1172. submit() {
  1173. if (!this.inWarehouse) {
  1174. this.$message.error('请输入入库量')
  1175. return
  1176. }
  1177. if (
  1178. Number(this.warehouseInfo.warehouseNumViewList[0].outNetWeight) >
  1179. Number(this.inWarehouse)
  1180. ) {
  1181. this.$message.error('入库量不可小于已出库量')
  1182. return
  1183. }
  1184. if (
  1185. String(this.inWarehouse).indexOf('.') != -1 &&
  1186. String(this.inWarehouse).length -
  1187. (String(this.inWarehouse).indexOf('.') + 1) >
  1188. 3
  1189. ) {
  1190. this.$message.error('入库量输入错误')
  1191. return
  1192. }
  1193. if (Number(this.warehouseInfo.maxInStorage) < Number(this.inWarehouse)) {
  1194. this.$message.error('入库量不可超过合同上限')
  1195. return
  1196. }
  1197. let InnetWeight = {
  1198. baseId: this.warehouseInfo.warehouseId,
  1199. netWeight: this.inWarehouse
  1200. }
  1201. postInWeight(InnetWeight)
  1202. .toPromise()
  1203. .then(response => {
  1204. this.$notify.success({
  1205. title: '成功',
  1206. message: '修改成功'
  1207. })
  1208. ;(this.indialog = false), (this.inWarehouse = ''), this.getList1()
  1209. })
  1210. .catch(response => {
  1211. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  1212. })
  1213. },
  1214. initCharts() {
  1215. let _x = []
  1216. let _y = []
  1217. for (var i = 0; i < this.totalReserves.length; i++) {
  1218. if (this.warehouseType == '1') {
  1219. _x.push(this.totalReserves[i].goodsName)
  1220. _y.push(this.totalReserves[i].stockNum)
  1221. } else {
  1222. _x.push(this.totalReserves[i].goodsName)
  1223. _y.push(this.totalReserves[i].surplus)
  1224. }
  1225. }
  1226. // 柱状图
  1227. let myChart7 = this.$echarts.init(this.$refs.myEchart7)
  1228. var zoption = {
  1229. grid: {
  1230. left: '0',
  1231. right: '0',
  1232. bottom: '0',
  1233. top: '30',
  1234. containLabel: true
  1235. },
  1236. // --- 提示框 ----
  1237. tooltip: {
  1238. show: true, // 是否显示提示框,默认为true
  1239. trigger: 'item', // 数据项图形触发
  1240. axisPointer: {
  1241. // 指示样式
  1242. type: 'shadow',
  1243. axis: 'auto'
  1244. },
  1245. padding: 5,
  1246. textStyle: {
  1247. // 提示框内容的样式
  1248. color: '#fff'
  1249. }
  1250. },
  1251. // ------ X轴 ------
  1252. xAxis: {
  1253. axisLabel: {
  1254. // 坐标轴标签
  1255. show: true, // 是否显示
  1256. inside: false, // 是否朝内
  1257. rotate: 0, // 旋转角度
  1258. margin: 10, // 刻度标签与轴线之间的距离
  1259. color: '#929AB8', // 默认取轴线的颜色
  1260. interval: 0
  1261. },
  1262. splitArea: {
  1263. // 网格区域
  1264. show: false // 是否显示,默认为false
  1265. },
  1266. data: _x
  1267. },
  1268. // ------ y轴 ----------
  1269. yAxis: {
  1270. axisLine: {
  1271. // 坐标轴 轴线
  1272. show: false // 是否显示
  1273. },
  1274. axisLabel: {
  1275. // 坐标轴的标签
  1276. show: true, // 是否显示
  1277. inside: false, // 是否朝内
  1278. rotate: 0, // 旋转角度
  1279. margin: 8, // 刻度标签与轴线之间的距离
  1280. color: '#929AB8' // 默认轴线的颜色
  1281. },
  1282. splitLine: {
  1283. // gird 区域中的分割线
  1284. show: true, // 是否显示
  1285. lineStyle: {
  1286. color: '#D9DDE7',
  1287. width: 1,
  1288. type: 'dashed'
  1289. }
  1290. }
  1291. },
  1292. // ------- 内容数据 -------
  1293. series: [
  1294. {
  1295. name: '储量', // 序列名称
  1296. type: 'bar', // 类型
  1297. legendHoverLink: true, // 是否启用图列 hover 时的联动高亮
  1298. // label: { // 图形上的文本标签
  1299. // show: false,
  1300. // position: 'insideTop', // 相对位置
  1301. // rotate: 0, // 旋转角度
  1302. // color: '#eee'
  1303. // },
  1304. itemStyle: {
  1305. // 图形的形状
  1306. // color: lineColor[index++]
  1307. // barBorderRadius: [18, 18, 0 ,0]
  1308. color: function(params) {
  1309. var colorList = [
  1310. '#5878E8',
  1311. '#50CAD4',
  1312. '#FF9F24',
  1313. '#E87C25',
  1314. '#27727B',
  1315. '#FE8463',
  1316. '#9BCA63',
  1317. '#FAD860',
  1318. '#F3A43B',
  1319. '#60C0DD',
  1320. '#D7504B',
  1321. '#C6E579',
  1322. '#F4E001',
  1323. '#F0805A',
  1324. '#26C0C0'
  1325. ]
  1326. return colorList[params.dataIndex]
  1327. }
  1328. },
  1329. barWidth: 20, // 柱形的宽度
  1330. barCategoryGap: '20%', // 柱形的间距
  1331. label: {
  1332. show: true,
  1333. position: 'top',
  1334. color: '#000000'
  1335. },
  1336. data: _y
  1337. }
  1338. ]
  1339. }
  1340. myChart7.setOption(zoption)
  1341. },
  1342. mapChange(num) {
  1343. if (num == 1) {
  1344. this.mapshow = false
  1345. this.btnCss1 = 'btn1'
  1346. this.btnCss2 = 'btn'
  1347. this.maptitle = '库点监控'
  1348. } else if (num == 2) {
  1349. this.mapshow = true
  1350. this.btnCss1 = 'btn'
  1351. this.btnCss2 = 'btn1'
  1352. this.maptitle = '定位'
  1353. }
  1354. },
  1355. getAddress(data) {
  1356. this.deptBudgetList.warehousePrivate = data[0]
  1357. this.deptBudgetList.warehouseCity = data[1]
  1358. this.deptBudgetList.warehouseArea = data[2]
  1359. },
  1360. searchAddress(e) {
  1361. this.deptBudgetList.warehousePositioning = e.lat + ',' + e.lng
  1362. },
  1363. marker: function(item) {
  1364. this.deptBudgetList.warehousePositioning =
  1365. item.lnglat.lat + ',' + item.lnglat.lng
  1366. },
  1367. handleMintor() {
  1368. this.$router.push({
  1369. path: 'warehouseManagementMintor'
  1370. })
  1371. },
  1372. dryClick() {
  1373. this.$router.push({
  1374. path: 'dryWarehousing'
  1375. })
  1376. },
  1377. materialInOut() {
  1378. this.$router.push({
  1379. path: 'materialInOutWarehouse'
  1380. })
  1381. },
  1382. handleall() {
  1383. this.$router.push({
  1384. path: 'warehouseManagement'
  1385. })
  1386. },
  1387. selectstaff(e) {
  1388. this.warehouseInfo.warehouseName = e
  1389. for (var tmp = 0; tmp < this.warehouseAllXiaLa.length; tmp++) {
  1390. if (this.warehouseAllXiaLa[tmp].warehouseName == e) {
  1391. this.warehouseType = this.warehouseAllXiaLa[tmp].warehouseType
  1392. this.monitorUrl1 = this.warehouseAllXiaLa[tmp].monitorUrl1
  1393. this.monitorUrl2 = this.warehouseAllXiaLa[tmp].monitorUrl2
  1394. if (this.warehouseType == '2') {
  1395. this.maptitle = '定位'
  1396. this.btnCss2 = 'btn1'
  1397. this.mapshow = true
  1398. } else {
  1399. this.maptitle = '库点监控'
  1400. this.btnCss1 = 'btn1'
  1401. this.btnCss2 = 'btn'
  1402. this.mapshow = false
  1403. }
  1404. break
  1405. }
  1406. }
  1407. this.warehouseXiaLa = this.warehouseXiaLaCopy
  1408. if (this.warehouseInfo.warehouseName.indexOf('(临)') != -1) {
  1409. this.warehouseInfo.warehouseName = this.warehouseInfo.warehouseName.replace(
  1410. ' (临)',
  1411. ''
  1412. )
  1413. }
  1414. this.getList1()
  1415. },
  1416. warehouseQuery(query) {
  1417. if (query) {
  1418. this.warehouseXiaLa = this.warehouseAllXiaLa
  1419. this.warehouseXiaLa = this.warehouseAllXiaLa.filter(
  1420. item => item.warehouseName.indexOf(query) > -1
  1421. )
  1422. } else {
  1423. this.warehouseXiaLa = this.warehouseXiaLaCopy
  1424. }
  1425. },
  1426. getCurrentDate(format) {
  1427. var now = new Date()
  1428. var year = now.getFullYear() //得到年份
  1429. var month = now.getMonth() //得到月份
  1430. var date = now.getDate() //得到日期
  1431. var day = now.getDay() //得到周几
  1432. var hour = now.getHours() //得到小时
  1433. var minu = now.getMinutes() //得到分钟
  1434. var sec = now.getSeconds() //得到秒
  1435. month = month + 1
  1436. if (month < 10) month = '0' + month
  1437. if (date < 10) date = '0' + date
  1438. if (hour < 10) hour = '0' + hour
  1439. if (minu < 10) minu = '0' + minu
  1440. if (sec < 10) sec = '0' + sec
  1441. var time = ''
  1442. //精确到天
  1443. if (format == 1) {
  1444. time = year + '-' + month + '-' + date
  1445. }
  1446. //精确到分
  1447. else if (format == 2) {
  1448. time =
  1449. year + '-' + month + '-' + date + ' ' + hour + ':' + minu + ':' + sec
  1450. }
  1451. return time
  1452. },
  1453. //添加
  1454. handleAdd() {
  1455. this.$router.push({
  1456. path: 'warehouseNewManagementAdd'
  1457. })
  1458. },
  1459. //编辑
  1460. handleEdit() {
  1461. this.$router.push({
  1462. path: 'warehouseNewManagementEdit'
  1463. })
  1464. },
  1465. //查看
  1466. handleLook() {
  1467. this.$router.push({
  1468. name: 'warehouseManagementLookNew'
  1469. })
  1470. },
  1471. //删除仓库
  1472. handleDelete() {
  1473. for (var num = 0; num < this.warehouseList.length; num++) {
  1474. //删除仓库前应当判断是否有库存
  1475. for (
  1476. var num_item = 0;
  1477. num_item < this.warehouseList[num].warehouseNumViewList.length;
  1478. num_item++
  1479. ) {
  1480. if (this.warehouseType == 2) {
  1481. if (
  1482. Number(
  1483. this.warehouseList[num].warehouseNumViewList[num_item].surplus
  1484. ) > 0
  1485. ) {
  1486. this.$message.error('删除前应清空库存!')
  1487. return
  1488. }
  1489. } else if (this.warehouseType == 1) {
  1490. if (
  1491. Number(
  1492. this.warehouseList[num].warehouseNumViewList[num_item].storage
  1493. ) > 0
  1494. ) {
  1495. this.$message.error('删除前应清空库存!')
  1496. return
  1497. }
  1498. }
  1499. }
  1500. }
  1501. this.$confirm(`确认删除` + this.warehouseInfo.warehouseName + `?`, {
  1502. cancelButtonText: '取消',
  1503. confirmButtonText: '确定',
  1504. type: 'warning'
  1505. })
  1506. .then(() => {
  1507. deletewarehouse({ id: this.warehouseInfo.warehouseId })
  1508. .toPromise()
  1509. .then(response => {
  1510. this.$notify.success({
  1511. title: '成功',
  1512. message: '删除成功'
  1513. })
  1514. this.getList1()
  1515. })
  1516. .catch(response => {
  1517. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  1518. })
  1519. })
  1520. .catch(() => {
  1521. return false
  1522. })
  1523. },
  1524. //记录
  1525. record() {
  1526. this.$router.push({
  1527. path: 'warehouseNewManagementRecord',
  1528. query: {
  1529. baseId: this.warehouseInfo.warehouseId,
  1530. positionId: this.warehouseInfo.binNumberId,
  1531. warehouseName: this.warehouseInfo.warehouseName,
  1532. remark: this.warehouseInfo.remark,
  1533. binNumber: this.warehouseInfo.binNumber,
  1534. capacity: this.warehouseInfo.capacity,
  1535. warehouseType: this.warehouseType
  1536. }
  1537. })
  1538. },
  1539. //盘损
  1540. loss() {
  1541. this.$router.push({
  1542. path: 'warehouseNewManagementIoss',
  1543. query: {
  1544. baseId: this.warehouseInfo.warehouseId,
  1545. positionId: this.warehouseInfo.binNumberId,
  1546. warehouseName: this.warehouseInfo.warehouseName,
  1547. binNumber: this.warehouseInfo.binNumber
  1548. }
  1549. })
  1550. },
  1551. //清仓
  1552. clearance() {
  1553. if (this.warehouseInfo.outNumber > 0) {
  1554. this.$confirm(`你还有未完善的出库记录,请完善提交后再进行操作`, {
  1555. cancelButtonText: '关闭'
  1556. })
  1557. .then(() => {})
  1558. .catch(() => {
  1559. return false
  1560. })
  1561. } else {
  1562. this.$confirm(
  1563. `清库操作代表库存已清零,清库后不可进行出库操作,是否确定清库`,
  1564. {
  1565. confirmButtonText: '确定',
  1566. cancelButtonText: '取消',
  1567. type: 'warning'
  1568. }
  1569. )
  1570. .then(() => {
  1571. clearancee({
  1572. id: this.warehouseInfo.warehouseId
  1573. })
  1574. .toPromise()
  1575. .then(response => {
  1576. this.$notify.success({
  1577. title: '成功',
  1578. message: '状态清库成功'
  1579. })
  1580. this.getList1()
  1581. })
  1582. .catch(response => {})
  1583. })
  1584. .catch(() => {
  1585. return false
  1586. })
  1587. }
  1588. },
  1589. //任务
  1590. handlTask() {
  1591. var arr = []
  1592. for (let i = 0; i < this.list.length; i++) {
  1593. arr.push(this.list[i].warehouseName)
  1594. }
  1595. this.$router.push({
  1596. path: 'tranManagementWarehouseInOutTask',
  1597. query: {
  1598. // stringList: arr,
  1599. // warehouseBaseInfoList: JSON.stringify(this.list)
  1600. }
  1601. })
  1602. },
  1603. getSummaries(param) {
  1604. const { columns, data } = param
  1605. const sums = []
  1606. columns.forEach((column, index) => {
  1607. if (index === 0) {
  1608. sums[index] = '合计'
  1609. } else if (index === 4 || index === 5 || index === 6) {
  1610. const values = data.map(item => {
  1611. var val = item.warehouseNumViewList.map(items => {
  1612. if (column.label == '入库量(吨)') {
  1613. return items.inNetWeight
  1614. } else if (column.label == '出库量(吨)') {
  1615. return items.outNetWeight
  1616. } else if (column.label == '应余量(吨)') {
  1617. return items.storage
  1618. } else if (column.label == '应余量(吨)') {
  1619. return items.storage
  1620. }
  1621. })
  1622. return val
  1623. })
  1624. if (!values.every(value => isNaN(value))) {
  1625. sums[index] = values.reduce((prev, curr) => {
  1626. if (curr.length > 1) {
  1627. var num = 0
  1628. for (let i = 0; i < curr.length; i++) {
  1629. num += Number(curr[i])
  1630. }
  1631. return Number(prev) + num
  1632. } else {
  1633. const value = Number(curr)
  1634. if (!isNaN(value)) {
  1635. return Number(prev) + Number(curr)
  1636. } else {
  1637. return Number(prev)
  1638. }
  1639. }
  1640. }, 0)
  1641. } else {
  1642. sums[index] = '--'
  1643. }
  1644. } else {
  1645. sums[index] = '--'
  1646. }
  1647. })
  1648. if (typeof sums[4] == 'number') {
  1649. sums[4] = sums[4].toFixed(3)
  1650. }
  1651. if (typeof sums[5] == 'number') {
  1652. sums[5] = sums[5].toFixed(3)
  1653. }
  1654. if (typeof sums[6] == 'number') {
  1655. sums[6] = sums[6].toFixed(3)
  1656. }
  1657. return sums
  1658. },
  1659. // 折转
  1660. transformation() {
  1661. this.$router.push({
  1662. path: 'transformation',
  1663. query: {
  1664. warehouseId: this.warehouseInfo.warehouseId,
  1665. warehouseName: this.warehouseInfo.warehouseName,
  1666. binNumberId: this.warehouseInfo.binNumberId,
  1667. warehouseType: this.warehouseType
  1668. } //warehouseType 1常用 2临时
  1669. })
  1670. },
  1671. getList() {
  1672. getreserves({ compId: localStorage.getItem('ws-pf_compId') })
  1673. .toPromise()
  1674. .then(response => {
  1675. var obj = { 类型: '库内储量' },
  1676. obj1 = { 类型: '移库在途' },
  1677. obj2 = { 类型: '采购在途' },
  1678. obj3 = { 类型: '销售在途' },
  1679. obj4 = { 类型: '合计' },
  1680. obj5 = { 类型: '货值' }
  1681. var arr = response.map(item => {
  1682. obj[item.goodsName] = item.stockNum
  1683. obj1[item.goodsName] = item.moveNum
  1684. obj2[item.goodsName] = item.purchaseNum
  1685. obj3[item.goodsName] = item.saleNum
  1686. return item.goodsName
  1687. })
  1688. arr.unshift('类型')
  1689. for (const i in obj) {
  1690. if (i != '类型') {
  1691. var num = obj[i] + obj1[i] + obj2[i] + obj3[i]
  1692. obj4[i] = num.toFixed(3)
  1693. }
  1694. }
  1695. this.tableData.push(obj)
  1696. this.tableData.push(obj1)
  1697. this.tableData.push(obj2)
  1698. this.tableData.push(obj3)
  1699. this.tableData.push(obj4)
  1700. this.tableHeader = arr
  1701. })
  1702. this.dateTime = this.getCurrentDate(1)
  1703. // 仓储部负责人
  1704. getResponsible({
  1705. compId: localStorage.getItem('ws-pf_compId')
  1706. })
  1707. .toPromise()
  1708. .then(response => {
  1709. this.responsible = response[0].staffName
  1710. })
  1711. // 仓库名称
  1712. getwarehousNameNew({
  1713. compId: localStorage.getItem('ws-pf_compId')
  1714. })
  1715. .toPromise()
  1716. .then(response => {
  1717. this.warehouseXiaLa = response
  1718. this.warehouseXiaLaCopy = response
  1719. this.warehouseInfo.warehouseName = this.warehouseXiaLa[0].warehouseName
  1720. this.monitorUrl1 = this.warehouseXiaLa[0].monitorUrl1
  1721. this.monitorUrl2 = this.warehouseXiaLa[0].monitorUrl2
  1722. for (var tmp = 0; tmp < response.length; tmp++) {
  1723. if (response[tmp].warehouseType == '2') {
  1724. response[tmp].warehouseName =
  1725. response[tmp].warehouseName + ' (临)'
  1726. }
  1727. }
  1728. this.warehouseAllXiaLa = response
  1729. this.getList1()
  1730. })
  1731. getsponsible({
  1732. compId: localStorage.getItem('ws-pf_compId')
  1733. })
  1734. .toPromise()
  1735. .then(response => {
  1736. this.list = response
  1737. })
  1738. packList({
  1739. constId: 'CON2'
  1740. })
  1741. .toPromise()
  1742. .then(response => {
  1743. this.goodnameList = response
  1744. })
  1745. },
  1746. changeWeight(e) {
  1747. //实际重量
  1748. if (e == '0') {
  1749. if (this.warehouseType == '1') {
  1750. getQualityReal({
  1751. compId: localStorage.getItem('ws-pf_compId'),
  1752. warehouseName: this.warehouseInfo.warehouseName
  1753. })
  1754. .toPromise()
  1755. .then(response => {
  1756. this.totalReserves = response.warehouseNumViewList
  1757. this.initCharts()
  1758. })
  1759. } else {
  1760. this.getList1()
  1761. }
  1762. } else {
  1763. getQualityZhe({
  1764. compId: localStorage.getItem('ws-pf_compId'),
  1765. baseId: this.warehouseInfo.warehouseId
  1766. })
  1767. .toPromise()
  1768. .then(response => {
  1769. console.log(this.totalReserves)
  1770. this.totalMoney1 = 0
  1771. this.totalMoney2 = 0
  1772. if (this.warehouseType == '1') {
  1773. for (let j = 0; j < this.totalReserves.length; j++) {
  1774. if (
  1775. this.totalReserves[j].cost &&
  1776. this.totalReserves[j].stockNum
  1777. ) {
  1778. if (this.totalReserves[j].goodsName.indexOf('玉米') != -1) {
  1779. this.totalReserves[j].totalMoney1 = (
  1780. Number(this.totalReserves[j].cost) *
  1781. Number(this.totalReserves[j].stockNum)
  1782. ).toFixed(3)
  1783. this.totalMoney1 = (
  1784. Number(this.totalMoney1) +
  1785. Number(this.totalReserves[j].totalMoney1)
  1786. ).toFixed(3)
  1787. } else if (
  1788. this.totalReserves[j].goodsName.indexOf('高粱') != -1
  1789. ) {
  1790. this.totalReserves[j].totalMoney2 = (
  1791. Number(this.totalReserves[j].cost) *
  1792. Number(this.totalReserves[j].stockNum)
  1793. ).toFixed(3)
  1794. this.totalMoney2 = (
  1795. Number(this.totalMoney2) +
  1796. Number(this.totalReserves[j].totalMoney2)
  1797. ).toFixed(3)
  1798. }
  1799. }
  1800. }
  1801. console.log(this.totalReserves)
  1802. if (response.warehouseNumViewList.length != 0) {
  1803. var result = []
  1804. for (let i = 0; i < response.warehouseNumViewList.length; i++) {
  1805. let param = {}
  1806. for (let num = 0; num < this.totalReserves.length; num++) {
  1807. if (
  1808. response.warehouseNumViewList[i].goodsName ==
  1809. this.totalReserves[num].goodsName &&
  1810. response.warehouseNumViewList[i].goodsName != '玉米' &&
  1811. response.warehouseNumViewList[i].goodsName != '高粱'
  1812. ) {
  1813. param.cost = this.totalReserves[num].cost
  1814. }
  1815. }
  1816. if (response.warehouseNumViewList[i].pureWeight) {
  1817. param.goodsName = response.warehouseNumViewList[i].goodsName
  1818. param.stockNum = Number(
  1819. response.warehouseNumViewList[i].pureWeight
  1820. ).toFixed(3)
  1821. if (param.goodsName == '玉米') {
  1822. param.conversionCost = (
  1823. Number(this.totalMoney1) / Number(param.stockNum)
  1824. ).toFixed(3)
  1825. } else if (param.goodsName == '高粱') {
  1826. param.conversionCost = (
  1827. Number(this.totalMoney2) / Number(param.stockNum)
  1828. ).toFixed(3)
  1829. }
  1830. result.push(param)
  1831. }
  1832. }
  1833. console.log(result)
  1834. this.totalReserves = result
  1835. this.initCharts()
  1836. } else {
  1837. // this.$message.error('当前仓库无潮粮库存,无需折算!')
  1838. // this.value = '0'
  1839. // return
  1840. }
  1841. } else {
  1842. //临时库
  1843. if (response.warehouseNumViewList.length != 0) {
  1844. var result1 = []
  1845. for (let i = 0; i < response.warehouseNumViewList.length; i++) {
  1846. let param = {}
  1847. if (response.warehouseNumViewList[i].pureWeight) {
  1848. param.goodsName = response.warehouseNumViewList[i].goodsName
  1849. param.surplus = Number(
  1850. response.warehouseNumViewList[i].pureWeight
  1851. ).toFixed(3)
  1852. result1.push(param)
  1853. }
  1854. }
  1855. this.totalReserves = result1
  1856. this.initCharts()
  1857. }
  1858. }
  1859. })
  1860. }
  1861. },
  1862. getList1() {
  1863. getList({
  1864. compId: localStorage.getItem('ws-pf_compId'),
  1865. warehouseName: this.warehouseInfo.warehouseName,
  1866. warehouseType: this.warehouseType
  1867. })
  1868. .toPromise()
  1869. .then(response => {
  1870. for (let q = 0; q < response.warehouseViewList.length; q++) {
  1871. if (response.warehouseViewList[q].warehouseNumViewList.length > 0) {
  1872. for (
  1873. let i = 0;
  1874. i < response.warehouseViewList[q].warehouseNumViewList.length;
  1875. i++
  1876. ) {
  1877. if (
  1878. response.warehouseViewList[q].warehouseNumViewList[i]
  1879. .inNetWeight
  1880. ) {
  1881. response.warehouseViewList[q].warehouseNumViewList[
  1882. i
  1883. ].inNetWeight = Number(
  1884. response.warehouseViewList[q].warehouseNumViewList[i]
  1885. .inNetWeight
  1886. ).toFixed(3)
  1887. }
  1888. if (
  1889. response.warehouseViewList[q].warehouseNumViewList[i]
  1890. .outNetWeight
  1891. ) {
  1892. response.warehouseViewList[q].warehouseNumViewList[
  1893. i
  1894. ].outNetWeight = Number(
  1895. response.warehouseViewList[q].warehouseNumViewList[i]
  1896. .outNetWeight
  1897. ).toFixed(3)
  1898. }
  1899. if (
  1900. response.warehouseViewList[q].warehouseNumViewList[i].storage
  1901. ) {
  1902. response.warehouseViewList[q].warehouseNumViewList[
  1903. i
  1904. ].storage = Number(
  1905. response.warehouseViewList[q].warehouseNumViewList[i]
  1906. .storage
  1907. ).toFixed(3)
  1908. }
  1909. if (
  1910. response.warehouseViewList[q].warehouseNumViewList[i]
  1911. .inNetWeight &&
  1912. response.warehouseViewList[q].warehouseNumViewList[i]
  1913. .outNetWeight
  1914. ) {
  1915. response.warehouseViewList[q].warehouseNumViewList[
  1916. i
  1917. ].surplus = (
  1918. response.warehouseViewList[q].warehouseNumViewList[i]
  1919. .inNetWeight -
  1920. response.warehouseViewList[q].warehouseNumViewList[i]
  1921. .outNetWeight
  1922. ).toFixed(3)
  1923. } else if (
  1924. response.warehouseViewList[q].warehouseNumViewList[i]
  1925. .inNetWeight
  1926. ) {
  1927. response.warehouseViewList[q].warehouseNumViewList[
  1928. i
  1929. ].surplus =
  1930. response.warehouseViewList[q].warehouseNumViewList[
  1931. i
  1932. ].inNetWeight
  1933. }
  1934. }
  1935. }
  1936. }
  1937. if (this.warehouseType == '1') {
  1938. this.totalReserves = response.warehouseNumViewList
  1939. } else {
  1940. this.totalReserves =
  1941. response.warehouseViewList[0].warehouseNumViewList
  1942. }
  1943. // this.totalMoney = Number(this.totalReserves[0].stockNum * this.totalReserves[0].cost).toFixed(3)
  1944. this.value = '0'
  1945. this.initCharts()
  1946. this.warehouseList = response.warehouseViewList
  1947. if (this.warehouseList.length > 0) {
  1948. this.warehouseInfo = this.warehouseList[0]
  1949. this.warehouseInfo.warehouseLocation =
  1950. this.warehouseList[0].warehousePrivate +
  1951. this.warehouseList[0].warehouseCity +
  1952. this.warehouseList[0].warehouseArea
  1953. // this.warehouseInfo.maxReserves = 0
  1954. //经纬度
  1955. this.warehousePositioning.lat = this.warehouseInfo.warehousePositioning.split(
  1956. ','
  1957. )[1]
  1958. this.warehousePositioning.lng = this.warehouseInfo.warehousePositioning.split(
  1959. ','
  1960. )[0]
  1961. for (let j = 0; j < this.warehouseXiaLa.length; j++) {
  1962. if (
  1963. this.warehouseInfo.warehouseName ==
  1964. this.warehouseXiaLa[j].warehouseName
  1965. ) {
  1966. this.warehouseInfo.maxReserves = this.warehouseXiaLa[
  1967. j
  1968. ].totalStorage
  1969. }
  1970. }
  1971. }
  1972. })
  1973. }
  1974. }
  1975. }
  1976. </script>
  1977. <style lang="scss" scoped>
  1978. .container {
  1979. background: #e8ecf6;
  1980. }
  1981. .top_form {
  1982. background: #ffffff;
  1983. /deep/.el-table .el-table__body .cell,
  1984. /deep/.el-table .cell {
  1985. text-align: center;
  1986. }
  1987. }
  1988. .title {
  1989. position: relative;
  1990. background: #f6f7fc;
  1991. height: 60px;
  1992. line-height: 60px;
  1993. }
  1994. .title::before {
  1995. content: '';
  1996. display: inline-block;
  1997. width: 5px;
  1998. height: 30px;
  1999. background: #5473e8;
  2000. position: absolute;
  2001. left: 0;
  2002. top: 12px;
  2003. }
  2004. .position {
  2005. border-radius: 4px;
  2006. background: #ffffff;
  2007. margin: 20px 10px;
  2008. padding-bottom: 10px;
  2009. height: 550px;
  2010. /deep/.el-table .el-table__body .cell,
  2011. /deep/.el-table .cell {
  2012. text-align: center;
  2013. }
  2014. /deep/.setUp_css .cell {
  2015. display: contents !important;
  2016. }
  2017. .title {
  2018. position: relative;
  2019. background: #f6f7fc;
  2020. height: 60px;
  2021. line-height: 60px;
  2022. margin-bottom: 14px;
  2023. }
  2024. .title::before {
  2025. content: '';
  2026. display: inline-block;
  2027. width: 5px;
  2028. height: 30px;
  2029. background: #5473e8;
  2030. position: absolute;
  2031. left: 0;
  2032. top: 12px;
  2033. }
  2034. .cangInfo {
  2035. font-size: 18px;
  2036. font-weight: 600;
  2037. margin-left: 14px;
  2038. line-height: 30px;
  2039. }
  2040. .el-input {
  2041. width: 95%;
  2042. }
  2043. .el-select {
  2044. width: 95%;
  2045. }
  2046. }
  2047. .right {
  2048. .title {
  2049. position: relative;
  2050. background: #f6f7fc;
  2051. height: 60px;
  2052. line-height: 60px;
  2053. margin-bottom: 14px;
  2054. }
  2055. .title::before {
  2056. content: '';
  2057. display: inline-block;
  2058. width: 5px;
  2059. height: 30px;
  2060. background: #5473e8;
  2061. position: absolute;
  2062. left: 0;
  2063. top: 12px;
  2064. }
  2065. .cangInfo {
  2066. font-size: 18px;
  2067. font-weight: 600;
  2068. margin-left: 14px;
  2069. line-height: 30px;
  2070. }
  2071. }
  2072. .reservesInfo {
  2073. display: inline-flex;
  2074. .reservesInfo_item {
  2075. width: 140px;
  2076. background: #f5f7fa;
  2077. // height: 54px;
  2078. text-align: center;
  2079. line-height: 25px;
  2080. margin: 0 10px;
  2081. border-radius: 4px;
  2082. padding: 10px 0;
  2083. .reservesInfo_GoodsName {
  2084. font-size: 12px;
  2085. color: #8890b1;
  2086. }
  2087. .reservesInfo_Amount {
  2088. color: #323233;
  2089. font-size: 14px;
  2090. font-weight: 600;
  2091. }
  2092. }
  2093. }
  2094. .weight {
  2095. display: inline-flex;
  2096. margin-left: 11px;
  2097. }
  2098. .color {
  2099. display: inline-flex;
  2100. width: 100%;
  2101. height: 40px;
  2102. line-height: 40px;
  2103. justify-content: flex-end;
  2104. .color_for {
  2105. margin: 0 10px;
  2106. display: flex;
  2107. }
  2108. .color_for .color_goodsName {
  2109. margin-left: 10px;
  2110. margin-top: -13px;
  2111. }
  2112. .color_item {
  2113. width: 15px;
  2114. height: 15px;
  2115. }
  2116. }
  2117. .column {
  2118. margin: 10px;
  2119. }
  2120. .map {
  2121. background: #ffffff;
  2122. width: 99%;
  2123. margin: 100px auto 50px;
  2124. height: 560px;
  2125. border-radius: 4px;
  2126. .map_switch {
  2127. display: flex;
  2128. border-bottom: 1px solid #d8dce6;
  2129. .btn,
  2130. .btn1 {
  2131. padding: 7px 20px;
  2132. border-radius: 4px;
  2133. margin: 10px 0 10px 10px;
  2134. font-size: 14px;
  2135. cursor: pointer;
  2136. }
  2137. .btn1 {
  2138. background: #f0f6ff;
  2139. color: #5878e8;
  2140. }
  2141. }
  2142. .map-item {
  2143. width: 96%;
  2144. margin: auto;
  2145. }
  2146. .monitor {
  2147. margin-top: 30px;
  2148. display: flex;
  2149. .video1 {
  2150. width: 440px;
  2151. height: 360px;
  2152. text-align: center;
  2153. .img1 {
  2154. width: 440px;
  2155. height: 235px;
  2156. padding: 20px;
  2157. }
  2158. }
  2159. }
  2160. }
  2161. //打印弹窗
  2162. .mask {
  2163. background: black;
  2164. width: 100vw;
  2165. height: 100vh;
  2166. position: fixed;
  2167. top: 0;
  2168. z-index: 99;
  2169. opacity: 0.3;
  2170. }
  2171. .count {
  2172. text-align: center;
  2173. margin-bottom: 10px;
  2174. }
  2175. .print-type {
  2176. position: absolute;
  2177. top: 0;
  2178. bottom: 0;
  2179. left: 0;
  2180. right: 0;
  2181. margin: auto;
  2182. width: 340px;
  2183. height: 456px;
  2184. background: white;
  2185. border-radius: 10px;
  2186. z-index: 999;
  2187. .bottom-btn {
  2188. text-align: center;
  2189. }
  2190. }
  2191. .print-type-title {
  2192. text-align: center;
  2193. font-size: 18px;
  2194. // margin: 20px;
  2195. margin: 20px 20px 10px;
  2196. }
  2197. .print-type-checkbox {
  2198. padding-left: 20px;
  2199. .el-date-editor.el-input {
  2200. width: 85% !important;
  2201. }
  2202. .proportion_css {
  2203. width: 85%;
  2204. }
  2205. }
  2206. /deep/.el-table td,
  2207. /deep/.el-table th {
  2208. text-align: center;
  2209. }
  2210. </style>