This commit is contained in:
yzy 2024-03-14 15:17:06 +08:00
parent 2edad8e1d5
commit aadaff3b3f
16 changed files with 608 additions and 226 deletions

View File

@ -40,8 +40,21 @@ export const save = (params) => {
data: params
})
}
//发起设备检查
export const createDeviceInsp = (params) => {
return request({
url: `/sis/api/${website.hostAddress}/deviceinspection/create`,
method: 'post',
data: params
})
}
//获取设备信息详情
export const getDevice = (id) => {
return request({
url: `/sis/api/${website.hostAddress}/device/detail/${id}`,
method: 'get'
})
}
//获取设备检查待办详情
export const getDeviceDetail = (id) => {
return request({
@ -158,3 +171,14 @@ export const handoverFaceMatch = (file) => {
data: formData
})
};
// 获取影像平台附件链接
export const getFileURL = (busiBeginDate,contentId) => {
return request({
url: `/api/security-desk/upload/fileURL`,
method: 'get',
params: {
busiBeginDate,contentId
},
})
}

View File

@ -24,3 +24,13 @@ export const save = (data) => {
data: data
})
}
// 获取影像平台附件链接
export const getFileURL = (busiBeginDate,contentId) => {
return request({
url: `/sis/api/security-desk/upload/fileURL`,
method: 'get',
params: {
busiBeginDate,contentId
},
})
}

View File

@ -8,9 +8,11 @@
</div>
</div>
</van-overlay>
<van-nav-bar title="设备检查" left-text="返回" left-arrow @click-left="$router.back()" />
<van-nav-bar title="设备检查" left-text="返回" left-arrow @click-left="$router.go(-2)" />
<van-form>
<van-empty v-show="list.length === 0" description="无设备检查项" />
<van-empty v-show="list.length === 0" description="无设备检查项">
<img slot="image" src="@/assets/empty.png" alt="" />
</van-empty>
<div v-show="list.length > 0" v-for="(item, index) in list" :key="index">
<van-field v-model="item.name" name="设备检查项" label="设备检查项" readonly />
<van-field name="1" label="检查结果状态" required>
@ -21,11 +23,12 @@
</van-radio-group>
</template>
</van-field>
<van-field v-model="item.result" name="检查结果" label="检查结果" placeholder="请输入检查结果描述" required/>
<van-field name="uploader" label="检查时照片" required>
<van-field v-model="item.result" name="检查结果" label="检查结果" placeholder="请输入检查结果描述"
:required="item.problemLevel === '2'" />
<van-field name="uploader" label="检查时照片" :required="item.problemLevel === '2'">
<template #input>
<van-uploader v-model="item.unUploadImgUrl" :name="index" :ref="'upload' + index" capture="camera"
accept="image/*" />
accept="image/*" :before-read="beforeRead"/>
</template>
</van-field>
</div>
@ -61,7 +64,7 @@ export default {
unUploadImgUrl: [],
},
],
loading:false,
loading: false,
};
},
// activated() {
@ -71,33 +74,49 @@ export default {
this.getData();
},
methods: {
//
beforeRead(file) {
// eslint-disable-next-line no-unused-vars
return new Promise((resolve, reject) => {
upload.compressImg(file, (res) => {resolve(res)});
});
},
//
getData() {
this.loading=true
this.loading = true
const id = this.$route.params.dataId;
const type = '1';
this.form.id = id;
getDeviceItemDetail(id, type).then((res) => {
this.loading=false
this.loading = false
this.list = res.data.data;
});
},
//
submit() {
this.loading=true
this.loading = true
let data = this.form;
let syncList = [];
let hasNoFileItem = false;
let hasNoFileItem = false;//
this.list.forEach((element) => {
if (typeof element.unUploadImgUrl == 'undefined' || element.unUploadImgUrl.length < 1) {
this.loading=false;
// if (typeof element.unUploadImgUrl == 'undefined' || element.unUploadImgUrl.length < 1) {
// this.loading=false;
// hasNoFileItem = true;
// return
// }
if (!element.problemLevel ||
(element.problemLevel === '2' && (!element.result || !element.unUploadImgUrl || element.unUploadImgUrl.length < 1))) {
hasNoFileItem = true;
this.loading=false;
return
}
let fileList = [];
element.unUploadImgUrl.forEach((imgFile) => {
fileList.push(imgFile.file);
});
if (element.unUploadImgUrl && element.unUploadImgUrl.length > 0) {
element.unUploadImgUrl.forEach((imgFile) => {
fileList.push(imgFile.file);
});
}
syncList.push(new Promise((resolve, reject) => {
//
upload.multiUpload(fileList, '18', 'beforePicIds').then(res => {
@ -115,16 +134,13 @@ export default {
}))
});
if (hasNoFileItem) {
this.$dialog.alert({ message: "请上传所有检查时照片再提交" });
this.$dialog.alert({ message: "请检查必填内容!" });
return
}
Promise.all(syncList).then(() => {
data.appDeviceDTOList = this.list;
deviceHandin(data).then((res) => {
this.loading=false
if (res.data.code !== 200) {
return this.$dialog.alert({ message: res.data.msg });
}
deviceHandin(data).then(() => {
this.loading = false
this.$dialog.alert({ message: '提交成功' }).then(() => {
this.$router.push({ name: 'index' })
})

View File

@ -8,9 +8,11 @@
</div>
</div>
</van-overlay>
<van-nav-bar title="设备持续整改" left-text="返回" left-arrow @click-left="$router.back()" />
<van-nav-bar title="设备持续整改" left-text="返回" left-arrow @click-left="$router.go(-2)" />
<van-form>
<van-empty v-show="list.length === 0" description="无设备持续整改项" />
<van-empty v-show="list.length === 0" description="无设备持续整改项" >
<img slot="image" src="@/assets/empty.png" alt=""/>
</van-empty>
<div v-show="list.length > 0" v-for="(item, index) in list" :key="index">
<van-field v-model="item.name" name="检查内容" label="检查内容" readonly />
<van-field v-model="item.result" name="检查结果" label="检查结果" readonly />
@ -23,19 +25,20 @@
</template>
</van-field>
<van-field v-model="item.rectifyResult" name="整改结果" label="整改结果" placeholder="请输入整改结果描述" required/>
<van-field name="1" label="是否需要持续整改">
<!-- <van-field name="1" label="是否需要持续整改">
<template #input>
<van-radio-group v-model="item.recordFlag" direction="horizontal">
<van-radio name="1"></van-radio>
<van-radio name="2"></van-radio>
</van-radio-group>
</template>
</van-field>
</van-field> -->
<van-field readonly clickable :value="item.rectificationDeadline" name="calendar" label="持续整改期限"
placeholder="请选择持续整改期限" @click="showCalendarMethod(index)" v-if="item.recordFlag === '2'" />
<van-field name="uploader" label="整改后照片">
placeholder="结果异常需持续整改,可设定期限>" @click="showCalendarMethod(index)" v-if="item.rectificationStatus === '2'" />
<van-field name="uploader" label="整改后照片" required>
<template #input>
<van-uploader v-model="item.unUploadImgUrl" :ref="'upload' + index" capture="camera" />
<van-uploader v-model="item.unUploadImgUrl" :ref="'upload' + index" capture="camera"
accept="image/*" :before-read="beforeRead"/>
</template>
</van-field>
</div>
@ -85,6 +88,13 @@ export default {
this.getData();
},
methods: {
//
beforeRead(file) {
// eslint-disable-next-line no-unused-vars
return new Promise((resolve, reject) => {
upload.compressImg(file, (res) => {resolve(res)});
});
},
formDate(date) {
return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
},
@ -127,6 +137,10 @@ export default {
hasNoFileItem = true;
return
}
//
if(element.rectificationStatus==='2'){
element.recordFlag='2'
}
let fileList = [];
element.unUploadImgUrl.forEach((imgFile) => {
fileList.push(imgFile.file);
@ -153,11 +167,8 @@ export default {
}
Promise.all(syncList).then(() => {
data.appDeviceDTOList = this.list;
continuedRectifyHandin(data).then((res) => {
continuedRectifyHandin(data).then(() => {
this.loading=false
if (res.data.code !== 200) {
return this.$dialog.alert({ message: res.data.msg });
}
this.$dialog.alert({ message: '提交成功' }).then(() => {
this.$router.push({ name: 'index' })
})

View File

@ -25,16 +25,18 @@
<p class="backlog_item_type">业务类型设备持续整改</p>
<p>设备名称{{ item.taskName }}</p>
<p>设备编号{{ item.deviceNum }}</p>
<p>
<p v-if="item.deadline">
剩余时间<van-count-down
:time="item.overTime"
format="DD 天 HH 时 mm 分 ss 秒"
style="display: inline"
/>
</p>
<p>截止时间{{ item.deadline }}</p>
<p v-if="item.deadline">截止时间{{ item.deadline }}</p>
<b v-if="item.state==='3'">该记录审批被驳回</b>
<p>
<van-button
round block
size="small"
style="width: 100%"
color="linear-gradient(to right, #ff6034, #ee0a24)"

View File

@ -0,0 +1,89 @@
<!--扫码展示的设备信息-->
<template>
<div class="deviceDetailScan">
<van-nav-bar title="设备信息" left-text="返回" left-arrow @click-left="$router.back()" />
<van-form>
<van-field v-model="form.name" name="设备名称" label="设备名称" readonly />
<van-field v-model="form.deviceNum" name="设备编号" label="设备编号" readonly />
<van-field v-model="form.company" name="设备厂商" label="设备厂商" readonly />
<van-field v-model="form.modelNum" name="设备型号" label="设备型号" readonly />
<van-field v-model="form.typeName" name="设备分类" label="设备分类" readonly />
<van-field v-model="form.deptName" name="所属部门" label="所属部门" readonly />
<van-field v-model="form.address" name="设备位置" label="设备位置" readonly />
<van-field v-model="form.maintenanceDate" name="维保期限" label="维保期限" readonly />
<!-- <van-field v-model="form.usageState" name="使用状态" label="使用状态" readonly /> -->
<!-- 正在使用中超期使用中未投入使用的才可以发起设备检查已处置的不可以发起检查 -->
<div style="margin: 16px"
v-if="form.usageState === uStDic.using || form.usageState === uStDic.overUsing || form.usageState === uStDic.notUsing">
<van-button round block type="danger" @click="startCheck()" :loading="loading">发起设备检查</van-button>
</div>
</van-form>
</div>
</template>
<script>
import { getDevice, createDeviceInsp } from "../api";
export default {
name: "device-detail",
data() {
return {
// 使
uStDic: {
using: '1',//使
overUsing: '2',//使
notUsing: '0',//使
disposal:'3',//
},
form: {
id: "",
name: "",
deviceNum: "",
company: "",
modelNum: "",
typeName: "",
depName: "",
address: "",
maintenanceDate: "",
state: "",
},
deviceId: "",
pushFlag: false,
aimId: "",
loading: false,
};
},
mounted() {
this.getData();
// window.aimThisData = this.aimThisData;
},
methods: {
//
getData() {
this.aimId = this.$route.params.deviceId;
getDevice(this.aimId).then((res) => {
this.form = res.data.data;
});
},
//
startCheck() {
this.loading = true
if (this.form.usageState ===this.uStDic.disposal){
return this.$dialog.alert({ message: '已处置设备不可再发起设备检查!' });
}
createDeviceInsp({ ids: this.form.id }).then((res) => {
this.loading = false
if (res.data.data && res.data.data.length > 0) {
this.$dialog.alert({ message: '发起设备检查成功,即将跳转填写页' }).then(() => {
return this.$router.push({ name: "device-check", params: { dataId: res.data.data[0] } });
})
}
});
},
},
};
</script>
<style scoped>
</style>

View File

@ -3,19 +3,23 @@
<div class="deviceDetail">
<van-nav-bar title="设备信息" left-text="返回" left-arrow @click-left="$router.back()" />
<van-form>
<van-field v-model="form.name" name="设备名称" label="设备名称" readonly/>
<van-field v-model="form.deviceNum" name="设备编号" label="设备编号" readonly/>
<van-field v-model="form.company" name="设备厂商" label="设备厂商" readonly/>
<van-field v-model="form.modelNum" name="设备型号" label="设备型号" readonly/>
<van-field v-model="form.typeName" name="设备分类" label="设备分类" readonly/>
<van-field v-model="form.depName" name="所属部门" label="所属部门" readonly/>
<van-field v-model="form.address" name="设备位置" label="设备位置" readonly/>
<van-field v-model="form.maintenanceDate" name="维保时间" label="维保时间" readonly/>
<van-field v-model="form.state" name="待检状态" label="待检状态" readonly/>
<van-field v-model="form.name" name="设备名称" label="设备名称" readonly />
<van-field v-model="form.deviceNum" name="设备编号" label="设备编号" readonly />
<van-field v-model="form.company" name="设备厂商" label="设备厂商" readonly />
<van-field v-model="form.modelNum" name="设备型号" label="设备型号" readonly />
<van-field v-model="form.typeName" name="设备分类" label="设备分类" readonly />
<van-field v-model="form.depName" name="所属部门" label="所属部门" readonly />
<van-field v-model="form.address" name="设备位置" label="设备位置" readonly />
<van-field v-model="form.maintenanceDate" name="维保期限" label="维保期限" readonly />
<!-- <van-field v-model="form.state" name="待检状态" label="待检状态" readonly /> -->
<van-field v-if="type === '2'&& form.needScan === '1'" name="检查需扫码" label="检查需扫码" value="是" readonly />
<div style="margin: 16px">
<van-button round block type="danger" @click="startCheck()" v-if="type==='1'">录入整改结果</van-button>
<van-button round block type="danger" @click="scanning()" v-if="type==='2'">扫描设备二维码录入检查结果</van-button>
<van-button round block type="danger" @click="startCheck()" v-if="type==='3'">录入持续整改结果</van-button>
<van-button round block type="danger" @click="startCheck()" v-if="type === '1'">录入整改结果</van-button>
<van-button round block type="danger" @click="scanning()" v-if="type === '2' && form.needScan === '1'">扫描设备二维码录入检查结果
</van-button>
<van-button round block type="danger" @click="startCheck()" v-if="type === '2' && form.needScan === '0'">录入检查结果
</van-button>
<van-button round block type="danger" @click="startCheck()" v-if="type === '3'">录入持续整改结果</van-button>
<!-- pc端测试跳开二维码验证 -->
<!-- <van-button round block type="danger" @click="startCheck()" v-if="type==='2'">直接录入检查结果</van-button> -->
</div>
@ -40,11 +44,11 @@ export default {
address: "",
maintenanceDate: "",
state: "",
needScan: ''
},
deviceId: "",
pushFlag: false,
aimId: "",
type:"",//1- 2- 3-
type: "",//1- 2- 3-
};
},
mounted() {
@ -56,44 +60,34 @@ export default {
getData() {
this.aimId = this.$route.params.dataId;
const type = this.$route.params.type;
this.type=type;
this.type = type;
//
if (type === "1") {
getDeviceRectifyDetail(this.aimId).then((res) => {
if (res.data.code !== 200) {
return this.$dialog.alert({message: res.data.msg});
}
this.form = res.data.data;
});
}
//
if (type === "2") {
getDeviceDetail(this.aimId).then((res) => {
if (res.data.code !== 200) {
return this.$dialog.alert({message: res.data.msg});
}
this.form = res.data.data;
this.needScanStr=this.form.needScan;
});
}
//
if (type === "3") {
getDeviceContinuedDetail(this.aimId).then((res) => {
if (res.data.code !== 200) {
return this.$dialog.alert({message: res.data.msg});
}
this.form = res.data.data;
});
}
},
//
startCheck() {
//pc 线
// this.pushFlag=true;
const type = this.$route.params.type;
if (type === "1") {
return this.$router.push({ name: "device-rectify", params: { dataId: this.aimId } });
}
if (type === "2" && this.pushFlag) {
if (type === "2") {
return this.$router.push({ name: "device-check", params: { dataId: this.aimId } });
}
if (type === "3") {
@ -105,26 +99,25 @@ export default {
window.qing.call("scanQRCode", {
"needResult": 1,
"success": function (result) {
if(result.data && result.data.qrcode_str){
if (result.data && result.data.qrcode_str) {
let deviceId = result.data.qrcode_str.substring(0, 19);
// eslint-disable-next-line no-undef
aimThisData(deviceId);
}else{
return this.$dialog.alert({message: "扫描结果无法获取设备信息,请确认二维码是否属于设备二维码!"});
}
// eslint-disable-next-line no-undef
aimThisData(deviceId);
} else {
return this.$dialog.alert({ message: "扫描结果无法获取设备信息,请确认二维码是否属于设备二维码!" });
}
},
"error": function (res) {
return this.$dialog.alert({message: res.errMsg});
return this.$dialog.alert({ message: res.errMsg });
}
})
},
aimThisData(deviceId) {
this.deviceId = deviceId;
if (this.form.id === this.deviceId) {
this.pushFlag = true;
this.startCheck();
} else {
return this.$dialog.alert({message:"二维码和检测目标设备不匹配,请重新扫码"});
return this.$dialog.alert({ message: "二维码和检测目标设备不匹配,请重新扫码" });
}
}
},

View File

@ -7,43 +7,34 @@
</div>
</div>
</van-overlay>
<van-nav-bar
title="设备检查待办"
left-text="返回"
left-arrow
@click-left="$router.back()"
/>
<van-empty v-show="list.length === 0" description="无设备检查待办事项">
<img slot="image" src="@/assets/empty.png" alt="">
</van-empty>
<div
v-show="list.length > 0"
class="backlog_item"
v-for="item in list"
:key="item.id"
>
<p class="backlog_item_type">业务类型{{ item.businessType }}</p>
<p>设备名称{{ item.taskName }}</p>
<p>设备编号{{ item.deviceNum }}</p>
<p>
剩余时间<van-count-down
:time="item.overTime"
format="DD 天 HH 时 mm 分 ss 秒"
style="display: inline"
/>
</p>
<p>截止时间{{ item.deadline }}</p>
<p>
<van-button
size="small"
style="width: 100%"
color="linear-gradient(to right, #ff6034, #ee0a24)"
@click="backlogHandler(item.id)"
>
去处理
</van-button>
</p>
</div>
<!-- <van-nav-bar title="设备检查待办" left-text="返回" left-arrow @click-left="$router.back()">
</van-nav-bar> -->
<van-nav-bar title="设备检查待办" left-text="返回" left-arrow @click-left="$router.back()" right-text="主动检查+"
@click-right="addCheck()">
</van-nav-bar>
<van-empty v-show="list.length === 0" description="无设备检查待办事项">
<img slot="image" src="@/assets/empty.png" alt="">
</van-empty>
<div v-show="list.length > 0" class="backlog_item" v-for="item in list" :key="item.id">
<p class="backlog_item_type">业务类型{{ item.businessType }}</p>
<p>设备名称{{ item.taskName }}</p>
<p>设备编号{{ item.deviceNum }}</p>
<p>设备地址{{ item.address }}</p>
<b v-if="item.needScan==='1'">检查需扫码</b>
<p v-if="item.deadline">
剩余时间
<van-count-down :time="item.overTime" format="DD 天 HH 时 mm 分 ss 秒" style="display: inline" />
</p>
<p v-if="item.deadline">截止时间{{ item.deadline }}</p>
<b v-if="item.state==='3'">该记录审批被驳回</b>
<p>
<van-button round block size="small" style="width: 100%" color="linear-gradient(to right, #ff6034, #ee0a24)"
@click="backlogHandler(item.id)">
去处理
</van-button>
</p>
</div>
</div>
</template>
@ -73,18 +64,44 @@ export default {
},
//
getBackLogList() {
this.loading=true
this.loading = true
this.dataType = "3";
this.type = "all";
getBacklog(this.dataType,this.type).then((res) => {
this.loading=false
getBacklog(this.dataType, this.type).then((res) => {
this.loading = false
this.list = res.data.data;
});
},
//
backlogHandler(id) {
return this.$router.push({ name: "device-detail", params: { dataId: id , type: "2"} });
return this.$router.push({ name: "device-detail", params: { dataId: id, type: "2" } });
},
//
addCheck() {
let t=this;
window.qing.call("scanQRCode", {
"needResult": 1,
"success": function (result) {
if (result.data && result.data.qrcode_str) {
try {
let deviceId = result.data.qrcode_str.substring(0, 19);
// id
t.jumpToDeviceDetail(deviceId);
} catch (error) {
return t.$dialog.alert({ message: "通过二维码获取设备信息失败!" });
}
} else {
return t.$dialog.alert({ message: "扫描结果无法获取设备信息,请确认二维码是否属于设备二维码!" });
}
},
"error": function (res) {
return t.$dialog.alert({ message: res.errMsg });
}
})
},
jumpToDeviceDetail(deviceId) {
return this.$router.push({ name: "device-detail-scan", params: { deviceId: deviceId } });
}
},
};
</script>

View File

@ -25,16 +25,18 @@
<p class="backlog_item_type">业务类型{{ item.businessType }}</p>
<p>设备名称{{ item.taskName }}</p>
<p>设备编号{{ item.deviceNum }}</p>
<p>
<p v-if="item.deadline">
剩余时间<van-count-down
:time="item.overTime"
format="DD 天 HH 时 mm 分 ss 秒"
style="display: inline"
/>
</p>
<p>截止时间{{ item.deadline }}</p>
<p v-if="item.deadline">截止时间{{ item.deadline }}</p>
<b v-if="item.state==='3'">该记录审批被驳回</b>
<p>
<van-button
round block
size="small"
style="width: 100%"
color="linear-gradient(to right, #ff6034, #ee0a24)"

View File

@ -1,16 +1,18 @@
<!--设备整改-->
<template>
<div class="device">
<van-overlay :show="loading">
<van-overlay :show="loading">
<div class="wrapper">
<div class="block">
<van-loading color="black" vertical>上传中...</van-loading>
</div>
</div>
</van-overlay>
<van-nav-bar title="设备整改" left-text="返回" left-arrow @click-left="$router.back()" />
<van-nav-bar title="设备整改" left-text="返回" left-arrow @click-left="$router.go(-2)" />
<van-form>
<van-empty v-show="list.length === 0" description="无设备整改项" />
<van-empty v-show="list.length === 0" description="无设备整改项">
<img slot="image" src="@/assets/empty.png" alt="" />
</van-empty>
<div v-show="list.length > 0" v-for="(item, index) in list" :key="index">
<van-field v-model="item.name" name="检查内容" label="检查内容" readonly />
<van-field v-model="item.result" name="检查结果" label="检查结果" readonly />
@ -22,23 +24,23 @@
</van-radio-group>
</template>
</van-field>
<van-field v-model="item.rectifyResult" name="整改结果" label="整改结果" placeholder="请输入整改结果描述" required/>
<van-field name="1" label="是否需要持续整改">
<van-field v-model="item.rectifyResult" name="整改结果" label="整改结果" placeholder="请输入整改结果描述" required />
<!-- <van-field name="1" label="是否需要持续整改">
<template #input>
<van-radio-group v-model="item.recordFlag" direction="horizontal">
<van-radio name="1"></van-radio>
<van-radio name="2"></van-radio>
</van-radio-group>
</template>
</van-field>
</van-field> -->
<van-field readonly clickable :value="item.rectificationDeadline" name="calendar" label="持续整改期限"
placeholder="请选择持续整改期限" @click="showCalendarMethod(index)" v-if="item.recordFlag === '2'" />
placeholder="结果异常需持续整改,可设定期限>" @click="showCalendarMethod(index)" v-if="item.rectificationStatus === '2'" />
<van-field name="uploader" label="整改后照片" required>
<template #input>
<van-uploader v-model="item.unUploadImgUrl" :name="index" :ref="'upload' + index"
capture="camera" />
<van-uploader v-model="item.unUploadImgUrl" :name="index" :ref="'upload' + index" capture="camera"
accept="image/*" :before-read="beforeRead" />
</template>
</van-field>
</div>
@ -52,7 +54,7 @@
</template>
<script>
import { getDeviceItemDetail, deviceRectifyHandin } from "../api";
import { getDeviceItemDetail, deviceRectifyHandin,getFileURL } from "../api";
import upload from "@/util/upload";
import func from "@/util/func";
export default {
@ -81,13 +83,20 @@ export default {
deadlineDate: "",
showCalendar: false,
itemIndex: 0,//index,
loading:false,
loading: false,
};
},
mounted() {
this.getData();
},
methods: {
//
beforeRead(file) {
// eslint-disable-next-line no-unused-vars
return new Promise((resolve, reject) => {
upload.compressImg(file, (res) => { resolve(res) });
});
},
formDate(date) {
return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
},
@ -99,27 +108,66 @@ export default {
//
getData() {
this.loading=true
this.loading = true
const id = this.$route.params.dataId;
const type = '2';
this.form.id = id;
getDeviceItemDetail(id, type).then((res) => {
this.loading=false
this.loading = false
this.list = res.data.data;
// this.list.forEach((item) => {
// if (item.afterImages.length > 0) {
// // let getImgSync = [];
// item.afterImages.forEach((file) => {
// this.getFileUrl(file);
// // getImgSync.push(new Promise(((resolve) => {
// // upload.getImgPreviewFile(file, (base64Data) => {
// // file.content = base64Data;
// // file.originUrl = file.url;
// // resolve();
// // })
// // })))
// })
// // Promise.all(getImgSync).then(() => {
// // console.log('getImgSync',getImgSync)
// // item.unUploadImgUrl=getImgSync
// // })
// }
// })
});
},
// 便
getFileUrl(file){
getFileURL(file.busiBeginDate, file.contentId).then((res) => {
let url = res.data.data;
console.log('url-----',url)
// if (env.NODE_ENV === 'prod') {
// // iphttp://197.32.47.45:9080/ https://im.ynhtbank.cn/
// url = url.replace(/^.{24}/,'https://im.ynhtbank.cn')
// }
}).catch((err => {
this.$message.error(err);
}))
},
//
submit() {
this.loading=true
this.loading = true
let data = this.form;
let syncList = [];
let hasNoFileItem = false;
this.list.forEach(async (element) => {
if (typeof element.unUploadImgUrl == 'undefined' || element.unUploadImgUrl.length < 1) {
this.loading=false
this.loading = false
hasNoFileItem = true;
return
}
//
if(element.rectificationStatus==='2'){
element.recordFlag='2'
}
let fileList = [];
element.unUploadImgUrl.forEach((imgFile) => {
fileList.push(imgFile.file);
@ -146,11 +194,8 @@ export default {
}
Promise.all(syncList).then(() => {
data.appDeviceDTOList = this.list;
deviceRectifyHandin(data).then((res) => {
this.loading=false
if (res.data.code !== 200) {
return this.$dialog.alert({ message: res.data.msg });
}
deviceRectifyHandin(data).then(() => {
this.loading = false
this.$dialog.alert({ message: '提交成功' }).then(() => {
this.$router.push({ name: 'index' })
})

View File

@ -0,0 +1,130 @@
<template>
<div class="deviceTodoList">
<van-overlay :show="loading">
<div class="wrapper">
<div class="block">
<van-loading color="black" vertical>加载中...</van-loading>
</div>
</div>
</van-overlay>
<van-nav-bar title="任务待办" left-text="返回" left-arrow @click-left="$router.back()" right-text="主动检查+"
@click-right="addCheck()">
</van-nav-bar>
<van-empty v-show="list.length === 0" description="无待办事项">
<img slot="image" src="@/assets/empty.png" alt="">
</van-empty>
<div v-show="list.length > 0" class="backlog_item" v-for="item in list" :key="item.id">
<p class="backlog_item_type">业务类型{{ item.businessType }}</p>
<p>名称{{ item.taskName }}</p>
<p>设备编号{{ item.deviceNum }}</p>
<p v-if="item.address">设备地址{{ item.address }}</p>
<b v-if="item.needScan === '1'">检查需扫码</b>
<p v-if="item.deadline">
剩余时间
<van-count-down :time="item.overTime" format="DD 天 HH 时 mm 分 ss 秒" style="display: inline" />
</p>
<p v-if="item.inspectUserName">检查人{{ item.inspectUserName }}</p>
<p v-if="item.inspectTime">检查时间{{ item.inspectTime }}</p>
<p v-if="item.rectifyUserName">整改人{{ item.rectifyUserName }}</p>
<p v-if="item.deadline">截止时间{{ item.deadline }}</p>
<b v-if="item.state === '3'">该记录审批被驳回</b>
<p>
<van-button round block size="small" style="width: 100%" color="linear-gradient(to right, #ff6034, #ee0a24)"
@click="backlogHandler(item)">
去处理
</van-button>
</p>
</div>
</div>
</template>
<script>
import { getBacklog } from "../api";
export default {
name: "device-list",
data() {
return {
list: [],
loading: false,
finished: false,
refreshing: false,
dataType: "",
type: ""
};
},
mounted() {
this.getBackLogList();
},
methods: {
onLoad() {
setInterval(() => {
this.loading = false;
this.finished = true;
}, 1000);
},
//
getBackLogList() {
this.loading = true
this.type = "all";
getBacklog(this.dataType, this.type).then((res) => {
this.loading = false
this.list = res.data.data;
});
},
//
backlogHandler(item) {
let type = '';//1- 2- 3-
if (item.module === 'deviceCheck') {
type = '2'
} else if (item.module === 'deviceRectify') {
type = '1'
} else if (item.module === 'deviceContinuedRectify') {
type = '3'
}
return this.$router.push({ name: "device-detail", params: { dataId: item.id, type: type } });
},
//
addCheck() {
let t = this;
window.qing.call("scanQRCode", {
"needResult": 1,
"success": function (result) {
if (result.data && result.data.qrcode_str) {
try {
let deviceId = result.data.qrcode_str.substring(0, 19);
// id
t.jumpToDeviceDetail(deviceId);
} catch (error) {
return t.$dialog.alert({ message: "通过二维码获取设备信息失败!" });
}
} else {
return t.$dialog.alert({ message: "扫描结果无法获取设备信息,请确认二维码是否属于设备二维码!" });
}
},
"error": function (res) {
return t.$dialog.alert({ message: res.errMsg });
}
})
},
jumpToDeviceDetail(deviceId) {
return this.$router.push({ name: "device-detail-scan", params: { deviceId: deviceId } });
}
},
};
</script>
<style scoped>
.backlog_item {
background: #ffffff;
padding: 8px;
margin: 10px 8px;
border-radius: 10px;
box-shadow: 1px 0 2px 0 rgba(0, 0, 0, 0.05);
}
.backlog_item .backlog_item_type {
font-size: 18px;
font-weight: bold;
}
</style>

View File

@ -2,11 +2,17 @@
<div class="index">
<van-swipe :autoplay="3000" style="height: 200px" indicator-color="white">
<van-swipe-item>
<img class="index_bg" src="@/assets/bank.jpg">
<img class="index_bg" src="@/assets/index.jpg">
</van-swipe-item>
</van-swipe>
<van-grid class="gride" :border="false" :column-num="3" style="">
<van-grid-item
<van-grid class="gride" :border="false" :column-num="2" style="">
<van-grid-item
text="任务待办"
@click="$router.push({ name: 'device-todolist' })">
<i slot="icon" class="iconfont icon-shebeiguanli icon"></i>
<span slot="text" class="icon-text">任务待办</span>
</van-grid-item>
<!-- <van-grid-item
text="设备检查"
@click="$router.push({ name: 'device-list' })">
<i slot="icon" class="iconfont icon-shebeiguanli icon"></i>
@ -26,16 +32,16 @@
@click="$router.push({ name: 'device-continued-rectify' })">
<i slot="icon" class="iconfont icon-shebeizhuangtai icon"></i>
<span slot="text" class="icon-text">持续整改</span>
</van-grid-item>
</van-grid-item> -->
<!-- <van-grid-item
<van-grid-item
icon="photo-o"
text="宣传报道"
@click="$router.push({ name: 'report' })">
<i slot="icon" class="iconfont icon-xuanchuanshipin icon"></i>
<span slot="text" class="icon-text">宣传报道</span>
</van-grid-item> -->
<!-- <van-grid-item
</van-grid-item>
<van-grid-item
icon="photo-o"
text="人脸录入"
@click="faceRegClick">
@ -44,11 +50,11 @@
</van-grid-item>
<van-grid-item
icon="photo-o"
text="款箱交接"
text="工作交接"
@click="$router.push({ name: 'work-handover' })">
<i slot="icon" class="iconfont icon-jiaojieban icon"></i>
<span slot="text" class="icon-text">款箱交接</span>
</van-grid-item> -->
<span slot="text" class="icon-text">工作交接</span>
</van-grid-item>
</van-grid>
<van-dialog v-model="showFaceReg" theme="round-button" confirm-button-text="取消">
<van-row style="padding: 0 24px;padding-top: 16px;">
@ -113,8 +119,9 @@
};
},
mounted() {
this.getBackLogList();
this.auth()
// indexauth
// this.getBackLogList();
// this.auth()
},
methods: {
auth() {
@ -142,7 +149,7 @@
this.dataType = ""
this.type = "all"
getBacklog(this.dataType, this.type).then((res) => {
if (res.data.data.code === 200) {
if (res.data.code === 200) {
this.list = res.data.data;
}
});

View File

@ -11,15 +11,15 @@
v-model="form.password"
name="密码"
label="密码"/>
<!-- <van-cell title="验证码" value="内容" >
<van-cell title="验证码" value="内容" >
<template #default>
<img :src="form.img">
</template>
</van-cell> -->
<!-- <van-field
</van-cell>
<van-field
v-model="form.code"
name="验证码"
label="验证码"/> -->
label="验证码"/>
</van-form>
<div style="margin: 16px;">
<van-button round block type="danger" native-type="submit" @click="getToken()">提交</van-button>
@ -44,7 +44,7 @@ export default {
}
},
mounted() {
// this.getCaptcha()
this.getCaptcha()
},
methods:{
getCaptcha(){
@ -70,8 +70,7 @@ export default {
tenantId: '000000',
username: this.form.username,
password: md5(this.form.password),
//grant_type: 'captcha',
grant_type: 'password',
grant_type: 'captcha',
scope: "all",
type: 'account'
}

View File

@ -19,52 +19,75 @@ export default {
this.getToken();
},
methods: {
clearAllCookie() {
var cookies = document.cookie.split(";");
var domain = location.hostname;
console.log('location', location)
console.log('domain', domain)
if (cookies.length > 0) {
for (let i = 0; i < cookies.length; i++) {
let cookie = cookies[i];
let eqPos = cookie.indexOf('=');
let cname = eqPos > -1 ? cookie.substring(0, eqPos) : cookie;
document.cookie = cname + '=0;expires=Thu, 01 Jan 1970 00:00:00 GMT;Domain=' + domain + ';path=/';
console.log('cname', cname)
console.log('document.cookie', document.cookie)
}
}
},
getToken() {
// session
sessionStorage.clear();
localStorage.clear()
this.clearAllCookie();
var params = this.$route.query;
if (params && params.dev) {
return this.$router.push({ name: 'login' })
return this.$router.push({ name: 'login' })
} else
request({
url: '/sis/api/security-auth/oauth/token',
method: 'post',
params: {
...params,
tenantId: '000000',
grant_type: 'xyun',
scope: 'all',
client_id: 'saber',
client_secret: 'saber_secret'
}
}).then(res => {
this.loading = false;
this.$store.state.user = res.data
this.$store.state.user.token = res.data.access_token;
sessionStorage.setItem('token', res.data.access_token);
sessionStorage.setItem('xYunAccessToken', res.data.detail.xYunAccessToken);
sessionStorage.setItem('user',JSON.stringify(res.data))
this.$router.push({ name: 'index' })
}).catch(err => {
err += '。请返回重试';
this.loading = false;
this.$dialog.alert({
title: '登录失败',
confirmButtonText: '返回',
message: err
}).then(() => {
window.qing.call('closeWebView');
request({
url: '/sis/api/security-auth/oauth/token',
method: 'post',
params: {
...params,
tenantId: '000000',
grant_type: 'xyun',
scope: 'all',
client_id: 'saber',
client_secret: 'saber_secret'
}
}).then(res => {
console.log('res:', res)
this.loading = false;
this.$store.state.user = res.data
this.$store.state.user.token = res.data.access_token;
sessionStorage.setItem('token', res.data.access_token);
sessionStorage.setItem('xYunAccessToken', res.data.detail.xYunAccessToken);
sessionStorage.setItem('user', JSON.stringify(res.data))
this.$router.push({ name: 'index' })
}).catch(err => {
err += '。请返回重试';
this.loading = false;
this.$dialog.alert({
title: '登录失败',
confirmButtonText: '返回',
message: err
}).then(() => {
window.qing.call('closeWebView');
})
})
})
}
}
}
</script>
<style>
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
</style>

View File

@ -1,37 +1,21 @@
<template>
<div class="report">
<van-nav-bar
title="宣传报道"
left-text="返回"
right-text="录入"
left-arrow
@click-left="$router.back()"
@click-right="$router.push({name: 'report-form'})"
/>
<van-list
v-model="loading"
:finished="finished"
finished-text="没有更多了"
@load="onLoad"
>
<van-cell v-for="item in list" :key="item.id" @click="$router.push({name: 'report_detail', query:{id:item.id}})">
<template #title>
<div class="title">{{item.title}}</div>
</template>
<template #label>
<div class="van-multi-ellipsis--l2" v-html="item.content"></div>
</template>
</van-cell>
</van-list>
</div>
<div class="report">
<van-nav-bar title="宣传报道" left-text="返回" right-text="录入" left-arrow @click-left="$router.back()"
@click-right="$router.push({ name: 'report-form' })" />
<van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
<van-cell v-for="item in list" :key="item.id" @click="viewDetail(item)" :title="item.title"
:label="item.reportDescribe" :value="item.reportDate">
</van-cell>
</van-list>
</div>
</template>
<script>
import {getReportList} from '@/api/report.js'
import { getReportList, getFileURL } from '@/api/report.js'
export default {
name: "report",
data(){
return{
data() {
return {
loading: false,
finished: false,
list: [],
@ -40,13 +24,13 @@ export default {
total: 0
}
},
methods:{
onLoad(){
methods: {
onLoad() {
const index = this.pageIndex * this.pageSize
if(index > this.total){
if (index > this.total) {
return
}
getReportList({current: index, size: this.pageSize}).then(res => {
getReportList({ current: index, size: this.pageSize }).then(res => {
this.pageIndex++;
this.list = this.list.concat(res.data.data.records)
this.total = res.data.data.total
@ -54,12 +38,42 @@ export default {
this.finished = true
})
},
//
viewDetail(item) {
// this.$router.push({ name: 'report_detail', query: { id: item.id } })
let file = item.fileList[0];
getFileURL(file.busiBeginDate, file.contentId).then((res) => {
let url = res.data.data;
// console.log('url', url)
if (url && url != "") {
// iphttp://197.32.47.45:9080/ https://im.ynhtbank.cn/
let url2 = url.replace(/^.{24}/, 'https://im.ynhtbank.cn')
// console.log('url', url2)
// --1aURL ios Android
let a = document.createElement('a');
a.target = '_blank',
a.href = url2;
a.click();
// --2URL
// window.qing.call('gotoLightApp', {
// appName: 'item.title',
// urlParam: url
// });
} else {
this.$dialog.alert({ message: "未获取到相关附件!" });
}
}).catch((err => {
this.$dialog.alert({ message: err });
}))
}
}
}
</script>
<style scoped>
.report .title{
.report .title {
font-weight: bold;
}
</style>

View File

@ -53,7 +53,7 @@ export default {
},
methods: {
async submit() {
console.log(this.$refs['upload'].value)
// console.log(this.$refs['upload'].value)
let files = this.$refs['upload'].value
if (files.length === 0) {
return this.$dialog.alert({ message: '请上传现场照片' })