| | |
| | | modalList: {}, |
| | | showModal: false, |
| | | productTypeMap: { |
| | | 1: "导体", |
| | | 2: "铜杆", |
| | | 3: "导体2.6", |
| | | DTO1: "导体", |
| | | TG01: "铜杆", |
| | | DT02: "导体2.6", |
| | | }, |
| | | ScanCodeRecord: [], |
| | | background: { |
| | |
| | | <view class="_label-name">生产车间:</view> |
| | | </view> |
| | | <view class="_content"> |
| | | {{ item.workshop }} |
| | | {{ workshopList[item.workshop] || item.workshop }} |
| | | <!-- {{ item.workshop }} --> |
| | | </view> |
| | | </view> |
| | | <view class="row-list"> |
| | |
| | | total: 0, |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | status: 'loading', |
| | | status: "loading", |
| | | isLoading: false, |
| | | loadText: { |
| | | loadmore: "加载更多...", |
| | | loading: "努力加载中...", |
| | | nomore: "没有更多了", |
| | | }, |
| | | workshopList: {}, // 改为对象 |
| | | }; |
| | | }, |
| | | onReady() { |
| | | this.fetchWorkshops(); |
| | | }, |
| | | onLoad() { |
| | | this.getlist(); |
| | |
| | | //创建核销单 |
| | | openCreateWriteOffForm() { |
| | | uni.navigateTo({ |
| | | url: '/pages/wareHouse/nuclearScale/createwriteoffform' |
| | | }) |
| | | url: "/pages/wareHouse/nuclearScale/createwriteoffform", |
| | | }); |
| | | }, |
| | | getmoreList() { |
| | | if (this.pageSize >= this.total) { |
| | |
| | | }, |
| | | getlist() { |
| | | this.isLoading = true; |
| | | this.$u.api.NuclearScaleEntry |
| | | .getWeighingOrder({ |
| | | this.$u.api.NuclearScaleEntry.getWeighingOrder({ |
| | | current: this.pageNum, |
| | | size: this.pageSize |
| | | size: this.pageSize, |
| | | }) |
| | | .then((res) => { |
| | | this.handleListResponse(res); |
| | |
| | | this.list = []; |
| | | this.pageSize = 10; |
| | | this.isLoading = true; |
| | | this.$u.api.NuclearScaleEntry |
| | | .getWeighingOrder({ |
| | | this.$u.api.NuclearScaleEntry.getWeighingOrder({ |
| | | current: this.pageNum, |
| | | size: this.pageSize, |
| | | verificationNo: value, |
| | |
| | | |
| | | // 工具方法 |
| | | handleListResponse(res) { |
| | | console.log('API Response:', res); |
| | | console.log('Response Code:', res.code); |
| | | console.log('Response Data:', res.data); |
| | | console.log('Response Records:', res.data ? res.data.records : 'res.data is undefined'); |
| | | console.log("API Response:", res); |
| | | console.log("Response Code:", res.code); |
| | | console.log("Response Data:", res.data); |
| | | console.log( |
| | | "Response Records:", |
| | | res.data ? res.data.records : "res.data is undefined" |
| | | ); |
| | | |
| | | if (res.code != 0) { |
| | | uni.showToast({ |
| | | title: res.msg || '获取数据失败', |
| | | icon: 'none' |
| | | title: res.msg || "获取数据失败", |
| | | icon: "none", |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | if (!res.data) { |
| | | console.error('res.data is undefined'); |
| | | console.error("res.data is undefined"); |
| | | uni.showToast({ |
| | | title: '数据格式错误', |
| | | icon: 'none' |
| | | title: "数据格式错误", |
| | | icon: "none", |
| | | }); |
| | | return; |
| | | } |
| | |
| | | }, |
| | | |
| | | handleApiError(err) { |
| | | console.error('API请求失败:', err); |
| | | console.error("API请求失败:", err); |
| | | uni.showToast({ |
| | | title: '网络异常,请稍后重试', |
| | | icon: 'none' |
| | | title: "网络异常,请稍后重试", |
| | | icon: "none", |
| | | }); |
| | | }, |
| | | formatProductType(type) { |
| | | const productTypeMap = { |
| | | 1: '导体', |
| | | 2: '铜杆', |
| | | 3: '导体2.6' |
| | | DTO1: "导体", |
| | | TG01: "铜杆", |
| | | DT02: "导体2.6", |
| | | }; |
| | | return productTypeMap[type] || type; |
| | | }, |
| | |
| | | // 返回上一页 |
| | | uni.navigateBack({ |
| | | delta: 1, |
| | | }); |
| | | }, |
| | | /** |
| | | * 获取车间列表 |
| | | */ |
| | | fetchWorkshops() { |
| | | this.$u.api |
| | | .dictData({ |
| | | dictType: "workshop", |
| | | }) |
| | | .then((res) => { |
| | | console.log("获取车间列表响应:", res); |
| | | if (res.code === 0 && res.data.length > 0) { |
| | | // 改为对象映射,键为车间编码,值为车间名称 |
| | | const workshopMap = {}; |
| | | res.data.forEach((i) => { |
| | | workshopMap[i.value] = i.label; |
| | | }); |
| | | this.workshopList = workshopMap; |
| | | } else { |
| | | uni.showToast({ |
| | | title: res.msg || "获取车间列表失败", |
| | | icon: "none", |
| | | }); |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | uni.showToast({ |
| | | title: "网络错误,获取车间列表失败", |
| | | icon: "none", |
| | | }); |
| | | console.error("获取车间列表错误:", err); |
| | | }); |
| | | }, |
| | | }, |
| | |
| | | font-size: 50px; |
| | | position: relative; |
| | | bottom: 4px; |
| | | |
| | | } |
| | | |
| | | .finishProductIn-locno-bg { |
| | |
| | | .wrap .finishProductIn-locno-scroll-list { |
| | | height: calc(100vh - var(--window-top, 0) - var(--window-bottom, 0) - 242rpx); |
| | | width: 100%; |
| | | min-height: 300rpx; /* 添加最小高度确保元素始终可见 */ |
| | | min-height: 300rpx; |
| | | /* 添加最小高度确保元素始终可见 */ |
| | | } |
| | | |
| | | .finishProductIn-locno-scroll-list-group { |