12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115 |
- <template>
- <div style="height:100%;">
- <div class="searchForm-header"> <!-- 查询、操作按钮框 -->
- <el-form :model="query" label-width="100px" inline="">
- <el-row>
- <el-form-item label="库房名称"> <!-- 库房查询条件 -->
- <el-select v-model="query.wareName" clearable size="small" style="width:150px">
- <el-option v-for="item in optionsWare" :key="item.id" :label="item.name" :value="item.name">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="垛位名称"> <!-- 垛位查询条件 -->
- <el-input v-model="query.stackName" size="small" style="width:150px"></el-input>
- </el-form-item>
- <el-form-item label="品名"> <!-- 品名查询条件 -->
- <el-input v-model="query.materialName" size="small" style="width:150px">
- </el-input>
- </el-form-item>
- <el-form-item label="钢种"> <!-- 钢种查询条件 -->
- <el-input v-model="query.standard" size="small" style="width:150px">
- </el-input>
- </el-form-item>
- <el-form-item label="规格型号"> <!-- 规格型号查询条件 -->
- <el-input v-model="query.model" clearable size="small" style="width:120px">
- </el-input>
- </el-form-item>
- <el-form-item label="捆包号"> <!-- 捆包号查询条件 -->
- <el-input v-model="query.packNo" clearable size="small" style="width:120px" @input="getPackList">
- </el-input>
- </el-form-item>
- <el-form-item label="材料号"> <!-- 材料号查询条件 -->
- <el-input v-model="query.plateNo" clearable size="small" style="width:120px" @input="getPltList">
- </el-input>
- </el-form-item>
- <el-form-item label="订单号"> <!-- 订单号查询条件 -->
- <el-input v-model="query.ordNo" clearable size="small" style="width:120px" @input="getOrdList">
- </el-input>
- </el-form-item>
- <el-form-item label="合约号"> <!-- 合约号查询条件 -->
- <el-input v-model="query.contractNo" clearable size="small" style="width:120px" @input="getContractList">
- </el-input>
- </el-form-item>
- <el-form-item label="货权单位"> <!-- 货权单位查询条件 -->
- <el-select v-model="query.fkcustmerName" filterable placeholder="请选择货权单位" clearable size="small" style="width: 170px">
- <el-option v-for="item in optionsCust" :key="item.name" :label="item.name" :value="item.name" >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="客户名称"> <!-- 客户名称查询条件 -->
- <el-select v-model="query.customerName" filterable placeholder="请选择订单客户" clearable size="small" style="width: 170px">
- <el-option v-for="item in optionsCust" :key="item.name" :label="item.name" :value="item.name" >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="是否已出库"> <!-- 在库状态查询条件 -->
- <el-select v-model="query.outFlag" filterable placeholder="请选择在库状态" clearable size="small" style="width: 170px">
- <el-option v-for="item in optionsOutFlag" :key="item.value" :label="item.label" :value="item.value" >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="入库时间"> <!-- 入库时间查询条件 -->
- <el-date-picker size="small" v-model="query.inRecordDate" style="width:330px" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
- </el-date-picker>
- </el-form-item>
-
- <el-form-item label=""> <!-- 常规使用的操作按钮 -->
- <el-button @click="handleSearch" size="small" type="primary">查询</el-button>
- <el-button @click="showChangeCustomer" size="small" type="primary">货权转移</el-button>
- <el-button @click="showDistribution" size="small" type="primary">配货</el-button>
- <el-button @click="showOut" size="small" type="primary">出库</el-button>
- <el-button @click="resetButton" size="small" type="primary">重置</el-button>
- <el-button @click="handleExport" size="small" type="success">导出记录</el-button>
- </el-form-item>
-
- <el-form-item label=""> <!-- 防止异常操作隐藏起来的的操作按钮1 -->
- <el-dropdown placement="bottom" trigger="click" @command="batchOperate">
- <el-button type="danger" size="small"> 其他操作<i class="el-icon-arrow-down el-icon--right"></i></el-button>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item command="handleInBack" style="background-color: #f5f5f5;">取消入库</el-dropdown-item>
- <el-dropdown-item command="handleChangeCustomer" style="background-color: #f5f5f5;">批量修改</el-dropdown-item>
- <el-dropdown-item command="handleChangeStack" style="background-color: #f5f5f5;">批量倒垛</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </el-form-item>
-
- <el-form-item label=""> <!-- 防止异常操作隐藏起来的的操作按钮2 -->
- <el-dropdown placement="bottom" trigger="click" @command="batchOperate">
- <el-button type="danger" size="small"> 封锁出仓<i class="el-icon-arrow-down el-icon--right"></i></el-button>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item command="handleLock" style="background-color: #f5f5f5;">封锁</el-dropdown-item>
- <el-dropdown-item command="handleUnLock" style="background-color: #f5f5f5;">取消封锁</el-dropdown-item>
- <el-dropdown-item command="handleOutbound" style="background-color: #f5f5f5;">入仓</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
-
- </el-form-item>
- </el-row>
- </el-form>
- <!-- 数据统计用的框 -->
- <total-block ref="totalBlock" style="margin-left: -25px;font-size: 13px;margin-left: 5px" v-bind:childParam="childParam" v-bind:childUrl = 'childUrl'></total-block>
- </div>
-
- <div class="tabledata-grid"> <!-- 数据展示框(包含翻页功能) -->
- <el-table :data="tableData" height="100%" border style="width: 97%;" v-loading="loading" ref="multipleTable" @select="handleTableSelect" @select-all = "selectAll"
- :row-class-name="tableRowClassName">
- <el-table-column type="selection" width="40" header-align="center" align="center" fixed></el-table-column>
- <el-table-column label="操作">
- <template slot-scope="scope">
- <el-button size="mini" @click="handleEdit(scope.row)">编辑</el-button>
- </template>
- </el-table-column>
- <el-table-column prop="stack.name" label="垛位" width="100" show-overflow-tooltip header-align="center" align="center">
- </el-table-column>
- <el-table-column prop="layer" label="层数" width="60" show-overflow-tooltip header-align="center" align="center">
- </el-table-column>
- <el-table-column prop="material.name" label="品名" width="120" show-overflow-tooltip header-align="center" align="center">
- </el-table-column>
- <el-table-column prop="material.standard" label="钢种" width="120" show-overflow-tooltip header-align="center" align="center">
- </el-table-column>
- <el-table-column prop="plateNo" label="产品编号" width="150" show-overflow-tooltip header-align="center">
- </el-table-column>
- <el-table-column prop="ordNo" label="订单号" width="120" show-overflow-tooltip header-align="center">
- </el-table-column>
- <el-table-column prop="model" label="规格型号" width="160" show-overflow-tooltip header-align="center" align="center">
- </el-table-column>
- <el-table-column prop="weight" label="重量" width="80" show-overflow-tooltip align="left" header-align="center">
- </el-table-column>
- <el-table-column prop="count" label="数量" width="60" show-overflow-tooltip align="left" header-align="center">
- </el-table-column>
- <el-table-column prop="contractNo" label="合约号" width="100" show-overflow-tooltip align="left" header-align="center">
- </el-table-column>
- <el-table-column prop="fkCustomerName" label="货权单位" width="240" show-overflow-tooltip header-align="center">
- </el-table-column>
- <el-table-column prop="customer.name" label="客户名称" width="240" show-overflow-tooltip header-align="center">
- </el-table-column>
- <el-table-column prop="receiveAddress" label="收货地址" width="300" show-overflow-tooltip header-align="center">
- </el-table-column>
- <el-table-column prop="ware.name" label="仓库名称" width="100" show-overflow-tooltip header-align="center" align="center">
- </el-table-column>
- <el-table-column prop="carNo" label="入库车号" width="120" show-overflow-tooltip align="left">
- </el-table-column>
- <el-table-column prop="addTime" label="入库时间" width="180" show-overflow-tooltip align="left">
- </el-table-column>
- <el-table-column prop="productionPlace" label="产地" width="160" show-overflow-tooltip header-align="center">
- </el-table-column>
- <el-table-column prop="packNo" label="捆包号" width="140" show-overflow-tooltip header-align="center">
- </el-table-column>
- <el-table-column prop="remark" label="备注" width="150" show-overflow-tooltip header-align="center">
- </el-table-column>
- <el-table-column prop="lockFlag" label="锁定状态" width="100" show-overflow-tooltip header-align="center" :formatter="lockFormatter">
- </el-table-column>
- <el-table-column prop="addUser.userDesc" label="入库操作人" width="120px" show-overflow-tooltip align="left">
- </el-table-column>
- <el-table-column prop="tallyPeople" label="吊装工" width="100" show-overflow-tooltip header-align="center">
- </el-table-column>
- <el-table-column prop="wgtDcnMtcCd" label="计量方式" width="100" show-overflow-tooltip header-align="center">
- </el-table-column>
- <el-table-column prop="payWay" label="月付方式" width="100" show-overflow-tooltip header-align="center">
- </el-table-column>
- <el-table-column prop="outBound" label="是否出仓" width="100" show-overflow-tooltip header-align="center">
- </el-table-column>
- <el-table-column prop="inwareDay" label="存储天数" width="100" show-overflow-tooltip header-align="center">
- </el-table-column>
- </el-table>
- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
- :page-sizes="pageSizes" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="totalRows">
- </el-pagination>
- </div>
-
- <el-dialog title="货权转移" :visible.sync="customerDialogVisible" width="500px">
- <el-form>
- <el-form-item label="新客户">
- <el-select v-model="newCustomer.name" filterable placeholder="请选择客户名称" clearable>
- <el-option v-for="item in optionsCust" :key="item.id" :label="item.name" :value="item.id" >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="新货主">
- <el-select v-model="newfkCustomer.name" filterable placeholder="请选择货权单位" clearable>
- <el-option v-for="item in optionsCust" :key="item.id" :label="item.name" :value="item.id" >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="修改地址">
- <el-input v-model="newAddress">
- </el-input>
- </el-form-item>
- <el-form-item label=" ">
- <el-button type="success" @click="handleCustomerSave">保存</el-button>
- <el-button type="danger" @click="handleCustomerCancelSave">取消</el-button>
- </el-form-item>
- </el-form>
- </el-dialog>
-
- <el-dialog title="批量垛位" :visible.sync="stackDialogVisible" width="500px">
- <el-form>
- <el-form-item label="库房名称" style="margin-left: -15px">
- <el-select v-model="newWare" clearable size="small" style="width:120px;margin-left: -8px">
- <el-option v-for="item in optionsWare" :key="item.id" :label="item.name" :value="item.name">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="新垛位">
- <el-input v-model="newStack">
- </el-input>
- </el-form-item>
- <el-form-item label=" ">
- <el-button type="success" @click="handleStackSave">保存</el-button>
- <el-button type="danger" @click="handleStackCancelSave">取消</el-button>
- </el-form-item>
- </el-form>
- </el-dialog>
-
- <el-dialog title="批量修改信息明细" :visible.sync="changeCUSTDialogVisible" width="500px">
- <el-form>
- <el-form-item label="新客户名称" >
- <el-select v-model="newCustomername" filterable placeholder="请选择客户名称" clearable size="small" >
- <el-option v-for="item in optionsCust" :key="item.name" :label="item.name" :value="item.name" >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="新货权单位" >
- <el-select v-model="newFKCustomername" filterable placeholder="请选择货权单位" clearable size="small" >
- <el-option v-for="item in optionsCust" :key="item.name" :label="item.name" :value="item.name" >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="新订单号">
- <el-input v-model="newOrdno" style="width:200px;margin-left: 0px">
- </el-input>
- </el-form-item>
- <el-form-item label="新合约号">
- <el-input v-model="newContractno" style="width:200px;margin-left: 0px">
- </el-input>
- </el-form-item>
- <el-form-item label="新收货地址">
- <el-input v-model="newReceiveaddress" style="width:260px;margin-left: 0px">
- </el-input>
- </el-form-item>
- <el-form-item label="新产地">
- <el-input v-model="newProductionplace" style="width:260px;margin-left: 0px">
- </el-input>
- </el-form-item>
- <el-form-item label="新捆包号">
- <el-input v-model="newPackno" style="width:200px;margin-left: 0px">
- </el-input>
- </el-form-item>
-
- <el-form-item label=" ">
- <el-button type="success" @click="handleChangeCUSTSave">确定</el-button>
- <el-button type="danger" @click="handleChangeCUSTCancelSave">取消</el-button>
- </el-form-item>
- </el-form>
- </el-dialog>
-
- <el-dialog title="修改材料信息" :visible.sync="storedialogVisible" width="900px">
- <el-form :model="store" label-position="right" label-width="80px">
- <el-row>
- <el-col :span="9">
- <el-form-item label="材料编号">
- <el-input v-model.number="store.plateNo"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="9">
- <el-form-item label="规格型号">
- <el-input v-model.number="store.model"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="9">
- <el-form-item label="品名">
- <el-input v-model.number="store.material.name"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="9">
- <el-form-item label="钢种">
- <el-input v-model.number="store.material.standard"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="9">
- <el-form-item label="数量">
- <el-input v-model.number="store.count"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="9">
- <el-form-item label="重量">
- <el-input v-model.number="store.weight"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="9">
- <el-form-item label="订单号">
- <el-input v-model.number="store.ordNo"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="9">
- <el-form-item label="合约号">
- <el-input v-model.number="store.contractNo"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="9">
- <el-form-item label="捆包号">
- <el-input v-model.number="store.packNo"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="9">
- <el-form-item label="产地">
- <el-input v-model.number="store.productionPlace"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <!-- 第六行 -->
- <el-row>
- <el-col :span="9">
- <el-form-item label="货权单位">
- <el-select v-model="store.fkCustomerName" filterable placeholder="请选择客户名称" clearable >
- <el-option v-for="item in optionsCust" :key="item.id" :label="item.name" :value="item.name" >
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="9">
- <el-form-item label="客户名称">
- <el-select v-model="store.customer.name" filterable placeholder="请选择客户名称" clearable >
- <el-option v-for="item in optionsCust" :key="item.id" :label="item.name" :value="item.name" >
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="18">
- <el-form-item label="收货地址">
- <el-input v-model="store.receiveAddress"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="18">
- <el-form-item label="备注">
- <el-input v-model="store.remark"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-button size="medium" type="success" @click="handleChangeStore(store)">确定</el-button>
- <el-button size="medium" type="danger" @click="handleChangeStoreCancelSave()">取消</el-button>
- </el-row>
- </el-form>
- </el-dialog>
-
- <!-- 调用外部界面的弹窗索引 -->
- <popup-distribution ref="PopupDistribution" @receviceFromChild="receviceFromDistreibution" :selectRows="selectRows"></popup-distribution>
- <popup-out ref="PopupOut" @receviceFromChild="receviceFromOut"></popup-out>
- </div>
- </template>
-
- <script>
- import axios from '@/axios'
- import PopupDistribution from '@/components/PopupDistribution.vue'
- import PopupOut from '@/components/PopupOut.vue'
- import Export2Excel from '../../excel/Export2Excel.js'
- import TotalBlock from '@/components/TotalBlock.vue'
- import {
- mapState
- } from 'vuex'
- export default {
- components : {
- PopupDistribution,
- PopupOut,
- TotalBlock
- },
- computed: {
- ...mapState({
- serverName: state => state.app.serverName,
- })
- },
- data() {
- return {
- query: { //查询条件
- wareName: '',
- stackName: '',
- model: '',
- materialName: '',
- standard: '',
- customerName: '',
- plateNo: [],
- wareId:'',
- ordNo:[],
- contractNo:[],
- packNo:[],
- fkcustmerName:'',
- outFlag:'0',
- inRecordDate:[]
- },
- optionsWare: [], //库房下拉框
- optionsCust: [], //客户名称下拉框
- optionsOutFlag: [{ //物料状态下拉框
- value: '0',
- label: '在库'
- },{
- value: '1',
- label: '已出库'
- }],
- tableData: [], //数据展示区域用到变量
- selectRows: [], //数据展示区域选选中行数数据暂存
- multipleSelection: [],
- currentPage: 1, //数据展示显示页数
- totalRows: 0, //数据合计
- pageSizes: [50, 100, 200,1000],//单页中数据展示的行数下拉框
- pageSize: 1000,//初始单页中数据展示的默认值
- loading: false,//数据展示区中是否正在加载flag
- childParam:{ //数据统计区域用到的查询变量
- wareName: '',
- stackName: '',
- model: '',
- materialName: '',
- standard: '',
- customerName: '',
- plateNo: [],
- wareId:'',
- ordNo:[],
- contractNo:[],
- packNo:[],
- fkcustmerName:'',
- remark1:'',
- outFlag:'0',
- inRecordDate:[]
- },
- childUrl:'WareStore/queryTotal.do',// 数据统计区域调用的后台
-
- customerDialogVisible: false, //“货权转移”的弹框Flag
- stackDialogVisible: false, //“批量垛位”的弹框Flag
- changeCUSTDialogVisible: false, //“批量修改信息”的弹框Flag
- storedialogVisible: false, //“单只材料修改”的弹框Flag
-
- newCustomer: {//“货权转移”的弹框中“新客户”
- id: '',
- name: ''
- },
- newfkCustomer: {//“货权转移”的弹框中“新货主”
- id: '',
- name: ''
- },
- newAddress: '',//“货权转移”的弹框中“新地址”
-
- newWare:'', //“批量修改垛位”弹窗中“新库房”
- newStack:'',//“批量修改垛位”弹窗中“新垛位”
-
- store:{ //“单只材料信息修改”弹窗中对应数据信息
- id: '',
- material: {
- id: '',
- name: '',
- standard: ''
- },
- model: '',
- customer: {
- id: '',
- name: ''
- },
- fkCompony: {
- id: '',
- name: ''
- },
- count: '',
- weight: '',
- remark: '',
- plateNo: '',
- receiveAddress: '',
- receiveAddressFir: '',
- receiveAddressLast: '',
- wgtDcnMtcCd:'',
- edgeTy:'',
- productionPlace:'',
- ordNo:'',
- carNo:'',
- tallyPeople:'',
- fkComponyId:'',
- customerSName:''
- },
-
- newCustomername:'', //“批量修改”弹窗中“新客户名称”
- newFKCustomername:'', //“批量修改”弹窗中“新付款单位”
- newContractno:'', //“批量修改”弹窗中“新合同号”
- newOrdno:'', //“批量修改”弹窗中“新订单号”
- newReceiveaddress:'', //“批量修改”弹窗中“新收货地址”
- newProductionplace:'', //“批量修改”弹窗中“新产地”
- newPackno:'', //“批量修改”弹窗中“新捆包号”
- }
- },
- mounted() {
- this.getWare() //初始化-库房下拉框-数据载入
- this.getAllCustomer() //初始化-客户下拉框-数据载入
- },
- methods: {
- //获取--库房下拉框--数据
- getWare() {
- var url = 'MaintWare/queryByUserId.do'
- var param = {}
- axios.get(url, param).then(response => {
- this.optionsWare = response.data.data
- if (response.data.data.length == 1) {
- this.wareName = response.data.data[0].name
-
- }
- });
- },
- //获取--客户下拉框--数据
- getAllCustomer() {
- var url = 'MaintCustomer/queryByUserId.do'
- var param = {}
- axios.get(url, param).then(response => {
- this.optionsCust = response.data.data
- });
- },
- // “捆包号”查询框进行批量查询时用到的函数
- getPackList(){
- const replaceResult = this.query.packNo.replace(/[;,,;\s\r\n]+/g, ",").split(",");
- this.query.packNo = replaceResult;
- },
- // “材料号”查询框进行批量查询时用到的函数
- getPltList(){
- const replaceResult = this.query.plateNo.replace(/[;,,;\s\r\n]+/g, ",").split(",");
- this.query.plateNo = replaceResult;
- },
- // “订单号”查询框进行批量查询时用到的函数
- getOrdList(){
- const replaceResult = this.query.ordNo.replace(/[;,,;\s\r\n]+/g, ",").split(",");
- this.query.ordNo = replaceResult;
- },
- // “合同号”查询框进行批量查询时用到的函数
- getContractList(){
- const replaceResult = this.query.contractNo.replace(/[;,,;\s\r\n]+/g, ",").split(",");
- this.query.contractNo = replaceResult;
- },
- //下拉按钮中对应按钮调用的独影的函数
- batchOperate(command) {
- switch (command) {
- case "handleInBack":
- this.handleInBack();
- break;
- case "handleChangeCustomer":
- this.handleChangeCustomer();
- break;
- case "handleChangeStack":
- this.handleChangeStack();
- break;
- case "handleLock":
- this.handleLock();
- break;
- case "handleUnLock":
- this.handleUnLock();
- break;
- case "handleOutbound":
- this.handleOutbound();
- break;
- }
- },
- // 数据展示框中调用的函数
- handleTableSelect(selection, row) {
- console.log(JSON.stringify(row))
- this.selectRows = selection
- },
- handleTableSelectionChange(val) {
- this.selectRows = val
- },
- selectAll(selection){
- this.selectRows = selection;
- },
- lockFormatter: function(row, column) {
- switch (row.lockFlag) {
-
- case "0":
- return "";
- break;
- default:
- return "已锁定";
- break;
- }
- },
- tableRowClassName({row}) { //行数据进行变色处理的函数
- if (row.lockFlag === '1') {
- return 'warning-row'
- }
- return ''
- },
-
- // 查询相关的函数
- handleSearch() { //查询按钮调用的函数
- this.currentPage = 1
- this.getTableData()
- },
- handleSizeChange(val) { //数据展示区域中翻页调用的函数
- this.pageSize = val
- this.getTableData()
- },
- handleCurrentChange(val) { //数据展示区域中单页显示条数变更调用的函数
- this.currentPage = val
- this.getTableData()
- },
- getTableData() { //调用后台的通用函数
- //增加判断条件,防止查询历史数据时间过长
- if(this.query.outFlag == '1' && (this.query.inRecordDate == null || this.query.inRecordDate == '')){
- this.$message({
- type: 'error',
- message: '查询历史数据请选择入库时间区间',
- });
- return
- }
- if(this.query.inRecordDate == null){
- this.query.inRecordDate = [false,false];
- }
- this.loading = true
- var url = 'WareStore/queryStore.do'
- var param = {
- page: this.currentPage,
- rows: this.pageSize,
- wareName: this.query.wareName,
- stackName: this.query.stackName,
- model: this.query.model,
- materialName: this.query.materialName,
- standard: this.query.standard,
- customerName: this.query.customerName,
- fkcustmerName: this.query.fkcustmerName,
- plateNo: this.query.plateNo.length == 0 ? '' : this.query.plateNo.join(','),
- ordNo: this.query.ordNo == 0 ? '' : this.query.ordNo.join(','),
- contractNo: this.query.contractNo == 0 ? '' : this.query.contractNo.join(','),
- packNo: this.query.packNo == 0 ? '' : this.query.packNo.join(','),
- remark1: this.query.remark1,
- outFlag: this.query.outFlag,
- fromDate:(!this.query.inRecordDate[0]) ? "1970-01-01 00:00:00" : this.query.inRecordDate[0].Format("yyyy-MM-dd HH:mm:ss"), //date类型
- toDate :(!this.query.inRecordDate[1]) ? new Date().Format("yyyy-MM-dd HH:mm:ss") :this.query.inRecordDate[1].Format("yyyy-MM-dd HH:mm:ss"),
-
- }
- this.childParam = param;
- axios.get(url, param).then(response => {
- if (response.data.code == 0) {
- this.tableData = response.data.data.list
- this.totalRows = response.data.data.total
- this.$refs.totalBlock.getTotalData();
- } else {
- this.$message({
- type: 'error',
- message: '操作失败;' + response.data.msg,
- });
- }
- this.loading = false
- });
- },
-
- //货权转移按钮对应的操作函数
- showChangeCustomer() { //判断数据条件并打开弹窗
- if (this.multipleSelection.length < 1) {
- this.$message({
- type: 'error',
- message: '至少选择一条记录!',
- });
- return
- }
- var customerAddress = this.multipleSelection[0].customer.address
- var boolean = true
- for (var i = 0; i < this.multipleSelection.length; i++) {
- if (this.multipleSelection[i].customer.address == customerAddress) {
-
- } else {
- boolean = boolean && false
- customerAddress = this.multipleSelection[i].customer.address
- }
- }
- if (boolean) {
- this.oldCustomer = this.multipleSelection[0].customer.name
- this.newCustomer.name = "",
- this.newCustomer.id = "",
- this.newfkCustomer.name="",
- this.newfkCustomer.id = "",
- this.customerDialogVisible = true
-
- } else {
- this.$message({
- type: 'error',
- message: '请选择同一客户!',
- });
- }
- },
- handleCustomerSave() { //“货权转移”界面“保存”按钮对应的调用后台的函数
- this.newCustomer.id = this.newCustomer.name;
- this.newfkCustomer.id = this.newfkCustomer.name;
- var url = 'WareChange/changeCustomer.do'
- var param = {
- json: JSON.stringify(this.multipleSelection),
- customer: JSON.stringify(this.newCustomer),
- fkcustomer: JSON.stringify(this.newfkCustomer),
- address: this.newAddress
- }
- axios.post(url, param).then(response => {
- if (response.data.code == 0) {
- this.getTableData()
- this.customerDialogVisible = false
- } else {
- this.$message({
- type: 'error',
- message: '操作失败;' + response.data.msg,
- });
- }
- });
- },
- handleCustomerCancelSave() { //“货权转移”界面“取消”按钮对应的调用后台的函数
- this.customerDialogVisible = false
- },
-
- //配货按钮对应的操作函数
- showDistribution() {
- if (this.selectRows.length < 1) {
- this.$message({
- type: 'warning',
- message: '至少选择一条数据!',
- });
- }
- this.$refs.PopupDistribution.show()
- },
- receviceFromDistreibution() { //弹窗返回的数据调用的函数
- this.handleSearch()
- },
-
- //出库按钮对应的操作函数
- showOut() {
- this.$refs.PopupOut.show()
- },
- receviceFromOut(customer) { //弹窗返回的数据调用的函数
- this.handleSearch()
- },
-
- //重置按钮对应的操作函数
- resetButton(){ //查询条件重置
- this.query.wareName = '',
- this.query.stackName = '',
- this.query.model = '',
- this.query.materialName = '',
- this.query.standard = '',
- this.query.customerName = '',
- this.query.plateNo = '',
- this.query.wareId = '',
- this.query.ordNo = '',
- this.query.fkcustmerName = ''
- },
-
- //导出记录按钮对应操作函数
- handleExport() { //根据查询条件获取到后台返回的数据内容
- var imptData = [];
- var url = 'WareStore/queryStore.do'
- var param = {
- page: -1,
- rows: -1,
- wareName: this.query.wareName,
- stackName: this.query.stackName,
- model: this.query.model,
- materialName: this.query.materialName,
- standard: this.query.standard,
- customerName: this.query.customerName,
- fkcustmerName: this.query.fkcustmerName,
- plateNo: this.query.plateNo.length == 0 ? '' : this.query.plateNo.join(','),
- ordNo: this.query.ordNo == 0 ? '' : this.query.ordNo.join(','),
- contractNo: this.query.contractNo == 0 ? '' : this.query.contractNo.join(','),
- packNo: this.query.packNo == 0 ? '' : this.query.packNo.join(','),
- remark1: this.query.remark1,
- outFlag: this.query.outFlag,
- fromDate:(!this.query.inRecordDate[0]) ? "1970-01-01 00:00:00" : this.query.inRecordDate[0].Format("yyyy-MM-dd HH:mm:ss"), //date类型
- toDate :(!this.query.inRecordDate[1]) ? new Date().Format("yyyy-MM-dd HH:mm:ss") :this.query.inRecordDate[1].Format("yyyy-MM-dd HH:mm:ss"),
- }
- axios.get(url, param).then(response => {
-
- if (response.data.code == 0) {
- console.log(response);
- var imptData = response.data.data;
- if (imptData.length == 0) {
- this.$alert('无法导出,没有库存', '提示', {
- confirmButtonText: '确定',
- callback: action => {}
- });
- } else {
-
- this.exportExcel(imptData)
- }
- } else {
- this.$message({
- type: 'error',
- message: '操作失败;' + response.data.msg,
- });
- }
-
- });
-
- },
- exportExcel(imptData) {//处理数据并生成excel文件的代码
- const header = ["仓库名称",
- "垛位",
- "层数",
- "品名",
- "钢种",
- "产品编号",
- "订单号",
- "规格型号",
- "重量",
- "数量",
- "合约号",
- "入库车号",
- "入库时间",
- "货权单位",
- "客户名称",
- "收货地址",
- "产地",
- "捆包号",
- "备注",
- "锁定状态",
- "入库操作人",
- "吊装工",
- "计量方式",
- "月付方式",
- "是否出仓",
- "存储天数"
-
- ] // 导出的表头名
- const filterVal = ["wareName",
- "stackName",
- "layer",
- "materialName",
- "materialStandard",
- "plateNo",
- "ordNo",
- "model",
- "weight",
- "count",
- "contractNo",
- "carNo",
- "addTime",
- "fkCustomerName",
- "customerName",
- "receiveAddress",
- "productionPlace",
- "packNo",
- "remark",
- "lockFlag",
- "addUserUserDesc",
- "tallyPeople",
- "wgtDcnMtcCd",
- "payWay",
- "outBound",
- "inwareDay"
- ]
- for(var i=0;i<imptData.length;i++){
- imptData[i]["wareName"] = imptData[i].ware.name;
- imptData[i]["stackName"] = imptData[i].stack.name;
- imptData[i]["materialName"] = imptData[i].material.name;
- imptData[i]["materialStandard"] = imptData[i].material.standard;
- imptData[i]["customerName"] = imptData[i].customer.name;
- imptData[i]["addUserUserDesc"] = imptData[i].addUser.userDesc;
- imptData[i]["lockFlag"] = imptData[i].lockFlag == 0 ? '': '已锁定';
- }
- const list = imptData
- const data = this.formatJson(filterVal, list)
-
- const filename = '库存信息' + (new Date()).toLocaleDateString();
- Export2Excel.export_json_to_excel({
- header,
- data,
- filename,
- rowStyle: (rowData, rowIndex) => {
- // 根据库存量设置颜色
- if (rowData.lockFlag === "已锁定") {
- return {
- fill: { fgColor: { rgb: "FF0000" } }, // 红色
- font: { color: { rgb: "FFFFFF" }, bold: true }
- };
- }
- return {};
- }
- })
- },
- formatJson(filterVal, jsonData) {
- return jsonData.map(v => filterVal.map(j => {
- return v[j]
- }))
- },
-
- //取消入库按钮对应的操作函数
- handleInBack() {
- this.$confirm("确认取消入库吗?", "提示", {
- confirmButtonText:'确认',
- cancelButtonText:'取消',
- type: "warning"
- }).then(() => {
- if (this.selectRows.length < 1) {
- this.$message({
- type: 'error',
- message: '至少选择一条数据!',
- });
- return
- } else {
- var url = 'WareIn/back.do'
- var param = {
- json: JSON.stringify(this.selectRows),
- }
- axios.post(url, param).then(response => {
- if (response.data.code == 0) {
- this.getStoreByStackId(response.data.data)
- } else {
- this.$message({
- type: 'error',
- message: '操作失败;' + response.data.msg,
- });
- }
- });
- }
- }).catch(() => {});
-
- },
-
- //”批量修改“操作对应的操作函数
- handleChangeCustomer(){ //打开“批量修改”的弹窗
- this.newCustomername = '',
- this.newFKCustomername='',
- this.newContractno='',
- this.newOrdno='',
- this.newReceiveaddress='',
- this.newProductionplace='',
- this.newPackno='',
- this.changeCUSTDialogVisible= true
- },
- handleChangeCUSTSave(){ //“批量修改”弹窗中“保存”按钮对应的函数
- var url = 'WareStore/changeAll.do'
- var param = {
- json: JSON.stringify(this.multipleSelection),
- newCustomername: this.newCustomername,
- newFKCustomername: this.newFKCustomername,
- newContractno: this.newContractno,
- newOrdno: this.newOrdno,
- newReceiveaddress: this.newReceiveaddress,
- newProductionplace: this.newProductionplace,
- newPackno: this.newPackno,
-
- }
- axios.post(url, param).then(response => {
- if (response.data.code == 0) {
- this.getTableData()
- this.changeCUSTDialogVisible = false
- } else {
- this.$message({
- type: 'error',
- message: '操作失败;' + response.data.msg,
- });
- }
- });
- },
- handleChangeCUSTCancelSave(){//“批量修改”弹窗中“取消”按钮对应的函数
- this.changeCUSTDialogVisible = false
- },
-
- //“批量修改垛位”操作对应的操作函数
- handleChangeStack(){ //打开“批量垛位修改”的弹窗
- this.stackDialogVisible = true;
- this.newStack='';
- },
- handleStackSave(){ //“批量垛位修改”弹窗中“保存”按钮对应的函数
- var url = 'WareStore/changeStack.do'
- var param = {
-
- json: JSON.stringify(this.multipleSelection),
- newWare: this.newWare,
- newStack: this.newStack,
- newRemark1: this.newRemark1,
- newRemark: this.newRemark
- }
- axios.post(url, param).then(response => {
- if (response.data.code == 0) {
- this.getTableData()
- this.stackDialogVisible = false
- } else {
- this.$message({
- type: 'error',
- message: '操作失败;' + response.data.msg,
- });
- }
- });
- },
- handleStackCancelSave(){ //“批量修改垛位”弹窗中“取消”按钮对应的函数
- this.stackDialogVisible = false
- },
-
- handleLock(){ //“封锁”按钮对应的函数
- this.$confirm("确认将选中的材料进行封锁吗?", "提示", {
- confirmButtonText:'确认',
- cancelButtonText:'取消',
- type: "warning"
- }).then(() => {
- if (this.selectRows.length < 1) {
- this.$message({
- type: 'error',
- message: '至少选择一条数据!',
- });
- return
- } else {
- var url = 'WareStore/lockAndUnlock.do'
- var param = {
- json: JSON.stringify(this.selectRows),
- lockFlag:'1'
- }
- axios.post(url, param).then(response => {
- if (response.data.code == 0) {
- this.getTableData()
- } else {
- this.$message({
- type: 'error',
- message: '操作失败;' + response.data.msg,
- });
- }
- });
- }
- }).catch(() => {});
- },
-
- handleUnLock(){//“取消封锁”的按钮对应的函数
- this.$confirm("确认将选中的材料取消封锁吗?", "提示", {
- confirmButtonText:'确认',
- cancelButtonText:'取消',
- type: "warning"
- }).then(() => {
- if (this.selectRows.length < 1) {
- this.$message({
- type: 'error',
- message: '至少选择一条数据!',
- });
- return
- } else {
- var url = 'WareStore/lockAndUnlock.do'
- var param = {
- json: JSON.stringify(this.selectRows),
- lockFlag:'0'
- }
- axios.post(url, param).then(response => {
- if (response.data.code == 0) {
- this.getTableData()
- } else {
- this.$message({
- type: 'error',
- message: '操作失败;' + response.data.msg,
- });
- }
- });
- }
- }).catch(() => {});
- },
-
- handleOutbound(){ //“入仓”按钮对应的函数
- this.$confirm("确认将选中的材料标记为入仓吗?", "提示", {
- confirmButtonText:'确认',
- cancelButtonText:'取消',
- type: "warning"
- }).then(() => {
- if (this.selectRows.length < 1) {
- this.$message({
- type: 'error',
- message: '至少选择一条数据!',
- });
- return
- } else {
- var url = 'WareStore/Outbound.do'
- var param = {
- json: JSON.stringify(this.selectRows),
- outbound: '已入仓'
- }
- axios.post(url, param).then(response => {
- if (response.data.code == 0) {
- this.getTableData()
- } else {
- this.$message({
- type: 'error',
- message: '操作失败;' + response.data.msg,
- });
- }
- });
- }
- }).catch(() => {});
- },
-
- }
- }
- </script>
-
- <style>
- .option_btn { margin-left: 30px }
-
- .searchForm-header {
- height: auto;
- margin-left: 10px;
- }
-
- .tabledata-grid {
- font-size: 20px;
- margin-left: 5px;
- height: calc(100% - 100px);
- }
-
- .el-select-dropdown .el-scrollbar .el-scrollbar__wrap { overflow: scroll!important; }
-
- .el-table .warning-row { background-color: #fde2e2; }
-
- .el-table .success-row { background-color: #f0f9eb; }
- </style>
|