feat(api/index): 添加创建私有隐患库接口

feat(pageIndex/addSafeCheck): 增加隐患同步至隐患库功能
feat(pageIndex/checkHsitory): 优化复查及同步到学一学按钮显示
feat(pageIndex/dangerLibrary): 优化创建时间显示
feat(pageIndex/knowledge): 优化附件预览功能
feat(pageIndex/laws): 优化实施日期显示及附件预览功能
fix(pages/login): 关闭验证码开关
master
Tuzki 2 months ago
parent fb05f7cd1d
commit 738687ceb6
  1. 9
      api/index/index.js
  2. 2
      components/custom-nomore/custom-nomore.vue
  3. 219
      pageIndex/addSafeCheck/readdSafeCheck.vue
  4. 4
      pageIndex/aiAsk/aiAsk.vue
  5. 161
      pageIndex/checkHsitory/recheckHsitory.vue
  6. 2
      pageIndex/dangerLibrary/dangerLibrary.vue
  7. 7
      pageIndex/knowledge/knowledge.vue
  8. 63
      pageIndex/laws/laws.vue
  9. 2
      pages/login.vue

@ -176,4 +176,13 @@ export function getRegionTreeList() {
url: '/admin-api/system/area/tree', url: '/admin-api/system/area/tree',
method: 'GET', method: 'GET',
}) })
}
//创建私有隐患库
export function createPrivateHazard(data) {
return request({
url: '/admin-api/review/private-hazard-bank/create',
method: 'POST',
data: data
})
} }

@ -3,7 +3,7 @@
<view class="nomore"> <view class="nomore">
<!-- 这里的图片请换成自己项目的图片 --> <!-- 这里的图片请换成自己项目的图片 -->
<!-- <image class="nomore-image" mode="aspectFit" src="@/static/no_more.png"></image> --> <!-- <image class="nomore-image" mode="aspectFit" src="@/static/no_more.png"></image> -->
<text class="nomore-text">我也是有底线的~</text> <text class="nomore-text">到底了没有更多数据了</text>
</view> </view>
</template> </template>

