|
@@ -68,7 +68,7 @@
|
|
width="400px"
|
|
width="400px"
|
|
append-to-body
|
|
append-to-body
|
|
draggable
|
|
draggable
|
|
- @close="cancel"
|
|
|
|
|
|
+ @close="processClose"
|
|
>
|
|
>
|
|
<el-form style="padding: 16px" :inline="true">
|
|
<el-form style="padding: 16px" :inline="true">
|
|
<el-form-item label="工序:">
|
|
<el-form-item label="工序:">
|
|
@@ -102,7 +102,7 @@
|
|
<template #footer>
|
|
<template #footer>
|
|
<div class="dialog-footer">
|
|
<div class="dialog-footer">
|
|
<el-button type="primary" @click="handleProcess">确 定</el-button>
|
|
<el-button type="primary" @click="handleProcess">确 定</el-button>
|
|
- <el-button @click="cancel">取 消</el-button>
|
|
|
|
|
|
+ <el-button @click="processClose">取 消</el-button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
@@ -110,6 +110,7 @@
|
|
<script setup>
|
|
<script setup>
|
|
import { getDayworkItemProcess } from "@/api/business/daywork.js";
|
|
import { getDayworkItemProcess } from "@/api/business/daywork.js";
|
|
import { getProcessList } from "@/api/business/technologicalAmend.js";
|
|
import { getProcessList } from "@/api/business/technologicalAmend.js";
|
|
|
|
+import { ref } from "vue";
|
|
|
|
|
|
/** 变量 */
|
|
/** 变量 */
|
|
const visible = ref(false);
|
|
const visible = ref(false);
|
|
@@ -119,7 +120,8 @@ const ids = ref([]); //多选框选中数据
|
|
const click = ref(true); //按钮不可点
|
|
const click = ref(true); //按钮不可点
|
|
const processList = ref([]); //工序列表
|
|
const processList = ref([]); //工序列表
|
|
const process = ref({}); //新增工序
|
|
const process = ref({}); //新增工序
|
|
-const lot = ref({});
|
|
|
|
|
|
+const lot = ref({}); //批次信息
|
|
|
|
+const dayworkItem = ref({}); //报工信息
|
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
|
|
@@ -131,7 +133,8 @@ function open(id) {
|
|
visible.value = true;
|
|
visible.value = true;
|
|
loading.value = true;
|
|
loading.value = true;
|
|
getDayworkItemProcess(id).then((res) => {
|
|
getDayworkItemProcess(id).then((res) => {
|
|
- lot.value = res.data.item;
|
|
|
|
|
|
+ lot.value = res.data.lot;
|
|
|
|
+ dayworkItem.value = res.data.dayworkItem;
|
|
processList.value = res.data.processDetails;
|
|
processList.value = res.data.processDetails;
|
|
loading.value = false;
|
|
loading.value = false;
|
|
});
|
|
});
|
|
@@ -153,26 +156,32 @@ function querySearchAsync(queryString, cb) {
|
|
|
|
|
|
/** 新增工序确认按钮 操作*/
|
|
/** 新增工序确认按钮 操作*/
|
|
function handleProcess() {
|
|
function handleProcess() {
|
|
- if (process) {
|
|
|
|
|
|
+ if (!process.value.id) {
|
|
proxy.$modal.msgError("请选择一条数据");
|
|
proxy.$modal.msgError("请选择一条数据");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
let id = ids.value[0];
|
|
let id = ids.value[0];
|
|
let index = processList.value.findIndex((item) => item.id === id);
|
|
let index = processList.value.findIndex((item) => item.id === id);
|
|
- let pro = processList.value[index];
|
|
|
|
- console.log(pro);
|
|
|
|
|
|
+ // processList.value.splice(index, 0, process.value);
|
|
|
|
+ console.log("processList", processList.value[index]);
|
|
|
|
+ console.log("process", process.value);
|
|
}
|
|
}
|
|
|
|
|
|
/** 选择输出建议 */
|
|
/** 选择输出建议 */
|
|
function handleSelectEmployee(item) {
|
|
function handleSelectEmployee(item) {
|
|
process.value = item;
|
|
process.value = item;
|
|
|
|
+ console.log("process", process.value);
|
|
}
|
|
}
|
|
|
|
|
|
/** 是否可选 */
|
|
/** 是否可选 */
|
|
function checkSelectable(row) {
|
|
function checkSelectable(row) {
|
|
- return lot.value.status != 0
|
|
|
|
- ? row.processStepNumber > lot.value.processStepNumber
|
|
|
|
- : row.processStepNumber >= lot.value.processStepNumber;
|
|
|
|
|
|
+ if (dayworkItem.value) {
|
|
|
|
+ return dayworkItem.value.status != 0
|
|
|
|
+ ? row.processStepNumber > dayworkItem.value.processStepNumber
|
|
|
|
+ : row.processStepNumber >= dayworkItem.value.processStepNumber;
|
|
|
|
+ } else {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/** 添加新工序按钮操作 */
|
|
/** 添加新工序按钮操作 */
|
|
@@ -180,6 +189,11 @@ function handleAdd() {
|
|
addProcess.value = true;
|
|
addProcess.value = true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/** 关闭新增工序弹窗 */
|
|
|
|
+function processClose() {
|
|
|
|
+ addProcess.value = false;
|
|
|
|
+}
|
|
|
|
+
|
|
/** 关闭弹窗 */
|
|
/** 关闭弹窗 */
|
|
function cancel() {
|
|
function cancel() {
|
|
visible.value = false;
|
|
visible.value = false;
|