Browse Source

'250630'

master
wxc 5 months ago
parent
commit
c2c02657ca
  1. 131
      README.md
  2. 4
      api/negative.js
  3. 4
      components/file-list.vue
  4. 9
      components/net-image.vue
  5. 1
      components/police-picker.vue
  6. 33
      components/upload.vue
  7. 8
      pages.json
  8. 2
      pages/center/about.vue
  9. 8
      pages/center/manual.vue
  10. 27
      pages/common/camera.nvue
  11. 27
      pages/index/index.vue
  12. 230
      pages/negative/todo.vue
  13. 81
      pages/task/index.vue
  14. 22
      pages/task/problem/add.vue
  15. 2
      pages/task/selfexamination/list.vue
  16. 49
      pages/task/testingAlcohol/add.vue
  17. 16
      pages/task/testingAlcohol/info.vue
  18. 36
      pages/task/testingAlcohol/people.vue

131
README.md

@ -1,129 +1,2 @@
# hello-uniapp
`uni-app`框架示例,一套代码,同时发行到iOS、Android、H5、小程序等多个平台,请使用手机在下方扫码快速体验`uni-app`的强大功能。[官方文档](https://uniapp.dcloud.net.cn/)
## 快速上手
hello-uniapp 示例工程可以通过两种方式创建, 一种是 HBuilderX, 配套 IDE,集成开发;另一种是 CLI 创建;推荐前者。
### 通过 HBuilderX 可视化界面创建(推荐)
可视化的方式比较简单,HBuilderX内置相关环境,开箱即用,无需配置nodejs。
开始之前,开发者需先下载安装如下工具:
- HBuilderX:[官方IDE下载地址](https://www.dcloud.io/hbuilderx.html)
HBuilderX是通用的前端开发工具,但为`uni-app`做了特别强化,请下载App开发版。
由于截图在 github 不便浏览,参见官方文档 [HBuilderX 可视化界面创建](https://uniapp.dcloud.net.cn/quickstart?id=_1-%e9%80%9a%e8%bf%87-hbuilderx-%e5%8f%af%e8%a7%86%e5%8c%96%e7%95%8c%e9%9d%a2)
### 通过 vue-cli 创建
```
npm install -g @vue/cli
```
#### 创建uni-app
**使用正式版**(对应HBuilderX最新正式版)
```
vue create -p dcloudio/uni-preset-vue my-project
```
**使用alpha版**(对应HBuilderX最新alpha版)
```
vue create -p dcloudio/uni-preset-vue#alpha my-alpha-project
```
此时,会提示选择项目模板,选择 `hello uni-app` 项目模板,如下所示:
<div>
<img src="https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/h5-cli-01.png" width="300">
</div>
创建好后,进入项目目录
```
cd my-project
```
执行该命令运行到 h5 端
```
npm run dev:h5
```
欢迎提 issues,推荐到[官方社区](https://ask.dcloud.net.cn/explore/)提问。
## 扫码体验
<div class="quick">
<p>一套代码编到10个平台,这不是梦想。眼见为实,扫描10个二维码,亲自体验最全面的跨平台效果!</p>
<div style="display: flex;">
<a href="//m3w.cn/uniapp" target="_blank" class="clear-style barcode-view">
<div class="barcode-img-box">
<img src="https://web-assets.dcloud.net.cn/unidoc/zh/uni-android.png" width="160" />
</div>
<b>Android版</b>
</a>
<a href="https://itunes.apple.com/cn/app/hello-uni-app/id1417078253?mt=8" target="_blank" class="clear-style barcode-view">
<div class="barcode-img-box">
<img src="https://web-assets.dcloud.net.cn/unidoc/zh/uni-h5.png" width="160" />
</div>
<b>iOS版</b>
</a>
<a href="https://hellouniapp.dcloud.net.cn/" target="_blank" class="clear-style barcode-view">
<div class="barcode-img-box">
<img src="https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/uni-h5-hosting-qr.png" width="160" />
</div>
<b>H5版</b>
</a>
<a href="//m3w.cn/uniapp" target="_blank" class="clear-style barcode-view">
<div class="barcode-img-box"><img src="//img.cdn.aliyun.dcloud.net.cn/guide/uniapp/gh_33446d7f7a26_430.jpg" width="160" /></div>
<b>微信小程序版</b>
</a>
<a href="//m3w.cn/uniapp" target="_blank" class="clear-style barcode-view">
<div class="barcode-img-box"><img src="https://web-assets.dcloud.net.cn/unidoc/zh/alipay1.png" width="160" /></div>
<b>支付宝小程序版</b>
</a>
</div>
<div class="flex-img-group-view" style="margin-top: 20px;">
<a href="//m3w.cn/uniapp" target="_blank" class="clear-style barcode-view">
<div class="barcode-img-box"><img src="https://web-assets.dcloud.net.cn/unidoc/zh/baidu-uniapp.png" width="160" /></div>
<b>百度小程序版</b>
</a>
<a href="//m3w.cn/uniapp" target="_blank" class="clear-style barcode-view">
<div class="barcode-img-box">
<img src="https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/mp-toutiao.png" width="160" />
</div>
<b>字节跳动小程序版</b>
</a>
<a href="//m3w.cn/uniapp" target="_blank" class="clear-style barcode-view">
<div class="barcode-img-box">
<img src="https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/hello-uni-qq.png" width="160" />
</div>
<b>QQ小程序版</b>
</a>
<a href="//m3w.cn/uniapp" target="_blank" class="clear-style barcode-view">
<div class="barcode-img-box">
<img src="https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/hello-uni-qa-union.png" width="160" />
</div>
<b>快应用</b>
</a>
<a href="https://so.mp.360.cn/mp.html?appid=qh4j181qqtru354st6" target="_blank" class="clear-style barcode-view">
<div class="barcode-img-box">
<img src="https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/hello-uni-mp-360-qr.png" width="160" />
</div>
<b>360小程序</b>
</a>
</div>
<p>
<em>注:某些平台不能提交简单demo,故补充了一些其他功能;hello uni-app示例代码可从[github](https://github.com/dcloudio/hello-uniapp)获取</em></br>
<em>快应用仅支持 vivo 、oppo、华为</em></br>
<em>360小程序仅 windows平台支持,需要在360浏览器中打开</em></br>
</p>
</div>
`uni-app`官网文档详见[https://uniapp.dcloud.io](https://uniapp.dcloud.io)
更多uni-app的模板、示例详见[插件市场](https://ext.dcloud.net.cn/)
# supervision-uniapp
移动督察APP

4
api/negative.js

@ -10,4 +10,8 @@ export function getNegative(id, workId) {
export function executeNegative(id, body) {
return request.post({ url: `/negative/${id}/execute`, body})
}
export function listNegativeTodo(query) {
return request.get({ url: `/work/todo`, query})
}

4
components/file-list.vue

@ -1,7 +1,7 @@
<template>
<view class="flex gap-8 wrap">
<view class="flex gap-8 flex-wrap">
<view v-for="(file, index) in files" class="col-8 file-item">
<view class="file flex wrap flex-col items-center" v-if="getFileType(file.fileName) !== 'img'">
<view class="file flex flex-wrap flex-col items-center" v-if="getFileType(file.fileName) !== 'img'">
<view class="mt-10">
<image :src="`/static/icon/${ getFileType(file.fileName) }.png`" mode="widthFix" style="width: 78rpx"></image>
</view>

9
components/net-image.vue

@ -3,7 +3,7 @@
</template>
<script setup>
import { onMounted, ref, defineProps } from 'vue';
import { onMounted, ref, defineProps, watch } from 'vue';
import store from '@/store'
import { getFileBase64 } from '@/api/file'
@ -14,13 +14,18 @@
});
const src = ref('');
console.log('filepath', props.filepath)
onMounted(() => {
getFileBase64(props.filepath).then(data => {
src.value = data;
})
})
watch(() => props.filepath, () => {
getFileBase64(props.filepath).then(data => {
src.value = data;
})
})
</script>
<style scoped>

1
components/police-picker.vue

@ -63,6 +63,7 @@ import {
current: 1,
size: 16,
departBranch: true,
departId: props.departId
})
watch(() => props.modelValue, (val) => {

33
components/upload.vue

@ -1,7 +1,11 @@
<template>
<view class="upload-container">
<view v-for="(item, index) in files" class="upload-item">
<net-image :filepath="item.filePath" />
<template v-if="item.filePath">
<net-image :filepath="item.filePath" />
</template>
<image :src="item.localFilepath" v-else style="width: 100%; height: 100%" />
<button class="remove-btn" @tap="handleRemove(index)">
<uni-icons type="closeempty" color="#fff" size="18" />
</button>
@ -57,22 +61,25 @@
sizeType: ['original'],
count: 3,
success: (res) => {
uni.showLoading({
title: '文件上传中, 请稍等'
});
res.tempFiles.forEach(async (file) => {
const base64 = await pathToBase64(file.path);
const filename = file.path.substring(file.path.lastIndexOf('/') + 1)
const data = await uploadFileBase64({
base64,
originalFilename: filename
})
files.value.push({
filePath: data.filePath,
const fileItem = {
localFilepath: file.path,
fileName: filename
});
}
files.value.push(fileItem);
try {
const base64 = await pathToBase64(file.path);
const data = await uploadFileBase64({
base64,
originalFilename: filename
})
fileItem.filePath = data.filePath;
} catch(e) {
files.value.splice(files.value.indexOf(fileItem), 1)
}
emit('update:modelValue', files.value)
uni.hideLoading();
})
},
fail: (err) => {

8
pages.json

@ -49,6 +49,12 @@
"navigationBarTitleText": ""
}
},
{
"path": "pages/negative/todo",
"style": {
"navigationBarTitleText": "问题处置"
}
},
{
"path": "pages/duty/index",
"style": {
@ -171,7 +177,7 @@
{
"path": "problem/list",
"style": {
"navigationBarTitleText": "问题详情"
"navigationBarTitleText": "随拍清单"
}
},
{

2
pages/center/about.vue

@ -4,7 +4,7 @@
<image src="/static/image/logo-p.png" style="width: 238rpx" mode="widthFix"></image>
</view>
<view class="h1">移动督察</view>
<view class="version">版本 v6.2.1</view>
<view class="version">版本 v6.2.2</view>
</view>
</template>

8
pages/center/manual.vue

@ -1,13 +1,13 @@
<template>
<view class="container">
<uni-title type="h1" title="工作日测酒"></uni-title>
<view>
<scroll-view scroll-y="true" scroll-x="true">
<image src="/static/image/1.png" style="height: 200vh" mode="heightFix"></image>
</view>
</scroll-view>
<uni-title type="h1" title="督察任务"></uni-title>
<view>
<scroll-view scroll-y="true" scroll-x="true">
<image src="/static/image/2.png" style="height: 200vh" mode="heightFix"></image>
</view>
</scroll-view>
</view>
</template>

27
pages/common/camera.nvue

@ -15,8 +15,8 @@
<view class="tools-b">
<view>
<view class="img-btn tools-btn" @tap="openPhoto">
<view class="img-number">{{ files.length }}</view>
<template v-if="files.length > 0">
<view class="img-number">{{ files.length }}</view>
<net-image :filepath="files[0].filePath" class="img-btn-img" />
</template>
</view>
@ -62,7 +62,6 @@
this.initCamera();
// 解决 store 取不到值的问题
store.commit('setRequestUrl', this.$store.state.requestUrl)
store.commit('setFileRequestUrl', this.$store.state.fileRequestUrl)
store.commit('setAppCredential', this.$store.state.appCredential)
store.commit('setUserCredential', this.$store.state.userCredential)
},
@ -134,14 +133,12 @@
base64,
originalFilename: fileName
}).then(data => {
_this.files.push({
const fileItem = {
filePath: data.filePath,
fileName
})
addPhoto({
filePath: data.filePath,
fileName
}).then(() => {
}
_this.files.push(fileItem)
addPhoto(fileItem).then(() => {
})
})
@ -238,7 +235,7 @@
left: 0;
right: 0;
z-index: 9999;
background-color: rgba(0, 0, 0, 1);
background-color: rgba(0, 0, 0, 0.7);
padding: 48rpx 80rpx;
display: flex;
flex-direction: row;
@ -284,13 +281,11 @@
border-radius: 50%;
display: block;
}
.img-number {
color: white;
position: absolute;
}
}
.img-number {
position: absolute;
top: -16rpx;
right: -16rpx;
z-index: 999;
color: #fff;
}
}
</style>

27
pages/index/index.vue

@ -18,19 +18,14 @@
</view>
<view class="item-name">已办结</view>
</view>
</view>
</view>
<!-- <view class="container">
<view class="title">问题处置</view>
<view class="flex flex-wrap gap-32">
<view class="app-item" @tap="openTask('todo')">
<view class="app-item" @tap="openNegativeTodo()">
<view class="item-icon item-number mb-6">
<text>{{ task.todoCount }}</text>
<text>{{ task.negativeTodoCount }}</text>
</view>
<view class="item-name mb-6">待处理</view>
<view class="item-name">问题处置</view>
</view>
</view>
</view> -->
</view>
<view class="container">
<view class="title">督察应用</view>
<view class="flex flex-wrap app-container">
@ -38,7 +33,7 @@
<view class="item-icon mb-6">
<image src="/static/icon/ic_camera.png"></image>
</view>
<view class="item-name">问题随拍</view>
<view class="item-name">随拍清单</view>
</view>
<view class="app-item" @tap="openNegative">
<view class="item-icon mb-6">
@ -150,7 +145,8 @@
return {
task: {
todoCount: 0,
doneCount: 0
doneCount: 0,
negativeTodoCount: 0
},
user: {},
currentPage: 'home',
@ -175,9 +171,9 @@
},
async onShow() {
_this = this;
const url = 'http://172.20.10.3:8080/app/';
// const url = 'http://172.20.10.3:8080/app/';
const env = 'prod';
// const url = 'http://192.168.3.22:8080/app/'
const url = 'http://192.168.3.21:8080/app/'
// #ifdef APP-PLUS
if (env === 'dev') {
if (!store.state.requestUrl) {
@ -234,6 +230,11 @@
url: '/pages/task/index?taskStatus=' + taskStatus
});
},
openNegativeTodo() {
uni.navigateTo({
url: '/pages/negative/todo'
});
},
async openCamera() {
// #ifdef APP-PLUS
let status = await permision.requestAndroid('android.permission.CAMERA');

230
pages/negative/todo.vue

@ -0,0 +1,230 @@
<template>
<view class="flex search">
<view class="search-item flex justify-center" :search="searchFlag">
<view class="search-item-conent">
<uni-easyinput prefixIcon="search" type="text" placeholder="搜索" :inputBorder="false" v-model="query.thingDesc" @focus="searchFlag = true" />
</view>
</view>
<view class="search-item flex justify-center" v-if="!searchFlag" @tap="showPopup">
<view :class="filterFlag ? 'search-item-conent active': 'search-item-conent'">
<uni-icons customPrefix="customicons" type="filter" size="20" color="#666" />
<view>筛选</view>
</view>
</view>
<view v-else>
<view class="cancel-btn" @tap="cancleSearch">取消</view>
</view>
</view>
<view>
<view class="flex gap-16 task-item card" v-for="item in todos" @tap="open(item)" >
<view>
<image src="../../static/icon/ic_question.png" style="width: 44px; height: 44px"></image>
</view>
<view style="width: calc(100% - 60px)">
<view class="flex justify-between header">
<view class="title">{{ item.problemSources }}</view>
<view class="date">{{ item.createTime }}</view>
</view>
<view>
<view class="row">
<view class="col col-24">
<view class="label">业务类别</view>
<view class="content">{{ item.businessTypeName }}</view>
</view>
<view class="col col-24">
<view class="label">涉及单位</view>
<view class="content">{{ item.involveDepartName }}</view>
</view>
<view class="col col-24">
<view class="label">问题内容</view>
<view class="content">{{ item.thingDesc }}</view>
</view>
<view class="col col-24">
<view class="label">涉嫌问题</view>
<view class="content">{{ getDictLabelByArray(suspectProblems, item.involveProblem) || '/' }}</view>
</view>
</view>
<view style="color: #555;" v-if="item.flowKey === 'completed'">已办结</view>
<view style="color: #FF0000;" v-else>{{ getFlowLable(item.flowKey) }}</view>
</view>
</view>
</view>
<empty v-if="todos.length === 0" />
</view>
<uni-popup ref="filterPopupRef" type="top">
<view class="popup-container">
<view class="popup-header">
<view>全部筛选</view>
<uni-icons type="closeempty" class="close-btn" @tap="closePopup"></uni-icons>
</view>
<view class="popup-body">
<view class="filter-container">
<view class="filter-label mt-10">业务类型</view>
<filter-radio :data="businessTypes" v-model="query.businessTypeCode" :prop="{text: 'dictLabel', value: 'dictValue'}" @change="search" />
<view class="filter-label mt-10">办理状态</view>
<filter-radio :data="processingStatus" v-model="query.processingStatus" :prop="{text: 'dictLabel', value: 'dictValue'}" @change="search" />
</view>
</view>
<view class="footer col-24 flex gap-8">
<button class="col-12" @tap="reset">重置</button>
<button type="primary" @tap="handleSearch" class="col-12">完成</button>
</view>
</view>
</uni-popup>
</template>
<script>
import { listNegativeTodo } from '@/api/negative'
import { getDictLabelByArray } from '@/common/util'
import { getDictOptions } from '@/common/dict'
let _this;
let oldTasks = []
export default {
inheritAttrs: false,
data() {
return {
tabOptions: [
{
text: '我的待办(0)',
value: 'todo'
},
{
text: '我的已办(0)',
value: 'done'
}
],
query: {
size: 100,
current: 1
},
todos: [],
searchFlag: false,
filterFlag: false,
loading: false
}
},
setup() {
const suspectProblems = getDictOptions('suspectProblem');
const processingStatus = getDictOptions('processingStatus');
const businessTypes = getDictOptions('businessType')
return {
suspectProblems,
processingStatus,
businessTypes,
getDictLabelByArray
}
},
watch: {
searchFlag(val) {
if (val) {
oldTasks = this.todos;
this.todos = []
} else {
this.todos = oldTasks
}
},
'query.thingDesc': function(val) {
if (_this.searchFlag && val) {
_this.getList()
}
}
},
onLoad() {
_this = this;
},
onShow() {
this.getList()
},
methods: {
open(item) {
uni.navigateTo({
url: `/pages/negative/action?id=${item.negativeId}&workId=${item.workId}`
});
},
getFlowLable(flowKey) {
const signFlows = ['second_sign']
if (signFlows.indexOf(flowKey) > -1) {
return '待签收'
}
const distributeFlows = ['first_distribute', 'second_distribute']
if (distributeFlows.indexOf(flowKey) > -1) {
return '待下发'
}
const verifyFlows = ['verify']
if (verifyFlows.indexOf(flowKey) > -1) {
return '核查办理'
}
const approveFlows = ['second_approve']
if (approveFlows.indexOf(flowKey) > -1) {
return '待审批'
}
return ''
},
async getList() {
this.loading = true
uni.showLoading({
title: '数据加载中'
});
listNegativeTodo(this.query).then(data => {
this.todos = data.records
this.loading = false
uni.hideLoading();
})
},
cancleSearch() {
this.searchFlag = false
this.query.taskName = ''
},
showPopup() {
this.$refs.filterPopupRef.open()
},
closePopup() {
this.$refs.filterPopupRef.close()
},
search() {
if (this.query.businessTypeCode || this.query.processingStatus) {
this.filterFlag = true
} else {
this.filterFlag = false
}
this.getList()
},
handleSearch() {
this.search()
this.closePopup()
},
reset() {
this.filterFlag = false
this.query = {
size: 100,
current: 1
}
this.getList()
}
}
}
</script>
<style lang="scss" scoped>
.task-item {
.header {
margin-bottom: 12rpx;
.title {
font-size: 28rpx;
line-height: 40rpx;
}
.date {
font-size: 24rpx;
color: #666;
}
}
}
</style>

81
pages/task/index.vue

@ -113,39 +113,7 @@
</view>
</view>
</template>
<template v-if="item.taskType === 'negative'">
<view>
<image src="../../static/icon/ic_question.png" style="width: 44px; height: 44px"></image>
</view>
<view style="width: calc(100% - 60px)">
<view class="flex justify-between header">
<view class="title">{{ item.taskName }}</view>
<view class="date">{{ item.createTime }}</view>
</view>
<view>
<view class="row">
<view class="col col-24">
<view class="label">业务类别</view>
<view class="content">{{ item.businessTypeName }}</view>
</view>
<view class="col col-24">
<view class="label">涉及单位</view>
<view class="content">{{ item.supDepartName }}</view>
</view>
<view class="col col-24">
<view class="label">问题内容</view>
<view class="content">{{ item.taskContent }}</view>
</view>
<view class="col col-24">
<view class="label">涉嫌问题</view>
<view class="content">{{ getDictLabelByArray(suspectProblems, item.involveProblem) || '/' }}</view>
</view>
</view>
<view style="color: #555;" v-if="item.flowKey === 'completed'">已办结</view>
<view style="color: #FF0000;" v-else>{{ getFlowLable(item.flowKey) }}</view>
</view>
</view>
</template>
</view>
<empty v-if="tasks.length === 0" />
</view>
@ -173,7 +141,6 @@
</template>
<script>
import { listTask, getTaskCount } from '@/api/task'
import { getDictLabelByArray } from '@/common/util'
import { getDictOptions } from '@/common/dict'
let _this;
@ -203,7 +170,7 @@
loading: false,
taskTypes: [
{
text: '测酒任务',
text: '禁酒督察',
value: 'testing_alcohol'
},
{
@ -213,11 +180,7 @@
{
text: '所队自查',
value: 'selfexamination'
},
{
text: '问题',
value: 'negative'
},
}
],
taskStatus: [
{
@ -233,11 +196,7 @@
}
},
setup() {
const suspectProblems = getDictOptions('suspectProblem');
return {
suspectProblems,
getDictLabelByArray
}
},
watch: {
searchFlag(val) {
@ -287,38 +246,6 @@
url: `/pages/task/selfexamination/index?taskId=${item.id}`
});
}
if (item.taskType === 'negative') {
console.log(item.taskStatus)
if (item.taskStatus === 'todo') {
uni.navigateTo({
url: `/pages/negative/action?id=${item.negativeId}&workId=${item.id}`
});
} else {
uni.navigateTo({
url: `/pages/negative/info?id=${item.negativeId}`
});
}
}
},
getFlowLable(flowKey) {
const signFlows = ['second_sign']
if (signFlows.indexOf(flowKey) > -1) {
return '待签收'
}
const distributeFlows = ['first_distribute', 'second_distribute']
if (distributeFlows.indexOf(flowKey) > -1) {
return '待下发'
}
const verifyFlows = ['verify']
if (verifyFlows.indexOf(flowKey) > -1) {
return '核查办理'
}
const approveFlows = ['second_approve']
if (approveFlows.indexOf(flowKey) > -1) {
return '待审批'
}
return ''
},
async getTasks() {
this.loading = true

22
pages/task/problem/add.vue

@ -1,27 +1,29 @@
<template>
<uni-forms ref="form" :modelValue="formData" :rules="rules" label-width="210rpx" style="margin: 12px">
<uni-forms-item label="附件" name="files" label-position="top" required>
<upload v-model="formData.files" />
<uni-forms-item label="被督察单位" name="departId" required>
<uni-data-picker :localdata="departs" placeholder="请选择被督察单位" :border="false"
:map="{text:'shortName', value: 'id'}" v-model="formData.departId" />
</uni-forms-item>
<uni-forms-item label="是否存在问题" name="hasProblem" required>
<uni-data-checkbox v-model="formData.hasProblem" :localdata="hasProblem" />
</uni-forms-item>
<uni-forms-item label="关联督察任务" v-if="needSeelctTaskFlag">
<inspection-task-data-picker v-model="formData.taskId" />
</uni-forms-item>
<uni-forms-item label="被督察单位" name="departId" required>
<uni-data-picker :localdata="departs" placeholder="请选择被督察单位" :border="false"
:map="{text:'shortName', value: 'id'}" v-model="formData.departId" />
</uni-forms-item>
<uni-forms-item label="问题类型" name="problemTypeCode" v-if="formData.hasProblem === true">
<problem-picker v-model="formData.problemTypeCode" @nodeclick="(node) => formData.problemType = node.name" />
</uni-forms-item>
<uni-forms-item label="被督察人员" name="peoples" v-if="formData.hasProblem === true">
<police-picker v-model="formData.peoples" :departId="formData.departId" />
<police-picker v-model="formData.peoples" :departId="formData.departId || store.state.user.departId" />
</uni-forms-item>
<uni-forms-item label="情况描述" name="thingDesc" label-position="top" required v-if="formData.hasProblem === true">
<uni-easyinput type="textarea" :input-border="false" placeholder="请输入具体情况" v-model="formData.thingDesc" />
</uni-forms-item>
<uni-forms-item label="附件" name="files" label-position="top" required>
<upload v-model="formData.files" />
</uni-forms-item>
</uni-forms>
<view class="footer col-24 flex gap-8">
<button class="col-12" @tap="back">取消</button>
@ -30,6 +32,7 @@
</template>
<script>
import store from '@/store'
import {
departTree
} from '@/api/depart'
@ -95,6 +98,11 @@
needSeelctTaskFlag: true
}
},
setup() {
return {
store
}
},
onLoad() {
_this = this;
if (this.$page.options.taskId) {

2
pages/task/selfexamination/list.vue

@ -50,7 +50,7 @@
<view>全部筛选</view>
<uni-icons type="closeempty" class="close-btn" @tap="closePopup"></uni-icons>
</view>
<view class="popup-body">
<view class="popup-body" style="min-height: 50vh;">
<view class="filter-container">
<view class="filter-label mt-10">自查单位</view>

49
pages/task/testingAlcohol/add.vue

@ -33,25 +33,40 @@
<view style="color: red">待检测</view>
</view>
</view>
<uni-forms ref="form" :modelValue="formData" :rules="rules" label-width="80px" style="margin: 12px">
<uni-forms ref="form" :modelValue="formData" :rules="rules" label-width="180rpx" style="margin: 12px">
<uni-forms-item label="检测时间" name="testingTime" required>
<uni-datetime-picker type="datetime" v-model="formData.testingTime" :border="false" placeholder="请选择检测时间" />
</uni-forms-item>
<uni-forms-item label="检测情况" name="testingResult" required>
<uni-data-checkbox v-model="formData.testingResult" :localdata="testingResult" />
</uni-forms-item>
<uni-forms-item label="测酒结果" name="drinkResult" required v-if="formData.testingResult === '已检测'">
<uni-forms-item label="是否饮酒" name="drinkResult" required v-if="formData.testingResult === '已检测'">
<uni-data-checkbox v-model="formData.drinkResult" :localdata="drinkResult" />
</uni-forms-item>
<uni-forms-item label="酒精含量" name="alcoholContent" required v-if="formData.testingResult === '已检测' && formData.drinkResult === '饮酒'">
<uni-forms-item label="是否存在违规宴请" name="isIllegalBanquet" required v-if="formData.testingResult === '已检测'">
<uni-data-checkbox v-model="formData.isIllegalBanquet" :localdata="isIllegalBanquet" />
</uni-forms-item>
<uni-forms-item label="酒精含量" name="alcoholContent" v-if="formData.testingResult === '已检测' && formData.drinkResult === '饮酒'">
<uni-easyinput type="number" v-model="formData.alcoholContent" placeholder="请输入酒精含量" :inputBorder="false" />
</uni-forms-item>
<uni-forms-item label="测酒照片" name="testingFiles" label-position="top" required
v-if="formData.testingResult === '已检测'">
<upload v-model="formData.testingFiles" />
</uni-forms-item>
<uni-forms-item label="情况说明" name="unTestingDesc" required v-if="formData.testingResult === '未检测'">
<uni-easyinput type="textarea" v-model="formData.unTestingDesc" placeholder="请输入未检测现场情况说明"
<uni-forms-item label="未检测原因" name="unTestingDesc" required v-if="formData.testingResult === '未检测'">
<uni-data-select
v-model="formData.unTestingDesc"
:localdata="unTestingDesc?.map(item => {
return {
text: item.dictLabel,
value: item.dictValue
}
})"
:border="false"
></uni-data-select>
</uni-forms-item>
<uni-forms-item label="补充具体原因" name="unTestingDescOther" required v-if="formData.unTestingDesc === '其他'" label-position="top">
<uni-easyinput type="textarea" v-model="formData.unTestingDescOther" placeholder="请输入未检测现场具体原因"
:inputBorder="false" />
</uni-forms-item>
</uni-forms>
@ -64,6 +79,7 @@
<script>
import store from '@/store'
import { now } from '@/common/util'
import { getDictOptions } from '@/common/dict'
import {
updateTestingAlcoholPeople
@ -104,19 +120,19 @@
}
]
},
alcoholContent: {
unTestingDesc: {
rules: [
{
required: true,
errorMessage: '请输入酒精含量',
errorMessage: '请选择未检测原因',
}
]
},
unTestingDesc: {
unTestingDescOther: {
rules: [
{
required: true,
errorMessage: '请输入未检测现场情况说明',
errorMessage: '请输入未检测现场具体原因',
}
]
},
@ -148,9 +164,24 @@
text: '饮酒',
value: '饮酒'
},
],
isIllegalBanquet: [{
text: '是',
value: '是'
},
{
text: '否',
value: '否'
},
]
}
},
setup() {
const unTestingDesc = getDictOptions('unTestingDesc')
return {
unTestingDesc
}
},
onLoad() {
_this = this;
},

