|
|
@@ -2,7 +2,7 @@
|
|
|
<el-container class="is-vertical">
|
|
|
<sc-page-header v-if="!selectable" @add="table_add"></sc-page-header>
|
|
|
|
|
|
- <scTable ref="xGridTable" :apiObj="$API.workmanship.process" :formConfig="formConfig" :paramsColums="paramsColums" :columns="columns" v-bind="options">
|
|
|
+ <scTable ref="xGridTable" :apiObj="$API.process.stage" :formConfig="formConfig" :paramsColums="paramsColums" :columns="columns" v-bind="options">
|
|
|
<template #action="{ row }">
|
|
|
<el-button type="primary" link @click="table_edit(row)">
|
|
|
<template #icon><sc-iconify icon="ant-design:edit-outlined"></sc-iconify></template>修改
|
|
|
@@ -20,7 +20,7 @@
|
|
|
</scTable>
|
|
|
</el-container>
|
|
|
|
|
|
- <process-detail v-if="dialog" ref="processRef" @success="refreshTable" @closed="dialogClose"></process-detail>
|
|
|
+ <stage-detail v-if="dialog" ref="stageRef" @success="refreshTable" @closed="dialogClose"></stage-detail>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
@@ -29,9 +29,9 @@ import XEUtils from "xe-utils";
|
|
|
|
|
|
import API from "@/api";
|
|
|
import TOOL from "@/utils/tool";
|
|
|
-import { statusDic, workmanshipDic } from "@/utils/basicDic";
|
|
|
+import { statusDic, processDic } from "@/utils/basicDic";
|
|
|
import { mapFormItemInput, mapFormItemSelect, mapFormItemDatePicker } from "@/components/scTable/helper";
|
|
|
-import processDetail from "./detail";
|
|
|
+import stageDetail from "./detail";
|
|
|
|
|
|
const props = defineProps({
|
|
|
selectable: { type: Boolean, default: false },
|
|
|
@@ -66,7 +66,7 @@ const formConfig = reactive({
|
|
|
mapFormItemInput("nameLike", "工序名称"),
|
|
|
mapFormItemInput("codeLike", "工序编号"),
|
|
|
mapFormItemSelect("status", "工序状态", selectConfig),
|
|
|
- mapFormItemSelect("category", "工序分类", { ...selectConfig, options: workmanshipDic.category }),
|
|
|
+ mapFormItemSelect("category", "工序分类", { ...selectConfig, options: processDic.category }),
|
|
|
mapFormItemDatePicker("createTime", "创建日期", daterangeConfig)
|
|
|
])
|
|
|
});
|
|
|
@@ -86,19 +86,19 @@ const columns = computed(() => props.selectable ? [
|
|
|
{ type: props.multiple && "checkbox" || "radio", fixed: "left", width: 40 },
|
|
|
{ type: "html", field: "name", title: "工序名称", fixed: "left", minWidth: 150, sortable: true },
|
|
|
{ type: "html", field: "code", title: "工序编号", fixed: "left", minWidth: 150, sortable: true },
|
|
|
- { type: "html", field: "category", title: "工序分类", minWidth: 100, sortable: true, formatter: ({ cellValue }) => XEUtils.get(workmanshipDic.category, cellValue, cellValue) },
|
|
|
- { type: "html", field: "processType", title: "默认加工类型", minWidth: 140, sortable: true, formatter: ({ cellValue }) => XEUtils.get(workmanshipDic.type, cellValue, cellValue) },
|
|
|
- { type: "html", field: "calculateMethod", title: "工资默认计算方式", minWidth: 140, sortable: true, formatter: ({ cellValue }) => XEUtils.get(workmanshipDic.calcMethod, cellValue, cellValue) }
|
|
|
+ { type: "html", field: "category", title: "工序分类", minWidth: 100, sortable: true, formatter: ({ cellValue }) => XEUtils.get(processDic.category, cellValue, cellValue) },
|
|
|
+ { type: "html", field: "processType", title: "默认加工类型", minWidth: 140, sortable: true, formatter: ({ cellValue }) => XEUtils.get(processDic.type, cellValue, cellValue) },
|
|
|
+ { type: "html", field: "calculateMethod", title: "工资默认计算方式", minWidth: 140, sortable: true, formatter: ({ cellValue }) => XEUtils.get(processDic.calcMethod, cellValue, cellValue) }
|
|
|
] : [
|
|
|
{ type: "seq", fixed: "left", width: 60 },
|
|
|
{ type: "html", field: "name", title: "工序名称", fixed: "left", minWidth: 150, sortable: true },
|
|
|
{ type: "html", field: "code", title: "工序编号", fixed: "left", minWidth: 150, sortable: true },
|
|
|
{ field: "status", title: "工序状态", minWidth: 100, editRender: { name: "$cell-tag", options: statusDic } },
|
|
|
- { type: "html", field: "category", title: "工序分类", minWidth: 100, sortable: true, formatter: ({ cellValue }) => XEUtils.get(workmanshipDic.category, cellValue, cellValue) },
|
|
|
+ { type: "html", field: "category", title: "工序分类", minWidth: 100, sortable: true, formatter: ({ cellValue }) => XEUtils.get(processDic.category, cellValue, cellValue) },
|
|
|
{ type: "html", field: "directorName", title: "工序负责人", minWidth: 120, sortable: true },
|
|
|
{ visible: false, type: "html", field: "directorPhone", title: "联系方式", minWidth: 120, sortable: true },
|
|
|
- { visible: false, type: "html", field: "processType", title: "默认加工类型", minWidth: 140, sortable: true, formatter: ({ cellValue }) => XEUtils.get(workmanshipDic.type, cellValue, cellValue) },
|
|
|
- { visible: false, type: "html", field: "calculateMethod", title: "工资默认计算方式", minWidth: 140, sortable: true, formatter: ({ cellValue }) => XEUtils.get(workmanshipDic.calcMethod, cellValue, cellValue) },
|
|
|
+ { visible: false, type: "html", field: "processType", title: "默认加工类型", minWidth: 140, sortable: true, formatter: ({ cellValue }) => XEUtils.get(processDic.type, cellValue, cellValue) },
|
|
|
+ { visible: false, type: "html", field: "calculateMethod", title: "工资默认计算方式", minWidth: 140, sortable: true, formatter: ({ cellValue }) => XEUtils.get(processDic.calcMethod, cellValue, cellValue) },
|
|
|
{ type: "html", field: "createTime", title: "创建日期", minWidth: 120, sortable: true, formatter: ({ cellValue }) => TOOL.dateFormat(cellValue, "YYYY-MM-DD") || cellValue },
|
|
|
{ visible: false, type: "html", field: "remark", title: "概要", minWidth: 300, sortable: true },
|
|
|
{ title: "操作", fixed: "right", width: 220, slots: { default: "action" } }
|
|
|
@@ -108,17 +108,17 @@ const columns = computed(() => props.selectable ? [
|
|
|
const xGridTable = ref();
|
|
|
const refreshTable = (mode = "add") => xGridTable.value.searchData(mode);
|
|
|
|
|
|
-const processRef = ref();
|
|
|
+const stageRef = ref();
|
|
|
const dialog = ref(false);
|
|
|
|
|
|
const table_add = () => {
|
|
|
dialog.value = true;
|
|
|
- nextTick(() => processRef.value?.open());
|
|
|
+ nextTick(() => stageRef.value?.open());
|
|
|
}
|
|
|
|
|
|
const table_edit = row => {
|
|
|
dialog.value = true;
|
|
|
- nextTick(() => processRef.value?.setData(row));
|
|
|
+ nextTick(() => stageRef.value?.setData(row));
|
|
|
}
|
|
|
|
|
|
const table_del = ({ id }) => {
|
|
|
@@ -127,7 +127,7 @@ const table_del = ({ id }) => {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消"
|
|
|
}).then(() => {
|
|
|
- API.workmanship.process.del({ id }).then(() => {
|
|
|
+ API.process.stage.del({ id }).then(() => {
|
|
|
ElMessage.success("操作成功");
|
|
|
refreshTable();
|
|
|
});
|
|
|
@@ -143,7 +143,7 @@ const table_change = row => {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消"
|
|
|
}).then(() => {
|
|
|
- API.workmanship.process.edit({ id: row.id, status }).then(() => {
|
|
|
+ API.process.stage.edit({ id: row.id, status }).then(() => {
|
|
|
ElMessage.success("操作成功");
|
|
|
refreshTable();
|
|
|
});
|