|
@@ -8,6 +8,20 @@
|
|
<!-- 待周转页面 -->
|
|
<!-- 待周转页面 -->
|
|
<view class="padding-container" v-if='selectedInfo.id == 4'>
|
|
<view class="padding-container" v-if='selectedInfo.id == 4'>
|
|
<view class="scroll-container">
|
|
<view class="scroll-container">
|
|
|
|
+ <!-- <uni-section title="本地数据" type="line" padding style="height: calc(100vh - 100px);"> -->
|
|
|
|
+ <!-- <uni-data-picker placeholder="请选车间与周转区" popup-title="请选择所在车间与周转区" :localdata="dataTree"
|
|
|
|
+ v-model="classes" @change="onchange" @nodeclick="onnodeclick" @popupopened="onpopupopened"
|
|
|
|
+ @popupclosed="onpopupclosed">
|
|
|
|
+ </uni-data-picker> -->
|
|
|
|
+ <view
|
|
|
|
+ style="font-size: 30rpx;font-weight: bold; flex-direction: row; display: inline-block; line-height: 35px; height: 38px;">
|
|
|
|
+ <uni-data-select v-model="workshopId" :localdata="dataTree" :clear="true" placeholder="请选择车间"
|
|
|
|
+ @change="handleSelectedWorkshopChange" style="background-color: #ffffff;"></uni-data-select>
|
|
|
|
+ <uni-data-select v-model="turnoverId" :localdata="dataChildren" :clear="true" plac
|
|
|
|
+ placeholder="请选择周转区" @change="handleSelectedTurnoverIdChange"
|
|
|
|
+ style="background-color: #ffffff;"></uni-data-select>
|
|
|
|
+ </view>
|
|
|
|
+ <!-- </uni-section> -->
|
|
<view v-if="listData.length == 0" style="color: #999;margin: 50% auto;">
|
|
<view v-if="listData.length == 0" style="color: #999;margin: 50% auto;">
|
|
<text>暂无待周转批次</text>
|
|
<text>暂无待周转批次</text>
|
|
</view>
|
|
</view>
|
|
@@ -199,10 +213,15 @@
|
|
import {
|
|
import {
|
|
getDictInfoByType
|
|
getDictInfoByType
|
|
} from '@/api/dict/dict.js'
|
|
} from '@/api/dict/dict.js'
|
|
|
|
+ import {
|
|
|
|
+ getTreeData
|
|
|
|
+ } from '@/api/business/workshop.js'
|
|
import {
|
|
import {
|
|
store
|
|
store
|
|
} from '../../store'
|
|
} from '../../store'
|
|
-
|
|
|
|
|
|
+ const classes = ref(null)
|
|
|
|
+ const dataTree = ref([])
|
|
|
|
+ const dataChildren = ref([])
|
|
|
|
|
|
const sum = ref(0)
|
|
const sum = ref(0)
|
|
const pendingClass = ref({
|
|
const pendingClass = ref({
|
|
@@ -224,6 +243,8 @@
|
|
const lotList = ref([])
|
|
const lotList = ref([])
|
|
const deliveredList = ref([])
|
|
const deliveredList = ref([])
|
|
const showRight = ref(null) // 抽屉
|
|
const showRight = ref(null) // 抽屉
|
|
|
|
+ const workshopId = ref(null)
|
|
|
|
+ const turnoverId = ref(null)
|
|
const statusList = ref([{
|
|
const statusList = ref([{
|
|
"id": 4,
|
|
"id": 4,
|
|
"name": "待周转"
|
|
"name": "待周转"
|
|
@@ -244,8 +265,19 @@
|
|
|
|
|
|
onShow(() => {
|
|
onShow(() => {
|
|
init();
|
|
init();
|
|
|
|
+ getWorkShops()
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+ function getWorkShops() {
|
|
|
|
+ console.log('getWorkShops')
|
|
|
|
+ getTreeData().then(res => {
|
|
|
|
+ console.log(res)
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ dataTree.value = res.data
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
function init() {
|
|
function init() {
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
title: '加载中'
|
|
title: '加载中'
|
|
@@ -253,14 +285,16 @@
|
|
Promise.all([getItemList({
|
|
Promise.all([getItemList({
|
|
status: 4,
|
|
status: 4,
|
|
//turnoverType设置值是为了筛选掉车间内周转
|
|
//turnoverType设置值是为了筛选掉车间内周转
|
|
- turnoverType:1
|
|
|
|
|
|
+ workshopId: workshopId.value,
|
|
|
|
+ turnoverId: turnoverId.value,
|
|
|
|
+ turnoverType: 1
|
|
}), getItemList({
|
|
}), getItemList({
|
|
status: 5,
|
|
status: 5,
|
|
- turnoverType:1,
|
|
|
|
|
|
+ turnoverType: 1,
|
|
updaterId: store.userInfo.userId
|
|
updaterId: store.userInfo.userId
|
|
}), getItemList({
|
|
}), getItemList({
|
|
status: 7,
|
|
status: 7,
|
|
- turnoverType:1,
|
|
|
|
|
|
+ turnoverType: 1,
|
|
updaterId: store.userInfo.userId
|
|
updaterId: store.userInfo.userId
|
|
})])
|
|
})])
|
|
.then(([res1, res2, res3]) => {
|
|
.then(([res1, res2, res3]) => {
|
|
@@ -398,48 +432,48 @@
|
|
duration: 2000
|
|
duration: 2000
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
- // 设置周转状态
|
|
|
|
- for (let i = 0; i < selection.value.length; i++) {
|
|
|
|
- selection.value[i].status = status;
|
|
|
|
- }
|
|
|
|
- if (isBack) {
|
|
|
|
- updateBatchBack(selection.value).then(res => {
|
|
|
|
- if (res.code === 200) {
|
|
|
|
- uni.showToast({
|
|
|
|
- icon: 'success',
|
|
|
|
- title: '操作成功',
|
|
|
|
- duration: 2000
|
|
|
|
- });
|
|
|
|
- reflush();
|
|
|
|
- } else {
|
|
|
|
- uni.showToast({
|
|
|
|
- icon: 'none',
|
|
|
|
- title: '操作失败',
|
|
|
|
- duration: 2000
|
|
|
|
- });
|
|
|
|
|
|
+ // 设置周转状态
|
|
|
|
+ for (let i = 0; i < selection.value.length; i++) {
|
|
|
|
+ selection.value[i].status = status;
|
|
}
|
|
}
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- updateDayWorkItemBatch(selection.value).then(res => {
|
|
|
|
- if (res.code === 200) {
|
|
|
|
- uni.showToast({
|
|
|
|
- icon: 'success',
|
|
|
|
- title: '操作成功',
|
|
|
|
- duration: 2000
|
|
|
|
- });
|
|
|
|
- reflush();
|
|
|
|
|
|
+ if (isBack) {
|
|
|
|
+ updateBatchBack(selection.value).then(res => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'success',
|
|
|
|
+ title: '操作成功',
|
|
|
|
+ duration: 2000
|
|
|
|
+ });
|
|
|
|
+ reflush();
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ title: '操作失败',
|
|
|
|
+ duration: 2000
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ })
|
|
} else {
|
|
} else {
|
|
- uni.showToast({
|
|
|
|
- icon: 'none',
|
|
|
|
- title: '操作失败',
|
|
|
|
- duration: 2000
|
|
|
|
- });
|
|
|
|
|
|
+ updateDayWorkItemBatch(selection.value).then(res => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'success',
|
|
|
|
+ title: '操作成功',
|
|
|
|
+ duration: 2000
|
|
|
|
+ });
|
|
|
|
+ reflush();
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ title: '操作失败',
|
|
|
|
+ duration: 2000
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
- })
|
|
|
|
- }
|
|
|
|
- // 清空选中数组
|
|
|
|
- selection.value = [];
|
|
|
|
- }
|
|
|
|
|
|
+ // 清空选中数组
|
|
|
|
+ selection.value = [];
|
|
|
|
+ }
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
@@ -499,6 +533,52 @@
|
|
function singleSelectd(item) {
|
|
function singleSelectd(item) {
|
|
return selectedInfo.value == item
|
|
return selectedInfo.value == item
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ function onchange(e) {
|
|
|
|
+ // console.log(e)
|
|
|
|
+ // console.log(classes.value)
|
|
|
|
+ if (e.detail.value.length == 0) {
|
|
|
|
+ workshopId.value = null
|
|
|
|
+ turnoverId.value = null
|
|
|
|
+ } else if (e.detail.value.length == 1) {
|
|
|
|
+ workshopId.value = classes.value
|
|
|
|
+ turnoverId.value = null
|
|
|
|
+ } else if (e.detail.value.length == 2) {
|
|
|
|
+ turnoverId.value = classes.value
|
|
|
|
+ }
|
|
|
|
+ console.log(workshopId.value)
|
|
|
|
+ console.log(turnoverId.value)
|
|
|
|
+ reflush()
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function onpopupopened(e) {
|
|
|
|
+ // console.log('popupopend', e)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function onpopupclosed(e) {
|
|
|
|
+ // console.log('onpopupclosed', e)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function onnodeclick(e) {
|
|
|
|
+ // console.log('nodeclick', e)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function handleSelectedWorkshopChange() {
|
|
|
|
+ const item = dataTree.value.find(e => e.value == workshopId.value)
|
|
|
|
+ if (item != null) {
|
|
|
|
+ dataChildren.value = item.children
|
|
|
|
+ const currentItem = dataChildren.value.find(e => e.value == turnoverId.value)
|
|
|
|
+ turnoverId.value = currentItem != null ? turnoverId.value : null
|
|
|
|
+ } else {
|
|
|
|
+ turnoverId.value = null
|
|
|
|
+ dataChildren.value = []
|
|
|
|
+ }
|
|
|
|
+ reflush()
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function handleSelectedTurnoverIdChange() {
|
|
|
|
+ reflush()
|
|
|
|
+ }
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|