|
|
@@ -130,25 +130,6 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
- <!-- 作业位置标记(每张底图可分别打点,由后端 map_point 字段单独保存) -->
|
|
|
- <el-row :gutter="20">
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="作业位置标记:">
|
|
|
- <div class="map-marker-field">
|
|
|
- <map-marker-preview :markers="mapMarkers" />
|
|
|
- <el-button
|
|
|
- v-if="!isView"
|
|
|
- size="mini"
|
|
|
- icon="el-icon-edit"
|
|
|
- @click="openMapMarker"
|
|
|
- >
|
|
|
- {{ mapMarkers.length ? '重新标记' : '标记位置' }}
|
|
|
- </el-button>
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
<el-form-item label="作业票模板:">
|
|
|
<el-input
|
|
|
v-model="templateName"
|
|
|
@@ -239,7 +220,6 @@
|
|
|
<el-button @click="cancel">{{ isView ? '关闭' : '取消' }}</el-button>
|
|
|
</template>
|
|
|
<releaseRules ref="releaseRulesRef" @success="onReleaseRulesSuccess" />
|
|
|
- <map-marker-dialog ref="mapMarkerRef" @confirm="onMapMarkerConfirm" />
|
|
|
</ele-modal>
|
|
|
</template>
|
|
|
|
|
|
@@ -250,8 +230,6 @@
|
|
|
import personSelect from '@/components/CommomSelect/person-select.vue';
|
|
|
import experimentationProcessNew from '@/components/releaseRules/experimentationProcessNew.vue';
|
|
|
import workTicketForm from './components/workTicketForm.vue';
|
|
|
- import mapMarkerDialog from './components/mapMarkerDialog.vue';
|
|
|
- import mapMarkerPreview from './components/mapMarkerPreview.vue';
|
|
|
import areaMixin from '@/mixins/areaMixin';
|
|
|
import dictMixins from '@/mixins/dictMixins';
|
|
|
import dictEnum from '@/enum/dict';
|
|
|
@@ -268,15 +246,14 @@
|
|
|
getProcessInstanceId
|
|
|
} from './constants';
|
|
|
import { buildWorkTypeOptions, resolveWorkTypeLabel } from './workTypes';
|
|
|
- import { parseExtension, parseMapMarkers, buildMapPoint } from './mapMarker';
|
|
|
+ import { parseExtension } from './mapMarker';
|
|
|
import bpmDetail from '@/views/bpm/processInstance/detail.vue';
|
|
|
import {
|
|
|
ticketSave,
|
|
|
ticketUpdate,
|
|
|
ticketGetById,
|
|
|
ticketSubmit,
|
|
|
- ticketListByWorkId,
|
|
|
- ticketMapPoint
|
|
|
+ ticketListByWorkId
|
|
|
} from '@/api/dangerousWork';
|
|
|
import { listOrganizations, getUserPage } from '@/api/system/organization';
|
|
|
|
|
|
@@ -310,8 +287,6 @@
|
|
|
releaseRules,
|
|
|
experimentationProcessNew,
|
|
|
workTicketForm,
|
|
|
- mapMarkerDialog,
|
|
|
- mapMarkerPreview,
|
|
|
bpmDetail
|
|
|
},
|
|
|
mixins: [areaMixin, dictMixins],
|
|
|
@@ -336,10 +311,6 @@
|
|
|
frontendTemplate: null,
|
|
|
// 未匹配到前端模板时的原始作业票内容(降级展示)
|
|
|
rawExtension: null,
|
|
|
- // 作业位置标记(由后端 map_point 字段单独保存)
|
|
|
- mapMarkers: [],
|
|
|
- // 作业票未保存时暂存的地图位置标记,保存后补存
|
|
|
- pendingMarkers: null,
|
|
|
// 选中的作业票模板(发布规则)
|
|
|
templateData: {},
|
|
|
templateName: '',
|
|
|
@@ -648,8 +619,6 @@
|
|
|
this.templateName = '';
|
|
|
this.frontendTemplate = null;
|
|
|
this.rawExtension = null;
|
|
|
- this.mapMarkers = [];
|
|
|
- this.pendingMarkers = null;
|
|
|
this.$refs.experimentationProcessRef?.init('[]');
|
|
|
},
|
|
|
// 用作业票详情回填表单
|
|
|
@@ -680,10 +649,6 @@
|
|
|
// 解析已保存的作业票内容
|
|
|
const extension = parseExtension(detail.extensionJson);
|
|
|
this.form.remark = extension.remark || '';
|
|
|
- // 回显作业位置标记(每张底图一个标记点)
|
|
|
- this.mapMarkers = parseMapMarkers(
|
|
|
- detail?.mapPoint ?? detail?.map_point
|
|
|
- );
|
|
|
// 按作业类型匹配前端内置模板,匹配到则结构化回显
|
|
|
const option = this.workTypeList.find(
|
|
|
(item) => String(item.value) === String(detail.workType)
|
|
|
@@ -718,54 +683,6 @@
|
|
|
this.$refs.form && this.$refs.form.clearValidate();
|
|
|
});
|
|
|
},
|
|
|
- // 打开地图位置标记弹框
|
|
|
- openMapMarker() {
|
|
|
- this.$refs.mapMarkerRef.open(this.mapMarkers);
|
|
|
- },
|
|
|
- // 地图位置标记确认:调用后端专用接口保存(整段覆盖)
|
|
|
- async onMapMarkerConfirm(markers) {
|
|
|
- const list = markers || [];
|
|
|
- this.mapMarkers = list;
|
|
|
- // 作业票还没保存时没有 id,先暂存,等作业票保存后补存
|
|
|
- if (!this.form.id) {
|
|
|
- this.pendingMarkers = list;
|
|
|
- this.$message.success(
|
|
|
- list.length
|
|
|
- ? '地图位置已标记,保存作业票后生效'
|
|
|
- : '已清除地图位置标记'
|
|
|
- );
|
|
|
- return;
|
|
|
- }
|
|
|
- try {
|
|
|
- await ticketMapPoint({
|
|
|
- ticketId: this.form.id,
|
|
|
- // 没有标记时传 null,后端按空值清除标记
|
|
|
- mapPoint: buildMapPoint(list)
|
|
|
- });
|
|
|
- this.$message.success(
|
|
|
- list.length ? '地图位置标记成功' : '已清除地图位置标记'
|
|
|
- );
|
|
|
- } catch (e) {
|
|
|
- // 失败提示由响应拦截器统一处理
|
|
|
- }
|
|
|
- },
|
|
|
- // 保存暂存的地图位置标记:新增作业票保存后补存(编辑态标记已即时保存)
|
|
|
- // 标记保存失败不影响作业票本身的保存/提交,失败提示由响应拦截器统一处理
|
|
|
- // @param ticketId 作业票 id
|
|
|
- async flushPendingMarkers(ticketId) {
|
|
|
- if (!ticketId || !this.pendingMarkers) {
|
|
|
- return;
|
|
|
- }
|
|
|
- try {
|
|
|
- await ticketMapPoint({
|
|
|
- ticketId,
|
|
|
- mapPoint: buildMapPoint(this.pendingMarkers)
|
|
|
- });
|
|
|
- this.pendingMarkers = null;
|
|
|
- } catch (e) {
|
|
|
- // 忽略:作业票已保存,标记可稍后重新标记
|
|
|
- }
|
|
|
- },
|
|
|
cancel() {
|
|
|
this.form = { ...defForm };
|
|
|
this.personList = [];
|
|
|
@@ -773,8 +690,6 @@
|
|
|
this.templateName = '';
|
|
|
this.frontendTemplate = null;
|
|
|
this.rawExtension = null;
|
|
|
- this.mapMarkers = [];
|
|
|
- this.pendingMarkers = null;
|
|
|
this.detailLoading = false;
|
|
|
this.submitLoading = false;
|
|
|
this.newTicketId = '';
|
|
|
@@ -875,18 +790,7 @@
|
|
|
? ticketUpdate(params)
|
|
|
: ticketSave(params);
|
|
|
request
|
|
|
- .then(async (res) => {
|
|
|
- // 新增作业票:保存后补存暂存的地图位置标记
|
|
|
- if (this.pendingMarkers && !this.form.id) {
|
|
|
- const ticketId = await this.resolveSavedTicketId(res, params);
|
|
|
- if (ticketId) {
|
|
|
- await this.flushPendingMarkers(ticketId);
|
|
|
- } else {
|
|
|
- this.$message.warning(
|
|
|
- '作业票已保存,但未获取到作业票ID,地图位置标记未保存,请在作业票列表中重新标记'
|
|
|
- );
|
|
|
- }
|
|
|
- }
|
|
|
+ .then(() => {
|
|
|
this.$message.success(this.isEdit ? '保存成功' : '申请成功');
|
|
|
this.cancel();
|
|
|
this.$emit('reload');
|
|
|
@@ -962,8 +866,6 @@
|
|
|
return;
|
|
|
}
|
|
|
this.newTicketId = ticketId;
|
|
|
- // 新增作业票:补存暂存的地图位置标记
|
|
|
- await this.flushPendingMarkers(ticketId);
|
|
|
}
|
|
|
await ticketSubmit({ id: ticketId, processDefinitionKey });
|
|
|
this.$message.success('提交成功,已发起审批');
|
|
|
@@ -1036,13 +938,6 @@
|
|
|
line-height: 20px;
|
|
|
}
|
|
|
|
|
|
- /* 作业位置标记:缩略图与按钮并排 */
|
|
|
- .map-marker-field {
|
|
|
- display: flex;
|
|
|
- align-items: flex-start;
|
|
|
- gap: 12px;
|
|
|
- }
|
|
|
-
|
|
|
/* 未匹配到前端模板时的原始作业票内容 */
|
|
|
.raw-extension {
|
|
|
width: 100%;
|