12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118 |
- <template>
- <div style="height:100%;">
- <div class="searchForm-header">
- <el-form :model="query" label-width="100px" inline="">
- <el-row>
- <el-form-item label="库房名称" style="margin-left: -15px">
- <el-select v-model="query.wareName" 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="垛位名称" style="margin-left: -35px">
- <el-input v-model="query.stackName" size="small" style="width:120px;margin-left: -8px"></el-input>
- </el-form-item>
- <el-form-item label="品名" style="margin-left: -35px">
- <el-input v-model="query.materialName" size="small" style="width:120px;margin-left: -8px">
- <el-button slot="append" icon="el-icon-search" @click="showMaterial"></el-button>
- </el-input>
- </el-form-item>
- <el-form-item label="钢种" style="margin-left: -35px">
- <el-input v-model="query.standard" size="small" style="width:150px;margin-left: -8px">
- <el-button slot="append" icon="el-icon-search" @click="showMaterial"></el-button>
- </el-input>
- </el-form-item>
- <el-form-item label="规格型号" style="margin-left: -15px">
- <el-input v-model="query.model" clearable size="small" style="width:120px;margin-left: -8px">
- </el-input>
- </el-form-item>
- <el-form-item label="捆包号" style="margin-left: -15px">
- <el-input v-model="query.packNo" clearable size="small" style="width:120px;margin-left: -8px" @input="getPackList">
- </el-input>
- </el-form-item>
- <el-form-item label="材料号" style="margin-left: -15px">
- <el-input v-model="query.plateNo" clearable size="small" style="width:120px;margin-left: -8px" @input="getPltList">
- </el-input>
- </el-form-item>
- <el-form-item label="订单号" style="margin-left: -15px">
- <el-input v-model="query.ordNo" clearable size="small" style="width:120px;margin-left: -8px" @input="getOrdList">
- </el-input>
- </el-form-item>
- <el-form-item label="合约号" style="margin-left: -15px">
- <el-input v-model="query.contractNo" clearable size="small" style="width:120px;margin-left: -8px" @input="getContractList">
- </el-input>
- </el-form-item>
- <el-form-item label="货权单位" style="margin-left: -35px">
- <el-select v-model="query.fkcustmerName" filterable placeholder="请选择客户名称" clearable size="small" style="margin-left: 5px; 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="客户名称" style="margin-left: -35px">
- <el-select v-model="query.customerName" filterable placeholder="请选择订单客户" clearable size="small" style="margin-left: 5px; 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="" style="margin-top: 0px;margin-left: 10px">
- <el-button @click="handleSearch" size="small" type="primary">查询</el-button>
- <el-button @click="showChangeCustomer" size="small" type="primary">货权转移</el-button>
- <el-button type="primary" size="small" @click="showDistribution">配货</el-button>
- <el-button type="primary" size="small" @click="showOut">出库</el-button>
-
- <el-button type="primary" size="small" @click="resetButton" >重置</el-button>
- <el-button type="success" size="small" @click="handleExport" >导出记录</el-button>
-
- </el-form-item>
- <el-form-item label="" style="margin-top: 0px;margin-left: 10px">
- <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-row>
-
- </el-form>
- </div>
- <div class="tabledata-grid">
- <el-table :data="tableData" height="100%" border style="width: 97%;" v-loading="loading" ref="multipleTable" @select="handleTableSelect" @selection-change="handleSelectionChange" @select-all = "selectAll"
- :row-class-name="tableRowClassName">
- <el-table-column type="selection" width="40" header-align="center" align="center"></el-table-column>
- <el-table-column prop="ware.name" label="仓库名称" width="120" show-overflow-tooltip header-align="center" align="center">
- </el-table-column>
- <el-table-column prop="stack.name" label="垛位" width="60" 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="100" show-overflow-tooltip header-align="center" align="center">
- </el-table-column>
- <el-table-column prop="material.standard" label="钢种" width="100" show-overflow-tooltip header-align="center" align="center">
- </el-table-column>
- <el-table-column prop="plateNo" label="产品编号" width="200" show-overflow-tooltip header-align="center">
- </el-table-column>
- <el-table-column prop="ordNo" label="订单号" width="200" 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="120" show-overflow-tooltip align="right" header-align="center">
- </el-table-column>
- <el-table-column prop="count" label="数量" width="120" show-overflow-tooltip align="right" header-align="center">
- </el-table-column>
- <el-table-column prop="contractNo" label="合约号" width="120" show-overflow-tooltip align="right" header-align="center">
- </el-table-column>
- <el-table-column prop="carNo" label="入库车号" width="120px" show-overflow-tooltip align="left">
- </el-table-column>
- <el-table-column prop="addTime" label="入库时间" width="200px" show-overflow-tooltip align="left">
- </el-table-column>
- <el-table-column prop="fkCustomerName" label="货权单位" width="300" show-overflow-tooltip header-align="center">
- </el-table-column>
- <el-table-column prop="customer.name" label="客户名称" width="300" 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="productionPlace" label="产地" width="250" show-overflow-tooltip header-align="center">
- </el-table-column>
- <el-table-column prop="packNo" label="捆包号" width="180" 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="200" 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="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>
-
- <popup-material ref="PopupMaterial" @receviceFromChild="receviceFromMaterial"></popup-material>
- <popup-customer ref="PopupCustomer" @receviceFromChild="receviceFromCustomer"></popup-customer>
- <popup-customer ref="PopupFKcustmer" @receviceFromChild="receviceFKcustmerr"></popup-customer>
- <popup-customer ref="PopupNewCustomer" @receviceFromChild="receviceFromNewCustomer"></popup-customer>
- <popup-address ref="PopupAddress" @receviceFromChild="receviceFromAddress"></popup-address>
- <popup-distribution ref="PopupDistribution" @receviceFromChild="receviceFromDistreibution" :selectRows="selectRows"></popup-distribution>
- <popup-out ref="PopupOut" @receviceFromChild="receviceFromOut"></popup-out>
- <popup-in ref="PopupIn" @receviceFromChild="receviceFromIn" :wares="options" :wareId="query.wareId" :stack="moveFromStack"></popup-in>
- <el-dialog title="货权转移" :visible.sync="customerDialogVisible" width="500px">
- <el-form>
- <!-- <el-form-item label="旧货主">
- <el-input v-model="oldCustomer">
- </el-input>
- </el-form-item> -->
- <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-button slot="append" icon="el-icon-search" @click="showAddress"></el-button>
- </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="importDialogVisible" width="1000px">
-
- <el-upload class="upload-demo" action="" :on-change="handleChange" :on-exceed="handleExceed" :on-remove="handleRemove"
- ref="upload" :limit="1" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
- :auto-upload="false">
- <el-button slot="trigger" size="small" type="primary">选择文件</el-button>
- <el-button size="small" type="success" @click="inImport">保存</el-button>
- <!-- <div slot="tip" class="el-upload__tip">只 能 上 传 xlsx / xls 文 件</div> -->
- </el-upload>
-
- <el-table :data="imTableData" border>
- <el-table-column prop="层数" label="层数" width="60" show-overflow-tooltip header-align="center">
- </el-table-column>
- <el-table-column prop="库房" label="库房" width="100" show-overflow-tooltip header-align="center">
- </el-table-column>
- <el-table-column prop="垛位" label="垛位" width="120" show-overflow-tooltip header-align="center">
- </el-table-column>
- <el-table-column prop="物料" label="物料" width="120" show-overflow-tooltip align="center" header-align="center">
- </el-table-column>
- <el-table-column prop="钢种" label="钢种" width="120" show-overflow-tooltip align="center" header-align="center">
- </el-table-column>
- <el-table-column prop="钢板号" label="钢板号" width="200" show-overflow-tooltip header-align="center">
- </el-table-column>
- <el-table-column prop="规格型号" label="规格型号" width="120" show-overflow-tooltip header-align="center">
- </el-table-column>
- <el-table-column prop="数量" label="数量" width="120" show-overflow-tooltip align="right" header-align="center">
- </el-table-column>
- <el-table-column prop="重量" label="重量" width="120" show-overflow-tooltip align="right" header-align="center">
- </el-table-column>
- <el-table-column prop="客户" label="客户" width="300" show-overflow-tooltip header-align="center">
- </el-table-column>
- <el-table-column prop="备注" label="备注" width="150" show-overflow-tooltip header-align="center">
- </el-table-column>
- </el-table>
-
- </el-dialog>
-
- </div>
- </template>
-
- <script>
- import axios from '@/axios'
- import PopupStack from '@/components/PopupStack.vue'
- import PopupMaterial from '@/components/PopupMaterial.vue'
- import PopupCustomer from '@/components/PopupCustomer.vue'
- import PopupAddress from '@/components/PopupAddress.vue'
- import PopupDistribution from '@/components/PopupDistribution.vue'
- import PopupOut from '@/components/PopupOut.vue'
- import PopupIn from '@/components/PopupIn.vue'
- import Export2Excel from '../../excel/Export2Excel.js'
- import {
- mapState
- } from 'vuex'
- export default {
- components: {
- PopupStack,
- PopupMaterial,
- PopupCustomer,
- PopupAddress,
- PopupDistribution,
- PopupOut,
- PopupIn,
- },
- computed: {
- // splitCount: function() {
- // let result = Number(this.split.originalCount) - Number(this.split.count)
- // return result
- // },
- // splitWeight: function() {
- // let result = Number(this.split.originalWeight) - Number(this.split.weight)
- // return result
- // },
- ...mapState({
- serverName: state => state.app.serverName,
- // wareBackgroundColor: state => state.color.wareBackgroundColor,
- // stackColor: state => state.color.stackColor,
- // stackSelectedColor: state => state.color.stackSelectedColor,
- // lockColor: state => state.color.lockColor,
- })
- },
- data() {
- return {
- addressDialogVisible: false,
- customerDialogVisible: false,
- query: {
- wareName: '',
- stackName: '',
- model: '',
- materialName: '',
- standard: '',
- customerName: '',
- plateNo: [],
- wareId:'',
- ordNo:[],
- contractNo:[],
- packNo:[],
- fkcustmerName:'',
- remark1:''
- },
- multipleSelection: [],
- tableData: [],
- optionsWare: [],
-
- oldCustomer:'',
- newCustomer: {
- id: '',
- name: ''
- },
- newfkCustomer: {
- id: '',
- name: ''
- },
- newAddress: '',
-
- currentPage: 1,
- totalRows: 0,
- pageSizes: [50, 100, 200,1000],
- pageSize: 1000,
- HideAndShow: 0,
-
-
- loading: false,
- importDialogVisible: false,
- selectRows: [],
- options: [],
- moveFromStack: {}, //移除垛位
- fileTemp: [],
- imTableData: [],
- moveStore: {},
- optionsCust: [],
- sumCount:'',
- sumWeight:'',
-
- stackDialogVisible: false,
- newWare:'',
- newStack:'',
- newRemark1:'',
- newRemark:'',
- changeCUSTDialogVisible: false,
- newCustomername:'',
- newFKCustomername:'',
- newContractno:'',
- newOrdno:'',
- newReceiveaddress:'',
- newProductionplace:'',
- newPackno:''
- };
- },
- mounted() {
- this.getWare()
- this.getAllCustomer()
- //this.getTableData()
- },
- methods: {
- showMaterial() {
- this.$refs.PopupMaterial.show()
- },
- receviceFromMaterial(material) {
- this.query.materialName = material.name
- this.query.standard = material.standard
- },
- tableRowClassName({row}) {
- if (row.lockFlag === '1') {
- return 'warning-row'
- }
- return ''
- },
- batchOperate(command) {
- switch (command) {
- case "handleInBack":
- this.handleInBack();
- break;
- case "handleChangeCustomer":
- this.handleChangeCustomer();
- break;
- case "handleChangeStack":
- this.handleChangeStack();
- break;
- }
- },
-
- showCustomer() {
- this.$refs.PopupCustomer.show()
- },
- receviceFromCustomer(customer) {
- this.query.customerName = customer.name
- },
-
- handleChangeStack(){
- this.stackDialogVisible = true;
- this.newStack='';
- },
-
- showFKcustmer() {
- this.$refs.PopupFKcustmer.show()
- },
- receviceFKcustmerr(customer) {
- this.query.fkcustmerName = customer.name
- },
-
- showNewCustomer() {
- this.$refs.PopupNewCustomer.show()
- },
- receviceFromNewCustomer(customer) {
- this.newCustomer = customer
- this.newAddress = customer.address
- },
- showAddress() {
- this.$refs.PopupAddress.show(this.newCustomer.id)
- },
- receviceFromAddress(address) {
- this.newAddress = address.address
- },
-
- handleSearch() {
- this.currentPage = 1
- this.getTableData()
- },
- handleImport() {
- this.importDialogVisible = true
- },
- handleDownload() {
- window.open(this.serverName.substr(0, this.serverName.lastIndexOf('/', this.serverName.lastIndexOf('/') - 1)) +
- '/import.xls')
- },
- lockFormatter: function(row, column) {
- switch (row.lockFlag) {
-
- case "0":
- return "";
- break;
- default:
- return "已锁定";
- break;
- }
- },
- showIn() {
- // if (this.query.wareId == '') {
- // this.$message({
- // type: 'error',
- // message: '请选择入库库房'
- // });
- // return
- // }
- // if (this.query.stackId == '') {
- // this.$message({
- // type: 'error',
- // message: '请选择入库垛位'
- // });
- // return
- // }
- this.$refs.PopupIn.show()
- },
- 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(() => {});
-
- },
- 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 = ''
- },
- showDistribution() {
- //console.log(this.selectRows.length)
- if (this.selectRows.length < 1) {
- this.$message({
- type: 'warning',
- message: '至少选择一条数据!',
- });
- }
- this.$refs.PopupDistribution.show()
-
- },
- handleChangeCustomer(){
- this.newCustomername = '',
- this.newFKCustomername='',
- this.newContractno='',
- this.newOrdno='',
- this.newReceiveaddress='',
- this.newProductionplace='',
- this.newPackno='',
- this.changeCUSTDialogVisible= true
- },
- showOut() {
- this.$refs.PopupOut.show()
- },
- 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
- });
- },
- handleSizeChange(val) {
- this.pageSize = val
- this.getTableData()
- },
-
- handleCurrentChange(val) {
- this.currentPage = val
- this.getTableData()
- },
-
- search() {
- this.currentPage = 1
- this.getTableData()
- },
-
- getTableData() {
- 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
- }
- //console.log(param);
- axios.get(url, param).then(response => {
- if (response.data.code == 0) {
- //console.log(response.data.data.list);
- this.tableData = response.data.data.list
- this.totalRows = response.data.data.total
- } else {
- this.$message({
- type: 'error',
- message: '操作失败;' + response.data.msg,
- });
- }
- this.loading = false
- });
- },
- handleSelectionChange(val) {
- this.multipleSelection = val;
- this.sumCount =0;
- this.sumWeight=0;
- for (var i = 0; i < this.multipleSelection.length; i++){
- this.sumCount = parseInt(this.multipleSelection[i].count)+parseInt(this.sumCount);
- this.sumWeight = parseFloat(this.multipleSelection[i].weight)+parseFloat(this.sumWeight);
- }
- this.sumWeight = this.sumWeight.toFixed(3);
- },
- 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.newAddress = this.multipleSelection[0].receiveAddress
- 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
- },
- handleRemark1(){
- this.stackDialogVisible= true;
- this.newStack='';
- this.newRemark1='';
- this.newRemark = '';
- },
- 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
- },
- 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
- },
- inImport() {
- var url = 'WareIn/inImport.do'
- var json = JSON.stringify(this.imTableData)
- var param = {
- json: json
- }
- axios.post(url, param).then(response => {
- if (response.data.code == '0') {
- this.$message({
- type: 'success',
- message: '入库成功!',
- });
- this.importDialogVisible = false
- this.imTableData = []
- this.fileTemp = null
- } else {
- this.$message({
- type: 'error',
- message: '入库失败!' + response.data.msg
- });
-
- }
- });
- },
- handleTableSelectionChange(val) {
- this.selectRows = val
- this.setLayerColor()
- },
- receviceFromDistreibution() {
- this.getStoreByStackId(null)
- },
- getStoreByStackId(moveSelect) {
- this.tableDataLoading = true
- var url = 'WareStore/queryByWareIdStackId.do'
- var param = {
- wareId: this.query.wareId,
- stackId: this.moveFromStack.id
- }
- axios.get(url, param).then(response => {
- if (response.data.code == 0) {
- this.tableData = response.data.data
- this.selectRows = []
- // if (this.isLayer == '0') {
- // this.drawStoreNoLayer(response.data.data)
- // } else if (this.isLayer == '1') { //1是A开头的,2是B开头的,3是C开头的。
- // this.drawStoreAutoLayer(response.data.data)
- // } else if (this.isLayer == '2') {
- // this.drawStoreManulLayer(response.data.data)
- // }
- if (moveSelect) {
- this.$refs.multipleTable.clearSelection();
- for (let i = 0; i < this.tableData.length; i++) {
- for (let j = 0; j < moveSelect.length; j++) {
- if (moveSelect[j].layer === this.tableData[i].layer) {
- this.selectRows.push(this.tableData[i])
- }
- }
- }
- this.$nextTick(() => {
- this.toggleSelection(this.selectRows, true)
- this.setLayerColor()
- })
-
- }
- } else {
- this.$message({
- type: 'error',
- message: '保存失败' + response.data.msg,
- });
- }
- this.tableDataLoading = false
- });
- },
- receviceFromOut(customer) {
- this.getStoreByStackId()
- },
- receviceFromIn() {
- this.getStoreByStackId()
- },
- handleChange(file, fileList) {
- this.fileTemp = file.raw
- if (this.fileTemp) {
- if ((this.fileTemp.type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') || (this.fileTemp.type ==
- 'application/vnd.ms-excel')) {
- this.importfxx(this.fileTemp)
- } else {
- this.$message({
- type: 'warning',
- message: '附件格式错误,请删除后重新上传!'
- })
- }
- } else {
- this.$message({
- type: 'warning',
- message: '请上传附件!'
- })
- }
-
- },
- handleExceed(file, fileList) {},
- handleRemove(file, fileList) {
- this.fileTemp = null
- },
- toggleSelection(rows, selected) {
- if (rows) {
- rows.forEach(row => {
- this.$refs.multipleTable.toggleRowSelection(row, selected); //接受两个参数,row传递被勾选行的数据,selected设置是否选中
- });
- }
- },
- setLayerColor() {
- if (this.selectRows.length == 0) {
- for (let i = 0; i < this.moveStore.storage._roots.length; i++) {
- if (this.tableData[i].lockFlag == '1') {
- this.moveStore.storage._roots[i].attr('style', {
- fill: this.lockColor,
- })
- } else {
- this.moveStore.storage._roots[i].attr('style', {
- fill: this.stackColor,
- })
- }
- }
- } else {
- for (let i = 0; i < this.moveStore.storage._roots.length; i++) {
- for (let j = 0; j < this.selectRows.length; j++) {
- if (this.tableData[i] === this.selectRows[j]) {
- this.moveStore.storage._roots[i].attr('style', {
- fill: this.stackSelectedColor,
- })
- break;
- } else {
- if (this.tableData[i].lockFlag == '1') {
- this.moveStore.storage._roots[i].attr('style', {
- fill: this.lockColor,
- })
- } else {
- this.moveStore.storage._roots[i].attr('style', {
- fill: this.stackColor,
- })
- }
- }
- }
-
- }
- }
- },
- handleTableSelect(selection, row) { //第一个参数是目前所有选中的数据
- console.log(JSON.stringify(row))
- if (row.lockFlag == '1') {
- // this.$message({
- // type: 'error',
- // message: '该行已被配货锁定',
- // });
- alert("该行已被配货锁定")
- this.toggleSelection([row], false)
- // for(let i = 0;i<selection.length;i++){
- // if(selection[i]==row){
- // selection.splice(i,1)
- // }
- // }
- } else {
- this.selectRows = selection
- this.setLayerColor()
- }
- },
- selectAll(selection){
- this.selectRows = selection;
- },
- getlist(){
- const replaceResult = this.query.plateNo.replace(/[;,,;\s\r\n]+/g, ",").split(",");
- this.query.plateNo = 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;
- },
- getPackList(){
- const replaceResult = this.query.packNo.replace(/[;,,;\s\r\n]+/g, ",").split(",");
- this.query.packNo = replaceResult;
- },
-
- 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
- }
-
-
- 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) {
- // alert(JSON.stringify(imptData))
- 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",
- "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]
- }))
- },
-
- //showChangeAddress() {},
- // handleAddressSave() {
- // },
- // handleAddressCancelSave() {
- // this.addressDialogVisible = false
- // },
- },
- }
- </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>
|