16
pages/task/testingAlcohol/info.vue

@ -25,7 +25,10 @@
</view>
<view class="col col-24">
<view class="label">联系电话</view>
<view class="content">{{ people.mobile || '/' }}</view>
<view class="content">
<view v-if="people.mobile" @tap.stop="callPhone(people.mobile)">{{ people.mobile }}</view>
<view v-else>/</view>
</view>
</view>
</view>
@ -46,7 +49,7 @@
</view>
</view>
<view class="col col-12">
<view class="label">饮酒结果</view>
<view class="label">是否饮酒</view>
<view class="content">
<uni-tag :text="people.drinkResult" type="success" v-if="people.drinkResult === '未饮酒'" />
<uni-tag :text="people.drinkResult" type="error" v-else />
@ -60,13 +63,16 @@
<view class="label">未检测原因</view>
<view class="content">{{ people.unTestingDesc }}</view>
</view>
<view class="col col-24" v-if="people.isIllegalBanquet">
<view class="label">是否违规宴请</view>
<view class="content">{{ people.isIllegalBanquet }}</view>
</view>
</view>
</view>
</template>
<script>
import store from '@/store'
import { now } from '@/common/util'
import {
updateTestingAlcoholPeople
@ -76,7 +82,6 @@
export default {
data() {
return {
BASE_PATH: store.state.fileRequestUrl,
people: JSON.parse(this.$page.options.people)
}
},
@ -84,6 +89,9 @@
_this = this;
},
methods: {
callPhone(phoneNumber) {
uni.makePhoneCall({phoneNumber})
}
}
}
</script>

