From 3878c57a2bd710295931303ea85439a596838dfd Mon Sep 17 00:00:00 2001
From: Mr.Shi <1878285526@qq.com>
Date: 星期二, 05 九月 2023 16:01:31 +0800
Subject: [PATCH] 小程序
---
minipro_standard/pages_adjust/pages/transferList/transferList.vue | 480 +++++++++++++++++++++++++----------------------------------
1 files changed, 206 insertions(+), 274 deletions(-)
diff --git a/minipro_standard/pages_adjust/pages/transferList/transferList.vue b/minipro_standard/pages_adjust/pages/transferList/transferList.vue
index 411c87c..e2903f8 100644
--- a/minipro_standard/pages_adjust/pages/transferList/transferList.vue
+++ b/minipro_standard/pages_adjust/pages/transferList/transferList.vue
@@ -1,17 +1,18 @@
<template>
<view class="content">
<view class="content_search">
- <Search @searchInput="searchInput" @submit="submit" @reset="reset" :isShow="true"
- placeholder="鎼滅储杞簱鍗曞彿">
+ <Search @searchInput="searchInput" @submit="submit" @reset="reset" :isShow="true" placeholder="鎼滅储杞簱鍗曞彿">
<template v-slot:content>
<view class="Search_item">
<view class="Search_item_label">璁″垝鏃ユ湡</view>
<view class="Search_item_content" @click="openDate">
- <view class="Search_item_content_a" :style="listData.startDate ? 'color: #000' : ''">
- {{ listData.startDate ? listData.startDate : '寮�濮嬫棩鏈�'}}</view>
+ <view class="Search_item_content_a" :style="listData.outPlanDateStart ? 'color: #000' : ''">
+ {{ listData.outPlanDateStart ? listData.outPlanDateStart : '寮�濮嬫棩鏈�'}}
+ </view>
<text>-</text>
- <view class="Search_item_content_a" :style="listData.endDate ? 'color: #000' : ''">
- {{ listData.endDate ? listData.endDate : '缁撴潫鏃ユ湡'}}</view>
+ <view class="Search_item_content_a" :style="listData.outPlanDateEnd ? 'color: #000' : ''">
+ {{ listData.outPlanDateEnd ? listData.outPlanDateEnd : '缁撴潫鏃ユ湡'}}
+ </view>
</view>
</view>
<view class="Search_item">
@@ -30,7 +31,14 @@
</view>
<view class="content_total" :style="{top: top}">鍏眥{listData.total}}鏉℃暟鎹�</view>
<view class="content_list">
- <scroll-view @scrolltolower="getLists" scroll-y :style="{height: height}">
+ <scroll-view
+ :refresher-enabled="true"
+ :refresher-triggered="isLoading"
+ @refresherrefresh="onRefresh"
+ refresher-background="#fff"
+ @scrolltolower="getLists"
+ scroll-y
+ :style="{height: height}">
<view class="content_list_item" v-for="(item, i) in lists" :key="i" @click="jump(item)">
<!-- item澶撮儴瑙嗗浘 -->
<view class="content_list_item_top">
@@ -95,13 +103,20 @@
</scroll-view>
</view>
<!-- 閫夋嫨鏃ユ湡 -->
- <u-calendar :show="timeShow" @close="timeShow = false" @confirm="timeConfirm"></u-calendar>
+ <u-calendar
+ :show="timeShow"
+ mode="range"
+ @close="timeShow = false"
+ :minDate="minDate"
+ :maxDate="maxDate"
+ @confirm="timeConfirm"></u-calendar>
</view>
</template>
<script>
import Search from '@/components/Search.vue'
import LabelSelection from '@/components/LabelSelection.vue'
+ import { getTransferList, ZKPageCount } from "@/util/api/materialStorage";
export default {
components: {
Search,
@@ -111,23 +126,20 @@
return {
height: '',
top: '',
+ isLoading: false,
listData: {
capacity: 10,
page: 0,
total: 0,
- startDate: '',
- endDate: '',
- procedureIds: [],
- departIds: '',
- mixParam: '',
- cateIds: []
+ outPlanDateEnd: "",
+ outPlanDateStart: "",
+ code: "",
+ type: "",
+ status: ""
},
- types: [
- // { name: '鍏ㄩ儴', id: '', isActive: false },
- // { name: '杞﹂棿棰嗘枡', id: '1', isActive: false },
- // { name: '杞﹂棿澶囨枡', id: '2', isActive: false },
- // { name: '鍏朵粬', id: '3', isActive: false },
- {
+ minDate: new Date('2021-01-31'),
+ maxDate: new Date(),
+ types: [{
name: '杞﹂棿棰嗘枡',
id: '1',
isActive: false
@@ -218,25 +230,78 @@
isActive: false
}
],
- orderType: [
- { name: '杞﹂棿棰嗘枡', id: 1 },
- { name: '璁″垝棰嗘枡', id: 2 },
- { name: '鏈哄彴澶囨枡', id: 3 },
- { name: '瀹屽伐鍏ュ簱', id: 4 },
- { name: '杞﹂棿杞簱', id: 5 },
- { name: '澶栧崗棰嗘枡杞簱', id: 6 },
- { name: '澶栧崗瀹屽伐杞簱', id: 7 },
- { name: '浜у搧鍏ュ簱', id: 8 },
- { name: '浜у搧杞簱', id: 9 },
- { name: '璁╂鏀捐鍏ュ簱', id: 10 },
- { name: '璁╂鏀捐杞簱', id: 11 },
- { name: '瀹㈣繑杩斾慨棰嗘枡', id: 12 },
- { name: '瀹㈣繑杩斾慨鍏ュ簱', id: 13 },
- { name: '璺ㄧ粍缁囪浆搴�', id: 14 },
- { name: '宸ュ簭鎶ュ簾', id: 15 },
- { name: '瀹㈤��杩斾慨棰嗘枡', id: 16 },
- { name: '瀹㈤��杩斾慨鍏ュ簱', id: 17 },
- { name: '搴熷搧鍏ュ簱', id: 30 }
+ orderType: [{
+ name: '杞﹂棿棰嗘枡',
+ id: 1
+ },
+ {
+ name: '璁″垝棰嗘枡',
+ id: 2
+ },
+ {
+ name: '鏈哄彴澶囨枡',
+ id: 3
+ },
+ {
+ name: '瀹屽伐鍏ュ簱',
+ id: 4
+ },
+ {
+ name: '杞﹂棿杞簱',
+ id: 5
+ },
+ {
+ name: '澶栧崗棰嗘枡杞簱',
+ id: 6
+ },
+ {
+ name: '澶栧崗瀹屽伐杞簱',
+ id: 7
+ },
+ {
+ name: '浜у搧鍏ュ簱',
+ id: 8
+ },
+ {
+ name: '浜у搧杞簱',
+ id: 9
+ },
+ {
+ name: '璁╂鏀捐鍏ュ簱',
+ id: 10
+ },
+ {
+ name: '璁╂鏀捐杞簱',
+ id: 11
+ },
+ {
+ name: '瀹㈣繑杩斾慨棰嗘枡',
+ id: 12
+ },
+ {
+ name: '瀹㈣繑杩斾慨鍏ュ簱',
+ id: 13
+ },
+ {
+ name: '璺ㄧ粍缁囪浆搴�',
+ id: 14
+ },
+ {
+ name: '宸ュ簭鎶ュ簾',
+ id: 15
+ },
+ {
+ name: '瀹㈤��杩斾慨棰嗘枡',
+ id: 16
+ },
+ {
+ name: '瀹㈤��杩斾慨鍏ュ簱',
+ id: 17
+ },
+ {
+ name: '搴熷搧鍏ュ簱',
+ id: 30
+ }
],
tagList: [{
id: "",
@@ -262,120 +327,13 @@
id: "3",
name: "宸插彇娑�",
num: "12",
- }
+ },
],
- data: [], // 宸ュ簭鏁版嵁
- factoryList: [],
- finished: true,
+ finished: false,
loading: false,
refreshing: false,
timeShow: false,
- lists: [{
- id: 1,
- status: 0,
- urgent: 1,
- num: 100,
- batch: '11111',
- planDate: '2023-08-29',
- mmodel: {
- name: '宸ュ簭璁″垝',
- code: 'fbdseasafghb'
- },
- usermodel: {
- realname: '璁″垝浜哄憳'
- },
- pmodel: {
- name: '宸ュ簭璁″垝'
- },
- fmodel: {
- name: '宸ュ巶'
- }
- },
- {
- id: 2,
- status: 0,
- urgent: 1,
- num: 100,
- batch: '11111',
- planDate: '2023-08-29',
- mmodel: {
- name: '宸ュ簭璁″垝',
- code: 'fbdseasafghb'
- },
- usermodel: {
- realname: '璁″垝浜哄憳'
- },
- pmodel: {
- name: '宸ュ簭璁″垝'
- },
- fmodel: {
- name: '宸ュ巶'
- }
- },
- {
- id: 3,
- status: 0,
- urgent: 1,
- num: 100,
- batch: '11111',
- planDate: '2023-08-29',
- mmodel: {
- name: '宸ュ簭璁″垝',
- code: 'fbdseasafghb'
- },
- usermodel: {
- realname: '璁″垝浜哄憳'
- },
- pmodel: {
- name: '宸ュ簭璁″垝'
- },
- fmodel: {
- name: '宸ュ巶'
- }
- },
- {
- id: 4,
- status: 0,
- urgent: 1,
- num: 100,
- batch: '11111',
- planDate: '2023-08-29',
- mmodel: {
- name: '宸ュ簭璁″垝',
- code: 'fbdseasafghb'
- },
- usermodel: {
- realname: '璁″垝浜哄憳'
- },
- pmodel: {
- name: '宸ュ簭璁″垝'
- },
- fmodel: {
- name: '宸ュ巶'
- }
- },
- {
- id: 5,
- status: 0,
- urgent: 1,
- num: 100,
- batch: '11111',
- planDate: '2023-08-29',
- mmodel: {
- name: '宸ュ簭璁″垝',
- code: 'fbdseasafghb'
- },
- usermodel: {
- realname: '璁″垝浜哄憳'
- },
- pmodel: {
- name: '宸ュ簭璁″垝'
- },
- fmodel: {
- name: '宸ュ巶'
- }
- }
- ]
+ lists: []
};
},
onReady() {
@@ -386,6 +344,10 @@
that.top = `${rect.height}px`
}).exec()
})
+ },
+ onLoad() {
+ this.getLists();
+ this.getZKPageCount()
},
methods: {
tyepToStr(type) {
@@ -400,8 +362,17 @@
// 璺宠浆
jump(item) {
uni.navigateTo({
- url: `/pages/planDetails/planDetails?id=${item.id}`
+ url: `/pages_adjust/pages/warehousingDetails/warehousingDetails?id=${item.id}`
})
+ },
+ // 涓嬫媺鍒锋柊浼樺寲椤甸潰
+ onRefresh() {
+ this.isLoading = true
+ this.finished = false;
+ this.listData.page = 0
+ this.loading = true;
+ this.getLists();
+ this.getZKPageCount()
},
// 鑾峰彇澶撮儴缁勪欢楂樺害
getHeight(height) {
@@ -409,41 +380,56 @@
},
// 閲嶇疆
reset() {
- this.listData.page = 0
- this.finished = false
- this.lists = []
- this.listData.mixParam = ''
- this.listData.startDate = ''
- this.listData.endDate = ''
- this.listData.procedureIds = []
- if (this.factoryList.length > 0) {
- this.listData.departIds = this.factoryList[0].id
- }
- if (this.data.length > 0) {
- this.data.forEach(item => {
- item.isActive = false
- })
- }
- // this.getLists()
- // this.pageCounts()
+ this.listData.code = '';
+ this.listData.page = 0;
+ this.finished = false;
+ this.lists = [];
+ this.listData.type = ''
+ this.listData.outPlanDateEnd = ''
+ this.listData.outPlanDateStart = ''
+ this.types.forEach((item) => {
+ item.isActive = false
+ })
+ this.getLists()
+ this.getZKPageCount()
},
+ // 缁熻鎬绘暟
+ getZKPageCount() {
+ ZKPageCount({
+ code: this.listData.code,
+ outPlanDateEnd: this.listData.outPlanDateEnd,
+ outPlanDateStart: this.listData.outPlanDateStart,
+ type: this.listData.type
+ }).then(res => {
+ if (res.code === 200) {
+ this.tagList[0].num = res.data.allNum
+ this.tagList[1].num = res.data.startNum
+ this.tagList[2].num = res.data.outNum
+ this.tagList[3].num = res.data.inNum
+ this.tagList[4].num = res.data.cancelNum
+ }
+ })
+ },
+ loadData() {
+ this.getLists()
+ },
+
// 鏃ユ湡纭畾
timeConfirm(val) {
- this.listData.startDate = val[0]
- this.listData.endDate = val[val.length - 1]
+ this.listData.outPlanDateStart = val[0]
+ this.listData.outPlanDateEnd = val[val.length - 1]
this.timeShow = false
},
// 鍒囨崲宸ュ巶
- changeTags(i, id) {
- this.listData.departIds = id
- this.getWorkingProcedures(id)
- this.factoryList.forEach((item, index) => {
- if (index === i) {
- item.isActive = true
- } else {
+ changeTags(i) {
+ this.types[i].isActive = !this.types[i].isActive;
+ this.listData.type = this.types[i].id
+ for (const index in this.types) {
+ if (index != i) {
+ const item = this.types[index]
item.isActive = false
}
- })
+ }
},
// 鎵撳紑鏃ユ湡鎻掍欢
openDate() {
@@ -451,133 +437,79 @@
},
// 鎼滅储
searchInput(val) {
- this.listData.mixParam = val
+ this.listData.code = val
this.listData.page = 0
this.finished = false
this.lists = []
this.getLists()
+ this.getZKPageCount()
},
// 鐐瑰嚮鏍囩鎼滅储
clickTag(ids) {
- this.listData.cateIds = ids
- this.listData.page = 0
- this.finished = false
- this.lists = []
- // this.getLists()
- },
- // 鑾峰彇鍒楄〃缁熻
- pageCounts() {
- pageCount({
- factoryId: this.listData.departIds,
- procedureIdList: this.listData.procedureIds ? this.listData.procedureIds : [],
- startDate: this.listData.startDate,
- endDate: this.listData.endDate,
- statusList: this.listData.cateIds
- }).then(res => {
- if (res.code === 200 && res.data) {
- this.tagList[0].num = res.data.allNum.toString()
- this.tagList[1].num = res.data.startNum.toString()
- this.tagList[2].num = res.data.ingNum.toString()
- this.tagList[3].num = res.data.endNum.toString()
- }
- })
- },
- // 鑾峰彇宸ュ巶鏁版嵁
- getOrganizations() {
- getOrganization({
- type: 1
- }).then(res => {
- if (res.code === 200 && res.data && res.data.length !== 0) {
- res.data.forEach((item, i) => {
- item.isActive = i === 0;
- })
- if (res.data.length > 0) {
- this.factoryList = res.data
- this.listData.departIds = this.factoryList[0].id
- this.listData.procedureIds = ''
- this.finished = false
- this.getWorkingProcedures(this.factoryList[0].id)
- this.getLists()
- this.pageCounts()
- }
- }
- })
- },
- // 鑾峰彇宸ュ簭鏁版嵁
- getWorkingProcedures(orgId) {
- this.data = []
- getWorkingProcedure({
- orgId
- })
- .then(res => {
- if (res.code === 200 && res.data && res.data.length !== 0) {
- res.data.forEach((item, i) => {
- item.isActive = false;
- })
- this.data = res.data
- }
- })
+ this.listData.status = ids
+ this.listData.page = 0;
+ this.finished = false;
+ this.lists = [];
+ this.getLists()
},
// 鎼滅储寮规鎻愪氦
submit() {
- let pmodelOrgId = []
- this.data.forEach((item) => {
- if (item.isActive) {
- pmodelOrgId.push(item.id)
- }
- })
- this.listData.procedureIds = pmodelOrgId
- this.listData.page = 0
- this.finished = false
- this.lists = []
- // this.getLists()
- // this.pageCounts()
+ this.listData.page = 0;
+ this.finished = false;
+ this.lists = [];
+ this.getLists();
+ this.getZKPageCount()
},
// 鑾峰彇璁″垝鍒楄〃鏁版嵁
getLists() {
- console.log('getLists')
if (!this.finished) {
- this.loading = true
- this.listData.page = this.listData.page++
- getList({
+ this.loading = true;
+ this.listData.page = this.listData.page += 1;
+ getTransferList({
capacity: this.listData.capacity,
model: {
- mixParam: this.listData.mixParam,
- startDate: this.listData.startDate,
- endDate: this.listData.endDate,
- procedureIdList: this.listData.procedureIds ? this.listData.procedureIds : [],
- factoryId: this.listData.departIds,
- statusList: this.listData.cateIds
+ code: this.listData.code,
+ outPlanDateEnd: this.listData.outPlanDateEnd,
+ outPlanDateStart: this.listData.outPlanDateStart,
+ type: this.listData.type,
+ status: this.listData.status
},
page: this.listData.page,
sorts: [{
- direction: 'ASC',
- property: 'publishDate'
- }]
- }).then(res => {
- this.loading = false
- this.listData.total = res.data.total
+ direction: "ASC",
+ property: "publishDate",
+ }, ],
+ })
+ .then((res) => {
+ this.isLoading = false
if (this.refreshing) {
this.lists = []
this.refreshing = false;
}
- if (res.code === 200 && res.data.records.length !== 0) {
- if (this.lists.length === 0) {
- this.lists = res.data.records
- } else {
- this.lists.push(...res.data.records)
+ this.loading = false;
+ this.listData.total = res.data.total;
+ if (res.code === 200) {
+ if (res.data.records.length < this.listData.capacity) {
+ this.finished = true;
}
- } else {
- this.finished = true
+ if (this.listData.page === 1) {
+ this.lists = res.data.records;
+ } else {
+ this.lists.push(...res.data.records);
+ }
}
- }).catch(err => {
- this.loading = false
- this.finished = true
+ })
+ .catch((err) => {
+ this.isLoading = false
+ this.loading = false;
+ this.finished = true;
if (this.refreshing) {
this.lists = []
this.refreshing = false;
}
})
+ } else {
+ this.isLoading = false
}
}
}
--
Gitblit v1.9.3