|
@@ -7,6 +7,10 @@
|
|
autoBack
|
|
autoBack
|
|
placeholder
|
|
placeholder
|
|
>
|
|
>
|
|
|
|
+ <view class="u-nav-slot btn-right" slot="right" @click="stashClick">
|
|
|
|
+ <view class="cang-name">{{ cangName }}</view>
|
|
|
|
+ <u-icon name="arrow-down-fill" color="#999999" size="12"></u-icon>
|
|
|
|
+ </view>
|
|
</u-navbar>
|
|
</u-navbar>
|
|
<view class="container_main">
|
|
<view class="container_main">
|
|
<view class="head-box">
|
|
<view class="head-box">
|
|
@@ -102,6 +106,15 @@
|
|
@confirm="pickerConfirm"
|
|
@confirm="pickerConfirm"
|
|
@cancel="typeShow = false"
|
|
@cancel="typeShow = false"
|
|
></u-picker>
|
|
></u-picker>
|
|
|
|
+ <!-- 中心仓弹窗 -->
|
|
|
|
+ <u-picker
|
|
|
|
+ :show="stashShow"
|
|
|
|
+ keyName="label"
|
|
|
|
+ :defaultIndex="defaultIndex2"
|
|
|
|
+ :columns="stashColumns"
|
|
|
|
+ @confirm="pickerConfirm2"
|
|
|
|
+ @cancel="stashShow = false"
|
|
|
|
+ ></u-picker>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -112,6 +125,7 @@ import {
|
|
inventoryPositionTree,
|
|
inventoryPositionTree,
|
|
materialCategoryTree,
|
|
materialCategoryTree,
|
|
} from "@/common/request/apis/inventoryInquiry";
|
|
} from "@/common/request/apis/inventoryInquiry";
|
|
|
|
+import { depotSpinnerList } from "@/common/request/apis/purchase";
|
|
import goodItem from "./components/good-item.vue";
|
|
import goodItem from "./components/good-item.vue";
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
@@ -162,7 +176,13 @@ export default {
|
|
categoryId: "",
|
|
categoryId: "",
|
|
position: "",
|
|
position: "",
|
|
keyword: "",
|
|
keyword: "",
|
|
|
|
+ depotId: "",
|
|
},
|
|
},
|
|
|
|
+ // 中心仓
|
|
|
|
+ stashShow: false,
|
|
|
|
+ cangName: "",
|
|
|
|
+ stashColumns: [],
|
|
|
|
+ defaultIndex2: [],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
@@ -183,9 +203,8 @@ export default {
|
|
// 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.getMaterialCategoryTree();
|
|
- this.loadData();
|
|
|
|
|
|
+ this.getDepotSpinnerList();
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
uni.$on("scanFinish", (data) => {
|
|
uni.$on("scanFinish", (data) => {
|
|
@@ -200,12 +219,30 @@ export default {
|
|
uni.$off("scanFinish");
|
|
uni.$off("scanFinish");
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ getDepotSpinnerList() {
|
|
|
|
+ depotSpinnerList().then((res) => {
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ this.stashColumns = [res.data];
|
|
|
|
+ this.cangName = res.data[0].label;
|
|
|
|
+ this.queryParams.depotId = res.data[0].value;
|
|
|
|
+ this.$store.commit("setcangName", this.cangName);
|
|
|
|
+ this.$store.commit("setDepotInfo", {
|
|
|
|
+ depotName: res.data[0].label,
|
|
|
|
+ id: res.data[0].value,
|
|
|
|
+ });
|
|
|
|
+ this.loadData();
|
|
|
|
+ this.getTreeData();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
scanCode() {
|
|
scanCode() {
|
|
this.$scan.scanCode();
|
|
this.$scan.scanCode();
|
|
},
|
|
},
|
|
async getTreeData() {
|
|
async getTreeData() {
|
|
try {
|
|
try {
|
|
- const res = await inventoryPositionTree();
|
|
|
|
|
|
+ const res = await inventoryPositionTree({
|
|
|
|
+ depotId: this.queryParams.depotId,
|
|
|
|
+ });
|
|
console.log("res=====", res);
|
|
console.log("res=====", res);
|
|
this.treeData = res.data;
|
|
this.treeData = res.data;
|
|
} catch (error) {}
|
|
} catch (error) {}
|
|
@@ -244,8 +281,8 @@ export default {
|
|
const pageSize = this.pageSize;
|
|
const pageSize = this.pageSize;
|
|
const params = {
|
|
const params = {
|
|
...this.queryParams,
|
|
...this.queryParams,
|
|
- currentPage,
|
|
|
|
- pageSize,
|
|
|
|
|
|
+ currentPage,
|
|
|
|
+ pageSize,
|
|
};
|
|
};
|
|
const res = await inventoryInquiry(params);
|
|
const res = await inventoryInquiry(params);
|
|
console.log("inventoryInquiry====", params);
|
|
console.log("inventoryInquiry====", params);
|
|
@@ -305,11 +342,51 @@ export default {
|
|
}
|
|
}
|
|
this.typeShow = false;
|
|
this.typeShow = false;
|
|
},
|
|
},
|
|
|
|
+ stashClick() {
|
|
|
|
+ this.defaultIndex2 = this.getDefaultIndex(
|
|
|
|
+ this.cangName,
|
|
|
|
+ this.stashColumns
|
|
|
|
+ );
|
|
|
|
+ this.stashShow = true;
|
|
|
|
+ },
|
|
|
|
+ pickerConfirm2(val) {
|
|
|
|
+ console.log("pickerConfirm2======", val);
|
|
|
|
+ this.cangName = val.value[0].label;
|
|
|
|
+ this.queryParams.depotId = val.value[0].value;
|
|
|
|
+ this.stashShow = false;
|
|
|
|
+ this.$store.commit("setcangName", this.cangName);
|
|
|
|
+ this.$store.commit("setDepotInfo", {
|
|
|
|
+ depotName: val.value[0].label,
|
|
|
|
+ id: val.value[0].value,
|
|
|
|
+ });
|
|
|
|
+ this.queryParams.position = "";
|
|
|
|
+ this.getTreeData();
|
|
|
|
+ this.onRefresh();
|
|
|
|
+ },
|
|
|
|
+ // 获取picker默认index
|
|
|
|
+ getDefaultIndex(val, list) {
|
|
|
|
+ let arr = [];
|
|
|
|
+ let index = list[0].findIndex((item) => item.label == val);
|
|
|
|
+ arr = [index];
|
|
|
|
+ return arr;
|
|
|
|
+ },
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
|
+.btn-right {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ .cang-name {
|
|
|
|
+ color: #0256ff;
|
|
|
|
+ text-align: center;
|
|
|
|
+ font-family: "PingFang SC";
|
|
|
|
+ font-size: 28rpx;
|
|
|
|
+ font-weight: 600;
|
|
|
|
+ margin-right: 10rpx;
|
|
|
|
+ }
|
|
|
|
+}
|
|
.inventory-page {
|
|
.inventory-page {
|
|
min-height: 100vh;
|
|
min-height: 100vh;
|
|
background: #f0f6fb;
|
|
background: #f0f6fb;
|