123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223 |
- <!--仓库管理-->
- <template>
- <div class="container">
- <!-- 表格 -->
- <!-- <div class="top_form" v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.kan`">
- <div style='position:relative;' class="title">
- <span style="font-size:18px;font-weight: 600;margin-left:20px">今日储量明细</span><span style="color:#8890B1;font-size:16px">({{dateTime}})</span>
- <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>
- </div>
- <el-table :data="tableData" style="width: 100%;margin-top:20px">
- <el-table-column :prop="item" :label="item" show-overflow-tooltip v-for="(item, index) in tableHeader" :key="index"></el-table-column>
- </el-table>
- </div> -->
- <div class="flex">
- <div class="left" style="width:35%;">
- <el-form
- class="position"
- ref="deptBudgetList"
- :rules="rules"
- :model="deptBudgetList"
- >
- <div class="title"><span class="cangInfo">仓库信息</span></div>
- <!-- 仓储部负责人 -->
- <!-- <el-form-item label-width="120px" label="仓储部负责人" span="1" prop="acceptanceMethod">
- <el-input v-model="responsible" placeholder="暂无" maxlength="100" size="small" disabled/>
- </el-form-item> -->
- <!--仓库名称-->
- <el-form-item
- label-width="120px"
- label="仓库名"
- span="1"
- prop="warehouseName"
- >
- <el-select
- v-model="warehouseInfo.warehouseName"
- placeholder="请选择仓库名"
- filterable
- clearable
- @change="selectstaff"
- :filter-method="warehouseQuery"
- >
- <el-option
- v-for="item in warehouseXiaLa"
- :key="item.warehouseName"
- :label="item.warehouseName"
- :value="item.warehouseName"
- />
- </el-select>
- </el-form-item>
- <!--仓库所在地-->
- <el-form-item
- label-width="120px"
- label="仓库所在地"
- span="1"
- prop="acceptanceMethod"
- >
- <el-input
- v-model="warehouseInfo.warehouseLocation"
- placeholder="暂无"
- maxlength="100"
- size="small"
- disabled
- />
- </el-form-item>
- <!--详细地址-->
- <el-form-item
- label-width="120px"
- label="详细地址"
- span="1"
- prop="detailedAddress"
- class="readonly"
- >
- <el-input
- v-model="warehouseInfo.detailedAddress"
- placeholder="暂无"
- maxlength="100"
- size="small"
- disabled
- />
- </el-form-item>
- <!--总储量(吨)-->
- <el-form-item
- label-width="120px"
- label="最大容量(吨)"
- span="1"
- prop="settlementMethod"
- v-if="warehouseType == 1"
- >
- <el-input
- :readonly="true"
- v-model="warehouseInfo.maxReserves"
- maxlength="100"
- placeholder="暂无"
- size="small"
- disabled
- />
- </el-form-item>
- <!--负责人-->
- <el-form-item
- label-width="120px"
- label="负责人"
- span="1"
- prop="personCharge"
- >
- <el-input
- v-model="warehouseInfo.personCharge"
- placeholder="暂无"
- maxlength="100"
- size="small"
- disabled
- />
- </el-form-item>
- <!--其他负责人-->
- <el-form-item
- label-width="120px"
- label="其他驻库人员"
- span="1"
- prop="otherPersonCharge"
- >
- <!-- <el-select v-model="WarehouseInfo.otherPersonPhone" placeholder="暂无" @change="selectstaffOther" multiple filterable clearable collapse-tags disabled> -->
- <el-input
- v-model="warehouseInfo.otherPersonCharge"
- placeholder="暂无"
- maxlength="100"
- size="small"
- disabled
- />
- </el-form-item>
- </el-form>
- </div>
- <div class="right" style="width:70%">
- <div class="position">
- <div class="title"><span class="cangInfo">仓库储量</span></div>
- <div class="weight">
- <el-switch
- style="display: block"
- v-model="value"
- active-color="#13ce66"
- inactive-color="#409EFF"
- active-text="折算纯重"
- inactive-text="实际重量"
- active-value="1"
- inactive-value="0"
- @change="changeWeight"
- ></el-switch>
- <!-- <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.view` " @click="changeWeight(2)">实际重量</ws-button>
- <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.view` " @click="changeWeight(1)">折算纯重</ws-button> -->
- </div>
- <div class="color">
- <div v-for="(item, i) in totalReserves" :key="i" class="color_for">
- <div
- :style="{ background: lineColor[i] }"
- class="color_item"
- ></div>
- <div class="color_goodsName">{{ item.goodsName }}</div>
- </div>
- </div>
- <div
- v-for="(item, index) in totalReserves"
- :key="index"
- class="reservesInfo"
- >
- <div class="reservesInfo_item" v-if="warehouseType == '1'">
- <div class="reservesInfo_GoodsName">{{ item.goodsName }}</div>
- <span class="reservesInfo_Amount"
- >{{ item.stockNum == 0 ? '-' : item.stockNum }}(吨)</span
- ><br />
- <span
- v-if="item.stockNum && item.cost"
- class="reservesInfo_Amount"
- >{{ item.cost == 0 ? '-' : item.cost }}(元/吨)</span
- >
- <span v-else class="reservesInfo_Amount"
- >{{
- item.conversionCost == 0 ? '-' : item.conversionCost
- }}(元/吨)</span
- ><br />
- <div style="display:grid">
- <span
- v-if="item.cargoWeight && item.cargoWeight != 0"
- class="reservesInfo_Amount"
- >含转入:{{ item.cargoWeight }}(吨)</span
- >
- <span
- v-if="item.redemptionWeight && item.redemptionWeight != 0"
- class="reservesInfo_Amount"
- >待赎回:{{ item.redemptionWeight }}(吨)</span
- >
- </div>
- </div>
- <div class="reservesInfo_item" v-if="warehouseType == '2'">
- <div class="reservesInfo_GoodsName">{{ item.goodsName }}(吨)</div>
- <span class="reservesInfo_Amount">{{
- item.surplus == 0 ? '-' : item.surplus
- }}</span>
- </div>
- </div>
- <div
- ref="myEchart7"
- style="height: 250px; width:96%;border-radius: 4px; border:1px solid #D8DCE6; padding: 10px;"
- class="column"
- ></div>
- </div>
- </div>
- </div>
- <div class="position">
- <div class="title">
- <span style="font-size:18px;font-weight: 600;margin-left:20px"
- >当期储量</span
- >
- </div>
- <ws-button
- type="primary"
- @click="handleAdd()"
- v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.add`"
- style="margin-left:20px"
- >添加</ws-button
- >
- <!-- <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.view` " @click="handleLook()">查看</ws-button> -->
- <ws-button
- v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.edit`"
- @click="handleEdit()"
- >编辑</ws-button
- >
- <!-- <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.delete`" @click="handleDelete()">删除</ws-button> -->
- <ws-button
- v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.view`"
- @click="record()"
- >记录</ws-button
- >
- <!-- <ws-button v-if="warehouseType == '1'" v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.view`" @click="loss()">盘库</ws-button> -->
- <!-- <ws-button v-if="warehouseInfo.clearStatusFlag == 1 && warehouseType == '2'" @click="clearance()">清库</ws-button> -->
- <!-- <ws-button v-if="warehouseInfo.clearStatusFlag == 3 && warehouseType == '2'" disabled> 已清库</ws-button> -->
- <!-- createType 1手动创建 2 自动创建 -->
- <!-- <ws-button v-if='warehouseInfo.createType==1' v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.delete`" @click="indialog = true">入库量</ws-button> -->
- <!-- <ws-button v-if='list.length>0' @click="handlTask()">任务</ws-button> -->
- <ws-button
- v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.add`"
- @click="outData(1)"
- >导出</ws-button
- >
- <ws-button @click="outData(2)">打印</ws-button>
- <!-- <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.kan`" @click="exportHistoricalData()">导出历史库存记录</ws-button> -->
- <ws-button
- @click="transformation()"
- v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.view`"
- >折转</ws-button
- >
- <!-- <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.kan`" @click="handleall()">全部仓库</ws-button> -->
- <!-- <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.kan`" @click="handleMintor()">查看监控</ws-button> -->
- <ws-button @click="dryClick()">烘干入库</ws-button>
- <!-- <ws-button @click="materialInOut()">物料出入库</ws-button> -->
- <el-table
- ref="table"
- show-summary
- :summary-method="getSummaries"
- class="wenzi setUp_css"
- :data="warehouseList"
- style="width: 100%; margin-top: 20px"
- height="calc(100% - 45px)"
- v-if="warehouseType == '1'"
- >
- <el-table-column prop="warehouseName" label="仓库名"> </el-table-column>
- <el-table-column prop="binNumber" label="仓位编号"> </el-table-column>
- <el-table-column prop="capacity" label="容量(吨)">
- <template slot-scope="scope">
- <div
- v-if="scope.row.capacity != 'null' && scope.row.capacity != null"
- >
- {{ scope.row.capacity }}
- </div>
- </template>
- </el-table-column>
- <el-table-column label="货名">
- <template slot-scope="scope">
- <div
- style="height: 24px"
- v-for="(item, i) in scope.row.warehouseNumViewList"
- :key="i"
- >
- {{ item.goodsName }}
- </div>
- </template>
- </el-table-column>
- <el-table-column label="入库量(吨)">
- <template slot-scope="scope">
- <div
- style="height: 24px"
- v-for="(item, i) in scope.row.warehouseNumViewList"
- :key="i"
- >
- {{ item.inNetWeight }}
- </div>
- </template>
- </el-table-column>
- <el-table-column label="出库量(吨)">
- <template slot-scope="scope">
- <div
- style="height: 24px"
- v-for="(item, i) in scope.row.warehouseNumViewList"
- :key="i"
- >
- {{
- item.outNetWeight == 0
- ? '0'
- : Number(item.outNetWeight).toFixed(3)
- }}
- </div>
- </template>
- </el-table-column>
- <el-table-column label="应余量(吨)">
- <template slot-scope="scope">
- <div
- style="height: 24px"
- v-for="(item, i) in scope.row.warehouseNumViewList"
- :key="i"
- >
- {{ item.storage }}
- </div>
- </template>
- </el-table-column>
- </el-table>
- <!-- 临时库 -->
- <el-table
- class="wenzi"
- :data="warehouseList"
- style="width: 100%; margin-top: 20px"
- height="calc(100% - 45px)"
- v-if="warehouseType == '2'"
- >
- <el-table-column prop="warehouseName" label="仓库名"> </el-table-column>
- <el-table-column prop="binNumber" label="仓位编号"> </el-table-column>
- <el-table-column prop="capacity" label="容量(吨)">
- <template slot-scope="scope">
- <div
- v-if="scope.row.capacity != 'null' && scope.row.capacity != null"
- >
- {{ scope.row.capacity }}
- </div>
- </template>
- </el-table-column>
- <el-table-column label="货名">
- <template slot-scope="scope">
- <div
- style="height: 24px"
- v-for="(item, i) in scope.row.warehouseNumViewList"
- :key="i"
- >
- {{ item.goodsName }}
- </div>
- </template>
- </el-table-column>
- <el-table-column label="入库量(吨)">
- <template slot-scope="scope">
- <div
- style="height: 24px"
- v-for="(item, i) in scope.row.warehouseNumViewList"
- :key="i"
- >
- {{ item.inNetWeight }}
- </div>
- </template>
- </el-table-column>
- <el-table-column label="出库量(吨)">
- <template slot-scope="scope">
- <div
- style="height: 24px"
- v-for="(item, i) in scope.row.warehouseNumViewList"
- :key="i"
- >
- {{ item.outNetWeight }}
- </div>
- </template>
- </el-table-column>
- <el-table-column label="应余量(吨)">
- <template slot-scope="scope">
- <div
- style="height: 24px"
- v-for="(item, i) in scope.row.warehouseNumViewList"
- :key="i"
- >
- {{ item.surplus }}
- </div>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <!-- <div class="map">
- <div class="title">
- <span style="font-size:18px;font-weight: 600;margin-left:20px">{{
- maptitle
- }}</span>
- </div>
- <div class="map_switch">
- <div :class="btnCss1" @click="mapChange(1)" v-if="warehouseType == '1'">
- 监控
- </div>
- <div :class="btnCss2" @click="mapChange(2)">定位</div>
- </div>
- <div
- class="map-item"
- v-if="mapshow && warehousePositioning.lat && warehousePositioning.lng"
- >
- <map-drag
- @marker="marker"
- ref="childMap"
- :isShowaddress="true"
- v-on:addressListen="getAddress"
- v-on:pickedAddress="searchAddress"
- :warehousePositioning="warehousePositioning"
- ></map-drag>
- </div>
- <div v-if="!mapshow && warehouseType == '1'" class="monitor">
- <div v-if="!monitorUrl1" class="video1">
- <img src="../../../public/img/quesheng@2x.png" alt="" class="img1" />
- <div>监控视频未连接</div>
- </div>
- <div v-else class="video1">
- <iframe
- :src="monitorUrl1"
- width="440"
- height="360"
- allowfullscreen="true"
- webkitallowfullscreen="true"
- mozallowfullscreen="true"
- allow="autoplay; fullscreen; microphone;"
- ></iframe>
- </div>
- <div v-if="!monitorUrl2" class="video1">
- <img src="../../../public/img/quesheng@2x.png" alt="" class="img1" />
- <div>监控视频未连接</div>
- </div>
- <div v-else class="video2">
- <iframe
- :src="monitorUrl2"
- width="440"
- height="360"
- allowfullscreen="true"
- webkitallowfullscreen="true"
- mozallowfullscreen="true"
- allow="autoplay; fullscreen; microphone;"
- ></iframe>
- </div>
- </div>
- </div> -->
- <el-dialog
- title="修改入库量"
- :visible.sync="indialog"
- width="30%"
- :before-close="handleClose"
- top="35vh"
- >
- <el-form>
- <el-form-item
- label-width="120px"
- label="入库量(吨)"
- span="1"
- prop="acceptanceMethod"
- >
- <el-input
- v-model="inWarehouse"
- placeholder="请输入入库量"
- maxlength="100"
- size="small"
- type="number"
- />
- </el-form-item>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="handleClose">取 消</el-button>
- <el-button type="primary" @click="submit">确 定</el-button>
- </span>
- </el-dialog>
- <div class="mask" v-show="isShowPrintType"></div>
- <div class="print-type" v-show="isShowPrintType">
- <div class="print-type-content">
- <div class="print-type-title">{{ headerText }}</div>
- <div class="print-type-checkbox">
- <el-form ref="form" label-width="110px">
- <el-form-item label="类型">
- <el-radio-group v-model="parameter.radio">
- <el-radio :label="3">入库记录</el-radio>
- <el-radio :label="2">出库记录</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item label="起始日期">
- <el-date-picker
- type="datetime"
- @change="startDataChange"
- format="yyyy-MM-dd HH:mm:ss"
- value-format="yyyy-MM-dd HH:mm:ss"
- placeholder="请选择起始日期"
- v-model="parameter.printStartDate"
- default-time="00:00:00"
- ></el-date-picker>
- <!-- <el-date-picker v-model="value3" type="datetime" placeholder="选择日期时间" default-time="12:00:00"></el-date-picker> -->
- </el-form-item>
- <el-form-item label="截止日期">
- <el-date-picker
- type="datetime"
- @change="endDataChange"
- format="yyyy-MM-dd HH:mm:ss"
- value-format="yyyy-MM-dd HH:mm:ss"
- placeholder="请选择截止日期"
- v-model="parameter.printEndDate"
- default-time="00:00:00"
- >
- </el-date-picker>
- </el-form-item>
- <!-- <el-form-item label="截止日期1">
- <el-date-picker value-format="timestamp" type="date" placeholder="请选择截止日期" v-model="parameter.endDate1">
- </el-date-picker>
- </el-form-item> -->
- <!--仓库名称-->
- <el-form-item label="仓库名称" span="1" prop="warehouseName">
- <el-select
- @change="warehousechange"
- v-model="parameter.warehouseName"
- placeholder="请选择仓库名称"
- filterable
- clearable
- >
- <el-option
- v-if="headerText != '打印记录'"
- key=""
- label="全部仓库"
- value="全部仓库"
- />
- <el-option
- v-for="item in warehouseAllXiaLa"
- :key="item.warehouseName"
- :label="item.warehouseName"
- :value="item.warehouseName"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="仓位编号" span="1" prop="warehouseName">
- <el-select
- v-model="parameter.binNumber"
- placeholder="请选择仓位编号"
- filterable
- clearable
- >
- <el-option
- v-for="item in typeList"
- :key="item.id"
- :label="item.binNumber"
- :value="item.binNumber"
- />
- </el-select>
- </el-form-item>
- <el-form-item
- v-if="headerText != '导出记录'"
- label="货名"
- span="1"
- prop="warehouseName"
- >
- <el-select
- v-model="parameter.goodsName"
- placeholder="请选择货名"
- filterable
- clearable
- >
- <el-option
- v-for="item in goodnameList"
- :key="item.constKey"
- :label="item.constValue"
- :value="item.constValue"
- />
- </el-select>
- </el-form-item>
- <!-- <el-form-item label="增量比例(%)" v-if="headerText == '打印记录'">
- <el-input placeholder="请输入增量比例" v-model="parameter.proportion" clearable class="proportion_css">
- </el-input>
- </el-form-item> -->
- </el-form>
- </div>
- </div>
- <div class="bottom-btn">
- <el-button @click="submitClick()">确定</el-button>
- <el-button @click="removePrint">取消</el-button>
- </div>
- </div>
- <div class="mask" v-show="isShowPrintType1"></div>
- <div class="print-type" v-show="isShowPrintType1">
- <div class="print-type-content">
- <div class="print-type-title">{{ headerText1 }}</div>
- <div class="print-type-checkbox">
- <el-form ref="form" label-width="110px">
- <el-form-item label="起始日期">
- <el-date-picker
- value-format="yyyy-MM-dd"
- type="date"
- placeholder="请选择起始日期"
- v-model="parameter.startDate"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="截止日期">
- <el-date-picker
- value-format="yyyy-MM-dd"
- type="date"
- placeholder="请选择截止日期"
- v-model="parameter.endDate"
- >
- </el-date-picker>
- </el-form-item>
- <!--仓库名称-->
- <el-form-item label="仓库名称" span="1" prop="warehouseName">
- <el-select
- v-model="parameter.warehouseName"
- placeholder="请选择仓库名称"
- filterable
- clearable
- >
- <el-option key="" label="全部仓库" value="全部仓库" />
- <el-option
- v-for="item in warehouseAllXiaLa"
- :key="item.warehouseName"
- :label="item.warehouseName"
- :value="item.warehouseName"
- />
- </el-select>
- </el-form-item>
- </el-form>
- </div>
- </div>
- <div class="bottom-btn">
- <el-button @click="submitClick1()">确定</el-button>
- <el-button @click="removePrint1">取消</el-button>
- </div>
- </div>
- </div>
- </template>
- <script>
- import { packList } from '@/model/contarct/index'
- import {
- getList,
- getsponsible,
- clearancee,
- xiala,
- getQualityZhe,
- getQualityReal,
- exportHistoricalInventory,
- postExport,
- addselectinfoList,
- printAdd,
- postExportOut,
- getreserves,
- getResponsible,
- deletewarehouse,
- postInWeight,
- getwarehousNameNew,
- getbintype,
- postExportjynin,
- postExportjynout
- } from '@/model/warehouse/index'
- import mapDrag from '@/components/mapdrag/warehouseMap'
- import { downloadFile } from '@/utils/batchDown'
- import { dayjs, EventBus } from 'base-core-lib'
- import Pagination from '@/components/Pagination'
- import WsUpload from '@/components/WsUpload'
- import axios from 'axios'
- export default {
- name: 'viewSpareMoney',
- components: {
- WsUpload,
- Pagination,
- mapDrag,
- axios
- },
- watch: {
- vesselId(val) {
- this.getList()
- },
- isShow(val) {
- this.showType = val
- }
- },
- data() {
- return {
- value: '0',
- compName: localStorage.getItem('ws-pf_compName'),
- rules: {},
- options: [],
- StartDate: '',
- compId: localStorage.getItem('ws-pf_compId'),
- deptBudgetList: {},
- dateTime: '',
- list: [],
- warehouseList: [],
- warehouseType: '1',
- totalStorage: 0,
- radio: 0,
- tableHeader: [],
- tableData: [],
- totalReserves: [],
- warehouseXiaLa: [],
- warehouseInfo: {
- warehouseName: ''
- },
- lineColor: [
- '#5878E8',
- '#50CAD4',
- '#FF9F24',
- '#E87C25',
- '#27727B',
- '#FE8463',
- '#9BCA63',
- '#FAD860',
- '#F3A43B',
- '#60C0DD',
- '#D7504B',
- '#C6E579',
- '#F4E001',
- '#F0805A',
- '#26C0C0'
- ],
- warehouseXiaLaCopy: [],
- warehouseAllXiaLa: [],
- responsible: '',
- maptitle: '库点监控',
- btnCss1: 'btn1',
- btnCss2: 'btn',
- mapshow: false,
- indialog: false,
- inWarehouse: '',
- parameter: {
- startDate: '',
- endDate: ''
- },
- EndDate: '',
- isShowPrintType: false, //打印
- headerText: '',
- typeList: [],
- isShowPrintType1: false,
- headerText1: '导出历史库存记录',
- date: {
- year: dayjs().format('YYYY'),
- month: dayjs().format('MM')
- },
- warehousePositioning: {},
- monitorUrl1: '',
- monitorUrl2: '',
- goodnameList: []
- }
- },
- activated() {
- this.tableData = []
- this.getList()
- // this.$refs.childMap.clearVal()
- this.showType = this.isShow
- },
- methods: {
- startDataChange(e) {
- var d = new Date(e)
- let year = d.getFullYear()
- let month = d.getMonth() + 1
- month = month < 10 ? '0' + month : month
- let date = d.getDate() < 10 ? '0' + d.getDate() : d.getDate()
- let hours = d.getHours() < 10 ? '0' + d.getHours() : d.getHours()
- let minutes = d.getMinutes() < 10 ? '0' + d.getMinutes() : d.getMinutes()
- let seconds = d.getSeconds() < 10 ? '0' + d.getSeconds() : d.getSeconds()
- this.parameter.printStartDate =
- year +
- '-' +
- month +
- '-' +
- date +
- ' ' +
- hours +
- ':' +
- minutes +
- ':' +
- seconds
- },
- endDataChange(e) {
- var d = new Date(e)
- let year = d.getFullYear()
- let month = d.getMonth() + 1
- month = month < 10 ? '0' + month : month
- let date = d.getDate() < 10 ? '0' + d.getDate() : d.getDate()
- let hours = d.getHours() < 10 ? '0' + d.getHours() : d.getHours()
- let minutes = d.getMinutes() < 10 ? '0' + d.getMinutes() : d.getMinutes()
- let seconds = d.getSeconds() < 10 ? '0' + d.getSeconds() : d.getSeconds()
- this.parameter.printEndDate =
- year +
- '-' +
- month +
- '-' +
- date +
- ' ' +
- hours +
- ':' +
- minutes +
- ':' +
- seconds
- },
- warehousechange(e) {
- for (let i = 0; i < this.warehouseAllXiaLa.length; i++) {
- if (this.warehouseAllXiaLa[i].warehouseName == e) {
- getbintype({ baseId: this.warehouseAllXiaLa[i].id })
- .toPromise()
- .then(response => {
- console.log(response)
- this.typeList = response
- })
- }
- }
- },
- downloadFile(url, fileName) {
- //fileurl文件地址(一般是接口返回) filename文件下载后的名字
- const x = new XMLHttpRequest()
- x.open('GET', url, true)
- x.responseType = 'blob'
- x.onload = function() {
- const url = window.URL.createObjectURL(x.response)
- const a = document.createElement('a')
- a.href = url
- a.download = fileName
- a.click()
- document.body.removeChild(a)
- // 然后移除
- }
- x.send()
- },
- //导出、打印EndDate
- outData(index) {
- if (index == 1) {
- this.headerText = '导出记录'
- } else if (index == 2) {
- this.headerText = '打印记录'
- let now = new Date()
- let tomorrow = new Date(now.getTime() + 24 * 60 * 60 * 1000)
- var year = tomorrow.getFullYear()
- var month = tomorrow.getMonth() + 1
- var strDate = tomorrow.getDate()
- if (strDate < 10) {
- strDate = '0' + strDate
- }
- var pastdate = new Date()
- this.StartDate =
- pastdate.getFullYear() +
- '-' +
- (pastdate.getMonth() + 1) +
- '-' +
- (pastdate.getDate() >= 10
- ? pastdate.getDate()
- : '0' + pastdate.getDate()) +
- ' 00:00:00'
- // this.StartDate = new Date(pastdate.getFullYear() + '-' + (pastdate.getMonth() + 1) + '-' + (pastdate.getDate()>10?pastdate.getDate():'0'+pastdate.getDate())+' 00:00:00')
- this.$set(this.parameter, 'printStartDate', this.StartDate)
- // parameter.printStartDate
- this.EndDate = '' + year + '-' + month + '-' + strDate + ' 00:00:00'
- this.$set(this.parameter, 'printEndDate', this.EndDate)
- }
- this.$forceUpdate()
- this.isShowPrintType = true
- },
- removePrint() {
- this.parameter.warehouseName = ''
- this.parameter.proportion = ''
- this.isShowPrintType = false
- },
- async submitClick() {
- if (!this.parameter.radio && this.headerText == '打印记录') {
- this.$message.error('请选择打印的类型')
- return
- }
- if (!this.parameter.printStartDate) {
- this.$message.error('请选择打印的起始日期')
- return
- }
- if (!this.parameter.printEndDate) {
- this.$message.error('请选择打印的截止日期')
- return
- }
- if (!this.parameter.warehouseName) {
- this.$message.error('请选择所要打印的仓库')
- return
- }
- if (this.parameter.warehouseName == '全部仓库') {
- this.parameter.warehouseName = ''
- }
- if (this.parameter.binNumber == '全部仓位') {
- this.parameter.binNumber = ''
- }
- // let enddate = new Date(this.parameter.endDate).toLocaleString()//将截止时间的时间戳转为时间
- // this.parameter.endDate = enddate.split(' ')[0].replace('/' ,'-').replace('/','-')
- this.parameter.warehouseName = this.parameter.warehouseName.replace(
- '(临)',
- ''
- )
- this.isShowPrintType = false
- if (this.headerText == '导出记录') {
- if (this.parameter.radio == 3) {
- if (this.compName == '辽宁佳屹农商贸有限公司') {
- const data = await postExportjynin({
- compId: localStorage.getItem('ws-pf_compId'),
- startDate: this.parameter.printStartDate,
- endDate: this.parameter.printEndDate,
- warehouseName: this.parameter.warehouseName
- }).toPromise()
- console.log(data)
- // window.open(data.data.data)
- this.downloadFile(
- data.data.data,
- `${this.date.year +
- (this.date.month ? `-${this.date.month}` : '')}导出出库记录`
- )
- } else {
- const { data } = await postExport(
- {
- startDate: this.parameter.printStartDate,
- endDate: this.parameter.printEndDate,
- warehouseName: this.parameter.warehouseName
- },
- {},
- {
- responseType: 'blob'
- }
- ).toPromise()
- downloadFile({
- res: data,
- fileName: `${this.date.year +
- (this.date.month ? `-${this.date.month}` : '')}导出入库记录`,
- type: 'xls'
- })
- }
- } else if (this.parameter.radio == 2) {
- if (this.compName == '辽宁佳屹农商贸有限公司') {
- const data = await postExportjynout({
- compId: localStorage.getItem('ws-pf_compId'),
- startDate: this.parameter.printStartDate,
- endDate: this.parameter.printEndDate,
- warehouseName: this.parameter.warehouseName
- }).toPromise()
- console.log(data)
- this.downloadFile(
- data.data.data,
- `${this.date.year +
- (this.date.month ? `-${this.date.month}` : '')}导出出库记录`
- )
- } else {
- const { data } = await postExportOut(
- {
- startDate: this.parameter.printStartDate,
- endDate: this.parameter.printEndDate,
- warehouseName: this.parameter.warehouseName
- },
- {},
- {
- responseType: 'blob'
- }
- ).toPromise()
- downloadFile({
- res: data,
- fileName: `${this.date.year +
- (this.date.month ? `-${this.date.month}` : '')}导出出库记录`,
- type: 'xls'
- })
- }
- }
- } else if (this.headerText == '打印记录') {
- if (this.parameter.binNumber == '全部仓位') {
- this.parameter.binNumber = ''
- }
- addselectinfoList({
- compId: localStorage.getItem('ws-pf_compId'),
- printStartDate: this.parameter.printStartDate,
- printEndDate: this.parameter.printEndDate,
- warehouseName: this.parameter.warehouseName,
- binNumber: this.parameter.binNumber,
- goodsName: this.parameter.goodsName,
- searchType: this.parameter.radio,
- printFlag: '1',
- currentPage: 1,
- pageSize: 999,
- statusFlag: 3
- })
- .toPromise()
- .then(response => {
- if (response.records.length == 0) {
- this.$message.warning('暂未查到所要打印的出入库信息')
- } else {
- var warehousePrint = response.records
- if (this.parameter.proportion) {
- var countWeight = 0
- for (let i = 0; i < warehousePrint.length; i++) {
- countWeight += Number(warehousePrint[i].netWeight)
- }
- var increment = (
- countWeight *
- (Number(this.parameter.proportion) / 100)
- ).toFixed(2) //所要增加的量
- printAdd()
- .toPromise()
- .then(response1 => {
- // setTimeout(function(){
- for (let i = 0; i < response1.length; i++) {
- increment = Number(increment)
- if (increment > 0) {
- let index = Math.abs(
- Math.round(Math.random() * response1.length - 1)
- )
- let pro = response1[index] //取出假数据并设定值
- pro.netWeight = Number(
- (Math.random() * (70 - 10 + 1) + 10).toFixed(2)
- )
- pro.tare = Number(
- (Math.random() * (20 - 10 + 1) + 10).toFixed(2)
- )
- // pro.grossWeight = Number((pro.tare + pro.netWeight).toFixed(2))
- if (pro.netWeight < increment) {
- //随机净重 小于 所要增量
- increment = (increment - pro.netWeight).toFixed(2) //所要增的量
- if (increment < 10 && pro.netWeight <= 60) {
- pro.netWeight += Number(increment)
- pro.grossWeight = Number(
- (pro.tare + pro.netWeight).toFixed(2)
- )
- increment = 0
- warehousePrint.push(pro)
- } else {
- increment -= pro.netWeight
- pro.grossWeight = Number(
- (pro.tare + pro.netWeight).toFixed(2)
- )
- warehousePrint.push(pro)
- }
- } else {
- //随机净重 大于 所要增量
- pro.netWeight = Number(increment.toFixed(2))
- pro.grossWeight = Number(
- (pro.tare + pro.netWeight).toFixed(2)
- )
- increment = 0
- warehousePrint.push(pro)
- }
- response1.splice(index, 1) //删除已添加过得假数据车牌号
- if (response1.length == 0) {
- sessionStorage.setItem(
- 'inOutWarehouse_Print',
- JSON.stringify(warehousePrint)
- )
- let _canshu = ''
- _canshu =
- this.parameter.radio +
- '&warehouseName=' +
- this.parameter.warehouseName +
- '&startDate=' +
- this.parameter.printStartDate +
- '&endDate=' +
- this.parameter.printEndDate
- window.open(
- '../../../../../static/warehousePrint.html?type=' +
- _canshu
- )
- }
- } else {
- //增量为0时
- break
- }
- }
- //跳转
- sessionStorage.setItem(
- 'inOutWarehouse_Print',
- JSON.stringify(warehousePrint)
- )
- let _canshu = ''
- _canshu =
- this.parameter.radio +
- '&warehouseName=' +
- this.parameter.warehouseName +
- '&startDate=' +
- this.parameter.printStartDate +
- '&endDate=' +
- this.parameter.printEndDate
- window.open(
- '../../../../../static/warehousePrint.html?type=' +
- _canshu
- )
- })
- } else {
- //没有增量比例的直接打印
- sessionStorage.setItem(
- 'inOutWarehouse_Print',
- JSON.stringify(response.records)
- )
- let _canshu1 = ''
- _canshu1 =
- this.parameter.radio +
- '&warehouseName=' +
- this.parameter.warehouseName +
- '&startDate=' +
- this.parameter.printStartDate +
- '&endDate=' +
- this.parameter.printEndDate
- window.open(
- '../../../../../static/warehousePrint.html?type=' + _canshu1
- )
- }
- }
- })
- }
- },
- //导出历史库存记录
- exportHistoricalData() {
- let date = new Date()
- var year = date.getFullYear()
- var month = date.getMonth() + 1
- var strDate = date.getDate()
- var pastdate = new Date(date.getTime() - 24 * 60 * 60 * 1000)
- this.parameter.startDate =
- pastdate.getFullYear() +
- '-' +
- (pastdate.getMonth() + 1) +
- '-' +
- pastdate.getDate()
- this.parameter.endDate = '' + year + '-' + month + '-' + strDate
- this.$forceUpdate()
- this.isShowPrintType1 = true
- },
- removePrint1() {
- this.parameter.warehouseName = ''
- this.parameter.proportion = ''
- this.isShowPrintType1 = false
- },
- async submitClick1() {
- if (!this.parameter.startDate) {
- this.$message.error('请选择打印的起始日期')
- return
- }
- if (!this.parameter.endDate) {
- this.$message.error('请选择打印的截止日期')
- return
- }
- if (
- new Date(this.parameter.endDate).getTime() <
- new Date(this.parameter.startDate).getTime()
- ) {
- this.$message.error('截止日期输入错误')
- return
- }
- if (this.parameter.warehouseName == '全部仓库') {
- this.parameter.warehouseName = ''
- }
- if (this.parameter.binNumber == '全部仓位') {
- this.parameter.binNumber = ''
- }
- const { data } = await exportHistoricalInventory(
- {
- startDate: this.parameter.startDate,
- endDate: this.parameter.endDate,
- warehouseName: this.parameter.warehouseName
- },
- {},
- {
- responseType: 'blob'
- }
- ).toPromise()
- downloadFile({
- res: data,
- fileName: `${this.date.year +
- (this.date.month ? `-${this.date.month}` : '')}导出历史库存记录`,
- type: 'xls'
- })
- },
- handleClose() {
- this.indialog = false
- },
- submit() {
- if (!this.inWarehouse) {
- this.$message.error('请输入入库量')
- return
- }
- if (
- Number(this.warehouseInfo.warehouseNumViewList[0].outNetWeight) >
- Number(this.inWarehouse)
- ) {
- this.$message.error('入库量不可小于已出库量')
- return
- }
- if (
- String(this.inWarehouse).indexOf('.') != -1 &&
- String(this.inWarehouse).length -
- (String(this.inWarehouse).indexOf('.') + 1) >
- 3
- ) {
- this.$message.error('入库量输入错误')
- return
- }
- if (Number(this.warehouseInfo.maxInStorage) < Number(this.inWarehouse)) {
- this.$message.error('入库量不可超过合同上限')
- return
- }
- let InnetWeight = {
- baseId: this.warehouseInfo.warehouseId,
- netWeight: this.inWarehouse
- }
- postInWeight(InnetWeight)
- .toPromise()
- .then(response => {
- this.$notify.success({
- title: '成功',
- message: '修改成功'
- })
- ;(this.indialog = false), (this.inWarehouse = ''), this.getList1()
- })
- .catch(response => {
- // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
- })
- },
- initCharts() {
- let _x = []
- let _y = []
- for (var i = 0; i < this.totalReserves.length; i++) {
- if (this.warehouseType == '1') {
- _x.push(this.totalReserves[i].goodsName)
- _y.push(this.totalReserves[i].stockNum)
- } else {
- _x.push(this.totalReserves[i].goodsName)
- _y.push(this.totalReserves[i].surplus)
- }
- }
- // 柱状图
- let myChart7 = this.$echarts.init(this.$refs.myEchart7)
- var zoption = {
- grid: {
- left: '0',
- right: '0',
- bottom: '0',
- top: '30',
- containLabel: true
- },
- // --- 提示框 ----
- tooltip: {
- show: true, // 是否显示提示框,默认为true
- trigger: 'item', // 数据项图形触发
- axisPointer: {
- // 指示样式
- type: 'shadow',
- axis: 'auto'
- },
- padding: 5,
- textStyle: {
- // 提示框内容的样式
- color: '#fff'
- }
- },
- // ------ X轴 ------
- xAxis: {
- axisLabel: {
- // 坐标轴标签
- show: true, // 是否显示
- inside: false, // 是否朝内
- rotate: 0, // 旋转角度
- margin: 10, // 刻度标签与轴线之间的距离
- color: '#929AB8', // 默认取轴线的颜色
- interval: 0
- },
- splitArea: {
- // 网格区域
- show: false // 是否显示,默认为false
- },
- data: _x
- },
- // ------ y轴 ----------
- yAxis: {
- axisLine: {
- // 坐标轴 轴线
- show: false // 是否显示
- },
- axisLabel: {
- // 坐标轴的标签
- show: true, // 是否显示
- inside: false, // 是否朝内
- rotate: 0, // 旋转角度
- margin: 8, // 刻度标签与轴线之间的距离
- color: '#929AB8' // 默认轴线的颜色
- },
- splitLine: {
- // gird 区域中的分割线
- show: true, // 是否显示
- lineStyle: {
- color: '#D9DDE7',
- width: 1,
- type: 'dashed'
- }
- }
- },
- // ------- 内容数据 -------
- series: [
- {
- name: '储量', // 序列名称
- type: 'bar', // 类型
- legendHoverLink: true, // 是否启用图列 hover 时的联动高亮
- // label: { // 图形上的文本标签
- // show: false,
- // position: 'insideTop', // 相对位置
- // rotate: 0, // 旋转角度
- // color: '#eee'
- // },
- itemStyle: {
- // 图形的形状
- // color: lineColor[index++]
- // barBorderRadius: [18, 18, 0 ,0]
- color: function(params) {
- var colorList = [
- '#5878E8',
- '#50CAD4',
- '#FF9F24',
- '#E87C25',
- '#27727B',
- '#FE8463',
- '#9BCA63',
- '#FAD860',
- '#F3A43B',
- '#60C0DD',
- '#D7504B',
- '#C6E579',
- '#F4E001',
- '#F0805A',
- '#26C0C0'
- ]
- return colorList[params.dataIndex]
- }
- },
- barWidth: 20, // 柱形的宽度
- barCategoryGap: '20%', // 柱形的间距
- label: {
- show: true,
- position: 'top',
- color: '#000000'
- },
- data: _y
- }
- ]
- }
- myChart7.setOption(zoption)
- },
- mapChange(num) {
- if (num == 1) {
- this.mapshow = false
- this.btnCss1 = 'btn1'
- this.btnCss2 = 'btn'
- this.maptitle = '库点监控'
- } else if (num == 2) {
- this.mapshow = true
- this.btnCss1 = 'btn'
- this.btnCss2 = 'btn1'
- this.maptitle = '定位'
- }
- },
- getAddress(data) {
- this.deptBudgetList.warehousePrivate = data[0]
- this.deptBudgetList.warehouseCity = data[1]
- this.deptBudgetList.warehouseArea = data[2]
- },
- searchAddress(e) {
- this.deptBudgetList.warehousePositioning = e.lat + ',' + e.lng
- },
- marker: function(item) {
- this.deptBudgetList.warehousePositioning =
- item.lnglat.lat + ',' + item.lnglat.lng
- },
- handleMintor() {
- this.$router.push({
- path: 'warehouseManagementMintor'
- })
- },
- dryClick() {
- this.$router.push({
- path: 'dryWarehousing'
- })
- },
- materialInOut() {
- this.$router.push({
- path: 'materialInOutWarehouse'
- })
- },
- handleall() {
- this.$router.push({
- path: 'warehouseManagement'
- })
- },
- selectstaff(e) {
- this.warehouseInfo.warehouseName = e
- for (var tmp = 0; tmp < this.warehouseAllXiaLa.length; tmp++) {
- if (this.warehouseAllXiaLa[tmp].warehouseName == e) {
- this.warehouseType = this.warehouseAllXiaLa[tmp].warehouseType
- this.monitorUrl1 = this.warehouseAllXiaLa[tmp].monitorUrl1
- this.monitorUrl2 = this.warehouseAllXiaLa[tmp].monitorUrl2
- if (this.warehouseType == '2') {
- this.maptitle = '定位'
- this.btnCss2 = 'btn1'
- this.mapshow = true
- } else {
- this.maptitle = '库点监控'
- this.btnCss1 = 'btn1'
- this.btnCss2 = 'btn'
- this.mapshow = false
- }
- break
- }
- }
- this.warehouseXiaLa = this.warehouseXiaLaCopy
- if (this.warehouseInfo.warehouseName.indexOf('(临)') != -1) {
- this.warehouseInfo.warehouseName = this.warehouseInfo.warehouseName.replace(
- ' (临)',
- ''
- )
- }
- this.getList1()
- },
- warehouseQuery(query) {
- if (query) {
- this.warehouseXiaLa = this.warehouseAllXiaLa
- this.warehouseXiaLa = this.warehouseAllXiaLa.filter(
- item => item.warehouseName.indexOf(query) > -1
- )
- } else {
- this.warehouseXiaLa = this.warehouseXiaLaCopy
- }
- },
- getCurrentDate(format) {
- var now = new Date()
- var year = now.getFullYear() //得到年份
- var month = now.getMonth() //得到月份
- var date = now.getDate() //得到日期
- var day = now.getDay() //得到周几
- var hour = now.getHours() //得到小时
- var minu = now.getMinutes() //得到分钟
- var sec = now.getSeconds() //得到秒
- month = month + 1
- if (month < 10) month = '0' + month
- if (date < 10) date = '0' + date
- if (hour < 10) hour = '0' + hour
- if (minu < 10) minu = '0' + minu
- if (sec < 10) sec = '0' + sec
- var time = ''
- //精确到天
- if (format == 1) {
- time = year + '-' + month + '-' + date
- }
- //精确到分
- else if (format == 2) {
- time =
- year + '-' + month + '-' + date + ' ' + hour + ':' + minu + ':' + sec
- }
- return time
- },
- //添加
- handleAdd() {
- this.$router.push({
- path: 'warehouseNewManagementAdd'
- })
- },
- //编辑
- handleEdit() {
- this.$router.push({
- path: 'warehouseNewManagementEdit'
- })
- },
- //查看
- handleLook() {
- this.$router.push({
- name: 'warehouseManagementLookNew'
- })
- },
- //删除仓库
- handleDelete() {
- for (var num = 0; num < this.warehouseList.length; num++) {
- //删除仓库前应当判断是否有库存
- for (
- var num_item = 0;
- num_item < this.warehouseList[num].warehouseNumViewList.length;
- num_item++
- ) {
- if (this.warehouseType == 2) {
- if (
- Number(
- this.warehouseList[num].warehouseNumViewList[num_item].surplus
- ) > 0
- ) {
- this.$message.error('删除前应清空库存!')
- return
- }
- } else if (this.warehouseType == 1) {
- if (
- Number(
- this.warehouseList[num].warehouseNumViewList[num_item].storage
- ) > 0
- ) {
- this.$message.error('删除前应清空库存!')
- return
- }
- }
- }
- }
- this.$confirm(`确认删除` + this.warehouseInfo.warehouseName + `?`, {
- cancelButtonText: '取消',
- confirmButtonText: '确定',
- type: 'warning'
- })
- .then(() => {
- deletewarehouse({ id: this.warehouseInfo.warehouseId })
- .toPromise()
- .then(response => {
- this.$notify.success({
- title: '成功',
- message: '删除成功'
- })
- this.getList1()
- })
- .catch(response => {
- // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
- })
- })
- .catch(() => {
- return false
- })
- },
- //记录
- record() {
- this.$router.push({
- path: 'warehouseNewManagementRecord',
- query: {
- baseId: this.warehouseInfo.warehouseId,
- positionId: this.warehouseInfo.binNumberId,
- warehouseName: this.warehouseInfo.warehouseName,
- remark: this.warehouseInfo.remark,
- binNumber: this.warehouseInfo.binNumber,
- capacity: this.warehouseInfo.capacity,
- warehouseType: this.warehouseType
- }
- })
- },
- //盘损
- loss() {
- this.$router.push({
- path: 'warehouseNewManagementIoss',
- query: {
- baseId: this.warehouseInfo.warehouseId,
- positionId: this.warehouseInfo.binNumberId,
- warehouseName: this.warehouseInfo.warehouseName,
- binNumber: this.warehouseInfo.binNumber
- }
- })
- },
- //清仓
- clearance() {
- if (this.warehouseInfo.outNumber > 0) {
- this.$confirm(`你还有未完善的出库记录,请完善提交后再进行操作`, {
- cancelButtonText: '关闭'
- })
- .then(() => {})
- .catch(() => {
- return false
- })
- } else {
- this.$confirm(
- `清库操作代表库存已清零,清库后不可进行出库操作,是否确定清库`,
- {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }
- )
- .then(() => {
- clearancee({
- id: this.warehouseInfo.warehouseId
- })
- .toPromise()
- .then(response => {
- this.$notify.success({
- title: '成功',
- message: '状态清库成功'
- })
- this.getList1()
- })
- .catch(response => {})
- })
- .catch(() => {
- return false
- })
- }
- },
- //任务
- handlTask() {
- var arr = []
- for (let i = 0; i < this.list.length; i++) {
- arr.push(this.list[i].warehouseName)
- }
- this.$router.push({
- path: 'tranManagementWarehouseInOutTask',
- query: {
- // stringList: arr,
- // warehouseBaseInfoList: JSON.stringify(this.list)
- }
- })
- },
- getSummaries(param) {
- const { columns, data } = param
- const sums = []
- columns.forEach((column, index) => {
- if (index === 0) {
- sums[index] = '合计'
- } else if (index === 4 || index === 5 || index === 6) {
- const values = data.map(item => {
- var val = item.warehouseNumViewList.map(items => {
- if (column.label == '入库量(吨)') {
- return items.inNetWeight
- } else if (column.label == '出库量(吨)') {
- return items.outNetWeight
- } else if (column.label == '应余量(吨)') {
- return items.storage
- } else if (column.label == '应余量(吨)') {
- return items.storage
- }
- })
- return val
- })
- if (!values.every(value => isNaN(value))) {
- sums[index] = values.reduce((prev, curr) => {
- if (curr.length > 1) {
- var num = 0
- for (let i = 0; i < curr.length; i++) {
- num += Number(curr[i])
- }
- return Number(prev) + num
- } else {
- const value = Number(curr)
- if (!isNaN(value)) {
- return Number(prev) + Number(curr)
- } else {
- return Number(prev)
- }
- }
- }, 0)
- } else {
- sums[index] = '--'
- }
- } else {
- sums[index] = '--'
- }
- })
- if (typeof sums[4] == 'number') {
- sums[4] = sums[4].toFixed(3)
- }
- if (typeof sums[5] == 'number') {
- sums[5] = sums[5].toFixed(3)
- }
- if (typeof sums[6] == 'number') {
- sums[6] = sums[6].toFixed(3)
- }
- return sums
- },
- // 折转
- transformation() {
- this.$router.push({
- path: 'transformation',
- query: {
- warehouseId: this.warehouseInfo.warehouseId,
- warehouseName: this.warehouseInfo.warehouseName,
- binNumberId: this.warehouseInfo.binNumberId,
- warehouseType: this.warehouseType
- } //warehouseType 1常用 2临时
- })
- },
- getList() {
- getreserves({ compId: localStorage.getItem('ws-pf_compId') })
- .toPromise()
- .then(response => {
- var obj = { 类型: '库内储量' },
- obj1 = { 类型: '移库在途' },
- obj2 = { 类型: '采购在途' },
- obj3 = { 类型: '销售在途' },
- obj4 = { 类型: '合计' },
- obj5 = { 类型: '货值' }
- var arr = response.map(item => {
- obj[item.goodsName] = item.stockNum
- obj1[item.goodsName] = item.moveNum
- obj2[item.goodsName] = item.purchaseNum
- obj3[item.goodsName] = item.saleNum
- return item.goodsName
- })
- arr.unshift('类型')
- for (const i in obj) {
- if (i != '类型') {
- var num = obj[i] + obj1[i] + obj2[i] + obj3[i]
- obj4[i] = num.toFixed(3)
- }
- }
- this.tableData.push(obj)
- this.tableData.push(obj1)
- this.tableData.push(obj2)
- this.tableData.push(obj3)
- this.tableData.push(obj4)
- this.tableHeader = arr
- })
- this.dateTime = this.getCurrentDate(1)
- // 仓储部负责人
- getResponsible({
- compId: localStorage.getItem('ws-pf_compId')
- })
- .toPromise()
- .then(response => {
- this.responsible = response[0].staffName
- })
- // 仓库名称
- getwarehousNameNew({
- compId: localStorage.getItem('ws-pf_compId')
- })
- .toPromise()
- .then(response => {
- this.warehouseXiaLa = response
- this.warehouseXiaLaCopy = response
- this.warehouseInfo.warehouseName = this.warehouseXiaLa[0].warehouseName
- this.monitorUrl1 = this.warehouseXiaLa[0].monitorUrl1
- this.monitorUrl2 = this.warehouseXiaLa[0].monitorUrl2
- for (var tmp = 0; tmp < response.length; tmp++) {
- if (response[tmp].warehouseType == '2') {
- response[tmp].warehouseName =
- response[tmp].warehouseName + ' (临)'
- }
- }
- this.warehouseAllXiaLa = response
- this.getList1()
- })
- getsponsible({
- compId: localStorage.getItem('ws-pf_compId')
- })
- .toPromise()
- .then(response => {
- this.list = response
- })
- packList({
- constId: 'CON2'
- })
- .toPromise()
- .then(response => {
- this.goodnameList = response
- })
- },
- changeWeight(e) {
- //实际重量
- if (e == '0') {
- if (this.warehouseType == '1') {
- getQualityReal({
- compId: localStorage.getItem('ws-pf_compId'),
- warehouseName: this.warehouseInfo.warehouseName
- })
- .toPromise()
- .then(response => {
- this.totalReserves = response.warehouseNumViewList
- this.initCharts()
- })
- } else {
- this.getList1()
- }
- } else {
- getQualityZhe({
- compId: localStorage.getItem('ws-pf_compId'),
- baseId: this.warehouseInfo.warehouseId
- })
- .toPromise()
- .then(response => {
- console.log(this.totalReserves)
- this.totalMoney1 = 0
- this.totalMoney2 = 0
- if (this.warehouseType == '1') {
- for (let j = 0; j < this.totalReserves.length; j++) {
- if (
- this.totalReserves[j].cost &&
- this.totalReserves[j].stockNum
- ) {
- if (this.totalReserves[j].goodsName.indexOf('玉米') != -1) {
- this.totalReserves[j].totalMoney1 = (
- Number(this.totalReserves[j].cost) *
- Number(this.totalReserves[j].stockNum)
- ).toFixed(3)
- this.totalMoney1 = (
- Number(this.totalMoney1) +
- Number(this.totalReserves[j].totalMoney1)
- ).toFixed(3)
- } else if (
- this.totalReserves[j].goodsName.indexOf('高粱') != -1
- ) {
- this.totalReserves[j].totalMoney2 = (
- Number(this.totalReserves[j].cost) *
- Number(this.totalReserves[j].stockNum)
- ).toFixed(3)
- this.totalMoney2 = (
- Number(this.totalMoney2) +
- Number(this.totalReserves[j].totalMoney2)
- ).toFixed(3)
- }
- }
- }
- console.log(this.totalReserves)
- if (response.warehouseNumViewList.length != 0) {
- var result = []
- for (let i = 0; i < response.warehouseNumViewList.length; i++) {
- let param = {}
- for (let num = 0; num < this.totalReserves.length; num++) {
- if (
- response.warehouseNumViewList[i].goodsName ==
- this.totalReserves[num].goodsName &&
- response.warehouseNumViewList[i].goodsName != '玉米' &&
- response.warehouseNumViewList[i].goodsName != '高粱'
- ) {
- param.cost = this.totalReserves[num].cost
- }
- }
- if (response.warehouseNumViewList[i].pureWeight) {
- param.goodsName = response.warehouseNumViewList[i].goodsName
- param.stockNum = Number(
- response.warehouseNumViewList[i].pureWeight
- ).toFixed(3)
- if (param.goodsName == '玉米') {
- param.conversionCost = (
- Number(this.totalMoney1) / Number(param.stockNum)
- ).toFixed(3)
- } else if (param.goodsName == '高粱') {
- param.conversionCost = (
- Number(this.totalMoney2) / Number(param.stockNum)
- ).toFixed(3)
- }
- result.push(param)
- }
- }
- console.log(result)
- this.totalReserves = result
- this.initCharts()
- } else {
- // this.$message.error('当前仓库无潮粮库存,无需折算!')
- // this.value = '0'
- // return
- }
- } else {
- //临时库
- if (response.warehouseNumViewList.length != 0) {
- var result1 = []
- for (let i = 0; i < response.warehouseNumViewList.length; i++) {
- let param = {}
- if (response.warehouseNumViewList[i].pureWeight) {
- param.goodsName = response.warehouseNumViewList[i].goodsName
- param.surplus = Number(
- response.warehouseNumViewList[i].pureWeight
- ).toFixed(3)
- result1.push(param)
- }
- }
- this.totalReserves = result1
- this.initCharts()
- }
- }
- })
- }
- },
- getList1() {
- getList({
- compId: localStorage.getItem('ws-pf_compId'),
- warehouseName: this.warehouseInfo.warehouseName,
- warehouseType: this.warehouseType
- })
- .toPromise()
- .then(response => {
- for (let q = 0; q < response.warehouseViewList.length; q++) {
- if (response.warehouseViewList[q].warehouseNumViewList.length > 0) {
- for (
- let i = 0;
- i < response.warehouseViewList[q].warehouseNumViewList.length;
- i++
- ) {
- if (
- response.warehouseViewList[q].warehouseNumViewList[i]
- .inNetWeight
- ) {
- response.warehouseViewList[q].warehouseNumViewList[
- i
- ].inNetWeight = Number(
- response.warehouseViewList[q].warehouseNumViewList[i]
- .inNetWeight
- ).toFixed(3)
- }
- if (
- response.warehouseViewList[q].warehouseNumViewList[i]
- .outNetWeight
- ) {
- response.warehouseViewList[q].warehouseNumViewList[
- i
- ].outNetWeight = Number(
- response.warehouseViewList[q].warehouseNumViewList[i]
- .outNetWeight
- ).toFixed(3)
- }
- if (
- response.warehouseViewList[q].warehouseNumViewList[i].storage
- ) {
- response.warehouseViewList[q].warehouseNumViewList[
- i
- ].storage = Number(
- response.warehouseViewList[q].warehouseNumViewList[i]
- .storage
- ).toFixed(3)
- }
- if (
- response.warehouseViewList[q].warehouseNumViewList[i]
- .inNetWeight &&
- response.warehouseViewList[q].warehouseNumViewList[i]
- .outNetWeight
- ) {
- response.warehouseViewList[q].warehouseNumViewList[
- i
- ].surplus = (
- response.warehouseViewList[q].warehouseNumViewList[i]
- .inNetWeight -
- response.warehouseViewList[q].warehouseNumViewList[i]
- .outNetWeight
- ).toFixed(3)
- } else if (
- response.warehouseViewList[q].warehouseNumViewList[i]
- .inNetWeight
- ) {
- response.warehouseViewList[q].warehouseNumViewList[
- i
- ].surplus =
- response.warehouseViewList[q].warehouseNumViewList[
- i
- ].inNetWeight
- }
- }
- }
- }
- if (this.warehouseType == '1') {
- this.totalReserves = response.warehouseNumViewList
- } else {
- this.totalReserves =
- response.warehouseViewList[0].warehouseNumViewList
- }
- // this.totalMoney = Number(this.totalReserves[0].stockNum * this.totalReserves[0].cost).toFixed(3)
- this.value = '0'
- this.initCharts()
- this.warehouseList = response.warehouseViewList
- if (this.warehouseList.length > 0) {
- this.warehouseInfo = this.warehouseList[0]
- this.warehouseInfo.warehouseLocation =
- this.warehouseList[0].warehousePrivate +
- this.warehouseList[0].warehouseCity +
- this.warehouseList[0].warehouseArea
- // this.warehouseInfo.maxReserves = 0
- //经纬度
- this.warehousePositioning.lat = this.warehouseInfo.warehousePositioning.split(
- ','
- )[1]
- this.warehousePositioning.lng = this.warehouseInfo.warehousePositioning.split(
- ','
- )[0]
- for (let j = 0; j < this.warehouseXiaLa.length; j++) {
- if (
- this.warehouseInfo.warehouseName ==
- this.warehouseXiaLa[j].warehouseName
- ) {
- this.warehouseInfo.maxReserves = this.warehouseXiaLa[
- j
- ].totalStorage
- }
- }
- }
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .container {
- background: #e8ecf6;
- }
- .top_form {
- background: #ffffff;
- /deep/.el-table .el-table__body .cell,
- /deep/.el-table .cell {
- text-align: center;
- }
- }
- .title {
- position: relative;
- background: #f6f7fc;
- height: 60px;
- line-height: 60px;
- }
- .title::before {
- content: '';
- display: inline-block;
- width: 5px;
- height: 30px;
- background: #5473e8;
- position: absolute;
- left: 0;
- top: 12px;
- }
- .position {
- border-radius: 4px;
- background: #ffffff;
- margin: 20px 10px;
- padding-bottom: 10px;
- height: 550px;
- /deep/.el-table .el-table__body .cell,
- /deep/.el-table .cell {
- text-align: center;
- }
- /deep/.setUp_css .cell {
- display: contents !important;
- }
- .title {
- position: relative;
- background: #f6f7fc;
- height: 60px;
- line-height: 60px;
- margin-bottom: 14px;
- }
- .title::before {
- content: '';
- display: inline-block;
- width: 5px;
- height: 30px;
- background: #5473e8;
- position: absolute;
- left: 0;
- top: 12px;
- }
- .cangInfo {
- font-size: 18px;
- font-weight: 600;
- margin-left: 14px;
- line-height: 30px;
- }
- .el-input {
- width: 95%;
- }
- .el-select {
- width: 95%;
- }
- }
- .right {
- .title {
- position: relative;
- background: #f6f7fc;
- height: 60px;
- line-height: 60px;
- margin-bottom: 14px;
- }
- .title::before {
- content: '';
- display: inline-block;
- width: 5px;
- height: 30px;
- background: #5473e8;
- position: absolute;
- left: 0;
- top: 12px;
- }
- .cangInfo {
- font-size: 18px;
- font-weight: 600;
- margin-left: 14px;
- line-height: 30px;
- }
- }
- .reservesInfo {
- display: inline-flex;
- .reservesInfo_item {
- width: 140px;
- background: #f5f7fa;
- // height: 54px;
- text-align: center;
- line-height: 25px;
- margin: 0 10px;
- border-radius: 4px;
- padding: 10px 0;
- .reservesInfo_GoodsName {
- font-size: 12px;
- color: #8890b1;
- }
- .reservesInfo_Amount {
- color: #323233;
- font-size: 14px;
- font-weight: 600;
- }
- }
- }
- .weight {
- display: inline-flex;
- margin-left: 11px;
- }
- .color {
- display: inline-flex;
- width: 100%;
- height: 40px;
- line-height: 40px;
- justify-content: flex-end;
- .color_for {
- margin: 0 10px;
- display: flex;
- }
- .color_for .color_goodsName {
- margin-left: 10px;
- margin-top: -13px;
- }
- .color_item {
- width: 15px;
- height: 15px;
- }
- }
- .column {
- margin: 10px;
- }
- .map {
- background: #ffffff;
- width: 99%;
- margin: 100px auto 50px;
- height: 560px;
- border-radius: 4px;
- .map_switch {
- display: flex;
- border-bottom: 1px solid #d8dce6;
- .btn,
- .btn1 {
- padding: 7px 20px;
- border-radius: 4px;
- margin: 10px 0 10px 10px;
- font-size: 14px;
- cursor: pointer;
- }
- .btn1 {
- background: #f0f6ff;
- color: #5878e8;
- }
- }
- .map-item {
- width: 96%;
- margin: auto;
- }
- .monitor {
- margin-top: 30px;
- display: flex;
- .video1 {
- width: 440px;
- height: 360px;
- text-align: center;
- .img1 {
- width: 440px;
- height: 235px;
- padding: 20px;
- }
- }
- }
- }
- //打印弹窗
- .mask {
- background: black;
- width: 100vw;
- height: 100vh;
- position: fixed;
- top: 0;
- z-index: 99;
- opacity: 0.3;
- }
- .count {
- text-align: center;
- margin-bottom: 10px;
- }
- .print-type {
- position: absolute;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- margin: auto;
- width: 340px;
- height: 456px;
- background: white;
- border-radius: 10px;
- z-index: 999;
- .bottom-btn {
- text-align: center;
- }
- }
- .print-type-title {
- text-align: center;
- font-size: 18px;
- // margin: 20px;
- margin: 20px 20px 10px;
- }
- .print-type-checkbox {
- padding-left: 20px;
- .el-date-editor.el-input {
- width: 85% !important;
- }
- .proportion_css {
- width: 85%;
- }
- }
- /deep/.el-table td,
- /deep/.el-table th {
- text-align: center;
- }
- </style>
|