|
@@ -82,14 +82,68 @@
|
|
|
</t-col>
|
|
|
</t-row>
|
|
|
</t-form>
|
|
|
- <t-space class="sop-step-footer">
|
|
|
- <template v-if="showAction">
|
|
|
- <t-button theme="primary" @click="submitHandle('START')"
|
|
|
- >提交</t-button
|
|
|
- >
|
|
|
- <t-button theme="default" @click="cancelHandle">取消</t-button>
|
|
|
- </template>
|
|
|
+ <t-space v-if="showAction" class="sop-step-footer">
|
|
|
+ <t-button theme="primary" @click="submitHandle('START')"
|
|
|
+ >提交</t-button
|
|
|
+ >
|
|
|
+ <t-button theme="default" @click="cancelHandle">取消</t-button>
|
|
|
+ </t-space>
|
|
|
+ <t-space v-else class="sop-step-footer" style="flex-direction: row">
|
|
|
+ <t-button theme="primary" @click="cancelHandle">返回</t-button>
|
|
|
</t-space>
|
|
|
+ <!-- setup history -->
|
|
|
+ <div v-if="flowApproveHistoryList.length" class="sop-step-history">
|
|
|
+ <div class="sop-step-history-label" @click="toViewHistory">
|
|
|
+ <ChevronRightDoubleIcon v-if="stepHistoryShow" />
|
|
|
+ <ChevronLeftDoubleIcon v-else />
|
|
|
+ 流程动态
|
|
|
+ </div>
|
|
|
+ <transition name="fade-slide" mode="out-in" appear>
|
|
|
+ <div v-if="stepHistoryShow" class="sop-step-history-content">
|
|
|
+ <div class="content-head">
|
|
|
+ <h2>
|
|
|
+ {{ sopInfo.statusStr }}
|
|
|
+ </h2>
|
|
|
+ </div>
|
|
|
+ <div class="content-body">
|
|
|
+ <t-collapse>
|
|
|
+ <t-collapse-panel
|
|
|
+ v-for="(item, findex) in flowApproveHistoryList"
|
|
|
+ :key="findex"
|
|
|
+ :header="item.taskName"
|
|
|
+ >
|
|
|
+ <template #headerRightContent>
|
|
|
+ <t-space size="small">
|
|
|
+ <span class="collapse-head-right">{{
|
|
|
+ timestampFilter(item.createTime)
|
|
|
+ }}</span>
|
|
|
+ <t-tag
|
|
|
+ :theme="
|
|
|
+ item.approveOperation === 'REJECT'
|
|
|
+ ? 'danger'
|
|
|
+ : 'success'
|
|
|
+ "
|
|
|
+ variant="light"
|
|
|
+ >
|
|
|
+ {{ item.approveRemark }}
|
|
|
+ </t-tag>
|
|
|
+ </t-space>
|
|
|
+ </template>
|
|
|
+ <div class="content-detail">
|
|
|
+ <div class="content-detail-head">
|
|
|
+ {{ item.approveUserName || '--' }}
|
|
|
+ </div>
|
|
|
+ <div class="content-detail-body">
|
|
|
+ <p>开始处理:{{ timestampFilter(item.createTime) }}</p>
|
|
|
+ <p>处理耗时:{{ item.duration }}</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </t-collapse-panel>
|
|
|
+ </t-collapse>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </transition>
|
|
|
+ </div>
|
|
|
</t-tab-panel>
|
|
|
</t-tabs>
|
|
|
</div>
|
|
@@ -97,6 +151,10 @@
|
|
|
|
|
|
<script setup name="QualityIssue">
|
|
|
import { ref, computed, watch, reactive } from 'vue';
|
|
|
+import {
|
|
|
+ ChevronLeftDoubleIcon,
|
|
|
+ ChevronRightDoubleIcon,
|
|
|
+} from 'tdesign-icons-vue-next';
|
|
|
import {
|
|
|
issuesFeedbackSaveApi,
|
|
|
issuesFeedbackApproveApi,
|
|
@@ -104,6 +162,9 @@ import {
|
|
|
import { flowFormPropertiesApi, sopFlowViewApi } from '@/api/sop';
|
|
|
import { MessagePlugin } from 'tdesign-vue-next';
|
|
|
import DynamicFormItem from '../../components/dynamic-form-item/index.vue';
|
|
|
+import { CUSTOMER_TYPE } from '@/config/constants';
|
|
|
+import { timeNumberToText } from '@/utils/tool';
|
|
|
+import { timestampFilter } from '@/utils/filter';
|
|
|
|
|
|
const props = defineProps({
|
|
|
sop: {
|
|
@@ -119,9 +180,35 @@ const props = defineProps({
|
|
|
});
|
|
|
const emit = defineEmits(['confirm', 'cancel']);
|
|
|
|
|
|
+const stepHistoryShow = ref(false);
|
|
|
+const flowApproveHistoryList = ref([]);
|
|
|
+function getFlowApproveHistoryList(data, allStepData) {
|
|
|
+ if (!data) return [];
|
|
|
+
|
|
|
+ let setupData = {};
|
|
|
+ allStepData.forEach((item) => {
|
|
|
+ setupData[item.setup] = item.taskName;
|
|
|
+ });
|
|
|
+ let lastTime = 0;
|
|
|
+ return data.map((item, index) => {
|
|
|
+ let nitem = { ...item };
|
|
|
+ nitem.duration =
|
|
|
+ index === 0 ? '-' : timeNumberToText(item.createTime - lastTime);
|
|
|
+ lastTime = item.createTime;
|
|
|
+ nitem.taskName = setupData[item.approveSetup];
|
|
|
+ return nitem;
|
|
|
+ });
|
|
|
+}
|
|
|
+const toViewHistory = () => {
|
|
|
+ stepHistoryShow.value = !stepHistoryShow.value;
|
|
|
+};
|
|
|
+
|
|
|
const IS_NEW_MODE = computed(() => {
|
|
|
return props.type === 'new';
|
|
|
});
|
|
|
+const IS_VIEW_MODE = computed(() => {
|
|
|
+ return props.type === 'view';
|
|
|
+});
|
|
|
const IS_FILL_MODE = computed(() => {
|
|
|
return props.type === 'fill';
|
|
|
});
|
|
@@ -134,6 +221,7 @@ const sopInfo = reactive({
|
|
|
crmNo: props.sop.crmNo,
|
|
|
productName: props.sop.productName,
|
|
|
crmName: props.sop.crmName,
|
|
|
+ statusStr: props.sop.statusStr,
|
|
|
});
|
|
|
|
|
|
const needValueCodes = [
|
|
@@ -197,17 +285,15 @@ const initFill = async () => {
|
|
|
sopInfo.crmName = crmInfo.value.crmName;
|
|
|
sopInfo.productName = crmInfo.value.productName;
|
|
|
sopInfo.serviceName = crmInfo.value.serviceUnitName;
|
|
|
+ sopInfo.sopNo = res.sopNo;
|
|
|
+ sopInfo.customManagerTypeStr = CUSTOMER_TYPE[crmInfo.value.customType];
|
|
|
|
|
|
- curStep.value = res.currFlowTaskResult.taskName;
|
|
|
- currFlowTaskResultSetup.value = res.currFlowTaskResult.setup;
|
|
|
- curStepSetup.value = res.currFlowTaskResult.setup;
|
|
|
res.flowTaskHistoryList = res.flowTaskHistoryList || [];
|
|
|
res.flowTaskHistoryList.forEach((item) => {
|
|
|
item.formProperty.forEach((v) => {
|
|
|
v.writable = false;
|
|
|
});
|
|
|
});
|
|
|
- allSteps.value = [...res.flowTaskHistoryList, res.currFlowTaskResult];
|
|
|
tabs.value = [
|
|
|
...res.flowTaskHistoryList.map((item) => {
|
|
|
return {
|
|
@@ -215,16 +301,33 @@ const initFill = async () => {
|
|
|
label: item.taskName,
|
|
|
};
|
|
|
}),
|
|
|
- {
|
|
|
+ ];
|
|
|
+
|
|
|
+ if (res.currFlowTaskResult) {
|
|
|
+ curStep.value = res.currFlowTaskResult.taskName;
|
|
|
+ currFlowTaskResultSetup.value = res.currFlowTaskResult.setup;
|
|
|
+ curStepSetup.value = res.currFlowTaskResult.setup;
|
|
|
+
|
|
|
+ allSteps.value = [...res.flowTaskHistoryList, res.currFlowTaskResult];
|
|
|
+ tabs.value.push({
|
|
|
value: res.currFlowTaskResult.taskName,
|
|
|
label: res.currFlowTaskResult.taskName,
|
|
|
- },
|
|
|
- ];
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ allSteps.value = [...res.flowTaskHistoryList];
|
|
|
+ curStepSetup.value = allSteps.value[0].setup;
|
|
|
+ curStep.value = allSteps.value[0].taskName;
|
|
|
+ }
|
|
|
+
|
|
|
allSteps.value.forEach((item) => {
|
|
|
item.formProperty.forEach((prop) => {
|
|
|
prop.value = prop.value ? JSON.parse(prop.value).value : null;
|
|
|
});
|
|
|
});
|
|
|
+ flowApproveHistoryList.value = getFlowApproveHistoryList(
|
|
|
+ res.flowApproveHistoryList,
|
|
|
+ allSteps.value
|
|
|
+ );
|
|
|
loading.value = false;
|
|
|
};
|
|
|
|
|
@@ -257,6 +360,11 @@ const curFormConfig = computed(() => {
|
|
|
if (!stepData) return [];
|
|
|
|
|
|
const formProperty = stepData.formProperty || [];
|
|
|
+ if (IS_VIEW_MODE.value) {
|
|
|
+ formProperty.forEach((item) => {
|
|
|
+ item.writable = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
return formProperty;
|
|
|
});
|
|
|
watch(curFormConfig, (val) => {
|