36
pages/task/testingAlcohol/people.vue

@ -44,34 +44,31 @@
</view>
<view class="col col-24">
<view class="label">联系电话</view>
<view class="content">{{ item.mobile || '/' }}</view>
<view class="content">
<view v-if="item.mobile" @tap.stop="callPhone(item.mobile)">{{ item.mobile }}</view>
<view v-else>/</view>
</view>
</view>
<template v-if="item.status === 'done'">
<view class="col col-24">
<view class="label">测酒时间</view>
<view class="content">{{ item.testingTime }}</view>
</view>
<view class="col col-12">
<view class="label">检测情况</view>
<view class="content">
<view v-if="item.testingResult === '未检测'" style="color: var(--danger-color)">{{ item.testingResult }}</view>
<view v-else>{{ item.testingResult }}</view>
<view class="col col-24">
<view class="label">
<view style="padding-right: 18rpx;">
<uni-tag :text="item.testingResult" type="primary" size="mini" v-if="item.testingResult === '已检测'" />
<uni-tag :text="item.testingResult" type="error" size="mini" v-else />
</view>
</view>
</view>
<view class="col col-12">
<view class="label">饮酒结果</view>
<view class="content">
<uni-tag :text="item.drinkResult" type="success" v-if="item.drinkResult === '未饮酒'" />
<uni-tag :text="item.drinkResult" type="error" v-else />
<text v-if="item.drinkResult === '未饮酒'">{{ item.drinkResult }}</text>
<text v-else style="color: red">{{ item.drinkResult }}</text>
<text style="color: #ff5722">{{ item.unTestingDesc }}</text>
</view>
</view>
<view class="col col-12" v-if="item.alcoholContent">
<view class="label">酒精含量</view>
<view class="content">{{ item.alcoholContent }}</view>
</view>
<view class="col col-24" v-if="item.unTestingDesc">
<view class="label">未检测原因</view>
<view class="content">{{ item.unTestingDesc }}</view>
<view class="col col-24" v-if="item.isIllegalBanquet">
<view>是否违规宴请{{ item.isIllegalBanquet }}</view>
</view>
</template>
</view>
@ -269,6 +266,9 @@
taskStatus
}
this.getPeoples()
},
callPhone(phoneNumber) {
uni.makePhoneCall({phoneNumber})
}
}
}

Loading…
Cancel
Save