|
|
@@ -200,6 +200,37 @@
|
|
200
|
200
|
</el-col>
|
|
201
|
201
|
</el-row>
|
|
202
|
202
|
</el-form>
|
|
|
203
|
+ <!-- 工单查看按钮 -->
|
|
|
204
|
+ <div style="margin-top: 20px; padding: 0 10px;">
|
|
|
205
|
+ <h4 style="margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid #e6ebf5; color: #303133; font-size: 14px; font-weight: 600;">关联工单</h4>
|
|
|
206
|
+ <div v-if="Array.isArray(dialogModel.workIds) && dialogModel.workIds.length > 0" style="display: flex; flex-wrap: wrap; gap: 10px;">
|
|
|
207
|
+ <el-button
|
|
|
208
|
+ v-for="(workId, index) in dialogModel.workIds"
|
|
|
209
|
+ :key="index"
|
|
|
210
|
+ type="info"
|
|
|
211
|
+ size="small"
|
|
|
212
|
+ plain
|
|
|
213
|
+ style="border-radius: 4px; padding: 6px 15px;"
|
|
|
214
|
+ @click="viewWorkOrder(workId)"
|
|
|
215
|
+ >
|
|
|
216
|
+ <i class="el-icon-document" /> 工单 {{ index + 1 }}
|
|
|
217
|
+ </el-button>
|
|
|
218
|
+ </div>
|
|
|
219
|
+ <div v-else-if="dialogModel.workIds && typeof dialogModel.workIds === 'number' && dialogModel.workIds > 0" style="display: flex; gap: 10px;">
|
|
|
220
|
+ <el-button
|
|
|
221
|
+ type="info"
|
|
|
222
|
+ size="small"
|
|
|
223
|
+ plain
|
|
|
224
|
+ style="border-radius: 4px; padding: 6px 15px;"
|
|
|
225
|
+ @click="viewWorkOrder(dialogModel.workIds)"
|
|
|
226
|
+ >
|
|
|
227
|
+ <i class="el-icon-document" /> 查看工单
|
|
|
228
|
+ </el-button>
|
|
|
229
|
+ </div>
|
|
|
230
|
+ <div v-else style="color: #909399; font-size: 13px; padding: 10px 0;">
|
|
|
231
|
+ 无关联工单
|
|
|
232
|
+ </div>
|
|
|
233
|
+ </div>
|
|
203
|
234
|
</div>
|
|
204
|
235
|
</el-card>
|
|
205
|
236
|
</el-aside>
|
|
|
@@ -210,7 +241,7 @@
|
|
210
|
241
|
<div slot="header" class="clearfix">
|
|
211
|
242
|
<span>巡查轨迹</span>
|
|
212
|
243
|
<el-button type="primary" size="mini" style="padding:5px; float:right; margin-right: 10px" :icon="dialogFormShowBtnIconFile" @click="btnFormShowFile">{{ btnFormShowFileTitle }}</el-button>
|
|
213
|
|
- <el-button v-if="btnvisiblexcgj" type="primary" size="mini" :icon="dialogFormShowBtnIcon" style="padding:5px; float:right; margin-right: 10px" @click="btnFormShowBtn1">{{ dialogFormShowBtn1 }}</el-button>
|
|
|
244
|
+ <!-- <el-button v-if="btnvisiblexcgj" type="primary" size="mini" :icon="dialogFormShowBtnIcon" style="padding:5px; float:right; margin-right: 10px" @click="btnFormShowBtn1">{{ dialogFormShowBtn1 }}</el-button> -->
|
|
214
|
245
|
</div>
|
|
215
|
246
|
<!-- 查看巡视轨迹地图 -->
|
|
216
|
247
|
<div v-show="dialogFormShowMap" id="amapContainer" class="box-cardhchild" />
|
|
|
@@ -749,41 +780,45 @@
|
|
749
|
780
|
openFile(url) {
|
|
750
|
781
|
window.open(url)
|
|
751
|
782
|
},
|
|
752
|
|
- btnFormShowBtn1() {
|
|
753
|
|
- this.dialogFormVisiblexcgj = true
|
|
754
|
|
- if (this.workIds > 0 || this.workIds !== null) {
|
|
755
|
|
- this.btnvisiblexcgj = true
|
|
756
|
|
- // 请求获取详细信息
|
|
757
|
|
- request({
|
|
758
|
|
- url: '/workorderbaseApp/selectAppWorkorderbaseById',
|
|
759
|
|
- method: 'post',
|
|
760
|
|
- data: {
|
|
761
|
|
- fWorkorderid: this.workIds
|
|
762
|
|
- }
|
|
763
|
|
- })
|
|
764
|
|
- .then(res => {
|
|
765
|
|
- this.loadingdialog = false
|
|
766
|
|
- if (res.status === 200) {
|
|
767
|
|
- console.log(res.data)
|
|
768
|
|
- this.dialogModelxsxc = res.data.tWoWorkorderbase
|
|
769
|
|
- // this.dialogModel = res.data.tWoWorkorderbase
|
|
770
|
|
- this.dialogModelList = res.data.tWoWorkordertaskdealinfos
|
|
771
|
|
- for (var i = 0; i < this.dialogModelList.length; i++) {
|
|
772
|
|
- for (var j = 0; j < this.dialogModelList[i].imgList.length; j++) {
|
|
773
|
|
- this.srcList.push(this.dialogModelList[i].imgList[j].fFileurl)
|
|
774
|
|
- }
|
|
775
|
|
- }
|
|
776
|
|
- } else {
|
|
777
|
|
- this.$message.error('加载失败:' + res.data)
|
|
778
|
|
- }
|
|
779
|
|
- })
|
|
780
|
|
- .catch(err => {
|
|
781
|
|
- this.loadingdialog = false
|
|
782
|
|
- this.$message.error(err || '加载失败')
|
|
783
|
|
- })
|
|
784
|
|
- } else {
|
|
785
|
|
- this.btnvisiblexcgj = false
|
|
786
|
|
- }
|
|
|
783
|
+ viewWorkOrder(workId) {
|
|
|
784
|
+ this.workIds = workId
|
|
|
785
|
+ this.dialogFormVisiblexcgj = true
|
|
|
786
|
+ if (workId > 0 || workId !== null) {
|
|
|
787
|
+ this.btnvisiblexcgj = true
|
|
|
788
|
+ // 请求获取详细信息
|
|
|
789
|
+ request({
|
|
|
790
|
+ url: '/workorderbaseApp/selectAppWorkorderbaseById',
|
|
|
791
|
+ method: 'post',
|
|
|
792
|
+ data: {
|
|
|
793
|
+ fWorkorderid: workId
|
|
|
794
|
+ }
|
|
|
795
|
+ })
|
|
|
796
|
+ .then(res => {
|
|
|
797
|
+ this.loadingdialog = false
|
|
|
798
|
+ if (res.status === 200) {
|
|
|
799
|
+ console.log(res.data)
|
|
|
800
|
+ this.dialogModelxsxc = res.data.tWoWorkorderbase
|
|
|
801
|
+ // this.dialogModel = res.data.tWoWorkorderbase
|
|
|
802
|
+ this.dialogModelList = res.data.tWoWorkordertaskdealinfos
|
|
|
803
|
+ for (var i = 0; i < this.dialogModelList.length; i++) {
|
|
|
804
|
+ for (var j = 0; j < this.dialogModelList[i].imgList.length; j++) {
|
|
|
805
|
+ this.srcList.push(this.dialogModelList[i].imgList[j].fFileurl)
|
|
|
806
|
+ }
|
|
|
807
|
+ }
|
|
|
808
|
+ } else {
|
|
|
809
|
+ this.$message.error('加载失败:' + res.data)
|
|
|
810
|
+ }
|
|
|
811
|
+ })
|
|
|
812
|
+ .catch(err => {
|
|
|
813
|
+ this.loadingdialog = false
|
|
|
814
|
+ this.$message.error(err || '加载失败')
|
|
|
815
|
+ })
|
|
|
816
|
+ } else {
|
|
|
817
|
+ this.btnvisiblexcgj = false
|
|
|
818
|
+ }
|
|
|
819
|
+ },
|
|
|
820
|
+ btnFormShowBtn1() {
|
|
|
821
|
+ this.viewWorkOrder(this.workIds)
|
|
787
|
822
|
},
|
|
788
|
823
|
btnFormShowBtn() {
|
|
789
|
824
|
if (this.dialogFormShowForm) {
|
|
|
@@ -849,7 +884,7 @@
|
|
849
|
884
|
|
|
850
|
885
|
// 请求获取详细信息
|
|
851
|
886
|
request({
|
|
852
|
|
- url: '/t-zgzs-patrol-track/selectTzgzsPatrolTrackById',
|
|
|
887
|
+ url: '/lhgyWork/selectPatrolTrackById',
|
|
853
|
888
|
method: 'post',
|
|
854
|
889
|
data: {
|
|
855
|
890
|
id: obj.id
|
|
|
@@ -858,22 +893,38 @@
|
|
858
|
893
|
.then(res => {
|
|
859
|
894
|
this.loadingdialog = false
|
|
860
|
895
|
if (res.status === 200) {
|
|
861
|
|
- this.dialogModel = res.data
|
|
862
|
|
- const mapARRS = res.data.totalCoordinatesGc.split(';')
|
|
863
|
|
- const arrsi = []
|
|
864
|
|
- mapARRS.forEach((item, index) => {
|
|
865
|
|
- if (item != '') {
|
|
866
|
|
- arrsi.push(item)
|
|
867
|
|
- }
|
|
868
|
|
- })
|
|
869
|
|
- const arrsis = []
|
|
870
|
|
- arrsi.forEach((item, index) => {
|
|
871
|
|
- let point = [0, 0]
|
|
872
|
|
- const x = item.split(',')[0]
|
|
873
|
|
- const y = item.split(',')[1]
|
|
874
|
|
- point = [y, x]
|
|
875
|
|
- arrsis.push(point)
|
|
876
|
|
- })
|
|
|
896
|
+ this.dialogModel = res.data
|
|
|
897
|
+
|
|
|
898
|
+ // 处理workIds,确保如果是字符串或数字,转换为数组格式方便显示多个按钮
|
|
|
899
|
+ if (this.dialogModel.workIds) {
|
|
|
900
|
+ if (typeof this.dialogModel.workIds === 'string') {
|
|
|
901
|
+ // 如果是字符串,尝试分割成数组
|
|
|
902
|
+ if (this.dialogModel.workIds.includes(',')) {
|
|
|
903
|
+ this.dialogModel.workIds = this.dialogModel.workIds.split(',').map(id => parseInt(id.trim()))
|
|
|
904
|
+ } else {
|
|
|
905
|
+ this.dialogModel.workIds = [parseInt(this.dialogModel.workIds)]
|
|
|
906
|
+ }
|
|
|
907
|
+ } else if (typeof this.dialogModel.workIds === 'number') {
|
|
|
908
|
+ // 如果是数字,转换为数组
|
|
|
909
|
+ this.dialogModel.workIds = [this.dialogModel.workIds]
|
|
|
910
|
+ }
|
|
|
911
|
+ }
|
|
|
912
|
+
|
|
|
913
|
+ const mapARRS = res.data.totalCoordinatesGc.split(';')
|
|
|
914
|
+ const arrsi = []
|
|
|
915
|
+ mapARRS.forEach((item, index) => {
|
|
|
916
|
+ if (item != '') {
|
|
|
917
|
+ arrsi.push(item)
|
|
|
918
|
+ }
|
|
|
919
|
+ })
|
|
|
920
|
+ const arrsis = []
|
|
|
921
|
+ arrsi.forEach((item, index) => {
|
|
|
922
|
+ let point = [0, 0]
|
|
|
923
|
+ const x = item.split(',')[0]
|
|
|
924
|
+ const y = item.split(',')[1]
|
|
|
925
|
+ point = [y, x]
|
|
|
926
|
+ arrsis.push(point)
|
|
|
927
|
+ })
|
|
877
|
928
|
|
|
878
|
929
|
// 绘制轨迹
|
|
879
|
930
|
const polyline = new AMap.Polyline({
|
|
|
@@ -1308,7 +1359,8 @@
|
|
1308
|
1359
|
datas = this.page
|
|
1309
|
1360
|
}
|
|
1310
|
1361
|
request({
|
|
1311
|
|
- url: '/t-zgzs-patrol-track/selectTzgzsPatroTrackByPageList',
|
|
|
1362
|
+ // url: '/t-zgzs-patrol-track/selectTzgzsPatroTrackByPageList',
|
|
|
1363
|
+ url: '/lhgyWork/selectPatrolTrackByPage',
|
|
1312
|
1364
|
method: 'post',
|
|
1313
|
1365
|
data: this.page
|
|
1314
|
1366
|
})
|