@ -69,7 +69,10 @@
<view class="tab-content"> <view class="tab-content">
<view v-for="(item, index) in hazardList" :key="index" :id="'hazardItem' + index" class="hazard-list"> <view v-for="(item, index) in hazardList" :key="index" :id="'hazardItem' + index" class="hazard-list">
<view class="form-item"> <view class="form-item">
<text class="label">隐患描述#{{ index + 1 }}</text> <view class="form-item-titlebox">
<text class="label">隐患描述#{{ index + 1 }}</text>
<text v-if="isTongBu" @click="tongbuPopup(item)" class="label label1">同步至隐患库</text>
</view>
<input class="input" :disabled="disabled" v-model="item.description" placeholder="请输入隐患描述" /> <input class="input" :disabled="disabled" v-model="item.description" placeholder="请输入隐患描述" />
</view> </view>
<view class="form-item"> <view class="form-item">
@ -183,6 +186,30 @@
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
<uni-popup ref="tongbuPopup" type="center" background-color="#fff">
<view class="popup-box">
<view class="popup-box-content">
<view class="popup-box-content-item">
<text>请选择隐患类型</text>
<view>
<uni-data-checkbox mode="tag" :map="maps" v-model="hazardType"
:localdata="hazardTypeList"></uni-data-checkbox>
</view>
</view>
<view class="popup-box-content-item">
<text>请选择隐患等级</text>
<view>
<uni-data-checkbox mode="tag" :map="maps" v-model="hazardLevel"
:localdata="hazardLevelList"></uni-data-checkbox>
</view>
</view>
</view>
<view class="popup-box-btn-box">
<view class="popup-box-btn-box-item" @click="reset1">取消</view>
<view class="popup-box-btn-box-item" @click="tongbu(2)">确定</view>
</view>
</view>
</uni-popup>
<q-previewImage ref="previewImage" :urls="pics" @onLongpress="onLongpress" @open="open" <q-previewImage ref="previewImage" :urls="pics" @onLongpress="onLongpress" @open="open"
@close="close"></q-previewImage> @close="close"></q-previewImage>
</view> </view>
@ -217,6 +244,10 @@ export default {
arr: [ arr: [
], ],
maps: {
text: 'label',
value: 'value'
},
hazardList: [], hazardList: [],
addComForm: { addComForm: {
enterpriseName: '', enterpriseName: '',
@ -234,8 +265,15 @@ export default {
status: '1',// status: '1',//
disabled: false, disabled: false,
isReCheck: false, // isReCheck: false, //
isTongBu: false, //
id: '', id: '',
formData: {} formData: {},
hazardLevelList: [],
hazardTypeList: [],
hazardLevel: '',
hazardType: '',
formData1: null,
selectItem: null,
} }
}, },
onLoad(options) { onLoad(options) {
@ -258,6 +296,11 @@ export default {
} else { } else {
this.isReCheck = false this.isReCheck = false
} }
if (options.type && options.type == 4) {
this.isTongBu = true
} else {
this.isTongBu = false
}
}, },
onShow() { onShow() {
@ -274,9 +317,92 @@ export default {
}) })
}, 1500) }, 1500)
}) })
this.getDicts('hazard_level')
this.getDicts('hazard_type')
}, },
methods: { methods: {
reset1() {
this.hazardLevel = ''
this.hazardType = ''
this.formData1 = null
this.$refs.tongbuPopup.close()
},
tongbu(val) {
if (val == 2) {
if (!this.hazardLevel) {
uni.showToast({
title: '请选择隐患等级',
icon: 'none'
})
return
}
if (!this.hazardType) {
uni.showToast({
title: '请选择隐患类型',
icon: 'none'
})
return
}
let that = this
uni.showModal({
title: '提示',
content: '确定同步吗?',
showCancel: true,
success: function (res) {
if (res.confirm) {
that.formData1 = {
hazardDescription: that.selectItem.description,
inspectionBasis: that.selectItem.rectificationBasis,
remediationSuggestions: that.selectItem.rectificationSuggestion,
hazardType: that.hazardType,
hazardLevel: that.hazardLevel,
sort: 0,
status: true
}
debugger
Api.createPrivateHazard(that.formData1).then(res => {
uni.showToast({
title: '同步完成',
icon: 'none'
})
that.$refs.tongbuPopup.close()
that.$refs.paging.refresh()
that.hazardType = ''
that.hazardLevel = ''
that.formData1 = null
}).catch(err => {
console.log(err)
})
} else if (res.cancel) {
that.hazardType = ''
that.hazardLevel = ''
that.formData1 = null
console.log('用户点击取消');
}
}
})
}
},
tongbuPopup(item) {
this.selectItem = item
this.$refs.tongbuPopup.open()
},
getDicts(type) {
const params = {
type: type
}
getDicts(params).then(res => {
if (type === 'hazard_level') {
this.hazardLevelList = res.data
} else if (type === 'hazard_type') {
this.hazardTypeList = res.data
}
}).catch(err => {
console.log(err)
})
},
parseTime(time) { parseTime(time) {
return parseTime(time, '{y}-{m}-{d}') return parseTime(time, '{y}-{m}-{d}')
}, },
@ -1267,4 +1393,91 @@ export default {
} }
} }
} }
.form-item-titlebox {
display: flex;
align-items: center;
justify-content: space-between;
.label1 {
font-size: 24rpx;
color: #0d6dc1;
border: solid 1rpx #0d6dc1;
padding: 5rpx 10rpx;
border-radius: 10rpx;
}
}
.popup-box {
padding: 30rpx;
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;
&-content {
&-item {
margin-bottom: 40rpx;
&:last-child {
margin-bottom: 0;
}
>text {
display: block;
font-size: 32rpx;
font-weight: bold;
color: #333;
margin-bottom: 20rpx;
}
.uni-data-checkbox {
display: flex;
flex-wrap: wrap;
::v-deep .uni-checkbox-group {
display: flex;
flex-wrap: wrap;
.uni-label {
width: 50%;
margin-bottom: 20rpx;
display: flex;
align-items: center;
.uni-checkbox-input {
transform: scale(0.8);
margin-right: 10rpx;
}
}
}
}
}
}
&-btn-box {
display: flex;
justify-content: space-between;
margin-top: 30rpx;
&-item {
flex: 1;
height: 80rpx;
line-height: 80rpx;
text-align: center;
border-radius: 10rpx;
font-size: 30rpx;
&:first-child {
background-color: #f5f5f5;
color: #666;
margin-right: 20rpx;
}
&:last-child {
background-color: #007AFF;
color: #fff;
margin-left: 20rpx;
}
}
}
}
</style> </style>

