master
lion 6 months ago
parent cce54a990c
commit 5b9f4a8195

@ -2,7 +2,10 @@
<div>
<!-- 选择物资编号 -->
<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
v-model="wuzibianmakeyword"
style="margin-right:10px"
@ -18,7 +21,8 @@
type="text"
placeholder="请输入物资名称查找"
@keyup.enter.native="getWuzi"
/>
/>
<el-button type="primary" @click="getWuzi"></el-button>
</div>
@ -52,7 +56,10 @@
// } from "@/api/system/baseForm.js"
import {
index
} from '@/api/inventory.js'
} from '@/api/inventory.js'
import {
index as getFenleilist
} from '@/api/fenlei.js'
export default {
data() {
return {
@ -62,7 +69,9 @@ export default {
isShowWuzi: false,
wuziPageIndex: 1,
wuzibianmakeyword: '',
wuzimingchengkeyword: '',
wuzimingchengkeyword: '',
wuzifenlei:'',
fenleiList:[],
wuziTotal: 0,
wzList: [],
selectItem: {},
@ -127,7 +136,8 @@ export default {
},
watch: {
isShowWuzi(newVal) {
if (newVal) {
if (newVal) {
this.getFenlei()
this.getWuzi()
}else{
this.wzList = []
@ -136,7 +146,38 @@ 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() {
this.showLoading = true
this.loadingtable = true
@ -144,7 +185,8 @@ export default {
page_size: 40,
page: this.wuziPageIndex,
sort_type: 'DESC',
sort_name: 'wuzibianma',
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>
<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">
<!-- <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>
@ -77,7 +82,10 @@
import {
index,
destroy
} from '@/api/inventory.js'
} from '@/api/inventory.js'
import {
index as getFenleilist
} from '@/api/fenlei.js'
import {
getInfo
} from '@/api/user.js'
@ -110,12 +118,14 @@
authName: '',
roleName: '',
isCkName: '',
isPandian: '',
isPandian: '',
fenleiList:[],
select: {
pageSize: 40,
pageIndex: 1,
keyword: '',
wzbm: '',
wzbm: '',
fenlei:'',
is_export: 0,
min: '',
max: '',
@ -293,7 +303,8 @@
if (path[1]) {
this.isPandian = 'pandian'
}
}
}
this.getFenlei()
this.getField()
this.getindex()
this.getUserName()
@ -442,6 +453,37 @@
search() {
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
@ -454,7 +496,8 @@
page: this.select.pageIndex,
table_name: 'inventorys',
sort_type: 'DESC',
sort_name: 'wuzibianma',
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