赵鹏 2 months ago
parent
commit
05637ff378
  1. 103
      pages.json
  2. 3
      pages/login.vue
  3. 89
      pages/task.vue
  4. 199
      sub/enterprise/edit.vue
  5. 136
      sub/task/detail.vue
  6. 275
      sub/task/record.vue

103
pages.json

@ -61,51 +61,68 @@
"subPackages": [{
"root": "sub",
"pages": [{
"path": "owner/edit",
"style": {
"navigationBarTitleText": "个人信息"
}
}, {
"path": "owner/invite",
"style": {
"navigationBarTitleText": "邀请企业"
}
}, {
"path": "enterprise/edit",
"style": {
"navigationBarTitleText": "企业填报"
}
}, {
"path": "common/waiting",
"style": {
"navigationBarTitleText": ""
}
}, {
"path": "enterprise/detail",
"style": {
"navigationBarTitleText": "企业详情"
}
}, {
"path": "chat/index",
"style": {
"navigationBarTitleText": "智慧生态"
}
}, {
"path": "task/detail",
"style": {
"navigationBarTitleText": "任务详情",
"onReachBottonDistance": 50,
"enablePullDownRefresh": true,
"usingComponents": {
"van-dropdown-menu": "/wxcomponents/vant/dropdown-menu/index",
"van-dropdown-item": "/wxcomponents/vant/dropdown-item/index"
},
"componentPlaceholder": {
"u-modal": "view",
"u-sticky": "view"
"path": "owner/edit",
"style": {
"navigationBarTitleText": "个人信息"
}
}, {
"path": "owner/invite",
"style": {
"navigationBarTitleText": "邀请企业"
}
}, {
"path": "enterprise/edit",
"style": {
"navigationBarTitleText": "企业填报"
}
}, {
"path": "common/waiting",
"style": {
"navigationBarTitleText": ""
}
}, {
"path": "enterprise/detail",
"style": {
"navigationBarTitleText": "企业详情"
}
}, {
"path": "chat/index",
"style": {
"navigationBarTitleText": "智慧生态"
}
}, {
"path": "task/detail",
"style": {
"navigationBarTitleText": "任务详情",
"onReachBottonDistance": 50,
"enablePullDownRefresh": true,
"usingComponents": {
"van-dropdown-menu": "/wxcomponents/vant/dropdown-menu/index",
"van-dropdown-item": "/wxcomponents/vant/dropdown-item/index"
},
"componentPlaceholder": {
"u-modal": "view",
"u-sticky": "view"
}
}
},
{
"path": "task/record",
"style": {
"navigationBarTitleText": "记录详情",
"onReachBottonDistance": 50,
"enablePullDownRefresh": true,
"usingComponents": {
"van-dropdown-menu": "/wxcomponents/vant/dropdown-menu/index",
"van-dropdown-item": "/wxcomponents/vant/dropdown-item/index"
},
"componentPlaceholder": {
"u-modal": "view",
"u-sticky": "view"
}
}
}
}]
]
}],
"tabBar": {
"list": [{

3
pages/login.vue

@ -36,8 +36,7 @@ export default {
state: 'default',
userType: this.getUserType()
}
//
this.$store.dispatch('Login', data).then(() => {
this.loginSuccess()

89
pages/task.vue

@ -12,11 +12,11 @@
"
/>
<van-dropdown-item
:value="queryParams.zf_qy"
:options="getDropdownOption('zf_qy')"
:value="queryParams.priority"
:options="getDropdownOption('task_priority')"
@change="
v => {
querySelect(v, 'zf_qy')
querySelect(v, 'priority')
}
"
/>
@ -50,42 +50,83 @@
:enable-flex="true"
:style="{ maxHeight: `${listHeight}px` }"
>
<view v-for="task in list" :key="task.id" class="wd-flex wd-items-center enterprise" @click="goDetail(task.id)">
<view
v-for="task in list"
:key="task.id"
class="wd-flex wd-items-center enterprise"
@click="goDetail(task.id)"
>
<view class="rate">
<van-circle
:value="task.status == '3' ? 0 : task.pace"
size="56"
type="2d"
color="#17c653"
:layer-color="task.status == '2' ? '#EAFFF1' : '#F1F1F4'"
:layer-color="
task.status == '2' ? '#EAFFF1' : '#F1F1F4'
"
:canvasId="`canvas-${task.id}`"
>
<template>
<u-count-to :startVal="0" :endVal="task.pace" fontSize="16" bold duration="1000"></u-count-to>
<u-count-to
:startVal="0"
:endVal="task.pace"
fontSize="16"
bold
duration="1000"
></u-count-to>
%
</template>
</van-circle>
</view>
<view class="wd-flex wd-flex-col" style="gap: 4px">
<text class="wd-font-800 wd-text-15 wd-pb-2px">{{ task.title }}</text>
<text class="wd-font-800 wd-text-15 wd-pb-2px">
{{ task.title }}
</text>
<view class="wd-flex wd-pb-8px">
<u-icon name="calendar" size="18" :color="task.status == '2' ? '#17C653' : '#78829D'"></u-icon>
<u-icon
name="calendar"
size="18"
:color="task.status == '2' ? '#17C653' : '#78829D'"
></u-icon>
<text
class="address wd-text-12"
style="margin-left: 4px"
:style="{ color: task.status == '2' ? '#17C653' : '#78829D' }"
:style="{
color: task.status == '2' ? '#17C653' : '#78829D'
}"
>
{{ $util.formatDate(task.endDate, 'YYYY年MM月DD日') }}结束
{{
$util.formatDate(task.endDate, 'YYYY年MM月DD日')
}}结束
</text>
</view>
<view class="tagList">
<view class="tag" v-for="(tag, index) in task.tagList" :key="index">
<view class="tag" v-if="task.deptName">
{{ task.deptName }}
</view>
<view class="tag">
{{
$dict.echoDicValue(
dictMap.task_priority,
task.priority
)
}}
</view>
<view
class="tag"
v-for="(tag, index) in task.tagList"
:key="index"
>
{{ tag }}
</view>
</view>
</view>
<view class="audit">
<cs-dict-tag :dict="dictMap.task_state" :value="task.status"></cs-dict-tag>
<cs-dict-tag
:dict="dictMap.task_state"
:value="task.status"
></cs-dict-tag>
</view>
</view>
<u-loadmore :status="load" marginTop="12" marginBottom="12" />
@ -95,7 +136,11 @@
</template>
<script>
import { getDictBatchByType, getDeptTree, getTagData } from '@/api/system/dict.js'
import {
getDictBatchByType,
getDeptTree,
getTagData
} from '@/api/system/dict.js'
import { TaskApi } from '@/api/task/index.js'
export default {
data() {
@ -104,7 +149,7 @@ export default {
pageSize: 10,
pageNo: 1,
zf_lx: '',
zf_qy: '',
priority: '',
status: '',
select_week: '',
tagList: ''
@ -156,8 +201,10 @@ export default {
uni.hideToast()
},
async getDict() {
const tags = await getTagData(['zf_lx', 'zf_qy'].join(','))
const dict = await getDictBatchByType({ type: ['select_week', 'task_state'].join(',') })
const tags = await getTagData(['zf_lx'].join(','))
const dict = await getDictBatchByType({
type: ['select_week', 'task_state', 'task_priority'].join(',')
})
let tagMap = {}
tags.data.forEach(t => {
tagMap[t.tagCode] = t.children
@ -170,12 +217,12 @@ export default {
getDropdownOption(key) {
if (!this.dictMap[key]) return []
const keyMap = {
zf_qy: '按区域',
task_priority: '按等级',
zf_lx: '按类型',
task_state: '按状态',
select_week: '按周期'
}
if (['zf_qy', 'zf_lx'].includes(key)) {
if (['zf_qy'].includes(key)) {
return [
...this.dictMap[key].map(d => {
return {
@ -205,7 +252,9 @@ export default {
this.queryParams.pageNo = 1
this.load = 'loadmore'
this.list = []
this.queryParams.tagList = [this.queryParams.zf_qy, this.queryParams.zf_lx].filter(i => i != '').join()
this.queryParams.tagList = [this.queryParams.zf_lx]
.filter(i => i != '')
.join()
this.getList()
},
loadMore() {
@ -236,7 +285,7 @@ export default {
pageSize: 10,
pageNo: 1,
zf_lx: '',
zf_qy: '',
priority: '',
status: '',
select_week: '',
tagList: ''

199
sub/enterprise/edit.vue

@ -1,41 +1,73 @@
<template>
<cs-page isCustom>
<template #header>
<view class="wd-flex wd-flex-row wd-items-center" style="gap: 8px">
<view class="icon-box" v-if="!invateId">
<u-icon name="arrow-left" size="12"></u-icon>
</view>
<text class="wd-font-800 wd-text-16">编辑企业信息</text>
</view>
</template>
<view>
<view class="container">
<uni-steps :options="step.options" :active="step.active"></uni-steps>
<scroll-view scroll-y="true" class="info-container" v-if="step.active == 0">
<scroll-view
scroll-y="true"
class="info-container"
v-if="step.active == 0"
>
<u--form :model="info.form" ref="infoFormRef">
<!-- 企业名称 -->
<u-form-item label="名称" prop="enterprisesName" borderBottom>
<u-input v-model="info.form.enterprisesName" border="none" placeholder="请输入名称" />
<u-input
v-model="info.form.enterprisesName"
border="none"
placeholder="请输入名称"
/>
</u-form-item>
<!-- 企业类型 -->
<u-form-item label="类型" prop="type" borderBottom @tap="showPicker('enterprises_type', 'type')">
<u-form-item
label="类型"
prop="type"
borderBottom
@tap="showPicker('enterprises_type', 'type')"
>
<text v-if="info.form.type">
{{ $dict.echoDicValue(dictMap.enterprises_type, info.form.type.toString()) }}
{{
$dict.echoDicValue(
dictMap.enterprises_type,
info.form.type.toString()
)
}}
</text>
<text class="placeholder" v-else>请选择类型</text>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<!-- 企业地址 -->
<u-form-item label="地址" prop="address" borderBottom>
<u-input v-model="info.form.address" border="none" placeholder="请输入地址" />
<u-input
v-model="info.form.address"
border="none"
placeholder="请输入地址"
/>
</u-form-item>
<!-- 环保负责人 -->
<u-form-item label="环保负责人" prop="contactName" borderBottom labelWidth="80">
<u-input v-model="info.form.contactName" border="none" placeholder="请输入环保负责人姓名" />
<u-form-item
label="环保负责人"
prop="contactName"
borderBottom
labelWidth="80"
>
<u-input
v-model="info.form.contactName"
border="none"
placeholder="请输入环保负责人姓名"
/>
</u-form-item>
<!-- 联系方式 -->
<u-form-item label="联系方式" prop="environmentalContactPhone" borderBottom labelWidth="80">
<u-input v-model="info.form.environmentalContactPhone" border="none" placeholder="请输入联系方式" />
<u-form-item
label="联系方式"
prop="environmentalContactPhone"
borderBottom
labelWidth="80"
>
<u-input
v-model="info.form.environmentalContactPhone"
border="none"
placeholder="请输入联系方式"
/>
</u-form-item>
<!-- 成立时间 -->
<u-form-item
@ -45,12 +77,20 @@
labelWidth="80"
@tap="showCalendar('establishmentDate')"
>
<text v-if="info.form.establishmentDate">{{ info.form.establishmentDate }}</text>
<text v-if="info.form.establishmentDate">
{{ info.form.establishmentDate }}
</text>
<text class="placeholder" v-else>请选择时间</text>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<!-- 企业照片 -->
<u-form-item label="企业照片" prop="photo" borderBottom labelPosition="top" labelWidth="80">
<u-form-item
label="企业照片"
prop="photo"
borderBottom
labelPosition="top"
labelWidth="80"
>
<u-upload
:fileList="info.form.photo"
@afterRead="addEnterprisePhoto"
@ -60,7 +100,12 @@
></u-upload>
</u-form-item>
<!-- 企业简介 -->
<u-form-item label="简介" prop="introduction" borderBottom labelPosition="top">
<u-form-item
label="简介"
prop="introduction"
borderBottom
labelPosition="top"
>
<u--textarea
v-model="info.form.introduction"
placeholder="请输入简介"
@ -69,12 +114,18 @@
></u--textarea>
</u-form-item>
<u-form-item>
<u-button shape="circle" type="primary" @click="submitInfo">提交</u-button>
<u-button shape="circle" type="primary" @click="submitInfo">
提交
</u-button>
</u-form-item>
</u--form>
</scroll-view>
<view class="prove-container" v-else>
<u--form :model="prove.form" ref="proveFormRef" v-if="prove.isEdit">
<u--form
:model="prove.form"
ref="proveFormRef"
v-if="prove.isEdit"
>
<u-form-item
label="资质名称"
prop="qualificationName"
@ -83,13 +134,27 @@
@tap="showPicker('enterprise_qua', 'qualificationName')"
>
<text v-if="prove.form.qualificationName">
{{ $dict.echoDicValue(dictMap.enterprise_qua, prove.form.qualificationName.toString()) }}
{{
$dict.echoDicValue(
dictMap.enterprise_qua,
prove.form.qualificationName.toString()
)
}}
</text>
<text class="placeholder" v-else>请选择资质名称</text>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="资质编号" prop="enterpriseAuth" borderBottom labelWidth="80">
<u-input v-model="prove.form.enterpriseAuth" border="none" placeholder="请输入编号" />
<u-form-item
label="资质编号"
prop="enterpriseAuth"
borderBottom
labelWidth="80"
>
<u-input
v-model="prove.form.enterpriseAuth"
border="none"
placeholder="请输入编号"
/>
</u-form-item>
<u-form-item
label="办理日期"
@ -98,7 +163,9 @@
labelWidth="80"
@tap="showCalendar('handleDate')"
>
<text v-if="prove.form.handleDate">{{ prove.form.handleDate }}</text>
<text v-if="prove.form.handleDate">
{{ prove.form.handleDate }}
</text>
<text class="placeholder" v-else>请选择办理日期</text>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
@ -109,11 +176,18 @@
labelWidth="80"
@tap="showCalendar('expiryDate')"
>
<text v-if="prove.form.expiryDate">{{ prove.form.expiryDate }}</text>
<text v-if="prove.form.expiryDate">
{{ prove.form.expiryDate }}
</text>
<text class="placeholder" v-else>请选择到期日期</text>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="描述" prop="qualificationDescription" borderBottom labelPosition="top">
<u-form-item
label="描述"
prop="qualificationDescription"
borderBottom
labelPosition="top"
>
<u--textarea
v-model="prove.form.qualificationDescription"
placeholder="请输入描述"
@ -123,9 +197,19 @@
</u-form-item>
</u--form>
<view class="prove-list" v-else>
<view class="prove" v-for="prove in prove.list" :key="prove.id" @click="editProve(prove)">
<view
class="prove"
v-for="prove in prove.list"
:key="prove.id"
@click="editProve(prove)"
>
<view class="wd-font-800" style="margin-bottom: 5px">
{{ $dict.echoDicValue(dictMap.enterprise_qua, prove.qualificationName.toString()) }}
{{
$dict.echoDicValue(
dictMap.enterprise_qua,
prove.qualificationName.toString()
)
}}
</view>
<view class="">
{{ $util.formatDate(prove.handleDate, 'YYYY年M月D日') }}
@ -134,11 +218,22 @@
</view>
</view>
<view class="operation" v-if="prove.isEdit">
<u-button shape="circle" type="primary" @click="submitProve">提交</u-button>
<u-button shape="circle" type="primary" @click="submitProve">
提交
</u-button>
</view>
<view class="operation" v-else>
<u-button shape="circle" type="info" @click="addProve">添加资质</u-button>
<u-button shape="circle" type="success" v-if="invateId" @click="handlerDone">完成</u-button>
<u-button shape="circle" type="info" @click="addProve">
添加资质
</u-button>
<u-button
shape="circle"
type="success"
v-if="invateId"
@click="handlerDone"
>
完成
</u-button>
</view>
</view>
</view>
@ -152,8 +247,12 @@
@close="closePicker"
@confirm="confirmPicker"
></u-picker>
<uni-calendar ref="calendarRef" :insert="false" @confirm="confirmCalendar" />
</cs-page>
<uni-calendar
ref="calendarRef"
:insert="false"
@confirm="confirmCalendar"
/>
</view>
</template>
<script>
@ -161,7 +260,11 @@ import { uploadFile } from '@/api/system/file.js'
import { getDictBatchByType } from '@/api/system/dict.js'
import { showConfirm } from '@/utils/common'
import { createEnterPrise } from '@/api/enterprise/index.js'
import { createProve, getProveList, updateProve } from '@/api/enterprise/prove.js'
import {
createProve,
getProveList,
updateProve
} from '@/api/enterprise/prove.js'
export default {
data() {
return {
@ -266,7 +369,8 @@ export default {
this.getDict()
},
onReady() {
this.step.active == 0 && this.$refs.infoFormRef.setRules(this.info.rules)
this.step.active == 0 &&
this.$refs.infoFormRef.setRules(this.info.rules)
this.initProveList()
},
methods: {
@ -318,7 +422,9 @@ export default {
* 获取字典
*/
async getDict() {
const dict = await getDictBatchByType({ type: ['enterprises_type', 'enterprise_qua'].join(',') })
const dict = await getDictBatchByType({
type: ['enterprises_type', 'enterprise_qua'].join(',')
})
this.dictMap = {
...dict.data
}
@ -428,7 +534,10 @@ export default {
*/
async initProveList() {
this.prove.loading = true
const res = await getProveList({ pageSize: -1, enterpriseId: this.info.form.id })
const res = await getProveList({
pageSize: -1,
enterpriseId: this.info.form.id
})
this.prove.list = res.data.list
this.prove.loading = false
},
@ -466,8 +575,14 @@ export default {
*/
editProve(prove) {
this.prove.form = prove
this.prove.form.handleDate = this.$util.formatDate(prove.handleDate, 'YYYY-MM-DD')
this.prove.form.expiryDate = this.$util.formatDate(prove.expiryDate, 'YYYY-MM-DD')
this.prove.form.handleDate = this.$util.formatDate(
prove.handleDate,
'YYYY-MM-DD'
)
this.prove.form.expiryDate = this.$util.formatDate(
prove.expiryDate,
'YYYY-MM-DD'
)
this.prove.isEdit = true
},
/**

136
sub/task/detail.vue

@ -1,40 +1,91 @@
<template>
<cs-page>
<view class="detail-container" :style="{ paddingBottom: isSelect.length > 0 ? '70px' : '20px' }">
<view
class="detail-container"
:style="{
paddingBottom: isSelect.length > 0 ? '70px' : '20px'
}"
>
<view class="box detail">
<text class="wd-font-800 wd-text-16" style="margin-bottom: 4px">{{ detail.title }}</text>
<text class="wd-font-800 wd-text-16" style="margin-bottom: 4px">
{{ detail.title }}
</text>
<view class="tagList">
<view v-for="(tag, index) in detail.tagList" :key="index" class="tag">{{ tag }}</view>
<view
v-for="(tag, index) in detail.tagList"
:key="index"
class="tag"
>
{{ tag }}
</view>
</view>
<view class="wd-flex wd-text-13" style="justify-content: space-between">
<view
class="wd-flex wd-text-13"
style="justify-content: space-between"
>
<view class="wd-flex" style="align-items: center; gap: 4px">
<u-icon name="calendar" color="#17C653" />
<text class="wd-text-13 wd-ml-4px">
{{ $util.formatDate(detail.startDate, 'YYYY/M/D') }} ~ {{ $util.formatDate(detail.endDate, 'YYYY/M/D') }}
{{
`${$util.formatDate(
detail.startDate,
'YYYY/M/D'
)}~${$util.formatDate(detail.endDate, 'YYYY/M/D')}`
}}
</text>
</view>
</view>
<view
style="font-size: 13px; line-height: 160%; position: relative; transform: 0.2s all"
style="
font-size: 13px;
line-height: 160%;
position: relative;
transform: 0.2s all;
"
v-if="detail.description.length < 20"
>
{{ detail.description }}
</view>
<view
v-else
style="font-size: 13px; line-height: 160%; position: relative; transform: 0.2s all"
style="
font-size: 13px;
line-height: 160%;
position: relative;
transform: 0.2s all;
"
@tap="isShowAllText = !isShowAllText"
>
{{ isShowAllText ? detail.description : `${detail.description.slice(1, 20)}...` }}
<text style="color: #17c653; padding-left: 4px">{{ isShowAllText ? '收起' : '展开' }}</text>
{{
isShowAllText
? detail.description
: `${detail.description.slice(1, 20)}...`
}}
<text style="color: #17c653; padding-left: 4px">
{{ isShowAllText ? '收起' : '展开' }}
</text>
</view>
<view class="audit">
<cs-dict-tag :dict="dictMap.task_state" :value="detail.status"></cs-dict-tag>
<cs-dict-tag
:dict="dictMap.task_state"
:value="detail.status"
></cs-dict-tag>
</view>
</view>
<u-sticky>
<view :class="['options-container', OptionsOffset.isTop ? 'isTop' : '']" ref="optionRef" id="options">
<van-dropdown-menu safe-area-tab-bar active-color="#17C653" style="flex: 1">
<view
:class="[
'options-container',
OptionsOffset.isTop ? 'isTop' : ''
]"
ref="optionRef"
id="options"
>
<van-dropdown-menu
safe-area-tab-bar
active-color="#17C653"
style="flex: 1"
>
<van-dropdown-item
:value="queryParams.dept"
:options="getDropdownOption('dept')"
@ -61,10 +112,18 @@
</view>
</view>
</u-sticky>
<view class="record" v-for="record in list" :key="record.id">
<view
class="record"
v-for="record in list"
:key="record.id"
@tap="goRecord(record)"
>
<view
:class="{ select: true, isSelect: isSelect.includes(record.id) }"
@tap.self="select(record.id)"
:class="{
select: true,
isSelect: isSelect.includes(record.id)
}"
@tap.native.stop="select(record.id)"
v-if="[3, null].includes(record.inspectionStatus)"
>
<u-icon name="checkbox-mark" size="16px" color="#fff"></u-icon>
@ -72,18 +131,31 @@
<view class="disable" v-else></view>
<view class="info">
<view class="name">{{ record.enterpriseAddress }}</view>
<view style="font-size: 1 3px">{{ record.enterpriseAddress }}</view>
<view style="font-size: 1 3px">
{{ record.enterpriseAddress }}
</view>
<view class="tagList" style="margin-top: 8px">
<view v-for="(item, index) in record.tagList" :key="index" class="tag">{{ item }}</view>
<view
v-for="(item, index) in record.tagList"
:key="index"
class="tag"
>
{{ item }}
</view>
</view>
</view>
<view class="audit" v-show="record.inspectionStatus">
<cs-dict-tag :dict="dictMap.Inspections_status" :value="record.inspectionStatus"></cs-dict-tag>
<cs-dict-tag
:dict="dictMap.Inspections_status"
:value="record.inspectionStatus"
></cs-dict-tag>
</view>
</view>
<u-loadmore :status="load" marginTop="12" marginBottom="12" />
<view class="btn-box" v-if="isSelect.length > 0">
<view class="confirm-btn" @tap="replay">已选择({{ isSelect.length }})</view>
<view class="confirm-btn" @tap="replay">
已选择({{ isSelect.length }})
</view>
</view>
<u-modal :show="model.show" closeOnClickOverlay @close="closeModel">
<view class="wd-flex wd-flex-col" style="gap: 20px">
@ -100,7 +172,9 @@
class="staff"
v-for="(staff, index) in 10"
:key="staff.id"
:style="{ '--select-color': index == 0 ? '#17c653' : '#f1f1f4' }"
:style="{
'--select-color': index == 0 ? '#17c653' : '#f1f1f4'
}"
>
<u-avatar size="40" shape="circle"></u-avatar>
<view class="info">
@ -108,7 +182,11 @@
<view class="dept">部门</view>
</view>
<view class="isSelect">
<u-icon name="checkbox-mark" size="16px" color="#fff"></u-icon>
<u-icon
name="checkbox-mark"
size="16px"
color="#fff"
></u-icon>
</view>
</view>
</view>
@ -191,7 +269,9 @@ export default {
* 获取字典
*/
async getDict() {
const dict = await getDictBatchByType({ type: ['task_state', 'Inspections_status'].join(',') })
const dict = await getDictBatchByType({
type: ['task_state', 'Inspections_status'].join(',')
})
const dept = await getDeptTree()
this.dictMap = {
...dict.data,
@ -234,7 +314,6 @@ export default {
},
querySelect(v, key) {
this.queryParams[key] = v.detail
// this.queryEnterprise()
},
async init() {
const res = await TaskApi.getDetail(this.queryParams.taskId)
@ -301,6 +380,11 @@ export default {
},
closeModel() {
this.model.show = false
},
goRecord(record) {
uni.navigateTo({
url: `/sub/task/record?taskId=${record.taskId}&recordId=${record.id}&enterpriseId=${record.enterpriseId}`
})
}
}
}
@ -479,7 +563,11 @@ export default {
top: 0;
width: 30px;
height: 30px;
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0) 50%, var(--select-color, #f1f1f4) 50%);
background-image: linear-gradient(
45deg,
rgba(255, 255, 255, 0) 50%,
var(--select-color, #f1f1f4) 50%
);
display: flex;
justify-content: flex-end;
align-items: flex-start;

275
sub/task/record.vue

@ -0,0 +1,275 @@
<template>
<view class="view-container">
<view class="box detail">
<text class="wd-font-800 wd-text-16" style="margin-bottom: 4px">
{{ detail.title }}
</text>
<view class="tagList">
<view
v-for="(tag, index) in detail.tagList"
:key="index"
class="tag"
>
{{ tag }}
</view>
</view>
<view
class="wd-flex wd-text-13"
style="justify-content: space-between"
>
<view class="wd-flex" style="align-items: center; gap: 4px">
<u-icon name="calendar" color="#17C653" />
<text class="wd-text-13 wd-ml-4px">
{{
`${$util.formatDate(
detail.startDate,
'YYYY/M/D'
)}~${$util.formatDate(detail.endDate, 'YYYY/M/D')}`
}}
</text>
</view>
</view>
<view
style="
font-size: 13px;
line-height: 160%;
position: relative;
transform: 0.2s all;
"
v-if="detail.description.length < 20"
>
{{ detail.description }}
</view>
<view
v-else
style="
font-size: 13px;
line-height: 160%;
position: relative;
transform: 0.2s all;
"
@tap="isShowAllText = !isShowAllText"
>
{{
isShowAllText
? detail.description
: `${detail.description.slice(1, 20)}...`
}}
<text style="color: #17c653; padding-left: 4px">
{{ isShowAllText ? '收起' : '展开' }}
</text>
</view>
<view
class="wd-flex wd-items-center enterprise"
@tap="goEnterprise(detail.enterprise)"
>
<u-avatar
:src="detail.enterprise.files[0].url"
shape="square"
size="64"
></u-avatar>
<view class="wd-flex wd-flex-col" style="gap: 4px">
<text class="wd-font-800 wd-text-15">
{{ detail.enterprise.enterprisesName }}
</text>
<view class="wd-flex wd-pb-8px">
<u-icon name="map" size="14" color="#17C653"></u-icon>
<text class="address wd-text-12" style="margin-left: 4px">
{{ detail.enterprise.address }}
</text>
</view>
<view class="tagList">
<view
class="tag"
v-for="(tag, index) in detail.enterprise.tagList"
:key="index"
>
{{ tag }}
</view>
</view>
</view>
</view>
<view class="audit">
<cs-dict-tag
:dict="dictMap.task_state"
:value="detail.status"
></cs-dict-tag>
</view>
</view>
</view>
</template>
<script>
import { getDeptTree, getDictBatchByType } from '@/api/system/dict.js'
import { TaskApi } from '@/api/task/index.js'
import { getEnterPrise } from '@/api/enterprise/index.js'
export default {
data() {
return {
dictMap: {},
//
detail: {
id: '',
description: ''
},
//
isShowAllText: false,
//
queryParams: {
dept: '',
Inspections_status: '',
pageSize: 8,
pageNo: 1,
taskId: '',
recordId: ''
},
list: [],
load: 'loadmore'
}
},
onLoad(res) {
this.queryParams.taskId = res.taskId
this.queryParams.recordId = res.recordId
this.queryParams.enterpriseId = res.enterpriseId
this.getDict()
this.init()
},
methods: {
/**
* 获取字典
*/
async getDict() {
const dict = await getDictBatchByType({
type: ['task_state', 'Inspections_status'].join(',')
})
const dept = await getDeptTree()
this.dictMap = {
...dict.data,
dept: dept.data
}
},
async init() {
const res = await TaskApi.getDetail(this.queryParams.taskId)
const enterprise = await getEnterPrise(this.queryParams.enterpriseId)
this.detail = {
...res.data,
enterprise: enterprise.data
}
uni.getLocation({
success: res => {
console.log(res)
}
})
// this.getList()
},
async getList() {
uni.showToast({
title: '加载中',
mask: true,
icon: 'loading'
})
this.load = 'loading'
// const { data } = await InspectionsApi.getList(this.queryParams)
this.list.push(...data.list)
this.load = 'loadmore'
if (this.list.length == data.total) {
this.load = 'nomore'
}
uni.hideToast()
},
goEnterprise(enterprise) {
uni.navigateTo({
url: `/sub/enterprise/detail?id=${enterprise.id}`
})
}
}
}
</script>
<style lang="scss" scoped>
.view-container {
padding: 12px;
.box {
background-color: #fff;
border-radius: $cs-border-radius;
padding: 16px;
}
.detail {
display: flex;
flex-flow: column nowrap;
gap: 12px;
position: relative;
overflow: hidden;
.tagList {
display: flex;
align-items: center;
gap: var(--Number-4px, 4px);
.tag {
display: flex;
padding: var(--Number-2px, 2px) var(--Number-6px, 6px);
justify-content: center;
align-items: center;
gap: var(--Number-4px, 4px);
border-radius: var(--Number-2px, 2px);
background: var(--LightMode-Grey-Grey-100, #f9f9f9);
color: var(--LightMode-Grey-Grey-600, #78829d);
text-align: center;
font-size: 12px;
font-style: normal;
font-weight: 400;
line-height: normal;
}
}
.enterprise {
border: 1px solid #f9f9f9;
padding: 12px;
border-radius: $cs-border-radius;
gap: 12px;
position: relative;
overflow: hidden;
font-size: 12px;
.address {
color: $uni-text-color-grey;
}
&:active {
background-color: $cs-color-touch;
}
.tagList {
margin-top: 8px;
display: flex;
gap: 4px;
color: $uni-text-color-grey;
display: flex;
.tag {
font-size: 12px;
display: flex;
padding: 2px 6px;
justify-content: center;
align-items: center;
border-radius: 2px;
background: #f9f9f9;
}
}
.audit {
position: absolute;
right: -19px;
top: 6px;
transform: rotateZ(45deg);
transform-origin: 50% 50%;
padding: 4px 20px;
font-size: 12px;
text-align: center;
}
}
.audit {
position: absolute;
right: 0;
top: 0;
transform: translateX(23px) translateY(16px) rotateZ(45deg);
transform-origin: 50% 50%;
}
}
}
</style>
Loading…
Cancel
Save