|
@@ -34,6 +34,7 @@ const FORM_KEYS = [
|
|
|
"deptName",
|
|
"deptName",
|
|
|
"contractName",
|
|
"contractName",
|
|
|
"taskName",
|
|
"taskName",
|
|
|
|
|
+ "relatedTasks",
|
|
|
"dailyGasInjection",
|
|
"dailyGasInjection",
|
|
|
"dailyWaterInjection",
|
|
"dailyWaterInjection",
|
|
|
"dailyInjectGasTime",
|
|
"dailyInjectGasTime",
|
|
@@ -123,6 +124,30 @@ const dictStore = useDataDictStore();
|
|
|
const nptReasonOptions = ref([]);
|
|
const nptReasonOptions = ref([]);
|
|
|
const constructionStatusOptions = ref([]);
|
|
const constructionStatusOptions = ref([]);
|
|
|
|
|
|
|
|
|
|
+const relatedTaskOptions = computed(() => {
|
|
|
|
|
+ const relatedTasks = form.value.relatedTasks;
|
|
|
|
|
+ if (!relatedTasks || Object.keys(relatedTasks).length === 0) {
|
|
|
|
|
+ const taskId = form.value.taskId;
|
|
|
|
|
+ if (taskId === null || taskId === undefined || taskId === "") return [];
|
|
|
|
|
+ return [
|
|
|
|
|
+ {
|
|
|
|
|
+ text: form.value.taskName || String(taskId),
|
|
|
|
|
+ value: taskId,
|
|
|
|
|
+ },
|
|
|
|
|
+ ];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return Object.entries(relatedTasks).map(([key, value]) => ({
|
|
|
|
|
+ text: value,
|
|
|
|
|
+ value: Number.isNaN(Number(key)) ? key : Number(key),
|
|
|
|
|
+ }));
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
|
|
+const handleTaskChange = (value) => {
|
|
|
|
|
+ const current = relatedTaskOptions.value.find((item) => item.value === value);
|
|
|
|
|
+ if (current) form.value.taskName = current.text;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
const loadOptions = () => {
|
|
const loadOptions = () => {
|
|
|
nptReasonOptions.value = dictStore
|
|
nptReasonOptions.value = dictStore
|
|
|
.getStrDictOptions("nptReason")
|
|
.getStrDictOptions("nptReason")
|
|
@@ -290,8 +315,16 @@ defineExpose({ formRef, form, loadDetail });
|
|
|
<uni-forms-item label="项目" name="contractName">
|
|
<uni-forms-item label="项目" name="contractName">
|
|
|
<span class="readOnly">{{ form.contractName }}</span>
|
|
<span class="readOnly">{{ form.contractName }}</span>
|
|
|
</uni-forms-item>
|
|
</uni-forms-item>
|
|
|
- <uni-forms-item label="任务" name="taskName">
|
|
|
|
|
- <span class="readOnly">{{ form.taskName }}</span>
|
|
|
|
|
|
|
+ <uni-forms-item label="任务" name="taskId">
|
|
|
|
|
+ <uni-data-select
|
|
|
|
|
+ :clear="false"
|
|
|
|
|
+ align="right"
|
|
|
|
|
+ placeholder="请选择"
|
|
|
|
|
+ :localdata="relatedTaskOptions"
|
|
|
|
|
+ placement="top"
|
|
|
|
|
+ :disabled="disabled('edit')"
|
|
|
|
|
+ v-model="form.taskId"
|
|
|
|
|
+ @change="handleTaskChange" />
|
|
|
</uni-forms-item>
|
|
</uni-forms-item>
|
|
|
<uni-forms-item label="施工区域" name="location">
|
|
<uni-forms-item label="施工区域" name="location">
|
|
|
<span class="readOnly">{{ form.location }}</span>
|
|
<span class="readOnly">{{ form.location }}</span>
|