123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062 |
- <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 type="success" size="small" @click="handleExport" >导出记录</el-button>
- </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">
- <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-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: ''
- },
- 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
- },
- 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.customerDialogVisible = true
-
- } else {
- this.$message({
- type: 'error',
- message: '请选择同一客户!',
- });
- }
- },
-
- handleCustomerSave() {
- this.newCustomer.id = this.newCustomer.name;
- var url = 'WareChange/changeCustomer.do'
- var param = {
-
- json: JSON.stringify(this.multipleSelection),
- customer: JSON.stringify(this.newCustomer),
- 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
- })
- },
- 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;
- }
- </style>
|