|
@@ -1,7 +1,7 @@
|
|
<template>
|
|
<template>
|
|
<dialog-base class="dialog-body" ref="baseDialog" title="添加新批次">
|
|
<dialog-base class="dialog-body" ref="baseDialog" title="添加新批次">
|
|
<view class="prompt">
|
|
<view class="prompt">
|
|
- <text>请选择批次再确认</text>
|
|
|
|
|
|
+ <text>请选择工序、批次后再确认</text>
|
|
</view>
|
|
</view>
|
|
<uni-section title="请选择当前工序" type="square">
|
|
<uni-section title="请选择当前工序" type="square">
|
|
<uni-data-select v-model="selectedProcess" :localdata="processList" :clear="false"
|
|
<uni-data-select v-model="selectedProcess" :localdata="processList" :clear="false"
|
|
@@ -28,7 +28,7 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="add-btn-container uni-row">
|
|
<view class="add-btn-container uni-row">
|
|
- <button type="primary" class="btn" @click="handleConfirm" :disabled="flag">确认</button>
|
|
|
|
|
|
+ <button type="primary" class="btn" @click="handleConfirm">确认</button>
|
|
</view>
|
|
</view>
|
|
</dialog-base>
|
|
</dialog-base>
|
|
</template>
|
|
</template>
|
|
@@ -41,16 +41,17 @@
|
|
import {
|
|
import {
|
|
getProcessList
|
|
getProcessList
|
|
} from '@/api/business/deptProcess.js'
|
|
} from '@/api/business/deptProcess.js'
|
|
|
|
+ import { store } from '@/store/index.js'
|
|
|
|
|
|
const baseDialog = ref(null)
|
|
const baseDialog = ref(null)
|
|
const selectedButton = ref(null)
|
|
const selectedButton = ref(null)
|
|
const form = ref({})
|
|
const form = ref({})
|
|
const emit = defineEmits(['submit'])
|
|
const emit = defineEmits(['submit'])
|
|
const selection = ref([])
|
|
const selection = ref([])
|
|
- const flag = ref(true)
|
|
|
|
const selectedProcess = ref(null)
|
|
const selectedProcess = ref(null)
|
|
const processList = ref([])
|
|
const processList = ref([])
|
|
|
|
|
|
|
|
+
|
|
const open = (data) => {
|
|
const open = (data) => {
|
|
// console.log(dialog.value)
|
|
// console.log(dialog.value)
|
|
form.value = data;
|
|
form.value = data;
|
|
@@ -67,7 +68,6 @@
|
|
})
|
|
})
|
|
|
|
|
|
function getProcesses() {
|
|
function getProcesses() {
|
|
- console.log("11111111111111111111111")
|
|
|
|
getProcessList({
|
|
getProcessList({
|
|
deptId: store.curDeptDetails.deptId,
|
|
deptId: store.curDeptDetails.deptId,
|
|
}).then(res => {
|
|
}).then(res => {
|
|
@@ -82,21 +82,31 @@
|
|
value: filteredData[i].processId
|
|
value: filteredData[i].processId
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- selectedProcess.value = filteredData[0].processId;
|
|
|
|
- console.log(processList.value)
|
|
|
|
|
|
+ // selectedProcess.value = filteredData[0].processId;
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
function handleProcessChange(){
|
|
function handleProcessChange(){
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
function handleConfirm() {
|
|
function handleConfirm() {
|
|
- console.log(selection.value)
|
|
|
|
- // close();
|
|
|
|
- // emit('submit', selection.value);
|
|
|
|
- // uni.$emit('dayworkItemUpdate');
|
|
|
|
|
|
+ // 添加选择的工序
|
|
|
|
+ for (let i = 0; i < selection.value.length; i++) {
|
|
|
|
+ selection.value[i].daywork.processId = selectedProcess.value;
|
|
|
|
+ }
|
|
|
|
+ // 执行确认
|
|
|
|
+ if(selectedProcess.value && selection.value.length > 0){
|
|
|
|
+ close();
|
|
|
|
+ emit('submit', selection.value);
|
|
|
|
+ uni.$emit('dayworkItemUpdate');
|
|
|
|
+ }else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ title: '请选择工序、批次后再确认'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
function isSelected(item) {
|
|
function isSelected(item) {
|
|
@@ -111,7 +121,6 @@
|
|
selection.value.push(item); // 选中
|
|
selection.value.push(item); // 选中
|
|
}
|
|
}
|
|
console.log(selection.value, "selection");
|
|
console.log(selection.value, "selection");
|
|
- flag.value = selection.value.length > 0 ? false : true;
|
|
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
@@ -133,7 +142,7 @@
|
|
}
|
|
}
|
|
|
|
|
|
.prompt {
|
|
.prompt {
|
|
- color: #999;
|
|
|
|
|
|
+ color: red;
|
|
margin: 8rpx auto 0;
|
|
margin: 8rpx auto 0;
|
|
}
|
|
}
|
|
|
|
|