|
@@ -1,147 +1,183 @@
|
|
<template>
|
|
<template>
|
|
- <my-dialog
|
|
|
|
|
|
+ <my-drawer
|
|
|
|
+ class="sop-dialog"
|
|
:visible="visible"
|
|
:visible="visible"
|
|
- @close="emit('update:visible', false)"
|
|
|
|
- :header="`跟进`"
|
|
|
|
- :width="1000"
|
|
|
|
|
|
+ :header="title"
|
|
|
|
+ size="80%"
|
|
|
|
+ attach="body"
|
|
:closeOnOverlayClick="false"
|
|
:closeOnOverlayClick="false"
|
|
|
|
+ :close-btn="true"
|
|
|
|
+ :footer="false"
|
|
|
|
+ @close="emit('update:visible', false)"
|
|
>
|
|
>
|
|
- <t-form ref="formRef" :data="formData" labelWidth="100px" :rules="rules">
|
|
|
|
- <div class="form-group-title">违规信息</div>
|
|
|
|
- <t-row :gutter="[0, 10]">
|
|
|
|
- <t-col :span="3">
|
|
|
|
- <t-form-item label="服务单元:">
|
|
|
|
- {{ asyncDetail.service }}</t-form-item
|
|
|
|
- >
|
|
|
|
- </t-col>
|
|
|
|
- <t-col :span="3">
|
|
|
|
- <t-form-item label="SOP流水号:">
|
|
|
|
- {{ asyncDetail.sopNo }}
|
|
|
|
- </t-form-item>
|
|
|
|
- </t-col>
|
|
|
|
- <t-col :span="3">
|
|
|
|
- <t-form-item label="客户类型:">
|
|
|
|
- {{ asyncDetail.customType }}
|
|
|
|
- </t-form-item>
|
|
|
|
- </t-col>
|
|
|
|
- <t-col :span="3">
|
|
|
|
- <t-form-item label="客户名称:">
|
|
|
|
- {{ asyncDetail.custom }}
|
|
|
|
- </t-form-item>
|
|
|
|
- </t-col>
|
|
|
|
- <t-col :span="3">
|
|
|
|
- <t-form-item label="登记时间:">
|
|
|
|
- {{ dateFormat(asyncDetail.createTime, 'yyyy-MM-dd hh:mm') }}
|
|
|
|
- </t-form-item>
|
|
|
|
- </t-col>
|
|
|
|
- <t-col :span="3">
|
|
|
|
- <t-form-item label="登记人:">
|
|
|
|
- {{ asyncDetail.createName }}
|
|
|
|
- </t-form-item>
|
|
|
|
- </t-col>
|
|
|
|
- <t-col :span="3">
|
|
|
|
- <t-form-item label="节点负责人:">
|
|
|
|
- {{ asyncDetail.userName }}
|
|
|
|
- </t-form-item>
|
|
|
|
- </t-col>
|
|
|
|
- <t-col :span="3">
|
|
|
|
- <t-form-item label="违规类型:">
|
|
|
|
- {{ VIOLATION_TYPE[asyncDetail.type] || asyncDetail.type }}
|
|
|
|
- </t-form-item>
|
|
|
|
- </t-col>
|
|
|
|
- <t-col :span="12">
|
|
|
|
- <t-form-item label="违规情况说明:">
|
|
|
|
- {{ asyncDetail.content }}
|
|
|
|
- </t-form-item>
|
|
|
|
- </t-col>
|
|
|
|
- <t-col :span="12">
|
|
|
|
- <t-form-item label="附件说明:">
|
|
|
|
- {{ asyncDetail.attachmentIds }}
|
|
|
|
- </t-form-item>
|
|
|
|
- </t-col>
|
|
|
|
- </t-row>
|
|
|
|
- <div class="form-group-title next-title">新增跟进</div>
|
|
|
|
- <t-row :gutter="[0, 10]">
|
|
|
|
- <t-col :span="12">
|
|
|
|
- <t-form-item label="跟进人:">
|
|
|
|
- {{ userStore.user.realName }}</t-form-item
|
|
|
|
- >
|
|
|
|
- </t-col>
|
|
|
|
- <t-col :span="12">
|
|
|
|
- <t-form-item label="跟进说明:" name="remark">
|
|
|
|
- <t-textarea
|
|
|
|
- v-model="formData.remark"
|
|
|
|
- tips="限100字以内"
|
|
|
|
- :maxlength="100"
|
|
|
|
- ></t-textarea>
|
|
|
|
- </t-form-item>
|
|
|
|
- </t-col>
|
|
|
|
- <t-col :span="12">
|
|
|
|
- <t-form-item label="附件说明:">
|
|
|
|
- <my-upload @change="fileChange"></my-upload>
|
|
|
|
- </t-form-item>
|
|
|
|
- </t-col>
|
|
|
|
- </t-row>
|
|
|
|
- <div class="m-t-20px">
|
|
|
|
- <t-button theme="primary" @click="save">保存</t-button>
|
|
|
|
- <t-link
|
|
|
|
- theme="primary"
|
|
|
|
- underline
|
|
|
|
- class="m-l-40px"
|
|
|
|
- @click="showHistory = !showHistory"
|
|
|
|
- >查看历史跟进记录</t-link
|
|
|
|
|
|
+ <div class="sop-step">
|
|
|
|
+ <t-collapse class="sop-step-mid" defaultExpandAll>
|
|
|
|
+ <t-collapse-panel disabled>
|
|
|
|
+ <template #expandIcon></template>
|
|
|
|
+ <template #header> SOP信息 </template>
|
|
|
|
+ <t-form colon label-width="120px">
|
|
|
|
+ <t-row :gutter="[0, 4]">
|
|
|
|
+ <t-col :span="3">
|
|
|
|
+ <t-form-item label="服务单元">{{ curRow.service }}</t-form-item>
|
|
|
|
+ </t-col>
|
|
|
|
+ <t-col :span="3">
|
|
|
|
+ <t-form-item label="SOP流水号">{{ curRow.sopNo }}</t-form-item>
|
|
|
|
+ </t-col>
|
|
|
|
+ <t-col :span="3">
|
|
|
|
+ <t-form-item label="客户类型">{{
|
|
|
|
+ curRow.customType
|
|
|
|
+ }}</t-form-item>
|
|
|
|
+ </t-col>
|
|
|
|
+ <t-col :span="3">
|
|
|
|
+ <t-form-item label="客户名称">{{ curRow.custom }}</t-form-item>
|
|
|
|
+ </t-col>
|
|
|
|
+ <t-col :span="3">
|
|
|
|
+ <t-form-item label="登记时间">{{
|
|
|
|
+ timestampFilter(curRow.createTime, 'mm')
|
|
|
|
+ }}</t-form-item>
|
|
|
|
+ </t-col>
|
|
|
|
+ <t-col :span="3">
|
|
|
|
+ <t-form-item label="登记人">{{
|
|
|
|
+ curRow.createName
|
|
|
|
+ }}</t-form-item>
|
|
|
|
+ </t-col>
|
|
|
|
+ <t-col :span="3">
|
|
|
|
+ <t-form-item label="节点负责人">{{
|
|
|
|
+ curRow.userName
|
|
|
|
+ }}</t-form-item>
|
|
|
|
+ </t-col>
|
|
|
|
+ <t-col :span="3">
|
|
|
|
+ <t-form-item label="违规类型">{{
|
|
|
|
+ violationTypeFilter(curRow.type)
|
|
|
|
+ }}</t-form-item>
|
|
|
|
+ </t-col>
|
|
|
|
+ <t-col :span="12">
|
|
|
|
+ <t-form-item label="违规情况说明">{{
|
|
|
|
+ curRow.content
|
|
|
|
+ }}</t-form-item>
|
|
|
|
+ </t-col>
|
|
|
|
+ <t-col :span="12">
|
|
|
|
+ <t-form-item label="截图说明">
|
|
|
|
+ <attachment-view
|
|
|
|
+ :ids="curRow.attachmentIds"
|
|
|
|
+ ></attachment-view>
|
|
|
|
+ </t-form-item>
|
|
|
|
+ </t-col>
|
|
|
|
+ </t-row>
|
|
|
|
+ </t-form>
|
|
|
|
+ </t-collapse-panel>
|
|
|
|
+ </t-collapse>
|
|
|
|
+ <div class="sop-step-list" style="flex-direction: column">
|
|
|
|
+ <t-form
|
|
|
|
+ ref="formRef"
|
|
|
|
+ :data="formData"
|
|
|
|
+ labelWidth="100px"
|
|
|
|
+ :rules="rules"
|
|
|
|
+ colon
|
|
|
|
+ class="sop-step-body"
|
|
>
|
|
>
|
|
|
|
+ <t-row :gutter="[0, 30]">
|
|
|
|
+ <t-col :span="12">
|
|
|
|
+ <div class="form-group-title"> 新增跟进 </div>
|
|
|
|
+ </t-col>
|
|
|
|
+ <t-col :span="12">
|
|
|
|
+ <t-form-item label="跟进人">
|
|
|
|
+ {{ userStore.user.realName }}</t-form-item
|
|
|
|
+ >
|
|
|
|
+ </t-col>
|
|
|
|
+ <t-col :span="12">
|
|
|
|
+ <t-form-item label="跟进说明" name="remark">
|
|
|
|
+ <t-textarea
|
|
|
|
+ v-model="formData.remark"
|
|
|
|
+ tips="限100字以内"
|
|
|
|
+ :maxlength="100"
|
|
|
|
+ ></t-textarea>
|
|
|
|
+ </t-form-item>
|
|
|
|
+ </t-col>
|
|
|
|
+ <t-col :span="12">
|
|
|
|
+ <t-form-item label="截图说明">
|
|
|
|
+ <my-upload @change="fileChange"></my-upload>
|
|
|
|
+ </t-form-item>
|
|
|
|
+ </t-col>
|
|
|
|
+ <t-col :span="12">
|
|
|
|
+ <div class="m-b-10px">
|
|
|
|
+ 历史明细查阅
|
|
|
|
+ <t-link
|
|
|
|
+ theme="primary"
|
|
|
|
+ class="m-l-10px"
|
|
|
|
+ @click="showHistory = !showHistory"
|
|
|
|
+ >查看 <ChevronUpIcon v-if="showHistory" />
|
|
|
|
+ <ChevronDownIcon v-else /></t-link
|
|
|
|
+ ></div>
|
|
|
|
+ <t-table
|
|
|
|
+ v-if="showHistory"
|
|
|
|
+ size="small"
|
|
|
|
+ row-key="id"
|
|
|
|
+ :columns="columns"
|
|
|
|
+ :data="tableData"
|
|
|
|
+ bordered
|
|
|
|
+ >
|
|
|
|
+ <template #createTime="{ row, col }">
|
|
|
|
+ {{ timestampFilter(row[col.colKey], 'mm') }}
|
|
|
|
+ </template>
|
|
|
|
+ <template #attachment="{ row, col }">
|
|
|
|
+ <attachment-view
|
|
|
|
+ :ids="row[col.colKey]"
|
|
|
|
+ :imgSize="60"
|
|
|
|
+ ></attachment-view>
|
|
|
|
+ </template>
|
|
|
|
+ </t-table>
|
|
|
|
+ </t-col>
|
|
|
|
+ </t-row>
|
|
|
|
+ </t-form>
|
|
|
|
+ <t-space class="sop-step-footer">
|
|
|
|
+ <t-button theme="primary" @click="save">保存</t-button>
|
|
|
|
+ <t-button theme="default" @click="emit('update:visible', false)"
|
|
|
|
+ >取消</t-button
|
|
|
|
+ >
|
|
|
|
+ </t-space>
|
|
</div>
|
|
</div>
|
|
- <template v-if="showHistory">
|
|
|
|
- <div class="form-group-title next-title">历史明细查阅</div>
|
|
|
|
- <t-table
|
|
|
|
- size="small"
|
|
|
|
- row-key="id"
|
|
|
|
- :columns="columns"
|
|
|
|
- :data="tableData"
|
|
|
|
- bordered
|
|
|
|
- ></t-table>
|
|
|
|
- </template>
|
|
|
|
- </t-form>
|
|
|
|
- <template #foot>
|
|
|
|
- <!-- <t-button theme="default" @click="emit('update:visible', false)"
|
|
|
|
- >取消</t-button
|
|
|
|
- >
|
|
|
|
- <t-button theme="primary" @click="save">保存</t-button> -->
|
|
|
|
- </template>
|
|
|
|
- </my-dialog>
|
|
|
|
|
|
+ </div>
|
|
|
|
+ </my-drawer>
|
|
</template>
|
|
</template>
|
|
<script setup name="ViolationFlowDialog">
|
|
<script setup name="ViolationFlowDialog">
|
|
import useClearDialog from '@/hooks/useClearDialog';
|
|
import useClearDialog from '@/hooks/useClearDialog';
|
|
|
|
+import { ChevronUpIcon, ChevronDownIcon } from 'tdesign-icons-vue-next';
|
|
|
|
+import { MessagePlugin } from 'tdesign-vue-next';
|
|
|
|
+
|
|
import { ref, computed } from 'vue';
|
|
import { ref, computed } from 'vue';
|
|
-import { VIOLATION_TYPE, VIOLATION_FLOW_STATUS } from '@/config/constants';
|
|
|
|
-import { dateFormat } from '@/utils/tool';
|
|
|
|
import { useUserStore } from '@/store';
|
|
import { useUserStore } from '@/store';
|
|
-import { violationDetail, violationDetailList, flowViolation } from '@/api/sop';
|
|
|
|
|
|
+import { violationDetailList, flowViolation } from '@/api/sop';
|
|
|
|
+import { timestampFilter, violationTypeFilter } from '@/utils/filter';
|
|
|
|
+
|
|
const userStore = useUserStore();
|
|
const userStore = useUserStore();
|
|
|
|
+
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
visible: Boolean,
|
|
visible: Boolean,
|
|
- curRow: Object,
|
|
|
|
|
|
+ curRow: {
|
|
|
|
+ type: Object,
|
|
|
|
+ default() {
|
|
|
|
+ return {};
|
|
|
|
+ },
|
|
|
|
+ },
|
|
});
|
|
});
|
|
-const { curRow } = props;
|
|
|
|
const emit = defineEmits(['update:visible', 'success']);
|
|
const emit = defineEmits(['update:visible', 'success']);
|
|
|
|
+
|
|
const formRef = ref(null);
|
|
const formRef = ref(null);
|
|
const asyncDetail = ref({});
|
|
const asyncDetail = ref({});
|
|
const tableData = ref([]);
|
|
const tableData = ref([]);
|
|
const showHistory = ref(false);
|
|
const showHistory = ref(false);
|
|
|
|
+
|
|
|
|
+const title = computed(() => {
|
|
|
|
+ return `违规信息(违规流水号:${props.curRow.code})`;
|
|
|
|
+});
|
|
|
|
+
|
|
const getDetail = async () => {
|
|
const getDetail = async () => {
|
|
- //编辑状态下获取回显数据的接口请求业务,如果curRow里的字段够用,就直接把curRow里的字段赋值给formData
|
|
|
|
- // for (let key in formData) {
|
|
|
|
- // formData[key] = props.curRow[key];
|
|
|
|
- // }
|
|
|
|
- violationDetail(curRow.id).then((res) => {
|
|
|
|
- asyncDetail.value = res;
|
|
|
|
- });
|
|
|
|
- violationDetailList(curRow.id).then((res) => {
|
|
|
|
- tableData.value = res;
|
|
|
|
- });
|
|
|
|
|
|
+ const res = await violationDetailList(props.curRow.id);
|
|
|
|
+ tableData.value = res;
|
|
};
|
|
};
|
|
-const { formData, isEdit } = useClearDialog(
|
|
|
|
|
|
+
|
|
|
|
+const { formData } = useClearDialog(
|
|
{
|
|
{
|
|
attachmentIds: '',
|
|
attachmentIds: '',
|
|
remark: '',
|
|
remark: '',
|
|
@@ -162,30 +198,27 @@ const rules = {
|
|
],
|
|
],
|
|
};
|
|
};
|
|
const fileChange = (fileList) => {
|
|
const fileChange = (fileList) => {
|
|
- formData.attachmentIds = fileList.map((item) => item.response.id).join(',');
|
|
|
|
|
|
+ formData.attachmentIds = fileList.map((item) => item.id).join(',');
|
|
};
|
|
};
|
|
const columns = [
|
|
const columns = [
|
|
{ colKey: 'createTime', title: '跟进时间' },
|
|
{ colKey: 'createTime', title: '跟进时间' },
|
|
{ colKey: 'createName', title: '跟进人' },
|
|
{ colKey: 'createName', title: '跟进人' },
|
|
{ colKey: 'remark', title: '跟进说明' },
|
|
{ colKey: 'remark', title: '跟进说明' },
|
|
- { colKey: 'attachmentIds', title: '附件说明' },
|
|
|
|
|
|
+ { colKey: 'attachmentIds', title: '附件说明', cell: 'attachment' },
|
|
];
|
|
];
|
|
-const flowHandler = () => {
|
|
|
|
- flowViolation({
|
|
|
|
|
|
+
|
|
|
|
+const save = async () => {
|
|
|
|
+ const valid = await formRef.value.validate();
|
|
|
|
+ if (valid !== true) return;
|
|
|
|
+
|
|
|
|
+ const res = await flowViolation({
|
|
...formData,
|
|
...formData,
|
|
- delayWarnId: curRow.id,
|
|
|
|
- id: asyncDetail.value.id || undefined,
|
|
|
|
- createId: asyncDetail.createId || undefined,
|
|
|
|
- createTime: asyncDetail.createTime || undefined,
|
|
|
|
- }).then((res) => {
|
|
|
|
- emit('success');
|
|
|
|
- });
|
|
|
|
-};
|
|
|
|
-const save = () => {
|
|
|
|
- formRef.value.validate().then(async (result) => {
|
|
|
|
- if (result === true) {
|
|
|
|
- flowHandler();
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ violationId: props.curRow.id,
|
|
|
|
+ }).catch(() => {});
|
|
|
|
+ if (!res) return;
|
|
|
|
+
|
|
|
|
+ MessagePlugin.success('保存成功');
|
|
|
|
+ emit('update:visible', false);
|
|
|
|
+ emit('success');
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|