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">
<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
v-model="wuzibianmakeyword"
style="margin-right:10px"
@ -19,6 +22,7 @@
placeholder="请输入物资名称查找"
@keyup.enter.native="getWuzi"
/>
<el-button type="primary" @click="getWuzi"></el-button>
</div>
@ -53,6 +57,9 @@
import {
index
} from '@/api/inventory.js'
import {
index as getFenleilist
} from '@/api/fenlei.js'
export default {
data() {
return {
@ -63,6 +70,8 @@ export default {
wuziPageIndex: 1,
wuzibianmakeyword: '',
wuzimingchengkeyword: '',
wuzifenlei:'',
fenleiList:[],
wuziTotal: 0,
wzList: [],
selectItem: {},
@ -128,6 +137,7 @@ export default {
watch: {
isShowWuzi(newVal) {
if (newVal) {
this.getFenlei()
this.getWuzi()
}else{
this.wzList = []
@ -137,6 +147,37 @@ export default {
}
},
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() {
this.showLoading = true
this.loadingtable = true
@ -145,6 +186,7 @@ export default {
page: this.wuziPageIndex,
sort_type: 'DESC',
sort_name: 'wuzibianma',
fenlei:this.wuzifenlei,
// table_name: 'inventorys',
filter: [{
'key': 'zichanmingcheng',

@ -7,13 +7,18 @@
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<div class="selector-item">
<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 class="selector-item">
<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 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>
<Input v-model="select.rmin" clearable style="width: 60px;margin:0 3px" placeholder="" />
<span class="selector-item__label"></span>
@ -24,12 +29,12 @@
<Input v-model="select.min" clearable style="width: 60px;margin:0 3px" placeholder="" />
<span class="selector-item__label"></span>
<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>
<Button type="primary" style="margin-left: 10px;" @click="toprint"></Button>
<Button type="primary" style="margin-left: 10px;"
@click="exportExcel(new Date().getTime().toString())">导出</Button>
<el-button type="primary" style="margin-left: 10px;" @click="getindex"></el-button>
<el-button type="primary" style="margin-left: 10px;" @click="toprint"></el-button>
<el-button type="primary" style="margin-left: 10px;"
@click="exportExcel(new Date().getTime().toString())">导出</el-button>
</div>
</slot>
@ -78,6 +83,9 @@
index,
destroy
} from '@/api/inventory.js'
import {
index as getFenleilist
} from '@/api/fenlei.js'
import {
getInfo
} from '@/api/user.js'
@ -111,11 +119,13 @@
roleName: '',
isCkName: '',
isPandian: '',
fenleiList:[],
select: {
pageSize: 40,
pageIndex: 1,
keyword: '',
wzbm: '',
fenlei:'',
is_export: 0,
min: '',
max: '',
@ -294,6 +304,7 @@
this.isPandian = 'pandian'
}
}
this.getFenlei()
this.getField()
this.getindex()
this.getUserName()
@ -443,6 +454,37 @@
this.select.pageIndex = 1
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() {
this.loading = true
const min = this.select.min ? this.select.min : 0
@ -455,6 +497,7 @@
table_name: 'inventorys',
sort_type: 'DESC',
sort_name: 'wuzibianma',
fenlei:this.select.fenlei,
// is_export:this.select.is_export,
filter: [{
'key': 'wuzibianma',

@ -2,7 +2,7 @@
<div>
<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>
<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>

Loading…
Cancel
Save