master
lion 6 months ago
parent cce54a990c
commit 5b9f4a8195

@ -3,6 +3,9 @@
<!-- 选择物资编号 --> <!-- 选择物资编号 -->
<Modal v-model="isShowWuzi" :z-index="10000" width="70" title="库存选择" :loading="showLoading"> <Modal v-model="isShowWuzi" :z-index="10000" width="70" title="库存选择" :loading="showLoading">
<div class="searchCompanys"> <div class="searchCompanys">
<el-cascader v-model="wuzifenlei" ref="cascaders" clearable popper-class="select_popper"
style="margin-right: 10px;flex-basis: 60%;" :options="fenleiList" :props="{label:'name',value:'id'}"
@change="(e)=>{changeFenlei(e)}" />
<el-input <el-input
v-model="wuzibianmakeyword" v-model="wuzibianmakeyword"
style="margin-right:10px" style="margin-right:10px"
@ -19,6 +22,7 @@
placeholder="请输入物资名称查找" placeholder="请输入物资名称查找"
@keyup.enter.native="getWuzi" @keyup.enter.native="getWuzi"
/> />
<el-button type="primary" @click="getWuzi"></el-button> <el-button type="primary" @click="getWuzi"></el-button>
</div> </div>
@ -53,6 +57,9 @@
import { import {
index index
} from '@/api/inventory.js' } from '@/api/inventory.js'
import {
index as getFenleilist
} from '@/api/fenlei.js'
export default { export default {
data() { data() {
return { return {
@ -63,6 +70,8 @@ export default {
wuziPageIndex: 1, wuziPageIndex: 1,
wuzibianmakeyword: '', wuzibianmakeyword: '',
wuzimingchengkeyword: '', wuzimingchengkeyword: '',
wuzifenlei:'',
fenleiList:[],
wuziTotal: 0, wuziTotal: 0,
wzList: [], wzList: [],
selectItem: {}, selectItem: {},
@ -128,6 +137,7 @@ export default {
watch: { watch: {
isShowWuzi(newVal) { isShowWuzi(newVal) {
if (newVal) { if (newVal) {
this.getFenlei()
this.getWuzi() this.getWuzi()
}else{ }else{
this.wzList = [] this.wzList = []
@ -137,6 +147,37 @@ export default {
} }
}, },
methods: { methods: {
async getFenlei() {
const res = await getFenleilist({
tree: 1
})
this.fenleiList = this.removeEmptyChildren(res)
},
changeFenlei(e, row) {
console.log('e', e)
if (e) {
this.wuzifenlei = e[e.length - 1]
} else {
this.wuzifenlei = ''
}
},
// children=[]
removeEmptyChildren(node) {
if (Array.isArray(node)) {
return node.map(child => {
if (child.children) {
//
child.children = this.removeEmptyChildren(child.children);
// children
if (child.children.length === 0) {
delete child.children;
}
}
return child;
});
}
return [];
},
async getWuzi() { async getWuzi() {
this.showLoading = true this.showLoading = true
this.loadingtable = true this.loadingtable = true
@ -145,6 +186,7 @@ export default {
page: this.wuziPageIndex, page: this.wuziPageIndex,
sort_type: 'DESC', sort_type: 'DESC',
sort_name: 'wuzibianma', sort_name: 'wuzibianma',
fenlei:this.wuzifenlei,
// table_name: 'inventorys', // table_name: 'inventorys',
filter: [{ filter: [{
'key': 'zichanmingcheng', 'key': 'zichanmingcheng',

@ -7,13 +7,18 @@
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;"> <div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<div class="selector-item"> <div class="selector-item">
<span class="selector-item__label">种类编码</span> <span class="selector-item__label">种类编码</span>
<Input v-model="select.wzbm" style="width: 120px;margin-right: 10px;" placeholder="种类编码搜索" /> <el-input v-model="select.wzbm" style="width: 120px;margin-right: 10px;" placeholder="种类编码搜索" />
</div> </div>
<div class="selector-item"> <div class="selector-item">
<span class="selector-item__label">物资名称</span> <span class="selector-item__label">物资名称</span>
<Input v-model="select.keyword" style="width: 120px;margin-right: 10px;" placeholder="物资名称搜索" /> <el-input v-model="select.keyword" style="width: 120px;margin-right: 10px;" placeholder="物资名称搜索" />
</div> </div>
<div class="selector-item"> <div>
<el-cascader v-model="select.fenlei" ref="cascaders" clearable popper-class="select_popper"
style="margin-right: 10px;flex-basis: 20%;" :options="fenleiList" :props="{label:'name',value:'id'}"
@change="(e)=>{changeFenlei(e)}" />
</div>
<!-- <div class="selector-item">
<span class="selector-item__label">入库数量</span> <span class="selector-item__label">入库数量</span>
<Input v-model="select.rmin" clearable style="width: 60px;margin:0 3px" placeholder="" /> <Input v-model="select.rmin" clearable style="width: 60px;margin:0 3px" placeholder="" />
<span class="selector-item__label"></span> <span class="selector-item__label"></span>
@ -24,12 +29,12 @@
<Input v-model="select.min" clearable style="width: 60px;margin:0 3px" placeholder="" /> <Input v-model="select.min" clearable style="width: 60px;margin:0 3px" placeholder="" />
<span class="selector-item__label"></span> <span class="selector-item__label"></span>
<Input v-model="select.max" clearable style="width: 60px;margin:0 3px" placeholder="" /> <Input v-model="select.max" clearable style="width: 60px;margin:0 3px" placeholder="" />
</div> </div> -->
<Button type="primary" style="margin-left: 10px;" @click="getindex"></Button> <el-button type="primary" style="margin-left: 10px;" @click="getindex"></el-button>
<Button type="primary" style="margin-left: 10px;" @click="toprint"></Button> <el-button type="primary" style="margin-left: 10px;" @click="toprint"></el-button>
<Button type="primary" style="margin-left: 10px;" <el-button type="primary" style="margin-left: 10px;"
@click="exportExcel(new Date().getTime().toString())">导出</Button> @click="exportExcel(new Date().getTime().toString())">导出</el-button>
</div> </div>
</slot> </slot>
@ -78,6 +83,9 @@
index, index,
destroy destroy
} from '@/api/inventory.js' } from '@/api/inventory.js'
import {
index as getFenleilist
} from '@/api/fenlei.js'
import { import {
getInfo getInfo
} from '@/api/user.js' } from '@/api/user.js'
@ -111,11 +119,13 @@
roleName: '', roleName: '',
isCkName: '', isCkName: '',
isPandian: '', isPandian: '',
fenleiList:[],
select: { select: {
pageSize: 40, pageSize: 40,
pageIndex: 1, pageIndex: 1,
keyword: '', keyword: '',
wzbm: '', wzbm: '',
fenlei:'',
is_export: 0, is_export: 0,
min: '', min: '',
max: '', max: '',
@ -294,6 +304,7 @@
this.isPandian = 'pandian' this.isPandian = 'pandian'
} }
} }
this.getFenlei()
this.getField() this.getField()
this.getindex() this.getindex()
this.getUserName() this.getUserName()
@ -443,6 +454,37 @@
this.select.pageIndex = 1 this.select.pageIndex = 1
this.getindex() this.getindex()
}, },
async getFenlei() {
const res = await getFenleilist({
tree: 1
})
this.fenleiList = this.removeEmptyChildren(res)
},
changeFenlei(e, row) {
console.log('e', e)
if (e) {
this.select.fenlei = e[e.length - 1]
} else {
this.select.fenlei = ''
}
},
// children=[]
removeEmptyChildren(node) {
if (Array.isArray(node)) {
return node.map(child => {
if (child.children) {
//
child.children = this.removeEmptyChildren(child.children);
// children
if (child.children.length === 0) {
delete child.children;
}
}
return child;
});
}
return [];
},
async getindex() { async getindex() {
this.loading = true this.loading = true
const min = this.select.min ? this.select.min : 0 const min = this.select.min ? this.select.min : 0
@ -455,6 +497,7 @@
table_name: 'inventorys', table_name: 'inventorys',
sort_type: 'DESC', sort_type: 'DESC',
sort_name: 'wuzibianma', sort_name: 'wuzibianma',
fenlei:this.select.fenlei,
// is_export:this.select.is_export, // is_export:this.select.is_export,
filter: [{ filter: [{
'key': 'wuzibianma', 'key': 'wuzibianma',

@ -2,7 +2,7 @@
<div> <div>
<div ref="lxHeader"> <div ref="lxHeader">
<lx-header icon="md-apps" text="防汛工单管理" style="margin-bottom: 10px; border: 0px; margin-top: 15px"> <lx-header icon="md-apps" text="应急调令管理" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<slot> <slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;"> <div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<!-- <Select v-model="select.storages_id" style="width: 200px;margin-right: 10px;" placeholder="所在仓库" clearable> <!-- <Select v-model="select.storages_id" style="width: 200px;margin-right: 10px;" placeholder="所在仓库" clearable>

Loading…
Cancel
Save