|
@@ -1,15 +1,14 @@
|
|
<template>
|
|
<template>
|
|
- <dialog-base class="dialog-body" ref="baseDialog" title="搜索产品">
|
|
|
|
- <view class="box-bg uni-row">
|
|
|
|
- <view class="input-view uni-row">
|
|
|
|
- <uni-icons class="input-uni-icon" type="search" size="18" color="#999" />
|
|
|
|
- <input class="nav-bar-input" type="text" v-model="keywords" placeholder="请输入产品描述" />
|
|
|
|
- </view>
|
|
|
|
- <view class="search" @click="handleSearch">
|
|
|
|
- 搜索
|
|
|
|
- </view>
|
|
|
|
|
|
+ <dialog-base class="dialog-body" ref="baseDialog" title="选择工序查看箱号">
|
|
|
|
+ <view class="selectedProcess">
|
|
|
|
+ <uni-section title="选择工序" type="square">
|
|
|
|
+ <uni-data-select v-model="selectedProcess" :localdata="processList" :clear="false"
|
|
|
|
+ @change="handleProcessChange"></uni-data-select>
|
|
|
|
+ </uni-section>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="carrierList" v-for="(item,index) in carrierList">
|
|
|
|
+ <view>{{ item.carrierCode }}</view>
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
</dialog-base>
|
|
</dialog-base>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -21,17 +20,103 @@
|
|
import {
|
|
import {
|
|
store
|
|
store
|
|
} from '../../store';
|
|
} from '../../store';
|
|
|
|
+ import {
|
|
|
|
+ getAvailableCarrierList
|
|
|
|
+ } from '@/api/business/dayWork.js'
|
|
|
|
+ import {
|
|
|
|
+ getProcessList
|
|
|
|
+ } from '@/api/business/deptProcess.js'
|
|
|
|
|
|
const baseDialog = ref(null)
|
|
const baseDialog = ref(null)
|
|
|
|
+ const selectedProcess = ref(0)
|
|
|
|
+ const processList = ref([])
|
|
|
|
+ const curProcessId = ref(0)
|
|
|
|
+ const carrierList = ref([])
|
|
|
|
|
|
function open() {
|
|
function open() {
|
|
- baseDialog.value.open();
|
|
|
|
|
|
+ reset();
|
|
|
|
+ // getProcessList({
|
|
|
|
+ // deptId: store.curDeptDetails.deptId
|
|
|
|
+ // }).then(res => {
|
|
|
|
+ // if (res.code == 200) {
|
|
|
|
+ // //过滤出工序交集
|
|
|
|
+ // let filteredData = store.planDetails.processSequence.filter((item1) =>
|
|
|
|
+ // res.data.some((item2) => item2.processCode === item1.processCode)
|
|
|
|
+ // );
|
|
|
|
+ // for (let i = 0; i < filteredData.length; i++) {
|
|
|
|
+ // processList.value[i] = {
|
|
|
|
+ // text: filteredData[i].processAlias,
|
|
|
|
+ // value: filteredData[i].id
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ // console.log(processList.value)
|
|
|
|
+ // }
|
|
|
|
+ // baseDialog.value.open();
|
|
|
|
+ // })
|
|
|
|
+
|
|
|
|
+ // getAvailableCarrierList(store.planDetails.id, store.curDeptDetails.deptId).then(res => {
|
|
|
|
+ // if (res.code == 200) {
|
|
|
|
+ // carrierList.value = res.data;
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+
|
|
|
|
+ Promise.all([getProcessList({
|
|
|
|
+ deptId: store.curDeptDetails.deptId
|
|
|
|
+ }), getAvailableCarrierList({
|
|
|
|
+ planDetailId: store.planDetails.id,
|
|
|
|
+ deptId: store.curDeptDetails.deptId
|
|
|
|
+ })]).then(([res, response]) => {
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ //过滤出工序交集
|
|
|
|
+ let filteredData = store.planDetails.processSequence.filter((item1) =>
|
|
|
|
+ res.data.some((item2) => item2.processCode === item1.processCode)
|
|
|
|
+ );
|
|
|
|
+ for (let i = 0; i < filteredData.length; i++) {
|
|
|
|
+ processList.value[i] = {
|
|
|
|
+ text: filteredData[i].processAlias,
|
|
|
|
+ value: filteredData[i].id
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ console.log(processList.value)
|
|
|
|
+ }
|
|
|
|
+ carrierList.value = response.data;
|
|
|
|
+ baseDialog.value.open();
|
|
|
|
+ })
|
|
}
|
|
}
|
|
|
|
|
|
function close() {
|
|
function close() {
|
|
baseDialog.value.close()
|
|
baseDialog.value.close()
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ function reset() {
|
|
|
|
+ selectedProcess.value = 0;
|
|
|
|
+ processList.value = [];
|
|
|
|
+ curProcessId.value = 0;
|
|
|
|
+ carrierList.value = [];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function handleProcessChange() {
|
|
|
|
+ for (let i = 1; i < store.planDetails.processSequence.length; i++) {
|
|
|
|
+ if (store.planDetails.processSequence[i].id == selectedProcess.value) {
|
|
|
|
+ curProcessId.value = store.planDetails.processSequence[i - 1].id;
|
|
|
|
+ console.log(curProcessId.value)
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ getAvailableCarrierList({
|
|
|
|
+ planDetailId: store.planDetails.id,
|
|
|
|
+ deptId: store.curDeptDetails.deptId,
|
|
|
|
+ proccessId: curProcessId.value
|
|
|
|
+ }).then(res => {
|
|
|
|
+ if(res.code == 200){
|
|
|
|
+ carrierList.value = res.data;
|
|
|
|
+ }
|
|
|
|
+ console.log(res)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
defineExpose({
|
|
defineExpose({
|
|
open
|
|
open
|
|
})
|
|
})
|
|
@@ -39,52 +124,13 @@
|
|
|
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
$nav-height: 60rpx;
|
|
$nav-height: 60rpx;
|
|
-
|
|
|
|
|
|
+
|
|
.dialog-body {
|
|
.dialog-body {
|
|
- // height: 60%;
|
|
|
|
- // margin: auto auto;
|
|
|
|
overflow: auto;
|
|
overflow: auto;
|
|
- }
|
|
|
|
-
|
|
|
|
- .box-bg {
|
|
|
|
- width: 94%;
|
|
|
|
- background-color: #F5F5F5;
|
|
|
|
- padding: 5rpx 16rpx;
|
|
|
|
- justify-content: space-around;
|
|
|
|
- align-items: center;
|
|
|
|
- margin: 24rpx auto 0;
|
|
|
|
-
|
|
|
|
- .input-view {
|
|
|
|
- width: 100%;
|
|
|
|
- flex: 4;
|
|
|
|
- background-color: #f8f8f8;
|
|
|
|
- height: $nav-height;
|
|
|
|
- border: 1rpx solid #999;
|
|
|
|
- border-radius: 15rpx;
|
|
|
|
- padding: 0 15rpx;
|
|
|
|
- flex-wrap: nowrap;
|
|
|
|
- margin: 0 10rpx 0;
|
|
|
|
- line-height: $nav-height;
|
|
|
|
-
|
|
|
|
- .input-uni-icon {
|
|
|
|
- line-height: $nav-height;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .nav-bar-input {
|
|
|
|
- width: 80%;
|
|
|
|
- height: $nav-height;
|
|
|
|
- line-height: $nav-height;
|
|
|
|
- padding: 0 5rpx;
|
|
|
|
- background-color: #f8f8f8;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .search {
|
|
|
|
- width: 20%;
|
|
|
|
- text-align: center;
|
|
|
|
- color: #808080;
|
|
|
|
|
|
+
|
|
|
|
+ .selectedProcess {
|
|
|
|
+ width: 88%;
|
|
|
|
+ margin: 20rpx auto 40rpx;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
</style>
|
|
</style>
|