| | |
| | | <el-input v-model="form.createuser" style="width: 200px" placeholder="请输入" /> |
| | | </el-form-item> |
| | | <el-form-item label="所属仓库" style=" display: flex;"> |
| | | <el-select v-model="form.stockcode" :popper-append-to-body="false" style="width: 200px" placeholder="请选择"> |
| | | <el-select |
| | | v-model="form.stockcode" |
| | | :popper-append-to-body="false" |
| | | style="width: 200px" |
| | | placeholder="请选择" |
| | | > |
| | | <!-- @focus="getWareHouseSelect"--> |
| | | <el-option |
| | | v-for="item in stockArr" |
| | | :key="item.code" |
| | |
| | | <el-divider /> |
| | | <div style="margin-left: 10px;display: flex"> |
| | | <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button> |
| | | <el-button type="primary" icon="el-icon-upload2" @click="upload">导入</el-button> |
| | | <!-- <el-button type="primary" icon="el-icon-upload2" @click="upload">导入</el-button>--> |
| | | </div> |
| | | <el-divider /> |
| | | <div class="elTableDiv"> |
| | | <el-table |
| | | :data="tableData" |
| | | border |
| | | :height="tableHeight" |
| | | stripe |
| | | :height="tableHeight+'px'" |
| | | :style="{width: 100+'%',height:tableHeight+'px',}" |
| | | highlight-current-row |
| | | :header-cell-style="this.$headerCellStyle" |
| | |
| | | prop="lm_date" |
| | | label="创建时间" |
| | | sortable="custom" |
| | | width="160" |
| | | /> |
| | | <el-table-column |
| | | label="操作" |
| | | width="120" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | | <el-button type="text" @click="edit('edit',row)">修改</el-button> |
| | | <el-button type="text" @click="edit('edit',row)">编辑</el-button> |
| | | <el-button type="text" @click="del(row)">删除</el-button> |
| | | </div> |
| | | </template> |
| | |
| | | </div> |
| | | |
| | | <el-dialog |
| | | :title="operation==='add'?'新增':'修改'" |
| | | :title="operation==='add'?'新增':'编辑'" |
| | | :visible.sync="dialogVisible" |
| | | width="50%" |
| | | width="800px" |
| | | :close-on-click-modal="false" |
| | | top="15vh" |
| | | @closed="handleClose" |
| | | @close="handleClose" |
| | | > |
| | | <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px"> |
| | | <el-form-item label="库位编码" prop="storagecode"> |
| | | <el-input v-model="dialogForm.storagecode" :disabled="operation!=='add'" style="width: 220px" /> |
| | | <el-input v-model="dialogForm.storagecode" :disabled="operation!=='add'" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="库位名称" prop="storagename"> |
| | | <el-input v-model="dialogForm.storagename" style="width: 220px" /> |
| | | <el-input v-model="dialogForm.storagename" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="所属库位" prop="stockcode"> |
| | | <el-select |
| | | v-model="dialogForm.stockcode" |
| | | filterable |
| | | :popper-append-to-body="false" |
| | | style="width: 220px" |
| | | style="width: 200px" |
| | | placeholder="请选择" |
| | | > |
| | | <!-- @focus="getWareHouseSelect2"--> |
| | | <el-option |
| | | v-for="item in stockArr" |
| | | :key="item.code" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="库位描述"> |
| | | <el-input v-model="dialogForm.description" type="textarea" style="width: 220px" /> |
| | | <el-input v-model="dialogForm.description" type="textarea" style="width: 200px" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import Pagination from '@/components/Pagination' |
| | | import { AddUpdateStorageDef, DeleteStorageDef, StorageDefSearch, WareHouseDefSearch, WareHouseSelect } from '@/api/wlgl' |
| | | import { AddUpdateStorageDef, DeleteStorageDef, StorageDefSearch, WareHouseSelect } from '@/api/wlgl' |
| | | |
| | | const SER_HZ = /^[\u4e00-\u9fa5]+$/ |
| | | export default { |
| | | name: 'Zzjg', |
| | | name: 'KWDY', |
| | | components: { |
| | | Pagination |
| | | }, |
| | |
| | | }, |
| | | total: 10, |
| | | stockArr: [], // 所属仓库数组 |
| | | // stockArr2: [], // 所属仓库数组对话框 |
| | | tableData: [], |
| | | dialogVisible: false, |
| | | dialogForm: { |
| | |
| | | } |
| | | }, |
| | | created() { |
| | | this.getStorageDefSearch() |
| | | this.getWareHouseSelect() |
| | | this.handleRequest() |
| | | }, |
| | | mounted() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | methods: { |
| | | handleRequest() { |
| | | this.getStorageDefSearch().then(res => { |
| | | if (res.code === '200') { |
| | | this.getWareHouseSelect() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | async getStorageDefSearch() { |
| | | const res = await StorageDefSearch(this.form) |
| | | this.tableData = res.data |
| | | this.total = res.count |
| | | return { code: res.code } |
| | | }, |
| | | async getWareHouseSelect() { |
| | | const { data: res } = await WareHouseSelect() |
| | | this.stockArr = res |
| | | }, |
| | | // 对话框中的 |
| | | // async getWareHouseSelect2() { |
| | | // const { data: res } = await WareHouseSelect() |
| | | // this.stockArr2 = res |
| | | // }, |
| | | // 排序改变时 |
| | | sortChange({ column, prop, order }) { |
| | | if (order === 'descending') { |
| | |
| | | // 查询 |
| | | search() { |
| | | this.getStorageDefSearch() |
| | | }, |
| | | upload() { |
| | | |
| | | }, |
| | | // 重置 |
| | | reset() { |
| | |
| | | getHeight() { |
| | | this.$nextTick(() => { |
| | | this.mainHeight = window.innerHeight - 250 |
| | | this.tableHeight = this.mainHeight - 100 |
| | | this.tableHeight = this.mainHeight - 50 |
| | | if (window.innerHeight < 769) { |
| | | this.tableHeight = this.tableHeight - 50 |
| | | } |
| | | }) |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |