提交 415d4376 authored 作者: JaxBBLL's avatar JaxBBLL

fix: styles fix

上级 6b8010dd
...@@ -54,7 +54,7 @@ export default { ...@@ -54,7 +54,7 @@ export default {
this.ctx.fillStyle = "#ffffff"; this.ctx.fillStyle = "#ffffff";
this.ctx.fillRect(0, 0, this.canvasWidth, this.canvasHeight); this.ctx.fillRect(0, 0, this.canvasWidth, this.canvasHeight);
this.ctx.setStrokeStyle("#000000"); // 设置线条颜色 this.ctx.setStrokeStyle("#000000"); // 设置线条颜色
this.ctx.setLineWidth(2); // 设置线条宽度 this.ctx.setLineWidth(4); // 设置线条宽度
this.ctx.setLineCap("round"); // 设置线条端点样式 this.ctx.setLineCap("round"); // 设置线条端点样式
this.ctx.setLineJoin("round"); // 设置线条连接样式 this.ctx.setLineJoin("round"); // 设置线条连接样式
this.ctx.draw(true); // 立即绘制背景 this.ctx.draw(true); // 立即绘制背景
...@@ -76,6 +76,9 @@ export default { ...@@ -76,6 +76,9 @@ export default {
if (this.points.length >= 2) { if (this.points.length >= 2) {
this.ctx.beginPath(); this.ctx.beginPath();
this.ctx.setLineWidth(4); // 设置线条宽度
this.ctx.setLineCap("round"); // 设置线条端点样式
this.ctx.setLineJoin("round"); // 设置线条连接样式
this.ctx.moveTo( this.ctx.moveTo(
this.points[this.points.length - 2].x, this.points[this.points.length - 2].x,
this.points[this.points.length - 2].y this.points[this.points.length - 2].y
...@@ -186,6 +189,7 @@ export default { ...@@ -186,6 +189,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
z-index: 5000;
.signature-canvas { .signature-canvas {
width: 761.6px; width: 761.6px;
height: 302.4px; height: 302.4px;
......
...@@ -64,7 +64,11 @@ ...@@ -64,7 +64,11 @@
{ {
"path": "pages/inspectionContent/inspectionContentList", "path": "pages/inspectionContent/inspectionContentList",
"style": { "style": {
"navigationBarTitleText": "" "navigationBarTitleText": "",
"app-plus":{
// 将回弹属性关掉
"bounce":"none"
}
} }
}, },
// 机房巡检新页面 // 机房巡检新页面
...@@ -78,7 +82,11 @@ ...@@ -78,7 +82,11 @@
{ {
"path": "pages/shaftInspection/shaftInspectionList", "path": "pages/shaftInspection/shaftInspectionList",
"style": { "style": {
"navigationBarTitleText": "" "navigationBarTitleText": "",
"app-plus":{
// 将回弹属性关掉
"bounce":"none"
}
} }
}, },
// 井道巡检新页面 // 井道巡检新页面
......
<template> <template>
<view class="container"> <view class="container">
<uni-nav-bar <uni-nav-bar :fixed="true" background-color="rgba(214, 240, 255, 0.0)" status-bar rightWidth="240">
:fixed="true"
background-color="rgba(214, 240, 255, 0.0)"
status-bar
rightWidth="240"
>
<block slot="left"> <block slot="left">
<view class="" @click="back"> <view class="" @click="back">
<text class="iconfont icon-fanhui"></text> <text class="iconfont icon-fanhui"></text>
...@@ -21,27 +16,24 @@ ...@@ -21,27 +16,24 @@
<view class="profile-box"> <view class="profile-box">
<view class="profile-left"> <view class="profile-left">
<view class="avatar"> <view class="avatar">
<image <image src="@/static/img/add-img/defaultAvatar.png" mode="aspectFit"></image>
src="@/static/img/add-img/defaultAvatar.png"
mode="aspectFit"
></image>
</view> </view>
<view class="info"> <view class="info">
<view class="describe"> <view class="describe">
<view class="username">{{ userInfo.user }}</view> <view class="username">{{ userInfo.user }}</view>
<view v-if="abnormalLengths" class="abnormal" <view v-if="abnormalLengths" class="abnormal">存在异常 {{ abnormalLengths }}</view>
>存在异常 {{ abnormalLengths }}</view
>
</view> </view>
<view class="describe"> <view class="describe">
<view class="number" <view class="number">
>巡检编号:<text class="value">{{ inspectionCode }}</text></view 巡检编号:
> <text class="value">{{ inspectionCode }}</text>
<view v-if="!!isSign" class="number" </view>
>巡检时间:<text class="value"> <view v-if="!!isSign" class="number">
巡检时间:
<text class="value">
{{ updateDate }} {{ updateDate }}
</text></view </text>
> </view>
</view> </view>
</view> </view>
</view> </view>
...@@ -52,72 +44,46 @@ ...@@ -52,72 +44,46 @@
:disabled="!allIsSubmitOne" :disabled="!allIsSubmitOne"
class="record-button" class="record-button"
:class="{ :class="{
'is-disabled': !allIsSubmitOne, 'is-disabled': !allIsSubmitOne
}" }"
@click="toSign" @click="toSign"
> >
巡检人签字 巡检人签字
</button> </button>
<div v-else style="display: flex"> <div v-else style="display: flex">
<image <image class="sign-img" mode="aspectFit" :src="detailsInfo.signImg" @click="previewImage([detailsInfo.signImg], 0)"></image>
style="width: 120px; height: 40px" <button v-if="detailsInfo.synchronization != 1" class="record-button" @click="toSign">重签</button>
mode="aspectFit"
:src="detailsInfo.signImg"
@click="previewImage([detailsInfo.signImg], 0)"
></image>
<button
v-if="detailsInfo.synchronization != 1"
class="record-button"
@click="toSign"
>
重签
</button>
</div> </div>
<template v-if="allIsSubmitOne"> <template v-if="allIsSubmitOne">
<button <button v-if="detailsInfo.synchronization != 1 && isSign" class="inspection-button ml-10" @click="onSyncData(true)">数据同步</button>
v-if="detailsInfo.synchronization != 1 && isSign"
class="inspection-button ml-10"
@click="onSyncData(true)"
>
数据同步
</button>
</template> </template>
</view> </view>
</view> </view>
</view> </view>
<view class="box" v-if="!isSign"> <view class="box" v-if="!isSign">
<view class="bar"> <view class="bar">
<view class="title"> 巡检进度 </view> <view class="title">巡检进度</view>
<view class="dai"> <view class="dai">
待巡检 待巡检
<text class="num">{{ listData.length - inspectionNumber }}</text <text class="num">{{ listData.length - inspectionNumber }}</text>
>个机房</view 个机房
> </view>
<view class="yi"> <view class="yi">
已完成 <text class="num">{{ inspectionNumber }}</text 已完成
>个机房</view <text class="num">{{ inspectionNumber }}</text>
> 个机房
</view>
</view> </view>
</view> </view>
<view v-if="!isSign" class="card-box"> <view v-if="!isSign" class="card-box">
<view <view class="card-row" :class="{ right: rowIndex % 2 !== 0 }" v-for="(row, rowIndex) in rows" :key="rowIndex">
class="card-row" <view class="card-wrapper" v-for="(card, cardIndex) in row" :key="cardIndex" @click="startDialog(card.name, card.jfType, card.value, false)">
:class="{ right: rowIndex % 2 !== 0 }"
v-for="(row, rowIndex) in rows"
:key="rowIndex"
>
<view
class="card-wrapper"
v-for="(card, cardIndex) in row"
:key="cardIndex"
@click="startDialog(card.name, card.jfType, card.value, false)"
>
<view <view
class="card" class="card"
:class="{ :class="{
status1: card.status == 1, status1: card.status == 1,
status2: card.status == 2, status2: card.status == 2,
active: value === card.value, active: value === card.value
}" }"
> >
<view class="card-content"> <view class="card-content">
...@@ -126,18 +92,9 @@ ...@@ -126,18 +92,9 @@
<text class="iconfont icon-weixunjian"></text> <text class="iconfont icon-weixunjian"></text>
</template> </template>
<template v-else> <template v-else>
<text <text v-if="card.status == 0" class="iconfont icon-weixunjian"></text>
v-if="card.status == 0" <text v-if="card.status == 1" class="iconfont icon-wancheng"></text>
class="iconfont icon-weixunjian" <text v-if="card.status == 2" class="iconfont icon-shibai1"></text>
></text>
<text
v-if="card.status == 1"
class="iconfont icon-wancheng"
></text>
<text
v-if="card.status == 2"
class="iconfont icon-shibai1"
></text>
</template> </template>
<text class="status" v-if="card.isSubmit == 0">草稿</text> <text class="status" v-if="card.isSubmit == 0">草稿</text>
...@@ -148,69 +105,32 @@ ...@@ -148,69 +105,32 @@
</view> </view>
</view> </view>
<view class="spacer-image right" v-if="cardIndex < row.length - 1"> <view class="spacer-image right" v-if="cardIndex < row.length - 1">
<image <image v-if="inspectionNumber == 11" class="img" src="@/static/img/arr2.svg" mode="aspectFit"></image>
v-if="inspectionNumber == 11" <image v-else class="img" src="@/static/img/arr1.svg" mode="aspectFit"></image>
class="img"
src="@/static/img/arr2.svg"
mode="aspectFit"
></image>
<image
v-else
class="img"
src="@/static/img/arr1.svg"
mode="aspectFit"
></image>
</view> </view>
<view class="spacer-image bottom" v-if="rowIndex < rows.length - 1"> <view class="spacer-image bottom" v-if="rowIndex < rows.length - 1">
<view <view v-if="(rowIndex == 1 && cardIndex == 0) || (rowIndex == 0 && cardIndex == 4)">
v-if=" <image v-if="inspectionNumber == 11" class="img" src="@/static/img/arr2.svg" mode="aspectFit"></image>
(rowIndex == 1 && cardIndex == 0) || <image v-else class="img" src="@/static/img/arr1.svg" mode="aspectFit"></image>
(rowIndex == 0 && cardIndex == 4) </view>
" </view>
> </view>
<image
v-if="inspectionNumber == 11"
class="img"
src="@/static/img/arr2.svg"
mode="aspectFit"
></image>
<image
v-else
class="img"
src="@/static/img/arr1.svg"
mode="aspectFit"
></image>
</view> </view>
</view> </view>
</view> </view>
</view> </view
></view>
<view v-else class="card-box detail"> <view v-else class="card-box detail">
<view <view class="card-row" :class="{ right: rowIndex % 2 !== 0 }" v-for="(row, rowIndex) in rows" :key="rowIndex">
class="card-row" <view class="card-wrapper" v-for="(card, cardIndex) in row" :key="cardIndex" @click="getDetailsItem(card.name, card.jfType, card.value)">
:class="{ right: rowIndex % 2 !== 0 }"
v-for="(row, rowIndex) in rows"
:key="rowIndex"
>
<view
class="card-wrapper"
v-for="(card, cardIndex) in row"
:key="cardIndex"
@click="getDetailsItem(card.name, card.jfType, card.value)"
>
<view <view
class="card" class="card"
:class="{ :class="{
active: value === card.value, active: value === card.value,
warning: card.statusLable == '巡检异常', warning: card.statusLable == '巡检异常'
}" }"
> >
<view class="card-content"> <view class="card-content">
<view class="first-row"> <view class="first-row">
<image <image class="icon" src="@/static/img/add-img/home1.png"></image>
class="icon"
src="@/static/img/add-img/home1.png"
></image>
<text class="status">{{ card.statusLable }}</text> <text class="status">{{ card.statusLable }}</text>
</view> </view>
<view class="second-row"> <view class="second-row">
...@@ -220,52 +140,39 @@ ...@@ -220,52 +140,39 @@
</view> </view>
</view> </view>
</view> </view>
<detail ref="detail" :jfType="jfType" :detailsItem="detailsItem"></detail <detail ref="detail" :jfType="jfType" :detailsItem="detailsItem"></detail>
></view> </view>
<view v-if="!isSign" class="submit-module"> <view v-if="!isSign" class="submit-module">
<view class="action-btn" @click="startDialogBtn()">开始巡检</view> <view class="action-btn" @click="startDialogBtn()">开始巡检</view>
</view> </view>
<signDialog ref="signDialog" @confirm="handlePopupConfirm"></signDialog> <signDialog ref="signDialog" @confirm="handlePopupConfirm"></signDialog>
<!-- 巡检弹窗 --> <!-- 巡检弹窗 -->
<startDialog <startDialog ref="startDialog" :startDialogData="startDialogData" @confirm="handleStartDialog"></startDialog>
ref="startDialog" <Dialog v-show="isDialog" :list="propList" @close="onSyncData(false)"></Dialog>
:startDialogData="startDialogData"
@confirm="handleStartDialog"
></startDialog>
<Dialog
v-show="isDialog"
:list="propList"
@close="onSyncData(false)"
></Dialog>
</view> </view>
</template> </template>
<script> <script>
import moment from "moment"; import moment from 'moment';
import { import { writeInspectionData, addLog, getLogContent, LOG_TYPE_ENUM } from '@/utils/IoReadingAndWriting.js';
writeInspectionData, import signDialog from '@/components/signDialog.vue';
addLog, import detail from './components/detail.vue';
getLogContent, import startDialog from './components/dialog.vue';
LOG_TYPE_ENUM,
} from "@/utils/IoReadingAndWriting.js";
import signDialog from "@/components/signDialog.vue";
import detail from "./components/detail.vue";
import startDialog from "./components/dialog.vue";
import assRoomApi from "@/api/assRoom.js"; import assRoomApi from '@/api/assRoom.js';
import inspectApi from "@/api/inspect"; import inspectApi from '@/api/inspect';
import { sqlToData, dataToSql, getHistoryData } from "./shared"; import { sqlToData, dataToSql, getHistoryData } from './shared';
import Dialog from "@/pages/inspectionManagement/dialog.vue"; import Dialog from '@/pages/inspectionManagement/dialog.vue';
export default { export default {
components: { components: {
signDialog, signDialog,
detail, detail,
startDialog, startDialog,
Dialog, Dialog
}, },
data() { data() {
return { return {
inspectionCode: "", inspectionCode: '',
rows: [], rows: [],
baseInfo: {}, // 基础信息 baseInfo: {}, // 基础信息
inspectionNumber: 0, // 已巡检的井道数量 inspectionNumber: 0, // 已巡检的井道数量
...@@ -274,23 +181,23 @@ export default { ...@@ -274,23 +181,23 @@ export default {
isDisable: false, // 禁用 isDisable: false, // 禁用
isSign: false, //签名状态 isSign: false, //签名状态
isSubmit: 0, //提交状态 isSubmit: 0, //提交状态
uid: "", uid: '',
options: {}, //存储数据 options: {}, //存储数据
backValue: "", backValue: '',
all_data: [], //所有数据 all_data: [], //所有数据
jfType: "0", //机房类型 jfType: '0', //机房类型
allIsSubmitOne: false, allIsSubmitOne: false,
startDialogData: { startDialogData: {
text: [], text: [],
isList: true, isList: true,
isLast: false, isLast: false
}, //弹窗文案 }, //弹窗文案
name: "F座3楼-内环屏蔽机房", name: 'F座3楼-内环屏蔽机房',
value: "1", value: '1',
listData: [], listData: [],
isDialog: false, isDialog: false,
propList: [], propList: [],
did: "", // 最近7天数据的id did: '' // 最近7天数据的id
}; };
}, },
computed: { computed: {
...@@ -298,20 +205,18 @@ export default { ...@@ -298,20 +205,18 @@ export default {
return this.$store.state.now_user || {}; return this.$store.state.now_user || {};
}, },
updateDate() { updateDate() {
return moment( return moment(Number(this.detailsInfo.updateTime || this.detailsInfo.createTime)).format('YYYY-MM-DD');
Number(this.detailsInfo.updateTime || this.detailsInfo.createTime)
).format("YYYY-MM-DD");
}, },
abnormalLengths() { abnormalLengths() {
return this.detailsInfo?.originData?.filter((t) => t.status === 2).length; return this.detailsInfo?.originData?.filter((t) => t.status === 2).length;
}, }
}, },
onLoad(options) { onLoad(options) {
this.options = options; this.options = options;
this.backValue = this.options.backValue || ""; this.backValue = this.options.backValue || '';
this.isDisable = options.isDisable == 1 ? true : false; this.isDisable = options.isDisable == 1 ? true : false;
this.uid = this.options.uid || ""; this.uid = this.options.uid || '';
this.value = this.options.value || "1"; this.value = this.options.value || '1';
}, },
onShow() { onShow() {
// 已经签名不触发更新,主要用于图片预览关闭后会触发onShow // 已经签名不触发更新,主要用于图片预览关闭后会触发onShow
...@@ -328,20 +233,18 @@ export default { ...@@ -328,20 +233,18 @@ export default {
getHistoryData().then((detailsInfo) => { getHistoryData().then((detailsInfo) => {
if (detailsInfo) { if (detailsInfo) {
// 处理历史数据(选项、文案、照片;异常项-不调出文案及照片) // 处理历史数据(选项、文案、照片;异常项-不调出文案及照片)
console.log("detailsInfo", detailsInfo); console.log('detailsInfo', detailsInfo);
this.did = detailsInfo.id; this.did = detailsInfo.id;
delete detailsInfo.id; delete detailsInfo.id;
delete detailsInfo.inspectionCode delete detailsInfo.inspectionCode;
this.listData = this.listFormat(detailsInfo.originData); this.listData = this.listFormat(detailsInfo.originData);
this.detailsInfo = detailsInfo; this.detailsInfo = detailsInfo;
this.inspectionNumber = detailsInfo.inspectionNumber; this.inspectionNumber = detailsInfo.inspectionNumber;
this.inspectionCode = `JFXJ${moment().format("yyyyMMDDHHmmss")}${ this.inspectionCode = `JFXJ${moment().format('yyyyMMDDHHmmss')}${Math.floor(Math.random() * 900) + 100}`;
Math.floor(Math.random() * 900) + 100
}`;
this.cardsInfo = detailsInfo.originData; this.cardsInfo = detailsInfo.originData;
this.isSubmit = 0; this.isSubmit = 0;
this.isSign = false; this.isSign = false;
...@@ -349,17 +252,10 @@ export default { ...@@ -349,17 +252,10 @@ export default {
// 默认选中第一个机房 // 默认选中第一个机房
this.detailsItem = detailsInfo.originData[0].details; this.detailsItem = detailsInfo.originData[0].details;
if ( if (this.detailsItem.afxt && this.detailsItem.afxt.detail && this.detailsItem.afxt.detail[2].inspectionResult === 1) {
this.detailsItem.afxt && this.detailsItem.afxt.detail = this.detailsItem.afxt.detail.slice(0, 3);
this.detailsItem.afxt.detail && }
this.detailsItem.afxt.detail[2].inspectionResult === 1 this.allIsSubmitOne = detailsInfo.originData.every((item) => item.isSubmit == 1);
) {
this.detailsItem.afxt.detail =
this.detailsItem.afxt.detail.slice(0, 3);
}
this.allIsSubmitOne = detailsInfo.originData.every(
(item) => item.isSubmit == 1
);
let group1 = this.cardsInfo.slice(0, 5); let group1 = this.cardsInfo.slice(0, 5);
let group2 = this.cardsInfo.slice(5, 10); let group2 = this.cardsInfo.slice(5, 10);
...@@ -382,21 +278,21 @@ export default { ...@@ -382,21 +278,21 @@ export default {
// `请到“${this.name}”后;`, // `请到“${this.name}”后;`,
// "点击“我已到达”开始巡检", // "点击“我已到达”开始巡检",
// ]; // ];
console.log("this.startDialogData", this.startDialogData); console.log('this.startDialogData', this.startDialogData);
this.all_data = this.$store.state.all_data; this.all_data = this.$store.state.all_data;
}, },
methods: { methods: {
getRoomList() { getRoomList() {
return assRoomApi.selectRoomList(1).then((res) => { return assRoomApi.selectRoomList(1).then((res) => {
console.log("机房列表", res); console.log('机房列表', res);
return res; return res;
}); });
}, },
listFormat(baseList) { listFormat(baseList) {
const roomFeatureMap = { const roomFeatureMap = {
1: "1", 1: '1',
2: "0", 2: '0',
3: "2", 3: '2'
}; };
let list = baseList.map((item, index) => { let list = baseList.map((item, index) => {
const jfType = roomFeatureMap[item.roomFeature]; const jfType = roomFeatureMap[item.roomFeature];
...@@ -408,10 +304,10 @@ export default { ...@@ -408,10 +304,10 @@ export default {
* 前端用的:jfType 机房类型 0屏蔽  1汇聚  2电池间(1) 3电池间(2) * 前端用的:jfType 机房类型 0屏蔽  1汇聚  2电池间(1) 3电池间(2)
* roomFeature 机房类型枚举:1.汇聚机房,2.屏蔽机房,3.UPS机房,4.数据机房 * roomFeature 机房类型枚举:1.汇聚机房,2.屏蔽机房,3.UPS机房,4.数据机房
*/ */
jfType: item.dictValue == "11" ? "3" : jfType, jfType: item.dictValue == '11' ? '3' : jfType,
isVaild: item.isVaild || false, // 校验通过 isVaild: item.isVaild || false, // 校验通过
status: item.status || 0, status: item.status || 0,
statusLable: item.statusLable || "未巡检", statusLable: item.statusLable || '未巡检'
}; };
}); });
return list; return list;
...@@ -422,7 +318,7 @@ export default { ...@@ -422,7 +318,7 @@ export default {
let list = this.listFormat(baseList); let list = this.listFormat(baseList);
this.listData = this.deepClone(list); this.listData = this.deepClone(list);
console.log("this.listData", this.listData); console.log('this.listData', this.listData);
const group1 = list.slice(0, 5); const group1 = list.slice(0, 5);
const group2 = list.slice(5, 10).reverse(); const group2 = list.slice(5, 10).reverse();
...@@ -432,15 +328,13 @@ export default { ...@@ -432,15 +328,13 @@ export default {
if (this.uid) { if (this.uid) {
this.inspectionCode = this.detailsInfo.inspectionCode; this.inspectionCode = this.detailsInfo.inspectionCode;
} else { } else {
this.inspectionCode = `JFXJ${moment().format("yyyyMMDDHHmmss")}${ this.inspectionCode = `JFXJ${moment().format('yyyyMMDDHHmmss')}${Math.floor(Math.random() * 900) + 100}`;
Math.floor(Math.random() * 900) + 100
}`;
} }
resolve(); resolve();
}); });
}, },
deepClone(target) { deepClone(target) {
if (typeof target !== "object" || target === null) { if (typeof target !== 'object' || target === null) {
return target; return target;
} }
...@@ -467,9 +361,9 @@ export default { ...@@ -467,9 +361,9 @@ export default {
return inspectApi return inspectApi
.info(uid) .info(uid)
.then((res) => { .then((res) => {
console.log("before sqlToData", res); console.log('before sqlToData', res);
const detailsInfo = sqlToData(res); const detailsInfo = sqlToData(res);
console.log("getDetails", detailsInfo); console.log('getDetails', detailsInfo);
this.listData = this.listFormat(detailsInfo.originData); this.listData = this.listFormat(detailsInfo.originData);
...@@ -483,19 +377,10 @@ export default { ...@@ -483,19 +377,10 @@ export default {
// 默认选中第一个机房 // 默认选中第一个机房
this.detailsItem = detailsInfo.originData[0].details; this.detailsItem = detailsInfo.originData[0].details;
if ( if (this.detailsItem.afxt && this.detailsItem.afxt.detail && this.detailsItem.afxt.detail[2].inspectionResult === 1) {
this.detailsItem.afxt && this.detailsItem.afxt.detail = this.detailsItem.afxt.detail.slice(0, 3);
this.detailsItem.afxt.detail && }
this.detailsItem.afxt.detail[2].inspectionResult === 1 this.allIsSubmitOne = detailsInfo.originData.every((item) => item.isSubmit == 1);
) {
this.detailsItem.afxt.detail = this.detailsItem.afxt.detail.slice(
0,
3
);
}
this.allIsSubmitOne = detailsInfo.originData.every(
(item) => item.isSubmit == 1
);
let group1 = this.cardsInfo.slice(0, 5); let group1 = this.cardsInfo.slice(0, 5);
let group2 = this.cardsInfo.slice(5, 10); let group2 = this.cardsInfo.slice(5, 10);
...@@ -504,7 +389,7 @@ export default { ...@@ -504,7 +389,7 @@ export default {
group2 = group2.reverse(); group2 = group2.reverse();
} }
this.rows = [group1, group2, group3]; this.rows = [group1, group2, group3];
console.log("this.cardsInfo", this.cardsInfo); console.log('this.cardsInfo', this.cardsInfo);
this.isDisable = this.isDisable || detailsInfo.synchronization == 1; // 是否禁用 1:已同步数据 0: 未同步数据 this.isDisable = this.isDisable || detailsInfo.synchronization == 1; // 是否禁用 1:已同步数据 0: 未同步数据
uni.hideLoading(); uni.hideLoading();
...@@ -512,8 +397,8 @@ export default { ...@@ -512,8 +397,8 @@ export default {
.catch((error) => { .catch((error) => {
uni.showToast({ uni.showToast({
title: error.msg, title: error.msg,
icon: "none", icon: 'none',
duration: 1000, duration: 1000
}); });
uni.hideLoading(); uni.hideLoading();
}); });
...@@ -527,38 +412,29 @@ export default { ...@@ -527,38 +412,29 @@ export default {
if (this.detailsItem.afxt.detail[2].inspectionResult === 1) { if (this.detailsItem.afxt.detail[2].inspectionResult === 1) {
this.detailsItem.afxt.detail = this.detailsItem.afxt.detail.slice(0, 3); this.detailsItem.afxt.detail = this.detailsItem.afxt.detail.slice(0, 3);
} }
console.log("this.detailsItem", this.detailsItem); console.log('this.detailsItem', this.detailsItem);
}, },
startDialogBtn(name = "F座3楼-内环屏蔽机房", jfType = "0", value = "1") { startDialogBtn(name = 'F座3楼-内环屏蔽机房', jfType = '0', value = '1') {
let item = this.findTargetObject(this.listData); let item = this.findTargetObject(this.listData);
console.log("即将操作的机房", item); console.log('即将操作的机房', item);
this.name = this.uid ? item.name : name; this.name = this.uid ? item.name : name;
this.jfType = this.uid ? item.jfType : jfType; this.jfType = this.uid ? item.jfType : jfType;
this.value = this.uid ? item.value : value; this.value = this.uid ? item.value : value;
this.startDialogData.text = [ this.startDialogData.text = [`请到“${name}”后;`, '点击“我已到达”开始巡检'];
`请到“${name}”后;`,
"点击“我已到达”开始巡检",
];
this.name = name; this.name = name;
this.jfType = jfType; this.jfType = jfType;
this.value = value; this.value = value;
this.$refs.startDialog.open(); this.$refs.startDialog.open();
}, },
startDialog(name = "F座3楼-内环屏蔽机房", jfType = "0", value = "1") { startDialog(name = 'F座3楼-内环屏蔽机房', jfType = '0', value = '1') {
this.name = name; this.name = name;
this.jfType = jfType; this.jfType = jfType;
this.value = value; this.value = value;
if (!this.uid && value != "1") { if (!this.uid && value != '1') {
this.startDialogData.text = [ this.startDialogData.text = [`当前线路非常用巡检线路,`, `是否需要从“${this.name}”开始巡检`];
`当前线路非常用巡检线路,`,
`是否需要从“${this.name}”开始巡检`,
];
} else { } else {
this.startDialogData.text = [ this.startDialogData.text = [`请到“${this.name}”后;`, '点击“我已到达”开始巡检'];
`请到“${this.name}”后;`,
"点击“我已到达”开始巡检",
];
} }
this.$refs.startDialog.open(); this.$refs.startDialog.open();
}, },
...@@ -568,14 +444,14 @@ export default { ...@@ -568,14 +444,14 @@ export default {
}, },
// 跳转到具体的机房 // 跳转到具体的机房
toShaftInspection(name, jfType, value) { toShaftInspection(name, jfType, value) {
console.log("name, 跳转到具体的机房, value", name, jfType, value); console.log('name, 跳转到具体的机房, value', name, jfType, value);
uni.navigateTo({ uni.navigateTo({
url: `/pages/inspectionContent/inspectionContentNew?value=${value}&inspectionCode=${this.inspectionCode}&jfType=${jfType}&location=${name}&uid=${this.uid}&backValue=${this.backValue}&did=${this.did}`, url: `/pages/inspectionContent/inspectionContentNew?value=${value}&inspectionCode=${this.inspectionCode}&jfType=${jfType}&location=${name}&uid=${this.uid}&backValue=${this.backValue}&did=${this.did}`
}); });
}, },
lookTable() { lookTable() {
uni.navigateTo({ uni.navigateTo({
url: "/pages/report/sampleTable?isJF=1", url: '/pages/report/sampleTable?isJF=1'
}); });
}, },
toSign() { toSign() {
...@@ -620,14 +496,10 @@ export default { ...@@ -620,14 +496,10 @@ export default {
this.detailsInfo.isSign = this.isSign = true; // 回显到文字显示区域 this.detailsInfo.isSign = this.isSign = true; // 回显到文字显示区域
this.detailsInfo.signImg = signImg; // 回显到文字显示区域 this.detailsInfo.signImg = signImg; // 回显到文字显示区域
this.detailsInfo.isSubmit = 1; // 提交状态 this.detailsInfo.isSubmit = 1; // 提交状态
const isException = this.detailsInfo.originData.some( const isException = this.detailsInfo.originData.some((item) => item.status == 2);
(item) => item.status == 2
);
this.detailsInfo.isException = isException ? 1 : 0; // 巡检异常 this.detailsInfo.isException = isException ? 1 : 0; // 巡检异常
let allIsSubmitOne = this.detailsInfo.originData.every( let allIsSubmitOne = this.detailsInfo.originData.every((item) => item.isSubmit === 1);
(item) => item.isSubmit === 1
);
if (!allIsSubmitOne) { if (!allIsSubmitOne) {
// 如果有机房没有巡检完,记录是编辑状态 // 如果有机房没有巡检完,记录是编辑状态
...@@ -638,26 +510,23 @@ export default { ...@@ -638,26 +510,23 @@ export default {
this.realSave(this.detailsInfo); this.realSave(this.detailsInfo);
}, },
realSave(params, type = "sign") { realSave(params, type = 'sign') {
const send = dataToSql(params); const send = dataToSql(params);
const api = this.uid ? inspectApi.update : inspectApi.save; const api = this.uid ? inspectApi.update : inspectApi.save;
const inspectionCode = this.inspectionCode || `JFXJ${moment().format("yyyyMMDDHHmmss")}${ const inspectionCode = this.inspectionCode || `JFXJ${moment().format('yyyyMMDDHHmmss')}${Math.floor(Math.random() * 900) + 100}`;
Math.floor(Math.random() * 900) + 100
}`
send.inspectionCode = inspectionCode send.inspectionCode = inspectionCode;
console.log('send', send); console.log('send', send);
api(this.uid ? { id: this.uid, ...send } : send).then((res) => { api(this.uid ? { id: this.uid, ...send } : send).then((res) => {
const logContent = getLogContent(LOG_TYPE_ENUM.sys, `巡检编号(${inspectionCode})`, '同步');
const logContent = getLogContent(LOG_TYPE_ENUM.sys, `巡检编号(${inspectionCode})`, "同步"); this.$logApi.addlog(logContent);
this.$logApi.addlog(logContent) console.log('logContent', logContent);
console.log("logContent", logContent);
uni.showToast({ uni.showToast({
title: type == "sign" ? "签字成功" : "同步成功", title: type == 'sign' ? '签字成功' : '同步成功',
icon: "success", icon: 'success'
}); });
if (!this.uid) { if (!this.uid) {
...@@ -666,17 +535,16 @@ export default { ...@@ -666,17 +535,16 @@ export default {
this.getDetails(res.lastInsertId); this.getDetails(res.lastInsertId);
}, 300); }, 300);
} }
}); });
}, },
back() { back() {
if (this.backValue === "home") { if (this.backValue === 'home') {
uni.navigateTo({ uni.navigateTo({
url: "/pages/home/home", url: '/pages/home/home'
}); });
} else { } else {
uni.navigateTo({ uni.navigateTo({
url: `/pages/inspectionManagement/index`, url: `/pages/inspectionManagement/index`
}); });
} }
}, },
...@@ -684,6 +552,8 @@ export default { ...@@ -684,6 +552,8 @@ export default {
uni.previewImage({ uni.previewImage({
current: index, current: index,
urls: images, urls: images,
success: (res) =>{
}
}); });
}, },
onSyncData(show) { onSyncData(show) {
...@@ -691,15 +561,15 @@ export default { ...@@ -691,15 +561,15 @@ export default {
this.propList = [ this.propList = [
{ {
...dataToSql(this.detailsInfo), ...dataToSql(this.detailsInfo),
id: this.uid, id: this.uid
}, }
]; ];
console.log("propList", this.propList); console.log('propList', this.propList);
if (!show) { if (!show) {
this.getDetails(this.uid); this.getDetails(this.uid);
} }
}, }
}, }
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
...@@ -1055,4 +925,14 @@ export default { ...@@ -1055,4 +925,14 @@ export default {
} }
} }
} }
.sign-img {
width: 80px;
height: 28.8px;
margin-right: 10px;
border: 1px solid #c5c5c5;
&.no-border {
border: none;
}
}
</style> </style>
...@@ -605,14 +605,14 @@ export default { ...@@ -605,14 +605,14 @@ export default {
this.all_data[index] = params; this.all_data[index] = params;
logContent = getLogContent( logContent = getLogContent(
LOG_TYPE_ENUM.edit, LOG_TYPE_ENUM.edit,
`${params.recordName}(${params.inspectionCode})`, `巡检编号(${params.inspectionCode})`,
"巡检模块" "巡检模块"
); );
} else { } else {
this.all_data.push(params); this.all_data.push(params);
logContent = getLogContent( logContent = getLogContent(
LOG_TYPE_ENUM.add, LOG_TYPE_ENUM.add,
`${params.recordName}(${params.inspectionCode})`, `巡检编号(${params.inspectionCode})`,
"巡检模块" "巡检模块"
); );
} }
......
...@@ -785,7 +785,6 @@ export default { ...@@ -785,7 +785,6 @@ export default {
height: 28.8px; height: 28.8px;
margin-right: 10px; margin-right: 10px;
border: 1px solid #ccc; border: 1px solid #ccc;
// border-right: none;
border-radius: 3px; border-radius: 3px;
&.no-border { &.no-border {
border: none; border: none;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论