123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416 |
- <template>
- <view class="content">
- <view class="title">
- <view class="">
- <text>库区筛选</text>
- </view>
- <view class="view_icon" @click="inputDialogToggle">
- <text>{{ value }}</text>
- <u-icon name="arrow-right" color="#000000" size="20"></u-icon>
- </view>
- </view>
- <view class="content_table">
- <view class="uni-container">
- <uni-table
- ref="table"
- :loading="loading"
- stripe
- emptyText="暂无更多数据"
- @selection-change="selectionChange">
- <uni-tr>
- <uni-th width="50" align="center">库位</uni-th>
- <uni-th width="50" align="center"></uni-th>
- <uni-th width="50" align="center">库位状态</uni-th>
- <uni-th width="50" align="center">库存状态</uni-th>
- </uni-tr>
- <uni-tr
- @filter-change="filtechange"
- v-for="(item, index) in tableData"
- :key="index">
- <uni-td>
- <view class="name" @click.prevent="ferterMan(item)">
- {{ item.locationNo }}
- </view>
- </uni-td>
- <uni-td>
- <view class="name" @click.prevent="ferterMan(item)">
- {{ item.name }}
- </view>
- </uni-td>
- <uni-td align="center">
- <view class="name" @click.prevent="ferterMan(item)">
- {{ item.stockStatus }}
- </view>
- </uni-td>
- <uni-td align="center">
- <view
- class="name"
- @click.prevent="ferterMan(item)"
- v-if="item.isEmpty == 'Y'">
- 空
- </view>
- <view
- class="name"
- @click.prevent="ferterMan(item)"
- v-if="item.isEmpty == 'N'">
- 非空
- </view>
- </uni-td>
- </uni-tr>
- </uni-table>
- <view class="uni-pagination-box">
- <uni-pagination
- show-icon
- :page-size="pageSize"
- :current="pageCurrent"
- :total="total"
- @change="change" />
- </view>
- </view>
- </view>
- <uni-popup ref="inputDialog" type="dialog">
- <uni-popup-dialog
- ref="inputClose"
- title="选择库区"
- value="对话框预置提示内容!"
- placeholder="请输入内容"
- @confirm="dialogInputConfirm">
- <u-radio-group
- placement="column"
- :borderBottom="true"
- v-model="value"
- iconPlacement="right">
- <u-radio
- :customStyle="{ marginBottom: '8px' }"
- v-for="(item, index) in radiolist1"
- :key="index"
- :label="item.name"
- :name="item.name"
- @change="radioChange($event, item)"></u-radio>
- </u-radio-group>
- </uni-popup-dialog>
- </uni-popup>
- </view>
- </template>
- <script>
- import tableData from "../tableData.js";
- export default {
- data() {
- return {
- type: "center",
- msgType: "success",
- messageText: "这是一条成功提示",
- value: "请选择",
- value1: "",
- value3: "",
- searchVal: "",
- tableData: [],
- IDBIndexs: "",
- pageSize: 10,
- host: "",
- pageCurrent: 1,
- total: 0,
- loading: true,
- rangeValue: "",
- zoneId: "",
- tip: 0,
- radiolist1: [
- {
- name: "SE车检",
- disabled: false,
- },
- {
- name: "成品区",
- disabled: false,
- },
- ],
- };
- },
- onLoad(options) {
- console.log("进", options);
- let _this = this;
- uni.getStorage({
- key: "hostappst",
- success(res) {
- console.log("获取成功", res.data);
- _this.host = res.data;
- },
- });
- this.getData(1);
- this.getReservoir();
- this.IDBIndexs = options.show;
- if (options.rangeValue != "") {
- this.rangeValue = options.rangeValue;
- }
- this.tip = options.tip;
- this.selectedIndexs = [];
- this.radiolist1 = [];
- },
- mounted() {
- if (this.tip == 1) {
- this.value = "桶装物料入库缓存区";
- this.dialogInputConfirm();
- } else if (this.tip == 2) {
- this.value = "桶装物料出库缓存区";
- this.dialogInputConfirm();
- } else if (this.rangeValue == "emptyPalletTargetOut") {
- this.value = "桶装物料入库缓存区";
- this.dialogInputConfirm();
- } else {
- this.inputDialogToggle();
- }
- // || this.IDBIndexs == 4
- if (this.IDBIndexs == 1 || this.IDBIndexs == 2) {
- this.inputDialogToggle();
- }
- },
- methods: {
- selectedItems() {
- return this.selectedIndexs.map((i) => this.tableData[i]);
- },
- selectionChange(e) {
- console.log(e.detail.index);
- this.selectedIndexs = e.detail.index;
- },
- ferterMan(val) {
- console.log("val", val);
- var pages = getCurrentPages();
- var prevPage = pages[pages.length - 2];
- let object = {
- id: val.id,
- locationNo: val.locationNo,
- show: this.IDBIndexs,
- };
- prevPage.$vm.otherFun(object);
- uni.navigateBack({
- delta: 1,
- });
- },
- delTable() {
- console.log(this.selectedItems());
- },
- filtechange(e) {
- console.log("e", e);
- },
- change(e) {
- this.$refs.table.clearSelection();
- this.selectedIndexs.length = 0;
- this.getData(e.current);
- },
- search() {
- this.getData(1, this.searchVal);
- },
- getData(pageCurrent, value = "") {
- this.loading = true;
- this.pageCurrent = pageCurrent;
- this.request({
- pageSize: this.pageSize,
- pageCurrent: pageCurrent,
- value: value,
- success: (res) => {},
- });
- },
- getReservoir() {
- let that = this;
- uni.getStorage({
- key: "GetPhone_Token",
- success: function (res) {
- uni.request({
- url: `http://${that.host}` + "/inv/asn/getZoneList",
- header: {
- Authorization: res.data,
- },
- method: "GET",
- success(res) {
- console.log("chaoShiPanDuan", res);
- if (res.data.code == 200) {
- res.data.data.forEach((item, index) => {
- that.radiolist1.push({
- name: item.zoneName,
- id: item.zoneId,
- disabled: false,
- });
- });
- } else {
- }
- console.log("res", res);
- },
- });
- },
- });
- },
- request(options) {
- const { pageSize, pageCurrent, success, value } = options;
- let total = tableData.length;
- let data = tableData.filter((item, index) => {
- const idx = index - (pageCurrent - 1) * pageSize;
- return idx < pageSize && idx >= 0;
- });
- if (value) {
- data = [];
- tableData.forEach((item) => {
- if (item.name.indexOf(value) !== -1) {
- data.push(item);
- }
- });
- total = data.length;
- }
- setTimeout(() => {
- typeof success === "function" &&
- success({
- data: data,
- total: total,
- });
- }, 500);
- },
- goto(data) {
- uni.navigateTo({
- url: data,
- });
- },
- inputDialogToggle() {
- // || this.IDBIndexs == 4
- if (this.IDBIndexs == 1 || this.IDBIndexs == 2) {
- this.$refs.inputDialog.open();
- }
- },
- radioChange(val, row) {
- console.log("111", val, row);
- this.value3 = val;
- this.zoneId = row.id;
- },
- dialogInputConfirm(val) {
- if (this.value3 != "") {
- this.value = this.value3;
- }
- this.tableData = [];
- console.log("val", this.zoneId);
- let that = this;
- let data = {
- zoneId: that.zoneId,
- locationSceneCode: "emptyPalletInvList",
- };
- let dataobj = {};
- let name;
- if (this.IDBIndexs == 3 || this.IDBIndexs == 6 || this.IDBIndexs == 7) {
- name = "getCacheLocationInfoCacheList";
- if (this.tip == 1) {
- dataobj = {
- cacheZoneSceneCode: "bucketCacheZoneIn",
- locationSceneCode: "bucketCacheIn",
- };
- } else {
- dataobj = {
- cacheZoneSceneCode: "bucketCacheZoneOut",
- locationSceneCode: "bucketCacheOut",
- };
- }
- } else if (this.IDBIndexs == 1 || this.IDBIndexs == 2) {
- name = "getBaseLocationInfoList";
- if (this.zoneId == 4) {
- dataobj = {
- zoneId: 4,
- };
- } else {
- dataobj = {
- zoneId: 5,
- };
- }
- } else {
- name = "getBaseLocationInfoList";
- if (this.zoneId == 4 || this.IDBIndexs == 4) {
- dataobj = {
- zoneId: 4,
- locationSceneCode: this.rangeValue,
- };
- } else {
- dataobj = {
- zoneId: 5,
- locationSceneCode: this.rangeValue,
- };
- }
- }
- this.loading = false;
- uni.getStorage({
- key: "GetPhone_Token",
- success: function (res) {
- // 恢复请求
- uni.request({
- url: `http://${that.host}` + "/inv/asn/" + name,
- header: {
- Authorization: res.data,
- },
- method: "GET",
- data: dataobj,
- success(res) {
- console.log("chaoShiPanDuan", res);
- if (res.data.code == 200) {
- res.data.data.forEach((item, index) => {
- res.data.data.forEach((item, index) => {
- if (item.stockStatus == "00") {
- item.stockStatus = "空闲";
- } else if (item.stockStatus == "10") {
- item.stockStatus = "占用";
- } else if (item.stockStatus == "20") {
- item.stockStatus = "完成";
- } else if (item.stockStatus == "90") {
- item.stockStatus = "合格";
- } else if (item.stockStatus == "99") {
- item.stockStatus = "不合格";
- } else if (item.stockStatus == "80") {
- item.stockStatus = "封存";
- }
- });
- that.tableData = [...res.data.data];
- that.total = res.data.total;
- });
- } else {
- }
- console.log("res", res);
- },
- });
- },
- });
- setTimeout(() => {
- uni.hideLoading();
- console.log(val);
- // 关闭窗口后,恢复默认内容
- this.$refs.inputDialog.close();
- }, 100);
- },
- },
- };
- </script>
- <style scoped lang="scss">
- .content {
- padding: 15px;
- .title {
- display: flex;
- justify-content: space-between;
- font-size: 17px;
- color: #525151;
- .view_icon {
- display: flex;
- align-content: center;
- align-items: center;
- }
- }
- .content_table {
- padding-top: 20px;
- }
- }
- </style>
|