|
@@ -14,8 +14,10 @@
|
|
<u-search
|
|
<u-search
|
|
placeholder="请输入单据编号"
|
|
placeholder="请输入单据编号"
|
|
shape="square"
|
|
shape="square"
|
|
- v-model="searchKey"
|
|
|
|
:showAction="false"
|
|
:showAction="false"
|
|
|
|
+ @search="handleSearch"
|
|
|
|
+ @clear="handleSearch"
|
|
|
|
+ v-model="queryParams.keyword"
|
|
></u-search>
|
|
></u-search>
|
|
<view class="scan-icon flex_box flex_row_center">
|
|
<view class="scan-icon flex_box flex_row_center">
|
|
<image src="@/static/image/scan-icon-2.png" mode=""></image>
|
|
<image src="@/static/image/scan-icon-2.png" mode=""></image>
|
|
@@ -48,19 +50,19 @@
|
|
}"
|
|
}"
|
|
>
|
|
>
|
|
<leo-tree
|
|
<leo-tree
|
|
|
|
+ v-if="typeName === '按库位展示'"
|
|
:data="treeData"
|
|
:data="treeData"
|
|
|
|
+ :defaultProps="defaultProps"
|
|
@node-click="nodeClick"
|
|
@node-click="nodeClick"
|
|
- v-model="typeId"
|
|
|
|
|
|
+ v-model="queryParams.position"
|
|
|
|
+ ></leo-tree>
|
|
|
|
+ <leo-tree
|
|
|
|
+ v-if="typeName === '按分类展示'"
|
|
|
|
+ :data="treeData2"
|
|
|
|
+ :defaultProps="defaultProps2"
|
|
|
|
+ @node-click="nodeClick2"
|
|
|
|
+ v-model="queryParams.categoryId"
|
|
></leo-tree>
|
|
></leo-tree>
|
|
- <!-- <view
|
|
|
|
- class="type-item"
|
|
|
|
- :class="item.id == typeId ? 'active-item' : ''"
|
|
|
|
- v-for="(item, i) in typeList"
|
|
|
|
- :key="i"
|
|
|
|
- @click="chooseType(item)"
|
|
|
|
- >
|
|
|
|
- {{ item.name }}
|
|
|
|
- </view> -->
|
|
|
|
</scroll-view>
|
|
</scroll-view>
|
|
</view>
|
|
</view>
|
|
<view class="goods-cont-right">
|
|
<view class="goods-cont-right">
|
|
@@ -93,7 +95,11 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import leoTree from "@/components/leo-tree/leo-tree.vue";
|
|
import leoTree from "@/components/leo-tree/leo-tree.vue";
|
|
-import { inventoryInquiry } from "@/common/request/apis/inventoryInquiry";
|
|
|
|
|
|
+import {
|
|
|
|
+ inventoryInquiry,
|
|
|
|
+ inventoryPositionTree,
|
|
|
|
+ materialCategoryTree,
|
|
|
|
+} from "@/common/request/apis/inventoryInquiry";
|
|
import goodItem from "@/components/good-item/good-item.vue";
|
|
import goodItem from "@/components/good-item/good-item.vue";
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
@@ -103,114 +109,48 @@ export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
offsetTop: 0,
|
|
offsetTop: 0,
|
|
- searchKey: "",
|
|
|
|
current: 0,
|
|
current: 0,
|
|
typeShow: false,
|
|
typeShow: false,
|
|
defaultIndex: [],
|
|
defaultIndex: [],
|
|
typeName: "按分类展示",
|
|
typeName: "按分类展示",
|
|
scrollH: 0,
|
|
scrollH: 0,
|
|
columnsList: [["按分类展示", "按库位展示"]],
|
|
columnsList: [["按分类展示", "按库位展示"]],
|
|
- typeId: "",
|
|
|
|
- treeData: [
|
|
|
|
- {
|
|
|
|
- id: "1",
|
|
|
|
- label: "1",
|
|
|
|
- children: [
|
|
|
|
- {
|
|
|
|
- id: "1-1",
|
|
|
|
- label: "1-1",
|
|
|
|
- children: [
|
|
|
|
- {
|
|
|
|
- id: "1-1-1",
|
|
|
|
- label: "哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: "1-1-2",
|
|
|
|
- label: "1-1-2",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: "1-1-3",
|
|
|
|
- label: "1-1-3",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: "1-1-4",
|
|
|
|
- label: "1-1-4",
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: "1-2",
|
|
|
|
- label: "1-2",
|
|
|
|
- children: [
|
|
|
|
- {
|
|
|
|
- id: "1-2-1",
|
|
|
|
- label: "1-2-1",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: "1-2-2",
|
|
|
|
- label: "1-2-2",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: "1-2-3",
|
|
|
|
- label: "1-2-3",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: "1-2-4",
|
|
|
|
- label: "1-2-4",
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: "2",
|
|
|
|
- label: "2",
|
|
|
|
- children: [
|
|
|
|
- {
|
|
|
|
- id: "2-1",
|
|
|
|
- label: "2-1",
|
|
|
|
- children: [
|
|
|
|
- {
|
|
|
|
- id: "2-1-1",
|
|
|
|
- label: "2-1-1",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: "2-1-2",
|
|
|
|
- label: "2-1-2",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: "2-1-3",
|
|
|
|
- label: "2-1-3",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: "2-1-4",
|
|
|
|
- label: "2-1-4",
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
|
|
+ treeData: [],
|
|
|
|
+ treeData2: [],
|
|
tabList: [
|
|
tabList: [
|
|
{
|
|
{
|
|
- index: 0,
|
|
|
|
|
|
+ value: "have",
|
|
name: "有库存",
|
|
name: "有库存",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- index: 1,
|
|
|
|
|
|
+ value: "none",
|
|
name: "无库存",
|
|
name: "无库存",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- index: 2,
|
|
|
|
|
|
+ value: "all",
|
|
name: "全部",
|
|
name: "全部",
|
|
},
|
|
},
|
|
],
|
|
],
|
|
-
|
|
|
|
|
|
+ defaultProps: {
|
|
|
|
+ id: "value",
|
|
|
|
+ children: "children",
|
|
|
|
+ label: "label",
|
|
|
|
+ },
|
|
|
|
+ defaultProps2: {
|
|
|
|
+ id: "id",
|
|
|
|
+ children: "children",
|
|
|
|
+ label: "title",
|
|
|
|
+ },
|
|
loadStatus: "loadmore", //加载前值为loadmore,加载中为loading,没有数据为nomore
|
|
loadStatus: "loadmore", //加载前值为loadmore,加载中为loading,没有数据为nomore
|
|
goodsList: [],
|
|
goodsList: [],
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
- query: {},
|
|
|
|
|
|
+ queryParams: {
|
|
|
|
+ type: "have",
|
|
|
|
+ categoryId: "",
|
|
|
|
+ position: "",
|
|
|
|
+ keyword: "",
|
|
|
|
+ },
|
|
};
|
|
};
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
@@ -226,13 +166,42 @@ export default {
|
|
})
|
|
})
|
|
.exec();
|
|
.exec();
|
|
},
|
|
},
|
|
|
|
+
|
|
onLoad() {
|
|
onLoad() {
|
|
// let systemInfo = uni.getSystemInfoSync();
|
|
// let systemInfo = uni.getSystemInfoSync();
|
|
// let statusBarHeight = systemInfo.statusBarHeight;
|
|
// let statusBarHeight = systemInfo.statusBarHeight;
|
|
// this.offsetTop = statusBarHeight + 40
|
|
// this.offsetTop = statusBarHeight + 40
|
|
|
|
+ this.getTreeData();
|
|
|
|
+ this.getMaterialCategoryTree();
|
|
this.loadData();
|
|
this.loadData();
|
|
},
|
|
},
|
|
|
|
+ onShow() {
|
|
|
|
+ uni.$on("scanFinish", (data) => {
|
|
|
|
+ this.params.keyword = data;
|
|
|
|
+ this.onRefresh();
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ onHide() {
|
|
|
|
+ uni.$off("scanFinish");
|
|
|
|
+ },
|
|
|
|
+ onUnload() {
|
|
|
|
+ uni.$off("scanFinish");
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
|
|
+ async getTreeData() {
|
|
|
|
+ try {
|
|
|
|
+ const res = await inventoryPositionTree();
|
|
|
|
+ console.log("res=====", res);
|
|
|
|
+ this.treeData = res.data;
|
|
|
|
+ } catch (error) {}
|
|
|
|
+ },
|
|
|
|
+ async getMaterialCategoryTree() {
|
|
|
|
+ try {
|
|
|
|
+ const res = await materialCategoryTree();
|
|
|
|
+ console.log("res=====", res);
|
|
|
|
+ this.treeData2 = res.data;
|
|
|
|
+ } catch (error) {}
|
|
|
|
+ },
|
|
async onRefresh() {
|
|
async onRefresh() {
|
|
try {
|
|
try {
|
|
await this.loadData(true);
|
|
await this.loadData(true);
|
|
@@ -261,7 +230,7 @@ export default {
|
|
const params = {
|
|
const params = {
|
|
pageNum,
|
|
pageNum,
|
|
pageSize,
|
|
pageSize,
|
|
- ...this.query,
|
|
|
|
|
|
+ ...this.queryParams,
|
|
};
|
|
};
|
|
const res = await inventoryInquiry(params);
|
|
const res = await inventoryInquiry(params);
|
|
console.log("res====", res);
|
|
console.log("res====", res);
|
|
@@ -281,12 +250,24 @@ export default {
|
|
}
|
|
}
|
|
} catch (error) {}
|
|
} catch (error) {}
|
|
},
|
|
},
|
|
|
|
+ handleSearch() {
|
|
|
|
+ this.loadData(true);
|
|
|
|
+ },
|
|
nodeClick(e) {
|
|
nodeClick(e) {
|
|
console.log("nodeClick======", e);
|
|
console.log("nodeClick======", e);
|
|
- console.log("this.typeId======", this.typeId);
|
|
|
|
- // this.typeId = e.id;
|
|
|
|
|
|
+ this.queryParams.position = e.value;
|
|
|
|
+ this.loadData(true);
|
|
|
|
+ },
|
|
|
|
+ nodeClick2(e) {
|
|
|
|
+ console.log("nodeClick======", e);
|
|
|
|
+ this.queryParams.categoryId = e.id;
|
|
|
|
+ this.loadData(true);
|
|
|
|
+ },
|
|
|
|
+ tabClick(e) {
|
|
|
|
+ console.log(e);
|
|
|
|
+ this.queryParams.type = e.value;
|
|
|
|
+ this.loadData(true);
|
|
},
|
|
},
|
|
- tabClick() {},
|
|
|
|
typeClick() {
|
|
typeClick() {
|
|
let index = this.columnsList[0].findIndex(
|
|
let index = this.columnsList[0].findIndex(
|
|
(item) => item == this.typeName
|
|
(item) => item == this.typeName
|
|
@@ -295,12 +276,16 @@ export default {
|
|
this.typeShow = true;
|
|
this.typeShow = true;
|
|
},
|
|
},
|
|
pickerConfirm(val) {
|
|
pickerConfirm(val) {
|
|
|
|
+ console.log("val===========", val);
|
|
this.typeName = val.value[0];
|
|
this.typeName = val.value[0];
|
|
|
|
+ if (this.typeName === "按分类展示") {
|
|
|
|
+ this.queryParams.position = "";
|
|
|
|
+ }
|
|
|
|
+ if (this.typeName === "按库位展示") {
|
|
|
|
+ this.queryParams.categoryId = "";
|
|
|
|
+ }
|
|
this.typeShow = false;
|
|
this.typeShow = false;
|
|
},
|
|
},
|
|
- chooseType(item) {
|
|
|
|
- this.typeId = item.id;
|
|
|
|
- },
|
|
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|