|
@@ -27,8 +27,8 @@
|
|
</el-form>
|
|
</el-form>
|
|
<div class="el-table-inner-container">
|
|
<div class="el-table-inner-container">
|
|
<el-table
|
|
<el-table
|
|
|
|
+ style="height: 600px"
|
|
v-loading="loading"
|
|
v-loading="loading"
|
|
- height="100%"
|
|
|
|
@selection-change="handleSelectionChange"
|
|
@selection-change="handleSelectionChange"
|
|
:data="processList"
|
|
:data="processList"
|
|
>
|
|
>
|
|
@@ -44,22 +44,16 @@
|
|
width="50"
|
|
width="50"
|
|
align="center"
|
|
align="center"
|
|
></el-table-column>
|
|
></el-table-column>
|
|
- <el-table-column
|
|
|
|
- label="工序名称"
|
|
|
|
- width="100"
|
|
|
|
- prop="processAlias"
|
|
|
|
- align="center"
|
|
|
|
- />
|
|
|
|
|
|
+ <el-table-column label="工序名称" prop="processAlias" align="center" />
|
|
|
|
|
|
<el-table-column
|
|
<el-table-column
|
|
label="工序编号"
|
|
label="工序编号"
|
|
prop="processStepNumber"
|
|
prop="processStepNumber"
|
|
|
|
+ width="200"
|
|
align="center"
|
|
align="center"
|
|
/>
|
|
/>
|
|
- <!-- <el-table-column label="工序编号" prop="processCode" align="center" /> -->
|
|
|
|
</el-table>
|
|
</el-table>
|
|
</div>
|
|
</div>
|
|
- <div></div>
|
|
|
|
<template #footer>
|
|
<template #footer>
|
|
<div class="dialog-footer">
|
|
<div class="dialog-footer">
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
@@ -71,46 +65,67 @@
|
|
<el-dialog
|
|
<el-dialog
|
|
title="选择工序"
|
|
title="选择工序"
|
|
v-model="addProcess"
|
|
v-model="addProcess"
|
|
- width="400px"
|
|
|
|
|
|
+ width="800px"
|
|
append-to-body
|
|
append-to-body
|
|
draggable
|
|
draggable
|
|
@close="processClose"
|
|
@close="processClose"
|
|
>
|
|
>
|
|
- <el-form style="padding: 16px" :inline="true">
|
|
|
|
- <el-form-item label="工序:">
|
|
|
|
- <el-autocomplete
|
|
|
|
- :fetch-suggestions="querySearchAsync"
|
|
|
|
- style="width: 100%"
|
|
|
|
- placeholder="请选择工序"
|
|
|
|
- v-model="newProcess.processAlias"
|
|
|
|
- popper-class="my-autocomplete"
|
|
|
|
- @select="handleSelectEmployee"
|
|
|
|
- >
|
|
|
|
- <template #default="{ item }">
|
|
|
|
- <div
|
|
|
|
- style="
|
|
|
|
- display: flex;
|
|
|
|
- flex-direction: row;
|
|
|
|
- justify-content: space-between;
|
|
|
|
- "
|
|
|
|
- >
|
|
|
|
- <div class="name" style="font-size: 12px">
|
|
|
|
- {{ item.processAlias }}
|
|
|
|
- </div>
|
|
|
|
- <span class="code" style="font-size: 10px; color: darkgrey">{{
|
|
|
|
- item.processKey
|
|
|
|
- }}</span>
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
- </el-autocomplete></el-form-item
|
|
|
|
- >
|
|
|
|
- </el-form>
|
|
|
|
- <template #footer>
|
|
|
|
- <div class="dialog-footer">
|
|
|
|
- <el-button type="primary" @click="handleProcess">确 定</el-button>
|
|
|
|
- <el-button @click="processClose">取 消</el-button>
|
|
|
|
|
|
+ <div class="page-container column-container">
|
|
|
|
+ <el-form style="padding: 16px" :inline="true">
|
|
|
|
+ <el-form-item label="工序名称:">
|
|
|
|
+ <el-input
|
|
|
|
+ placeholder="请输入工序名称或简称"
|
|
|
|
+ @keydown.enter.prevent
|
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
|
+ clearable
|
|
|
|
+ v-model="queryParams.keyword"
|
|
|
|
+ style="width: 200px"
|
|
|
|
+ />
|
|
|
|
+ <el-button
|
|
|
|
+ style="margin-left: 20px"
|
|
|
|
+ type="primary"
|
|
|
|
+ @click="handleSelect"
|
|
|
|
+ >搜索</el-button
|
|
|
|
+ >
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ <div class="el-table-inner-container">
|
|
|
|
+ <el-table height="95%" :data="addProcessList">
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="工序编号"
|
|
|
|
+ prop="processCode"
|
|
|
|
+ align="center"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="工序名称"
|
|
|
|
+ prop="processAlias"
|
|
|
|
+ align="center"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+
|
|
|
|
+ <el-table-column label="操作" width="80" align="center">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <el-button
|
|
|
|
+ link
|
|
|
|
+ size="small"
|
|
|
|
+ type="primary"
|
|
|
|
+ icon="check"
|
|
|
|
+ @click="handleProcess(scope.row)"
|
|
|
|
+ >选择</el-button
|
|
|
|
+ >
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
</div>
|
|
</div>
|
|
- </template>
|
|
|
|
|
|
+
|
|
|
|
+ <pagination
|
|
|
|
+ v-show="total > 0"
|
|
|
|
+ :total="total"
|
|
|
|
+ v-model:page="queryParams.pageNum"
|
|
|
|
+ v-model:limit="queryParams.pageSize"
|
|
|
|
+ @pagination="handleSelect"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
</template>
|
|
</template>
|
|
<script setup>
|
|
<script setup>
|
|
@@ -123,16 +138,23 @@ const visible = ref(false);
|
|
const loading = ref(false);
|
|
const loading = ref(false);
|
|
const haveModified = ref(false); //是否已经修改
|
|
const haveModified = ref(false); //是否已经修改
|
|
const addProcess = ref(false); //新增工序弹窗
|
|
const addProcess = ref(false); //新增工序弹窗
|
|
|
|
+const total = ref(0);
|
|
|
|
+const emit = defineEmits(["handleSaveSuccess"]);
|
|
const ids = ref([]); //多选框选中数据
|
|
const ids = ref([]); //多选框选中数据
|
|
const click = ref(true); //按钮不可点
|
|
const click = ref(true); //按钮不可点
|
|
|
|
+const addProcessList = ref([]); //新增选择工序列表
|
|
const processList = ref([]); //工序列表
|
|
const processList = ref([]); //工序列表
|
|
-const newProcess = ref({}); //新增工序
|
|
|
|
const lot = ref({}); //批次信息
|
|
const lot = ref({}); //批次信息
|
|
const dayworkItem = ref({}); //报工信息
|
|
const dayworkItem = ref({}); //报工信息
|
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
|
|
/** 查询对象 */
|
|
/** 查询对象 */
|
|
|
|
+const queryParams = ref({
|
|
|
|
+ keyword: "",
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ pageSize: 10,
|
|
|
|
+});
|
|
|
|
|
|
/*********************** 方法区 ****************************/
|
|
/*********************** 方法区 ****************************/
|
|
/** 打开弹窗 */
|
|
/** 打开弹窗 */
|
|
@@ -147,6 +169,14 @@ function open(id) {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/** 新增工序弹窗搜索按钮操作 */
|
|
|
|
+function handleSelect() {
|
|
|
|
+ getProcessList(queryParams.value).then((res) => {
|
|
|
|
+ addProcessList.value = res.rows;
|
|
|
|
+ total.value = res.total;
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
+
|
|
/** 多选框选中数据 */
|
|
/** 多选框选中数据 */
|
|
function handleSelectionChange(selection) {
|
|
function handleSelectionChange(selection) {
|
|
ids.value = selection.map((item) => item.id);
|
|
ids.value = selection.map((item) => item.id);
|
|
@@ -170,44 +200,37 @@ function handleDel() {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
-/** 输入框输出建议 */
|
|
|
|
-function querySearchAsync(queryString, cb) {
|
|
|
|
- const query = { keyword: queryString };
|
|
|
|
- getProcessList(query).then((res) => {
|
|
|
|
- cb(res.rows);
|
|
|
|
- });
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
/** 新增工序确认按钮 操作*/
|
|
/** 新增工序确认按钮 操作*/
|
|
-function handleProcess() {
|
|
|
|
- if (!newProcess.value.id) {
|
|
|
|
- proxy.$modal.msgError("请选择一条数据");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+function handleProcess(row) {
|
|
//查询选中工序位置
|
|
//查询选中工序位置
|
|
let id = ids.value[0];
|
|
let id = ids.value[0];
|
|
- let index = processList.value.findIndex((item) => item.id === id);
|
|
|
|
|
|
+ let indexNum = processList.value.findIndex((item) => item.id === id);
|
|
|
|
+
|
|
|
|
+ //获取新增工序上一条排序
|
|
|
|
+ let num = processList.value[indexNum - 1].processStepNumber; //
|
|
|
|
|
|
//复制选中数据
|
|
//复制选中数据
|
|
- let process = { ...processList.value[index] };
|
|
|
|
|
|
+ let process = { ...processList.value[indexNum] };
|
|
|
|
|
|
//修改新增数据
|
|
//修改新增数据
|
|
- process.processAlias = newProcess.value.processAlias;
|
|
|
|
- process.processCode = newProcess.value.processCode;
|
|
|
|
- process.processId = newProcess.value.id;
|
|
|
|
|
|
+ process.processAlias = row.processAlias;
|
|
|
|
+ process.processCode = row.processCode;
|
|
|
|
+ process.processId = row.id;
|
|
|
|
|
|
//插入数据
|
|
//插入数据
|
|
- processList.value.splice(index, 0, process);
|
|
|
|
|
|
+ processList.value.splice(indexNum, 0, process);
|
|
|
|
+
|
|
|
|
+ //修改排序数据
|
|
|
|
+ processList.value.forEach((item, index) => {
|
|
|
|
+ if (index >= indexNum) {
|
|
|
|
+ num = Number(num) + 1;
|
|
|
|
+ item.processStepNumber = Number(num);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
haveModified.value = true;
|
|
haveModified.value = true;
|
|
processClose();
|
|
processClose();
|
|
}
|
|
}
|
|
|
|
|
|
-/** 选择输出建议 */
|
|
|
|
-function handleSelectEmployee(item) {
|
|
|
|
- newProcess.value = item;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
/** 是否可选 */
|
|
/** 是否可选 */
|
|
function checkSelectable(row) {
|
|
function checkSelectable(row) {
|
|
if (dayworkItem.value) {
|
|
if (dayworkItem.value) {
|
|
@@ -227,7 +250,6 @@ function handleAdd() {
|
|
}
|
|
}
|
|
|
|
|
|
addProcess.value = true;
|
|
addProcess.value = true;
|
|
- newProcess.value = {};
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/** 关闭新增工序弹窗 */
|
|
/** 关闭新增工序弹窗 */
|
|
@@ -240,13 +262,13 @@ function cancel() {
|
|
visible.value = false;
|
|
visible.value = false;
|
|
addProcess.value = false;
|
|
addProcess.value = false;
|
|
haveModified.value = false;
|
|
haveModified.value = false;
|
|
- newProcess.value = {};
|
|
|
|
}
|
|
}
|
|
/** 确定按钮 */
|
|
/** 确定按钮 */
|
|
function submitForm() {
|
|
function submitForm() {
|
|
addAmend(lot.value.id, processList.value).then((res) => {
|
|
addAmend(lot.value.id, processList.value).then((res) => {
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
proxy.$modal.msgSuccess("修改成功");
|
|
proxy.$modal.msgSuccess("修改成功");
|
|
|
|
+ emit("handleSaveSuccess", lot.value.lotCode);
|
|
cancel();
|
|
cancel();
|
|
} else {
|
|
} else {
|
|
proxy.$modal.msgError(res.msg);
|
|
proxy.$modal.msgError(res.msg);
|