@ -253,8 +253,8 @@ export default {
this.sseBuffer = ""; this.sseBuffer = "";
const url = 'https://e629859.r39.cpolar.top/agent-api/api/v3/user_share_chat_completions' const url = 'https://e629859.r39.cpolar.top/agent-api/api/v3/user_share_chat_completions'
+ '?api_key=cjy-778af2cdb2f645ff99493cee58919e9d' + '?api_key=cjy-c8c36aa2ffa64aa5b4b1e89b14166a4c'
+ '&app_code=c8360e1c-6d21-11f0-8f29-00e04f309c26' + '&app_code=ebccfa05-78ab-11f0-9afa-00e04f3085ba'
+ '&random=' + this.random + '&user_input=' + encodeURIComponent(question); + '&random=' + this.random + '&user_input=' + encodeURIComponent(question);
const requestTask = wx.request({ const requestTask = wx.request({

@ -75,10 +75,13 @@
// <view class="list-btn"></view> // <view class="list-btn"></view>
// <view class="list-btn" @click="signIng(item)"></view> --> // <view class="list-btn" @click="signIng(item)"></view> -->
<view class="list-btn ani" hover-class="isHoverIng" @click="goReport(item)">查看报告</view> <view class="list-btn ani" hover-class="isHoverIng" @click="goReport(item)">查看报告</view>
<view class="list-btn ani" hover-class="isHoverIng" v-if="item.status == 3&&userType == 1||item.status == 3&&userType == 2" <view class="list-btn ani" hover-class="isHoverIng"
v-if="item.status == 3 && userType == 1 || item.status == 3 && userType == 2"
@click="viewDetails(item, true, '1')">复查</view> @click="viewDetails(item, true, '1')">复查</view>
<view class="list-btn ani" hover-class="isHoverIng" v-if="item.status == 4&&userType == 1||item.status == 4&&userType == 2" <view class="list-btn ani" hover-class="isHoverIng"
v-if="item.status == 4 && userType == 1 || item.status == 4 && userType == 2"
@click="viewDetails(item, true, '2')">同步到学一学</view> @click="viewDetails(item, true, '2')">同步到学一学</view>
<view class="list-btn ani" hover-class="isHoverIng" @click="viewDetails(item, true,'4')">查看详情</view>
</view> </view>
</view> </view>
</z-paging> </z-paging>
@ -118,7 +121,7 @@
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
<uni-popup ref="comTypePopup" type="bottom" background-color="#fff"> <uni-popup ref="comTypePopup" type="center" background-color="#fff">
<view class="popup-box"> <view class="popup-box">
<view class="popup-box-content"> <view class="popup-box-content">
<view class="popup-box-content-item"> <view class="popup-box-content-item">
@ -129,11 +132,12 @@
</view> </view>
</view> </view>
<view class="popup-box-btn-box"> <view class="popup-box-btn-box">
<view class="popup-box-btn-box-item" @click="reset">重置</view> <view class="popup-box-btn-box-item" @click="reset1">取消</view>
<view class="popup-box-btn-box-item" @click="tongbu">确定</view> <view class="popup-box-btn-box-item" @click="tongbu(1)">确定</view>
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
</view> </view>
</template> </template>
<script> <script>
@ -167,8 +171,9 @@ export default {
comType: '', comType: '',
status: '', status: '',
reviewName: '', reviewName: '',
formData:null, formData: null,
userType: this.$store.state.user.userType, userType: this.$store.state.user.userType,
} }
}, },
computed: { computed: {
@ -181,54 +186,122 @@ export default {
this.getDicts('initial_review_check_type') this.getDicts('initial_review_check_type')
this.getDicts('initial_review_status') this.getDicts('initial_review_status')
this.getDicts('com_type') this.getDicts('com_type')
}, },
methods: { methods: {
reset() { reset() {
this.checkType = '' this.checkType = ''
this.comType = ''
this.status = '' this.status = ''
this.reviewName = '' this.reviewName = ''
}, },
reset1() {
this.comType = ''
this.$refs.comTypePopup.close()
},
confirm() { confirm() {
this.$refs.paging.refresh() this.$refs.paging.refresh()
this.$refs.popup.close() this.$refs.popup.close()
}, },
// //
tongbu() { tongbu(val) {
if (!this.comType) { if (val == 1) {
uni.showToast({ if (!this.comType) {
title: '请选择企业类型', uni.showToast({
icon: 'none' title: '请选择企业类型',
icon: 'none'
})
return
}
let that = this
uni.showModal({
title: '提示',
content: '确定同步吗?',
showCancel: true,
success: function (res) {
if (res.confirm) {
that.formData = {
...that.formData,
type: that.comType
}
debugger
Api.updateReview(that.formData).then(res => {
uni.showToast({
title: '同步完成',
icon: 'none'
})
that.$refs.comTypePopup.close()
that.$refs.paging.refresh()
}).catch(err => {
console.log(err)
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
}) })
return
} }
let that = this if (val == 2) {
uni.showModal({ if (!this.hazardLevel) {
title: '提示', uni.showToast({
content: '确定同步吗?', title: '请选择隐患等级',
showCancel: true, icon: 'none'
success: function (res) {
if (res.confirm) {
that.formData = {
...that.formData,
type:that.comType
}
debugger
Api.updateReview(that.formData).then(res => {
uni.showToast({
title: '同步完成',
icon: 'none'
})
that.$refs.comTypePopup.close()
that.$refs.paging.refresh()
}).catch(err => {
console.log(err)
}) })
} else if (res.cancel) { return
console.log('用户点击取消');
}
} }
}) if (!this.hazardType) {
uni.showToast({
title: '请选择隐患类型',
icon: 'none'
})
return
}
let that = this
uni.showModal({
title: '提示',
content: '确定同步吗?',
showCancel: true,
success: function (res) {
if (res.confirm) {
const arr = JSON.parse(that.formData.reviewResult)
arr.forEach(item => {
const obj = {
"hazardType": "2", //
"hazardLevel": "", //
"hazardDescription": "你说的对", //
"inspectionBasis": "", //
"remediationSuggestions": "", //
"sort": 1, //
"status": 0 // 0 1
}
})
that.formData = {
...that.formData,
hazardDescription: that.formData.description,
inspectionBasis: that.formData.rectificationBasis,
remediationSuggestions: that.formData.rectificationSuggestion,
hazardType: that.hazardType,
hazardLevel: that.hazardLevel,
sort: 0,
status: true
}
debugger
Api.createPrivateHazard(that.formData).then(res => {
uni.showToast({
title: '同步完成',
icon: 'none'
})
that.$refs.comTypePopup.close()
that.$refs.paging.refresh()
}).catch(err => {
console.log(err)
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
})
}
}, },
getDicts(type) { getDicts(type) {
const params = { const params = {
@ -285,8 +358,9 @@ export default {
}) })
}, },
viewDetails(item, val, type) { viewDetails(item, val, type) {
const data = encodeURIComponent(JSON.stringify(item))
if (type == 1) { if (type == 1) {
const data = encodeURIComponent(JSON.stringify(item))
uni.navigateTo({ uni.navigateTo({
url: '/pageIndex/addSafeCheck/readdSafeCheck?data=' + data + '&val=' + val + '&type=' + type url: '/pageIndex/addSafeCheck/readdSafeCheck?data=' + data + '&val=' + val + '&type=' + type
}) })
@ -295,6 +369,15 @@ export default {
this.formData = item this.formData = item
this.$refs.comTypePopup.open() this.$refs.comTypePopup.open()
} }
if (type == 3) {
this.formData = item
this.$refs.comTypePopup.open()
}
if (type == 4) {
uni.navigateTo({
url: '/pageIndex/addSafeCheck/readdSafeCheck?data=' + data + '&val=' + val + '&type=' + type
})
}
}, },
goReport(item) { goReport(item) {
const data = encodeURIComponent(JSON.stringify(item)) const data = encodeURIComponent(JSON.stringify(item))

@ -148,7 +148,7 @@
</view> </view>
<view class="content"> <view class="content">
<view class="content-label">创建时间</view> <view class="content-label">创建时间</view>
<view class="content-value">{{ mockData.createTime }}</view> <view class="content-value">{{ parseTime(mockData.createTime) }}</view>
</view> </view>
</view> </view>
<view class="popup-box-btn-box"> <view class="popup-box-btn-box">

@ -60,7 +60,7 @@
</view> </view>
</view> </view>
<view class="list-item-feet border-top" > <view class="list-item-feet border-top" >
<view class="list-item-feet-btn" @click="goFilePage"> <view class="list-item-feet-btn" >
<!-- <image src="https://mp-df79fe8b-b924-41b0-bcb1-960be6b4a619.cdn.bspapp.com/images/common/fujian@2x.png"></image> --> <!-- <image src="https://mp-df79fe8b-b924-41b0-bcb1-960be6b4a619.cdn.bspapp.com/images/common/fujian@2x.png"></image> -->
<image src="https://i.postimg.cc/cH6cSgmq/fujian-2x.png"></image> <image src="https://i.postimg.cc/cH6cSgmq/fujian-2x.png"></image>
<text class="list-item-feet-btn-label" @click="goReport(item)">查看附件</text> <text class="list-item-feet-btn-label" @click="goReport(item)">查看附件</text>
@ -162,11 +162,6 @@ export default {
openPop() { openPop() {
this.$refs.popup.open() this.$refs.popup.open()
}, },
goFilePage() {
uni.navigateTo({
url: '/pageIndex/filePage/filePage'
})
},
parseTime(time) { parseTime(time) {
return parseTime(time) return parseTime(time)
}, },

@ -56,7 +56,7 @@
</view> </view>
<view class="list-item-body-desc"> <view class="list-item-body-desc">
<text class="list-item-body-desc-label">实施日期</text> <text class="list-item-body-desc-label">实施日期</text>
<text class="list-item-body-desc-value">{{ item.implementationDate }}</text> <text class="list-item-body-desc-value">{{ item.implementationDate.join('-') }}</text>
</view> </view>
<view class="list-item-body-desc"> <view class="list-item-body-desc">
<text class="list-item-body-desc-label">所属行业</text> <text class="list-item-body-desc-label">所属行业</text>
@ -64,8 +64,8 @@
}}</text> }}</text>
</view> </view>
</view> </view>
<view class="list-item-feet border-top" v-if="0 == 1"> <view class="list-item-feet border-top" v-if="item.filePath">
<view class="list-item-feet-btn" @click="goFilePage"> <view class="list-item-feet-btn" @click="goFilePage(item.filePath)">
<!-- <image src="https://mp-df79fe8b-b924-41b0-bcb1-960be6b4a619.cdn.bspapp.com/images/common/fujian@2x.png"></image> --> <!-- <image src="https://mp-df79fe8b-b924-41b0-bcb1-960be6b4a619.cdn.bspapp.com/images/common/fujian@2x.png"></image> -->
<image src="https://i.postimg.cc/cH6cSgmq/fujian-2x.png"></image> <image src="https://i.postimg.cc/cH6cSgmq/fujian-2x.png"></image>
<text class="list-item-feet-btn-label">查看附件</text> <text class="list-item-feet-btn-label">查看附件</text>
@ -142,6 +142,58 @@ export default {
this.getDicts('industry_type') this.getDicts('industry_type')
}, },
methods: { methods: {
goFilePage(url) {
//
const fileExtension = url.split(".").pop()?.toLowerCase();
if (!fileExtension) {
uni.showToast({ title: "无法识别文件类型", icon: "none" });
return;
}
//
if (["jpg", "jpeg", "png", "gif"].includes(fileExtension)) {
//
uni.previewImage({
urls: [url],
});
} else {
//
uni.downloadFile({
url: url,
// filePath: filePath,
success: (res) => {
if (res.statusCode === 200) {
uni.openDocument({
filePath: res.tempFilePath,
success: () => console.log("文档预览成功 路径: ", res.tempFilePath),
fail: (err) => {
console.error("文档预览失败", err);
uni.showToast({
title: "预览失败",
icon: "error",
});
},
});
} else {
uni.showToast({
title: "文件下载失败",
icon: "error",
});
}
},
fail: (err) => {
console.error("文件下载失败", err);
uni.showToast({
title: "文件下载失败",
icon: "error",
});
},
});
}
},
reset() { reset() {
this.industry = '' this.industry = ''
}, },
@ -167,11 +219,6 @@ export default {
openPop() { openPop() {
this.$refs.popup.open() this.$refs.popup.open()
}, },
goFilePage() {
uni.navigateTo({
url: '/pageIndex/filePage/filePage'
})
},
parseTime(time) { parseTime(time) {
return parseTime(time) return parseTime(time)
}, },

@ -48,7 +48,7 @@ export default {
}, },
data() { data() {
return { return {
captchaEnabled: true, // TODO captchaEnabled: false, // TODO
globalConfig: getApp().globalData.config, globalConfig: getApp().globalData.config,
loginForm: { loginForm: {
username: "", username: "",

Loading…
Cancel
Save