|
@@ -387,6 +387,18 @@ const initFill = async () => {
|
|
|
});
|
|
|
});
|
|
|
if (res.currFlowTaskResult) {
|
|
|
+ res.currFlowTaskResult.formProperty =
|
|
|
+ res.currFlowTaskResult.formProperty.map((item) => {
|
|
|
+ //设备出库时间和设备入库时间,赋予默认值为当前时间
|
|
|
+ if (
|
|
|
+ ['device_out_time_4', 'device_in_time_10'].includes(item.formName) &&
|
|
|
+ !item.value
|
|
|
+ ) {
|
|
|
+ let now = Date.now();
|
|
|
+ item.value = JSON.stringify({ value: now });
|
|
|
+ }
|
|
|
+ return item;
|
|
|
+ });
|
|
|
currFlowTaskResultSetup.value = res.currFlowTaskResult.setup;
|
|
|
allSteps.value = [...res.flowTaskHistoryList, res.currFlowTaskResult];
|
|
|
|
|
@@ -394,6 +406,7 @@ const initFill = async () => {
|
|
|
const stepData = allSteps.value.find(
|
|
|
(item) => item.taskKey === curStep.value
|
|
|
);
|
|
|
+
|
|
|
curStepData.value = stepData;
|
|
|
} else {
|
|
|
allSteps.value = [...res.flowTaskHistoryList];
|
|
@@ -417,9 +430,26 @@ const initEdit = async () => {
|
|
|
crmInfo.value = res.crmInfo || {};
|
|
|
updateSopInfo(crmInfo.value);
|
|
|
sopEditDetail.value = res;
|
|
|
- allSteps.value = Object.values(res.setupMap).sort(
|
|
|
- (a, b) => a.setup - b.setup
|
|
|
- );
|
|
|
+ allSteps.value = Object.values(res.setupMap)
|
|
|
+ .sort((a, b) => a.setup - b.setup)
|
|
|
+ //2023-11-20新增需求,编辑时,第一步里,除了那3个选人的地方,其余全部改为可写状态
|
|
|
+ .map((item) => {
|
|
|
+ if (item.setup == 1) {
|
|
|
+ item.formProperty = item.formProperty.map((v) => {
|
|
|
+ if (
|
|
|
+ ![
|
|
|
+ 'region_user_id_1',
|
|
|
+ 'engineer_user_id_1',
|
|
|
+ 'assistant_engineer_user_id_1',
|
|
|
+ ].includes(v.formName)
|
|
|
+ ) {
|
|
|
+ v.writable = true;
|
|
|
+ }
|
|
|
+ return v;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return item;
|
|
|
+ });
|
|
|
flowApproveHistoryList.value = getFlowApproveHistoryList(
|
|
|
res.flowApproveHistoryList
|
|
|
);
|
|
@@ -450,9 +480,16 @@ const init = () => {
|
|
|
};
|
|
|
init();
|
|
|
|
|
|
+const maxStep = computed(() => {
|
|
|
+ return Math.max(...allSteps.value.map((item) => item.setup));
|
|
|
+});
|
|
|
+
|
|
|
const showAction = computed(() => {
|
|
|
if (
|
|
|
- (IS_EDIT_MODE.value && curStepData.value.setup !== 1) ||
|
|
|
+ // (IS_EDIT_MODE.value && curStepData.value.setup !== 1) ||
|
|
|
+ (IS_EDIT_MODE.value &&
|
|
|
+ (curStepData.value.setup == 1 ||
|
|
|
+ curStepData.value.setup == maxStep.value)) ||
|
|
|
IS_NEW_MODE.value
|
|
|
)
|
|
|
return true;
|