|
@@ -1,11 +1,34 @@
|
|
<template>
|
|
<template>
|
|
<div class="office-sop flex flex-col h-full">
|
|
<div class="office-sop flex flex-col h-full">
|
|
<div class="page-action">
|
|
<div class="page-action">
|
|
- <t-space size="small">
|
|
|
|
- <t-button theme="danger" :disabled="!selectedRowKeys.length">
|
|
|
|
- 作废
|
|
|
|
- </t-button>
|
|
|
|
- </t-space>
|
|
|
|
|
|
+ <t-button
|
|
|
|
+ theme="primary"
|
|
|
|
+ :disabled="!selectedRowKeys.length"
|
|
|
|
+ @click="handleBatchCancel"
|
|
|
|
+ >
|
|
|
|
+ <template #icon><svg-icon name="delete" color="#fff" /></template>
|
|
|
|
+ 作废
|
|
|
|
+ </t-button>
|
|
|
|
+ <t-button variant="outline" @click="handleAdd">
|
|
|
|
+ <template #icon><svg-icon name="view" color="#262626" /></template>
|
|
|
|
+ 显示字段</t-button
|
|
|
|
+ >
|
|
|
|
+ <t-button variant="outline" @click="handleAdd">
|
|
|
|
+ <template #icon><svg-icon name="refresh" color="#262626" /></template>
|
|
|
|
+ 刷新</t-button
|
|
|
|
+ >
|
|
|
|
+ <t-button variant="outline" @click="handleAdd">
|
|
|
|
+ <template #icon><svg-icon name="sort" color="#262626" /></template>
|
|
|
|
+ 排序</t-button
|
|
|
|
+ >
|
|
|
|
+ <t-button variant="outline" @click="handleAdd">
|
|
|
|
+ <template #icon><svg-icon name="enlarge" color="#262626" /></template>
|
|
|
|
+ 放大</t-button
|
|
|
|
+ >
|
|
|
|
+ <t-button variant="outline" @click="handleAdd">
|
|
|
|
+ <template #icon><svg-icon name="shrink" color="#262626" /></template>
|
|
|
|
+ 缩小</t-button
|
|
|
|
+ >
|
|
</div>
|
|
</div>
|
|
<SearchForm :fields="fields" :params="params">
|
|
<SearchForm :fields="fields" :params="params">
|
|
<template #service="{ item, params }">
|
|
<template #service="{ item, params }">
|
|
@@ -28,15 +51,62 @@
|
|
showPageSize: false,
|
|
showPageSize: false,
|
|
total: pagination.total,
|
|
total: pagination.total,
|
|
}"
|
|
}"
|
|
|
|
+ v-loading="tableLoading"
|
|
:selected-row-keys="selectedRowKeys"
|
|
:selected-row-keys="selectedRowKeys"
|
|
@select-change="selectChange"
|
|
@select-change="selectChange"
|
|
>
|
|
>
|
|
|
|
+ <template #beginTime="{ col, row }">
|
|
|
|
+ {{ timestampFilter(row[col.colKey]) }}
|
|
|
|
+ </template>
|
|
|
|
+ <template #examStartTime="{ col, row }">
|
|
|
|
+ {{ timestampFilter(row[col.colKey]) }}
|
|
|
|
+ </template>
|
|
|
|
+ <template #examEndTime="{ col, row }">
|
|
|
|
+ {{ timestampFilter(row[col.colKey]) }}
|
|
|
|
+ </template>
|
|
|
|
+ <template #flowCreateTime="{ col, row }">
|
|
|
|
+ {{ timestampFilter(row[col.colKey]) }}
|
|
|
|
+ </template>
|
|
|
|
+ <template #flowUpdateTime="{ col, row }">
|
|
|
|
+ {{ timestampFilter(row[col.colKey]) }}
|
|
|
|
+ </template>
|
|
|
|
+ <template #operate="{ row }">
|
|
|
|
+ <div class="table-operations">
|
|
|
|
+ <t-link theme="primary" hover="color" @click="toCurSopFlow(row)">
|
|
|
|
+ 填报
|
|
|
|
+ </t-link>
|
|
|
|
+ <t-link theme="primary" hover="color" @click="createSopFlow(row)">
|
|
|
|
+ 新增SOP
|
|
|
|
+ </t-link>
|
|
|
|
+ <t-link
|
|
|
|
+ theme="primary"
|
|
|
|
+ hover="color"
|
|
|
|
+ @click="toCreateViolation(row)"
|
|
|
|
+ >
|
|
|
|
+ 新增违规
|
|
|
|
+ </t-link>
|
|
|
|
+ <t-link theme="primary" hover="color" @click="qualityIssue(row)">
|
|
|
|
+ 上报质量问题
|
|
|
|
+ </t-link>
|
|
|
|
+ <t-link theme="primary" hover="color" @click="planChange(row)">
|
|
|
|
+ 计划变更报备
|
|
|
|
+ </t-link>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
</t-table>
|
|
</t-table>
|
|
</div>
|
|
</div>
|
|
<!-- <PlanChangeDialog
|
|
<!-- <PlanChangeDialog
|
|
v-model:visible="showPlanChangeDialog"
|
|
v-model:visible="showPlanChangeDialog"
|
|
:curRow="curRow"
|
|
:curRow="curRow"
|
|
></PlanChangeDialog> -->
|
|
></PlanChangeDialog> -->
|
|
|
|
+
|
|
|
|
+ <!-- SopStepDialog -->
|
|
|
|
+ <sop-step-dialog
|
|
|
|
+ v-model:visible="showSopStepDialog"
|
|
|
|
+ :sop="curSopData"
|
|
|
|
+ :type="curSopType"
|
|
|
|
+ @confirm="fetchData"
|
|
|
|
+ ></sop-step-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -44,7 +114,9 @@
|
|
import { ref, reactive, computed } from 'vue';
|
|
import { ref, reactive, computed } from 'vue';
|
|
import useFetchTable from '@/hooks/useFetchTable';
|
|
import useFetchTable from '@/hooks/useFetchTable';
|
|
import { useRouter } from 'vue-router';
|
|
import { useRouter } from 'vue-router';
|
|
-import { sopListApi } from '@/api/sop';
|
|
|
|
|
|
+import { sopListApi, sopBatchCancelApi } from '@/api/sop';
|
|
|
|
+import { timestampFilter } from '@/utils/filter';
|
|
|
|
+import SopStepDialog from '../sop-step/sop-step-dialog.vue';
|
|
// import PlanChangeDialog from './plan-change-dialog.vue';
|
|
// import PlanChangeDialog from './plan-change-dialog.vue';
|
|
// const curRow = ref(null);
|
|
// const curRow = ref(null);
|
|
const selectedRowKeys = ref([]);
|
|
const selectedRowKeys = ref([]);
|
|
@@ -60,84 +132,29 @@ const columns = [
|
|
width: 50,
|
|
width: 50,
|
|
fixed: 'left',
|
|
fixed: 'left',
|
|
},
|
|
},
|
|
- { colKey: 'serviceName', title: '服务单元' },
|
|
|
|
- { colKey: 'sopNo', title: 'SOP流水号' },
|
|
|
|
- { colKey: 'crmNo', title: '项目单号' },
|
|
|
|
- { colKey: 'beginTime', title: '派单时间' },
|
|
|
|
- { colKey: 'customManagerName', title: '客户经理' },
|
|
|
|
- { colKey: 'customManagerTypeStr', title: '客户类型' },
|
|
|
|
- { colKey: 'customName', title: '客户名称' },
|
|
|
|
- { colKey: 'crmName', title: '项目名称' },
|
|
|
|
- { colKey: 'productName', title: '实施产品' },
|
|
|
|
- { colKey: 'examStartTime', title: '考试开始时间' },
|
|
|
|
- { colKey: 'examEndTime', title: '考试结束时间' },
|
|
|
|
|
|
+ { colKey: 'serviceName', title: '服务单元', width: 160 },
|
|
|
|
+ { colKey: 'sopNo', title: 'SOP流水号', width: 200 },
|
|
|
|
+ { colKey: 'crmNo', title: '项目单号', width: 200 },
|
|
|
|
+ { colKey: 'beginTime', title: '派单时间', width: 180 },
|
|
|
|
+ { colKey: 'customManagerName', title: '客户经理', width: 140 },
|
|
|
|
+ { colKey: 'customManagerTypeStr', title: '客户类型', width: 120 },
|
|
|
|
+ { colKey: 'customName', title: '客户名称', width: 140 },
|
|
|
|
+ { colKey: 'crmName', title: '项目名称', minWidth: 160 },
|
|
|
|
+ { colKey: 'productName', title: '实施产品', width: 120 },
|
|
|
|
+ { colKey: 'examStartTime', title: '考试开始时间', width: 180 },
|
|
|
|
+ { colKey: 'examEndTime', title: '考试结束时间', width: 180 },
|
|
//...
|
|
//...
|
|
- { colKey: 'flowCreateName', title: '提交人' },
|
|
|
|
- { colKey: 'flowCreateTime', title: '提交时间' },
|
|
|
|
- { colKey: 'flowUpdateTime', title: '更新时间' },
|
|
|
|
- { colKey: 'status', title: '流程状态' },
|
|
|
|
- { colKey: 'taskName', title: '流程节点' },
|
|
|
|
- { colKey: 'pendApproveName', title: '当前节点负责人' },
|
|
|
|
|
|
+ { colKey: 'flowCreateName', title: '提交人', width: 140 },
|
|
|
|
+ { colKey: 'flowCreateTime', title: '提交时间', width: 180 },
|
|
|
|
+ { colKey: 'flowUpdateTime', title: '更新时间', width: 180 },
|
|
|
|
+ { colKey: 'status', title: '流程状态', width: 120 },
|
|
|
|
+ { colKey: 'taskName', title: '流程节点', width: 160 },
|
|
|
|
+ { colKey: 'pendApproveName', title: '当前节点负责人', width: 140 },
|
|
{
|
|
{
|
|
title: '管理',
|
|
title: '管理',
|
|
colKey: 'operate',
|
|
colKey: 'operate',
|
|
fixed: 'right',
|
|
fixed: 'right',
|
|
- width: 400,
|
|
|
|
- cell: (h, { row }) => {
|
|
|
|
- return (
|
|
|
|
- <div class="table-operations">
|
|
|
|
- <t-link
|
|
|
|
- theme="primary"
|
|
|
|
- hover="color"
|
|
|
|
- onClick={(e) => {
|
|
|
|
- e.stopPropagation();
|
|
|
|
- toCurSopFlow(row);
|
|
|
|
- }}
|
|
|
|
- >
|
|
|
|
- 填报
|
|
|
|
- </t-link>
|
|
|
|
- <t-link
|
|
|
|
- theme="primary"
|
|
|
|
- hover="color"
|
|
|
|
- onClick={(e) => {
|
|
|
|
- e.stopPropagation();
|
|
|
|
- createSopFlow(row);
|
|
|
|
- }}
|
|
|
|
- >
|
|
|
|
- 新增SOP
|
|
|
|
- </t-link>
|
|
|
|
- <t-link
|
|
|
|
- theme="primary"
|
|
|
|
- hover="color"
|
|
|
|
- onClick={(e) => {
|
|
|
|
- e.stopPropagation();
|
|
|
|
- }}
|
|
|
|
- >
|
|
|
|
- 新增违规
|
|
|
|
- </t-link>
|
|
|
|
- <t-link
|
|
|
|
- theme="primary"
|
|
|
|
- hover="color"
|
|
|
|
- onClick={(e) => {
|
|
|
|
- e.stopPropagation();
|
|
|
|
- qualityIssue();
|
|
|
|
- }}
|
|
|
|
- >
|
|
|
|
- 上报质量问题
|
|
|
|
- </t-link>
|
|
|
|
- <t-link
|
|
|
|
- theme="primary"
|
|
|
|
- hover="color"
|
|
|
|
- onClick={(e) => {
|
|
|
|
- e.stopPropagation();
|
|
|
|
- planChange(row);
|
|
|
|
- }}
|
|
|
|
- >
|
|
|
|
- 计划变更报备
|
|
|
|
- </t-link>
|
|
|
|
- </div>
|
|
|
|
- );
|
|
|
|
- },
|
|
|
|
|
|
+ width: 420,
|
|
},
|
|
},
|
|
];
|
|
];
|
|
const fields = ref([
|
|
const fields = ref([
|
|
@@ -149,6 +166,19 @@ const fields = ref([
|
|
colSpan: 6,
|
|
colSpan: 6,
|
|
cell: 'service',
|
|
cell: 'service',
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ type: 'buttons',
|
|
|
|
+ colSpan: 3,
|
|
|
|
+ children: [
|
|
|
|
+ {
|
|
|
|
+ type: 'button',
|
|
|
|
+ text: '搜索',
|
|
|
|
+ onClick: () => {
|
|
|
|
+ search();
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
]);
|
|
]);
|
|
const params = reactive({
|
|
const params = reactive({
|
|
serviceId: '',
|
|
serviceId: '',
|
|
@@ -160,15 +190,52 @@ const {
|
|
loading: tableLoading,
|
|
loading: tableLoading,
|
|
pagination,
|
|
pagination,
|
|
tableData,
|
|
tableData,
|
|
|
|
+ search,
|
|
fetchData,
|
|
fetchData,
|
|
onChange,
|
|
onChange,
|
|
} = useFetchTable(sopListApi, { params: transParams });
|
|
} = useFetchTable(sopListApi, { params: transParams });
|
|
|
|
|
|
|
|
+const handleAdd = () => {};
|
|
|
|
+
|
|
|
|
+const handleBatchCancel = () => {
|
|
|
|
+ if (!selectedRowKeys.value.length) {
|
|
|
|
+ MessagePlugin.error('请选择要作废的记录');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ const confirmDia = DialogPlugin({
|
|
|
|
+ header: '系统通知',
|
|
|
|
+ body: `是否作废所选sop?`,
|
|
|
|
+ confirmBtn: '确定',
|
|
|
|
+ cancelBtn: '取消',
|
|
|
|
+ theme: 'warning',
|
|
|
|
+ onConfirm: async () => {
|
|
|
|
+ confirmDia.hide();
|
|
|
|
+ const res = await sopBatchCancelApi(selectedRowKeys.value).catch(
|
|
|
|
+ () => {}
|
|
|
|
+ );
|
|
|
|
+ if (!res) return;
|
|
|
|
+ MessagePlugin.success('操作成功');
|
|
|
|
+ refresh();
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+const toCreateViolation = (row) => {
|
|
|
|
+ console.log(row);
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+const showSopStepDialog = ref(false);
|
|
|
|
+const curSopData = ref({});
|
|
|
|
+const curSopType = ref('');
|
|
const createSopFlow = (row) => {
|
|
const createSopFlow = (row) => {
|
|
- router.push({ name: 'SopStep' });
|
|
|
|
|
|
+ curSopType.value = 'add';
|
|
|
|
+ curSopData.value = row;
|
|
|
|
+ showSopStepDialog.value = true;
|
|
};
|
|
};
|
|
const toCurSopFlow = (row) => {
|
|
const toCurSopFlow = (row) => {
|
|
- router.push({ name: 'SopStep', query: { type: 'fill', flowId: row.flowId } });
|
|
|
|
|
|
+ curSopType.value = 'fill';
|
|
|
|
+ curSopData.value = row;
|
|
|
|
+ showSopStepDialog.value = true;
|
|
};
|
|
};
|
|
|
|
|
|
const planChange = (row) => {
|
|
const planChange = (row) => {
|
|
@@ -180,5 +247,3 @@ const qualityIssue = (row) => {
|
|
router.push({ name: 'QualityIssue' });
|
|
router.push({ name: 'QualityIssue' });
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
-
|
|
|
|
-<style></style>
|
|
|