1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555 |
- <!--仓库管理-->
- <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>
- </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 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 {
- getList,
- getsponsible,
- clearancee,
- xiala,
- getQualityZhe,
- getQualityReal,
- exportHistoricalInventory,
- postExport,
- addselectinfoList,
- printAdd,
- postExportOut,
- getreserves,
- getResponsible,
- deletewarehouse,
- postInWeight,
- getwarehousNameNew,
- getbintype
- } 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',
- 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:''
- }
- },
- 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
- })
- }
-
- }
-
- },
- //导出、打印EndDate
- outData(index) {
- if (index == 1) {
- this.headerText = '导出记录'
- } else if (index == 2) {
- this.headerText = '打印记录'
- let date = new Date()
- var year = date.getFullYear();
- var month = date.getMonth() + 1;
- var strDate = date.getDate()
- if(strDate<10){
- strDate = '0'+strDate
- }
- var pastdate = new Date(date.getTime() - 24 * 60 * 60 * 1000)
- 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) {
- 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) {
- 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,
- searchType: this.parameter.radio,
- currentPage: 1,
- pageSize: 999,
- statusFlag:3
- }).toPromise()
- .then((response) => {
- if (response.records.length == 0) {
- this.$message.error('暂未查到所要打印的出入库信息')
- } 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
- })
- },
- changeWeight(e) {
- //实际重量
- if(e == '0'){
- getQualityReal({
- compId: localStorage.getItem('ws-pf_compId'),
- warehouseName: this.warehouseInfo.warehouseName
- })
- .toPromise()
- .then((response) => {
- this.totalReserves = response.warehouseNumViewList
- this.initCharts()
- })
- }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
- 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
- }
- })
- }
- },
- 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: 500px;
- /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: 120px;
- 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: 400px;
- 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>
|