|
@@ -1,26 +1,25 @@
|
|
|
<template>
|
|
|
<div class="mainContentBox">
|
|
|
- <Search :searchOptions="searchForm" @data-list="getList" ref="searchRef" />
|
|
|
- <div class="btns">
|
|
|
- <el-button type="primary" @click="add">新增</el-button>
|
|
|
- </div>
|
|
|
- <el-table :data="tableData" border>
|
|
|
- <el-table-column type="index" label="序号" width="80" />
|
|
|
- <el-table-column prop="workOrderCode" label="工单编码" />
|
|
|
- <el-table-column prop="materialCode" label="物料编码" />
|
|
|
- <el-table-column prop="materialModel" label="物料型号" />
|
|
|
- <el-table-column prop="materialName" label="物料名称" />
|
|
|
- <el-table-column prop="orderCode" label="订单编号" />
|
|
|
- <el-table-column prop="operationName" label="工序名称" />
|
|
|
- <el-table-column prop="creator" label="创建人" />
|
|
|
- <el-table-column prop="created" label="创建时间" />
|
|
|
- <!-- <el-table-column prop="seqNoList" label="管号">
|
|
|
- <template #default="scope">
|
|
|
- {{ scope.row.seqNoList.join(", ") }}
|
|
|
- </template>
|
|
|
- </el-table-column> -->
|
|
|
- <el-table-column label="操作">
|
|
|
- <template #default="{ row }">
|
|
|
+ <avue-crud
|
|
|
+ ref="crudRef"
|
|
|
+ v-model:search="search"
|
|
|
+ v-model="form"
|
|
|
+ :data="data"
|
|
|
+ :option="option"
|
|
|
+ v-model:page="page"
|
|
|
+ @row-save="createRow"
|
|
|
+ @row-update="updateRow"
|
|
|
+ @row-del="deleteRow"
|
|
|
+ @search-change="searchChange"
|
|
|
+ @search-reset="resetChange"
|
|
|
+ @size-change="dataList"
|
|
|
+ @current-change="dataList"
|
|
|
+ @selection-change="selectionChange"
|
|
|
+ >
|
|
|
+ <template #menu-left="{ size }">
|
|
|
+ <el-button type="primary" @click="add">新增</el-button></template>
|
|
|
+ <template #menu="{ row, index, type }">
|
|
|
+
|
|
|
<el-button
|
|
|
link
|
|
|
type="primary"
|
|
@@ -32,29 +31,38 @@
|
|
|
link
|
|
|
type="primary"
|
|
|
size="small"
|
|
|
- @click="showMaterial(row.id)"
|
|
|
+ @click="showMaterial(row)"
|
|
|
>采集替换</el-button
|
|
|
>
|
|
|
<el-button
|
|
|
link
|
|
|
- type="primary"
|
|
|
+ type="danger"
|
|
|
size="small"
|
|
|
- v-if="row?.state != '3'"
|
|
|
+ v-if="row?.flowState == '0'||row?.flowState == '2'||row?.flowState == '-1'"
|
|
|
v-hasPerm="[ButtonPermKeys.PLAN.BTNS.filtersheet_del]"
|
|
|
@click="deleteReplace(row.id)"
|
|
|
>删除</el-button
|
|
|
>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <div style="float: right">
|
|
|
- <pagination
|
|
|
- v-model:total="paginationObj.total"
|
|
|
- v-model:page="paginationObj.pageNo"
|
|
|
- v-model:limit="paginationObj.pageSize"
|
|
|
- @pagination="getList"
|
|
|
- />
|
|
|
- </div>
|
|
|
+ <el-button
|
|
|
+ link
|
|
|
+ icon="el-icon-copy-document"
|
|
|
+ v-if="row.flowState == '0' || row.flowState == '2' || row.flowState == '-1'"
|
|
|
+ @click="openCheckView(row)"
|
|
|
+ >提审</el-button
|
|
|
+ >
|
|
|
+
|
|
|
+ <el-button link v-if="row.flowState !== '0'" icon="el-icon-copy-document" @click="showFlowSteps(row)"
|
|
|
+ >流程</el-button>
|
|
|
+
|
|
|
+ <el-button
|
|
|
+ link
|
|
|
+ icon="el-icon-copy-document"
|
|
|
+ v-if="row.flowState == '3'"
|
|
|
+ @click="cancelFlow(row)"
|
|
|
+ >撤销</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
|
|
|
<el-dialog
|
|
|
v-model="dialog.visible"
|
|
@@ -73,7 +81,7 @@
|
|
|
>{{ item.formName }}</el-card
|
|
|
> -->
|
|
|
<el-form
|
|
|
- :model="form"
|
|
|
+ :model="formSeq"
|
|
|
ref="formRef"
|
|
|
label-width="auto"
|
|
|
style="max-width: 800px"
|
|
@@ -92,7 +100,7 @@
|
|
|
<el-select
|
|
|
class="tep"
|
|
|
:disabled="!addStatus"
|
|
|
- v-model="form.workOrderCode"
|
|
|
+ v-model="formSeq.workOrderCode"
|
|
|
@click="dialog1.visible = true"
|
|
|
/>
|
|
|
</el-form-item>
|
|
@@ -110,7 +118,7 @@
|
|
|
<el-select
|
|
|
filterable
|
|
|
class="tep"
|
|
|
- v-model="form.operationId"
|
|
|
+ v-model="formSeq.operationId"
|
|
|
@change="setSeqList"
|
|
|
>
|
|
|
<el-option
|
|
@@ -132,7 +140,7 @@
|
|
|
seqNoList
|
|
|
prop=""
|
|
|
>
|
|
|
- <el-select class="tep" v-model="form.seqNoList" multiple filterable>
|
|
|
+ <el-select class="tep" v-model="formSeq.seqNoList" multiple filterable>
|
|
|
<template #header>
|
|
|
<el-checkbox v-model="checkAll" @change="handleCheckAll">
|
|
|
全选
|
|
@@ -193,8 +201,13 @@
|
|
|
@close="dialog3.visible = false"
|
|
|
:destroy-on-close="true"
|
|
|
>
|
|
|
- <Replace :replaceId="replace.id" :dialog="dialog3" />
|
|
|
+ <Replace :replaceId="replace.id" :dialog="dialog3" :flowState="replace.flowState" />
|
|
|
</el-dialog>
|
|
|
+ <LookFlowStep ref="LookFlowStepRef"></LookFlowStep>
|
|
|
+ <WorkFlowCheck
|
|
|
+ ref="workFlowCheckRef"
|
|
|
+ @sureToSave="onWFSave"
|
|
|
+ ></WorkFlowCheck>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup>
|
|
@@ -211,6 +224,7 @@ import {
|
|
|
getReplace,
|
|
|
getSeqList,
|
|
|
} from "@/api/replace";
|
|
|
+import {useCrud} from "@/hooks/userCrud";
|
|
|
const updateTitle = ref("筛选单详情");
|
|
|
const tableData = ref([]);
|
|
|
const formRef = ref(null);
|
|
@@ -223,14 +237,42 @@ const showSeq = (seqs) => {
|
|
|
showSeqList.value = seqs;
|
|
|
dialog2.visible = true;
|
|
|
};
|
|
|
-const showMaterial = (id) => {
|
|
|
- replace.value.id = id;
|
|
|
+
|
|
|
+const LookFlowStepRef = ref(null);
|
|
|
+const showFlowSteps = (row) => {
|
|
|
+ LookFlowStepRef.value && LookFlowStepRef.value.openFlowStepDrawer(row.flowIns);
|
|
|
+};
|
|
|
+
|
|
|
+const cancelFlow=(row)=>{
|
|
|
+ cancelReplaceFlow(row).then(() => {
|
|
|
+ ElMessage.success("提交成功");
|
|
|
+ dataList();
|
|
|
+ });
|
|
|
+}
|
|
|
+const onWFSave = (flowForm) => {
|
|
|
+ submitReplaceFlow(flowForm).then(() => {
|
|
|
+ ElMessage.success("提交成功");
|
|
|
+ workFlowCheckRef.value && workFlowCheckRef.value.close();
|
|
|
+ dataList();
|
|
|
+ });
|
|
|
+};
|
|
|
+const showMaterial = (row) => {
|
|
|
+ replace.value = row;
|
|
|
dialog3.visible = true;
|
|
|
};
|
|
|
const dialog = reactive({
|
|
|
visible: false,
|
|
|
title: "新增替换记录",
|
|
|
});
|
|
|
+const workFlowCheckRef = ref(null);
|
|
|
+import WorkFlowCheck from "@/components/WorkFlows/workFlowCheck.vue";
|
|
|
+import LookFlowStep from "@/views/flow/common/LookFlowStep.vue";
|
|
|
+import RouteChangeLog from "@/views/base/craftManagement/route/components/routeChangeLog.vue";
|
|
|
+import {submitReplaceFlow,cancelReplaceFlow} from "@/api/flow";
|
|
|
+const openCheckView = (row) => {
|
|
|
+ row.businessId = row.id
|
|
|
+ workFlowCheckRef.value && workFlowCheckRef.value.openDialog(row, "itemReplaceService");
|
|
|
+};
|
|
|
const dialog1 = reactive({
|
|
|
visible: false,
|
|
|
title: "工单编码选择",
|
|
@@ -243,11 +285,6 @@ const dialog3 = reactive({
|
|
|
title: "物料替换",
|
|
|
visible: false,
|
|
|
});
|
|
|
-const paginationObj = reactive({
|
|
|
- pageNo: 1,
|
|
|
- pageSize: 10,
|
|
|
- total: 0,
|
|
|
-});
|
|
|
const submit = async () => {
|
|
|
formRef.value.validate((valid) => {
|
|
|
if (valid) {
|
|
@@ -265,26 +302,33 @@ const closeShow = () => {
|
|
|
workOderShow.value = false;
|
|
|
};
|
|
|
const resetForm = () => {
|
|
|
- form.value.id = "";
|
|
|
- form.value.seqNoList = [];
|
|
|
- form.value.workOrderCode = "";
|
|
|
- form.value.operationId = "";
|
|
|
+ formSeq.value.id = "";
|
|
|
+ formSeq.value.seqNoList = [];
|
|
|
+ formSeq.value.workOrderCode = "";
|
|
|
+ formSeq.value.operationId = "";
|
|
|
};
|
|
|
const toAdd = async () => {
|
|
|
- const { code } = await addReplace({ ...form.value });
|
|
|
+ const { code } = await addReplace({ ...formSeq.value });
|
|
|
if (code == "200") {
|
|
|
ElMessage.success("新增成功");
|
|
|
resetForm();
|
|
|
- getList();
|
|
|
+ dataList();
|
|
|
dialog.visible = false;
|
|
|
}
|
|
|
};
|
|
|
+const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
|
+ useCrud({
|
|
|
+ src: "/api/v1/processReplace",
|
|
|
+ });
|
|
|
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
|
|
|
+ Methords; //增删改查
|
|
|
+const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
|
|
|
const toEdiet = async () => {
|
|
|
- const { code } = await updateFilter({ ...form.value });
|
|
|
+ const { code } = await updateFilter({ ...formSeq.value });
|
|
|
if (code == "200") {
|
|
|
ElMessage.success("修改成功");
|
|
|
resetForm();
|
|
|
- getList();
|
|
|
+ dataList();
|
|
|
dialog.visible = false;
|
|
|
}
|
|
|
};
|
|
@@ -292,7 +336,7 @@ const deleteReplace = async (id) => {
|
|
|
const { code } = await delReplace({ id });
|
|
|
if (code === "200") {
|
|
|
ElMessage.success("删除成功");
|
|
|
- getList();
|
|
|
+ dataList();
|
|
|
}
|
|
|
};
|
|
|
const options = ref([]);
|
|
@@ -301,46 +345,29 @@ const checkAll = ref(false);
|
|
|
|
|
|
const handleCheckAll = (val) => {
|
|
|
if (val) {
|
|
|
- form.value.seqNoList = options.value
|
|
|
+ formSeq.value.seqNoList = options.value
|
|
|
.filter((item) => !item.disabled)
|
|
|
.map((item) => item.value);
|
|
|
} else {
|
|
|
- form.value.seqNoList = [];
|
|
|
+ formSeq.value.seqNoList = [];
|
|
|
}
|
|
|
};
|
|
|
|
|
|
const searchRef = ref(null);
|
|
|
-const form = ref({ seqNoList: [] });
|
|
|
-const searchForm = [
|
|
|
- {
|
|
|
- label: "工单编码",
|
|
|
- prop: "workOrderCode",
|
|
|
- type: "input",
|
|
|
- },
|
|
|
- {
|
|
|
- label: "物料编码",
|
|
|
- prop: "materialCode",
|
|
|
- type: "input",
|
|
|
- },
|
|
|
- {
|
|
|
- label: "物料名称",
|
|
|
- prop: "materialName",
|
|
|
- type: "input",
|
|
|
- },
|
|
|
-];
|
|
|
+const formSeq = ref({ seqNoList: [] });
|
|
|
const materialInfo1 = async (value) => {
|
|
|
- form.value.workOrderCode = value.workOrderCode;
|
|
|
+ formSeq.value.workOrderCode = value.workOrderCode;
|
|
|
await setOperationList();
|
|
|
- form.value.operationId = "";
|
|
|
+ formSeq.value.operationId = "";
|
|
|
options.value = [];
|
|
|
- form.value.seqNoList = [];
|
|
|
+ formSeq.value.seqNoList = [];
|
|
|
dialog1.visible = false;
|
|
|
};
|
|
|
const operations = ref([]);
|
|
|
const setOperationList = async () => {
|
|
|
- const { data } = await getOperations(form.value.workOrderCode);
|
|
|
+ const { data } = await getOperations(formSeq.value.workOrderCode);
|
|
|
operations.value = [];
|
|
|
- form.value.seqNoList = [];
|
|
|
+ formSeq.value.seqNoList = [];
|
|
|
data.forEach((element) => {
|
|
|
operations.value.push({
|
|
|
value: element.operationId,
|
|
@@ -351,10 +378,10 @@ const setOperationList = async () => {
|
|
|
|
|
|
const seqListlength = ref(null);
|
|
|
const setSeqList = async () => {
|
|
|
- form.value.seqNoList = [];
|
|
|
+ formSeq.value.seqNoList = [];
|
|
|
const { data } = await getSeqList(
|
|
|
- form.value.workOrderCode,
|
|
|
- form.value.operationId
|
|
|
+ formSeq.value.workOrderCode,
|
|
|
+ formSeq.value.operationId
|
|
|
);
|
|
|
options.value = [];
|
|
|
data.sort((a, b) => a.seqNo.localeCompare(b.seqNo));
|
|
@@ -365,26 +392,13 @@ const setSeqList = async () => {
|
|
|
});
|
|
|
});
|
|
|
};
|
|
|
-const getList = async () => {
|
|
|
- const { data, totalCount } = await getReplace({
|
|
|
- ...searchRef.value.searchForm,
|
|
|
- pageNo: paginationObj.pageNo,
|
|
|
- pageSize: paginationObj.pageSize,
|
|
|
- });
|
|
|
- tableData.value = data.records;
|
|
|
- paginationObj.total = data.totalCount;
|
|
|
-};
|
|
|
+
|
|
|
const add = () => {
|
|
|
resetForm();
|
|
|
addStatus.value = true;
|
|
|
dialog.visible = true;
|
|
|
};
|
|
|
-const edit = async (row) => {
|
|
|
- addStatus.value = false;
|
|
|
- form.value = row;
|
|
|
- await setSeqList();
|
|
|
- dialog.visible = true;
|
|
|
-};
|
|
|
+
|
|
|
const cancel = () => {
|
|
|
resetForm();
|
|
|
dialog.visible = false;
|
|
@@ -395,13 +409,83 @@ const startToSelectAheads = () => {
|
|
|
if (Number(toSelectCount.value)) {
|
|
|
const count = Number(toSelectCount.value);
|
|
|
const seqNoList = options.value.map((item) => item.value);
|
|
|
- form.value.seqNoList = seqNoList.slice(0, count);
|
|
|
+ formSeq.value.seqNoList = seqNoList.slice(0, count);
|
|
|
} else {
|
|
|
ElMessage.error("请输入数字");
|
|
|
}
|
|
|
};
|
|
|
onMounted(() => {
|
|
|
- getList();
|
|
|
+ dataList();
|
|
|
+});
|
|
|
+
|
|
|
+// 设置表格列或者其他自定义的option
|
|
|
+option.value = Object.assign(option.value, {
|
|
|
+ searchEnter: true,
|
|
|
+ selection: false,
|
|
|
+ addBtn: false,
|
|
|
+ delBtn: false,
|
|
|
+ editBtn: false,
|
|
|
+ viewBtn: false,
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: "生产批号",
|
|
|
+ prop: "workOrderCode",
|
|
|
+ editDisabled: true,
|
|
|
+ overHidden: true,
|
|
|
+ search: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "产品名称",
|
|
|
+ prop: "materialName",
|
|
|
+ editDisabled: true,
|
|
|
+ search: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "产品编码",
|
|
|
+ prop: "materialCode",
|
|
|
+ editDisabled: true,
|
|
|
+ search: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "产品规格",
|
|
|
+ prop: "materialModel",
|
|
|
+ search: true,
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "订单编号",
|
|
|
+ prop: "orderCode",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "工序名称",
|
|
|
+ prop: "operationName",
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ label: "创建人",
|
|
|
+ prop: "creator",
|
|
|
+ editDisplay: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "创建时间",
|
|
|
+ prop: "created",
|
|
|
+ },
|
|
|
+ /*{
|
|
|
+ label: "日期",
|
|
|
+ prop: "createdSearch",
|
|
|
+ width: 160,
|
|
|
+ type: "daterange",
|
|
|
+ searchRange: true,
|
|
|
+ display: false,
|
|
|
+ hide: true,
|
|
|
+ startPlaceholder: "开始范围",
|
|
|
+ endPlaceholder: "结束范围",
|
|
|
+ format: "YYYY-MM-DD",
|
|
|
+ valueFormat: "YYYY-MM-DD",
|
|
|
+ overHidden: true,
|
|
|
+ search: true,
|
|
|
+ },*/
|
|
|
+ ],
|
|
|
});
|
|
|
</script>
|
|
|
|