|
|
|
|
@ -12,14 +12,229 @@
|
|
|
|
|
safe-area-inset-top
|
|
|
|
|
placeholder
|
|
|
|
|
/>
|
|
|
|
|
<view class="u-flex u-flex-center u-m-20">
|
|
|
|
|
<u-input
|
|
|
|
|
v-model="queryParams.name"
|
|
|
|
|
placeholder="请输入组织名称"
|
|
|
|
|
border="surround"
|
|
|
|
|
:clear-icon="true"
|
|
|
|
|
suffixIcon="search"
|
|
|
|
|
font-size="12"
|
|
|
|
|
class="u-flex u-flex-center u-m-r-20"
|
|
|
|
|
@click="getOrgWorkerList"
|
|
|
|
|
/>
|
|
|
|
|
<u-input
|
|
|
|
|
v-model="queryParams.machineId"
|
|
|
|
|
placeholder="请输入关联机台"
|
|
|
|
|
border="surround"
|
|
|
|
|
:clear-icon="true"
|
|
|
|
|
suffixIcon="search"
|
|
|
|
|
font-size="12"
|
|
|
|
|
@click="getOrgWorkerList"
|
|
|
|
|
/>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="u-flex u-flex-center u-m-l-20 u-m-r-20">
|
|
|
|
|
<uni-data-select v-model="queryParams.status" placeholder="请选择组织状态" :localdata="organizationalStatus" @click="getOrgWorkerList">
|
|
|
|
|
</uni-data-select>
|
|
|
|
|
<view class="u-m-l-20">
|
|
|
|
|
<u-button @click="getOrgWorkerList" plain style="height: 35px; background: transparent">搜索</u-button>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</u-sticky>
|
|
|
|
|
<view class="container">
|
|
|
|
|
<view class="u-menu-wrap">
|
|
|
|
|
<scroll-view scroll-y="" scroll-with-animation="" class="u-tab-view menu-scroll-view" :scroll-top="scrollTop">
|
|
|
|
|
<view v-for="(item, index) in tabbar" :key="index" class="u-tab-item"
|
|
|
|
|
:class="[current === index ? 'u-tab-item-active' : '']" :data-current="index"
|
|
|
|
|
@tap.stop="switchMenu(index)">
|
|
|
|
|
<text class="u-line-1">{{ item.text }}</text>
|
|
|
|
|
</view>
|
|
|
|
|
</scroll-view>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="orgWorkerList.length" class="wrap">
|
|
|
|
|
<view>
|
|
|
|
|
<u-list>
|
|
|
|
|
<u-list-item
|
|
|
|
|
v-for="(item, index) in orgWorkerList"
|
|
|
|
|
:key="index"
|
|
|
|
|
>
|
|
|
|
|
<view class="content" @click="tab.navigateTo('/pages/application/components/deskArrangementHandle', { orgId: item.id, orgType: item.name})">
|
|
|
|
|
<view class="u-flex u-m-t-30 u-m-b-30">
|
|
|
|
|
<view class="u-flex flex_1">组织名称:
|
|
|
|
|
<u-text type="success" :text="item.name" class="u-m-l-10" size="12"></u-text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="u-flex flex_1">组织等级:
|
|
|
|
|
<u-text type="primary" :text="findTextByValue(orgClass, item.orgClass)" class="u-flex" size="12"> </u-text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="u-flex u-m-b-30">
|
|
|
|
|
<view class="u-flex flex_1">类型:
|
|
|
|
|
<u-text type="success" :text="findTextByValue(tabbar, item.orgType)" class="u-m-l-10" size="12"></u-text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="u-flex flex_1">今日工人:
|
|
|
|
|
<u-text type="primary" :text="item.workerUserName" class="u-m-l-10" size="12"></u-text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="u-m-t-10 u-m-b-20"><u-line/></view>
|
|
|
|
|
<view class="u-flex justify-end">
|
|
|
|
|
<view v-if="item.orgClass==='workplace' && item.status==='free'" class="u-m-r-20" @click.stop="navigatorTo(item.orgType, item.id, item.name, item.workerUserName)"> <u-button type="error" plain>派工</u-button></view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</u-list-item>
|
|
|
|
|
</u-list>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-else class="flex_1"> <u-empty icon="http://cdn.uviewui.com/uview/empty/data.png" /></view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
<script setup>
|
|
|
|
|
import { ref } from 'vue'
|
|
|
|
|
import { findTextByValue, organizationalStatus } from "@/api/system/dict/data";
|
|
|
|
|
import tab from "@/plugins/tab";
|
|
|
|
|
import { getListOrgWorker } from "@/api/mes/deskArrangement";
|
|
|
|
|
import { onLoad } from "@dcloudio/uni-app";
|
|
|
|
|
import { showConfirm } from "@/utils/common";
|
|
|
|
|
|
|
|
|
|
const tabbar = ref([
|
|
|
|
|
{ text: '所有', value: ''}, { text: '制浆', value: 'zhijiang'},{ text: '成型', value: 'chengxing'},{ text: '烘干', value: 'honggan'},{ text: '转移', value: 'zhuanyi'},{ text: '加湿', value: 'jiashi'},
|
|
|
|
|
{ text: '热压',value: 'reya'},{ text: '切边',value: 'qiebian'},{ text: '品检',value: 'pinjian'},{ text: '打包',value: 'dabao'},{ text: '贴标',value: 'tiebiao'},{ text: '品印',value: 'pinyin'},{ text: '塑封',value: 'sufeng'}
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
const orgClass = ref([
|
|
|
|
|
{ text: '工位', value: 'workplace'}, { text: '工序', value: 'process'}, { text: '产线', value: 'pipeline'}, { text: '车间', value: 'workshop'}, { text: '工厂', value: 'factory'}
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
const current = ref(0)
|
|
|
|
|
const scrollTop = ref(0)
|
|
|
|
|
const menuHeight = ref(0) // 左边菜单的高度
|
|
|
|
|
const menuItemHeight = ref(0) // 左边菜单item的高度
|
|
|
|
|
|
|
|
|
|
const switchMenu = async (index)=>{
|
|
|
|
|
if (index === current.value) return;
|
|
|
|
|
current.value = index;
|
|
|
|
|
|
|
|
|
|
// 将菜单菜单活动item垂直居中
|
|
|
|
|
scrollTop.value = index * menuItemHeight.value + menuItemHeight.value / 2 - menuHeight.value / 2;
|
|
|
|
|
orgWorkerList.value = []
|
|
|
|
|
getOrgWorkerList()
|
|
|
|
|
}
|
|
|
|
|
// 获取一个目标元素的高度
|
|
|
|
|
const getElRect = (elClass, dataVal) =>{
|
|
|
|
|
new Promise(() => {
|
|
|
|
|
const query = uni.createSelectorQuery().in(this);
|
|
|
|
|
query.select('.' + elClass).fields({ size: true }, res => {
|
|
|
|
|
// 如果节点尚未生成,res值为null,循环调用执行
|
|
|
|
|
if (!res) {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
getElRect(elClass);
|
|
|
|
|
}, 10);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this[dataVal] = res.height;
|
|
|
|
|
}).exec();
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const queryParams = ref({
|
|
|
|
|
name: '',
|
|
|
|
|
machineId: '',
|
|
|
|
|
status: '',
|
|
|
|
|
orgType: '',
|
|
|
|
|
pageNo: 1
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const orgWorkerList = ref([])
|
|
|
|
|
const getOrgWorkerList = ()=> {
|
|
|
|
|
queryParams.value.orgType = tabbar.value[current.value].value
|
|
|
|
|
getListOrgWorker(queryParams.value).then(response => {
|
|
|
|
|
orgWorkerList.value = response.data
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const navigatorTo = (type, id, orgName, workerName)=>{
|
|
|
|
|
if(workerName != null && workerName.length > 0){
|
|
|
|
|
showConfirm("工位:"+orgName+",今天已经派工,确定要重新派工吗?").then(
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
tab.navigateTo('/pages/application/components/assigningWork', { orgType: type, id: id, name: orgName })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onLoad(() => {
|
|
|
|
|
getOrgWorkerList()
|
|
|
|
|
uni.$on('success', data => {
|
|
|
|
|
if (data) {
|
|
|
|
|
getOrgWorkerList();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="sass" scoped>
|
|
|
|
|
.sticky
|
|
|
|
|
background: linear-gradient(180deg, #d4e9ff 0%, #f3f9ff 100%)
|
|
|
|
|
backdrop-filter: blur(27.18px)
|
|
|
|
|
box-shadow: 0 1px 1px 0 rgba(0, 72, 145, 0.1), 0 0.5px 0 0 rgba(0, 0, 0, 0.1)
|
|
|
|
|
padding-bottom: 20rpx
|
|
|
|
|
|
|
|
|
|
.container
|
|
|
|
|
margin: 10rpx
|
|
|
|
|
background-color: #f1f1f1
|
|
|
|
|
display: flex
|
|
|
|
|
flex-grow: 1
|
|
|
|
|
|
|
|
|
|
.u-menu-wrap
|
|
|
|
|
display: flex
|
|
|
|
|
overflow: hidden
|
|
|
|
|
|
|
|
|
|
.wrap
|
|
|
|
|
flex-grow: 1
|
|
|
|
|
background-color: #f1f1f1
|
|
|
|
|
padding: 0 0 20rpx 20rpx
|
|
|
|
|
font-size: 24rpx
|
|
|
|
|
.content
|
|
|
|
|
margin: 0 0 20rpx 0
|
|
|
|
|
padding: 20rpx
|
|
|
|
|
background-color: #ffffff
|
|
|
|
|
border-radius: 10rpx
|
|
|
|
|
|
|
|
|
|
.flex_1
|
|
|
|
|
flex: 1
|
|
|
|
|
|
|
|
|
|
.u-tab-view
|
|
|
|
|
width: 120rpx
|
|
|
|
|
height: 100%
|
|
|
|
|
|
|
|
|
|
.u-tab-item
|
|
|
|
|
height: 110rpx
|
|
|
|
|
background: #f6f6f6
|
|
|
|
|
box-sizing: border-box
|
|
|
|
|
display: flex
|
|
|
|
|
align-items: center
|
|
|
|
|
justify-content: center
|
|
|
|
|
font-size: 26rpx
|
|
|
|
|
color: #444
|
|
|
|
|
font-weight: 400
|
|
|
|
|
line-height: 1
|
|
|
|
|
|
|
|
|
|
.u-tab-item-active
|
|
|
|
|
position: relative
|
|
|
|
|
color: #000
|
|
|
|
|
font-size: 30rpx
|
|
|
|
|
font-weight: 600
|
|
|
|
|
background: #ffffff
|
|
|
|
|
|
|
|
|
|
.u-tab-item-active::before
|
|
|
|
|
border-left: 4px solid #3c9cff
|
|
|
|
|
content: ""
|
|
|
|
|
position: absolute
|
|
|
|
|
height: 32rpx
|
|
|
|
|
left: 0
|
|
|
|
|
top: 39rpx
|
|
|
|
|
|
|
|
|
|
.u-tab-view
|
|
|
|
|
height: 100%
|
|
|
|
|
|
|
|
|
|
.u-button
|
|
|
|
|
height: 60rpx
|
|
|
|
|
</style>
|
|
|
|
|
|