Commit 6ea0cd2e by zhangzhen

优化

parent 61cd1463
import http from "@/common/vmeitime-http/index.js"
const setParamsData = (data = {},pageData) => {
let obj = {}
for (let i in data) {
obj[i] = data[i]
}
let paramsData = {
"__version__": "2.0",
"__sys__": {},
"__blocks__": {
"inqu_status": {
"attr": {},
"meta": {
"desc": "",
"attr": {},
"columns": []
},
"rows": []
},
"result": {
"attr": {
count: 0,
limit: pageData && pageData.limit? pageData.limit : 10,
offset: pageData && pageData.offset? pageData.offset*pageData.limit : 0,
orderBy: "",
showCount: pageData && pageData.showCount? pageData.showCount : "true"
},
"meta": {
"desc": "",
"attr": {},
"columns": []
},
"rows": []
},
"detail": {
"attr": {},
"meta": {
"desc": "",
"attr": {},
"columns": []
},
"rows": []
}
}
}
let keyList = Object.keys(obj);
keyList.forEach((item, index) => {
paramsData.__blocks__.inqu_status.meta.columns.push({
pos: index,
name: item
})
})
paramsData.__blocks__.inqu_status.rows.push(Object.values(obj));
return paramsData
}
const setResultData = (data) => {
let obj = {}
for (let i in data) {
if (data[i] !== '') {
obj[i] = data[i]
}
}
let paramsData = {
"__version__": "2.0",
"__sys__": {},
"__blocks__": {
"inqu_status": {
"attr": {},
"meta": {
"desc": "",
"attr": {},
"columns": []
},
"rows": []
},
"result": {
"attr": {},
"meta": {
"desc": "",
"attr": {},
"columns": []
},
"rows": []
},
"detail": {
"attr": {},
"meta": {
"desc": "",
"attr": {},
"columns": []
},
"rows": []
}
}
}
let keyList = Object.keys(obj);
keyList.forEach((item, index) => {
paramsData.__blocks__.result.meta.columns.push({
pos: index,
name: item
})
})
paramsData.__blocks__.result.rows.push(Object.values(obj));
return paramsData
}
export const getList = (params,pageData) => {
let url = `/service/S_WD_LL_01`
let d = setParamsData(params,pageData)
return http.post(url, d)
}
export const addPreview = (data) => {
let url = `/service/S_WD_LL_02`
let d = setResultData(data)
return http.post(url, d)
}
export const addDownLoad = (data) => {
let url = `/service/S_WD_LL_03`
let d = setResultData(data)
return http.post(url, d)
}
......@@ -653,6 +653,28 @@
"navigationStyle": "custom",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/document/list",
"style" :
{
"navigationBarTitleText" : "文档浏览",
"navigationBarBackgroundColor": "#0072fc",
"navigationBarTextStyle": "white",
"navigationStyle": "custom",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/document/edit",
"style" :
{
"navigationBarTitleText" : "文档详情",
"navigationBarBackgroundColor": "#0072fc",
"navigationBarTextStyle": "white",
"navigationStyle": "custom",
"enablePullDownRefresh" : false
}
}
],
"globalStyle": {
......
<template>
<view class="page-content">
<cu-custom :isBack="true">
<block slot="backText">
<view class="list-icon" @tap="onBack">
<text class="cuIcon-back text-white text-bold text-xl"></text>
</view>
</block>
<block slot="content">
<text class="text-white">文档详情</text>
</block>
<block slot="right">
<view class="right-btn-box">
<text class="text-white" @tap="onDownLoad">下载</text>
</view>
</block>
</cu-custom>
<view v-if="statusBarHeight>0" class="content-black" :style="{height:statusBarHeight+45+'px'}">
</view>
<view class="order-content-box">
<view class="flex-row header">
<image src="../../static/icon10.png" mode="widthFix"></image>
<text class="text-lg text-bold text-black">详情</text>
</view>
<view class="flex-col content-box">
<view class="flex-row">
<text class="text-gray part-1">文件名称</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{orderInfo.fileName}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">项目名称</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{orderInfo.projName}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">公司名称</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{orderInfo.companyName}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">文件类型</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{fileTypeEnum[orderInfo.fileType]}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">版本</text>
<text class="text-gray part-2">:</text>
<text class="text-title">V{{orderInfo.docVersion}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">附件名称</text>
<text class="text-gray part-2">:</text>
<view class="flex-1 flex-between">
<text class="text-title">{{orderInfo.docName}}</text>
<button v-if="orderInfo.previewStatus" class="cu-btn block bg-blue sm round"
@tap="onNavToPreview">预览</button>
</view>
</view>
<view class="flex-row">
<text class="text-gray part-1">预览次数</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{orderInfo.previewNum}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">下载次数</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{orderInfo.downloadNum}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">发布时间</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{orderInfo.releaseDate}}</text>
</view>
</view>
</view>
<view v-if="previewStatus" class="preview-box">
<view class="text-box">
<text class="text-title">图片预览</text>
</view>
<image :src="assetsPath+'/hggp/file/download/'+orderInfo.docId" mode="widthFix" @tap="onPre"></image>
</view>
<!-- <view class="flex-col content-part-1">
<view class="footer-content">
<view class="btn-box">
<button class="cu-btn block bg-blue lg round" @tap="onOpenTip">预览明细</button>
</view>
<view class="btn-box">
<button class="cu-btn block bg-blue lg round" @tap="onOpenTip">下载明细</button>
</view>
</view>
</view> -->
</view>
</template>
<script>
import config from "@/config/index.config";
import {
getDict
} from "@/api/index.js"
import {
pathToBase64,
base64ToPath
} from '@/utils/index.js'
import {
toJsonData
} from "@/utils/tools.js";
import moment from "@/common/moment.js";
import {
getList,
addPreview,
addDownLoad
} from "@/api/document.js";
export default {
data() {
return {
assetsPath: config.assetsPath,
id: '',
minDate: moment().subtract(1, 'M').format("YYYY-MM-DD"),
content: "",
addStatus: false,
statusBarHeight: uni.getStorageSync("statusHeight") || 0,
orderInfo: {},
fileTypeEnum: {},
previewStatus: false,
imgUrl: ''
};
},
onLoad(option) {
if (option && option.id) {
this.id = option.id
this.onLoading()
}
},
methods: {
onPre() {
let list = [this.assetsPath + '/hggp/file/download/' + this.orderInfo.docId];
uni.previewImage({
urls: list,
current: 0
})
},
islmage(filename) {
const extension = filename.split('.').pop().toLowerCase();
console.log(extension, 9999)
const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg']
return imageExtensions.includes(extension);
},
onNavToPreview() {
addPreview(this.orderInfo).then(res => {
console.log(res, 99999);
if (res.data.__sys__.status === 1) {
this.imgUrl = ""
this.previewStatus = true;
}
this.onGetList();
})
},
onDownLoad() {
addDownLoad(this.orderInfo).then(res => {
console.log(res, 99999);
if (res.data.__sys__.status === 1) {
let url = this.assetsPath + '/hggp/file/download/' + this.orderInfo.docId;
// #ifdef H5
window.open(url)
// #endif
// #ifndef H5
uni.showLoading({
title:"文件下载中..."
})
uni.downloadFile({
url,
success: (res2) => {
uni.hideLoading()
uni.saveFile({
tempFilePath: res2.tempFilePath,
success: (result) => {
console.log(result)
}
})
}
})
// #endif
}
this.onGetList();
})
},
onBack() {
uni.navigateBack()
},
onLoading() {
getDict({
codeset: 'hggp.hgwd.fileType'
}).then(res => {
res.data.list.forEach(item => {
this.fileTypeEnum[item.value] = item.label;
})
this.onGetList();
})
},
onGetList() {
getList({
id: this.id
}).then(res => {
if (res.data.__sys__.status === 0) {
let list = toJsonData(res.data.__blocks__.result.rows, res.data.__blocks__.result.meta
.columns)
let updatedTime = list[0].releaseDate ? list[0].releaseDate.split('') : [];
if (list && list.length) {
this.orderInfo = {
...list[0],
previewStatus: this.islmage(list[0].docName),
releaseDate: updatedTime.length >= 13 ?
`${updatedTime[0]}${updatedTime[1]}${updatedTime[2]}${updatedTime[3]}/${updatedTime[4]}${updatedTime[5]}/${updatedTime[6]}${updatedTime[7]} ${updatedTime[8]}${updatedTime[9]}:${updatedTime[10]}${updatedTime[11]}:${updatedTime[12]}${updatedTime[13]}` :
''
};
console.log(this.orderInfo, "this.orderInfo")
}
}
})
}
}
}
</script>
<style>
page {
background-color: #f1f1f1;
}
</style>
<style lang="scss" scoped>
.page-content {
display: flex;
flex-direction: column;
min-height: 100vh;
width: 100%;
}
.cu-form-group {
picker {
padding-right: 0;
}
}
.header-title {
display: flex;
flex-direction: row;
width: 90%;
align-items: center;
margin: 30upx auto 12upx;
.flex-between {
display: flex;
flex: 1;
justify-content: center;
align-items: center;
border-radius: 20upx;
padding: 16upx 20upx;
background-color: rgba(246, 246, 248, 1);
.image {
width: 34upx;
margin-right: 8upx;
max-height: 42upx;
}
.text-blue {
color: #4a93f8;
font-weight: bold;
}
}
}
.u-tabs-box {
width: 70%;
margin: 0 auto;
}
.data-content {
display: flex;
flex-direction: column;
margin: 0 auto 30upx;
width: 96%;
.circle-par {
display: flex;
justify-content: center;
align-items: center;
}
.header {
border-radius: 12upx 12upx 0 0;
background-color: #eef2fe;
color: #101010;
font-size: 30upx;
border: 1px solid #d1dcfd;
padding: 14upx 24upx;
}
.content {
border-radius: 0 0 12upx 12upx;
background-color: #ffffff;
color: #101010;
font-size: 30upx;
border: 1px solid #cecece;
border-top: none;
}
}
.flex-content {
display: flex;
width: 100%;
justify-content: center;
}
.part-3 {
flex-direction: column;
padding-bottom: 120upx;
.content-item {
display: flex;
flex-direction: column;
width: 90%;
margin: 24upx auto 8upx;
padding-bottom: 24upx;
.header-title {
position: relative;
width: 100%;
margin: 0;
image {
width: 100%;
max-height: 100upx;
}
.flex-between {
position: absolute;
top: 0;
left: 12%;
width: 88%;
height: 70%;
padding: 0;
justify-content: space-between;
background-color: transparent;
}
}
.content-box {
position: relative;
z-index: 2;
box-shadow: 0 0 12upx rgba(0, 0, 0, 0.34);
border-radius: 12upx;
margin-top: -20upx;
background-color: #ffffff;
padding: 24upx;
.flex-wrap {
display: flex;
flex-wrap: wrap;
.margin-sm {
margin: 10upx;
}
}
}
}
.content-item:last-child {
border-bottom: none;
}
}
.flex-center {
display: flex;
align-items: center;
}
.line-progress {
align-items: center;
}
.u-page__item__slot-icon {
width: 24px;
height: 24px;
}
.part-left {
align-items: center;
}
.circle-center {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.margin-top-sm {
margin-top: 10upx;
}
.flex-row {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
}
.icon {
width: 36upx;
max-height: 50upx;
margin-right: 6upx;
}
.flex-row-center {
display: flex;
flex-direction: row;
align-items: center;
}
.content-part-1 {
position: fixed;
left: 0;
bottom: 0;
display: flex;
flex-direction: column;
align-items: center;
background-color: #ffffff;
.header {
display: flex;
flex-direction: row;
align-items: center;
width: 92%;
padding: 30upx 0;
image {
width: 20px;
height: 20px;
margin-right: 6upx;
}
}
.form-content-box {
width: 92%;
padding: 12upx 0;
border-radius: 12upx;
box-shadow: 0 0 8upx rgba(0, 0, 0, 0.34);
background-color: #ffffff;
.cu-form-group {
height: 32px;
min-height: 32px;
.title {
display: flex;
flex-direction: row;
width: 260upx;
align-items: center;
}
}
.action-box {
display: flex;
flex-direction: row;
justify-content: flex-end;
}
}
.footer-content {
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: 120upx;
.btn-box {
width: 46%;
margin: 0 2%;
}
}
}
.order-content-box {
display: flex;
flex-direction: column;
width: 100%;
background-color: #ffffff;
.header {
display: flex;
flex-direction: row;
align-items: center;
width: 100%;
padding: 24upx;
image {
width: 20px;
height: 20px;
margin-right: 6upx;
}
}
.content-box {
position: relative;
z-index: 2;
padding: 0 24upx 24upx;
.flex-row {
margin: 6upx 0;
align-items: center;
.text-title {
font-size: 30upx;
}
.part-1 {
font-size: 32upx;
width: 200upx;
text-align-last: justify;
}
.part-2 {
margin-right: 24upx;
}
}
.btn-box {
position: absolute;
right: 24upx;
bottom: 16upx;
}
}
}
.picker-box {
.flex-row-center {
justify-content: flex-end;
}
}
.right-btn-box {
padding: 0 24upx;
}
.preview-box {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-color: #ffffff;
margin: 24upx 0;
padding: 24upx 0;
.text-box {
width: 100%;
padding: 0 24upx;
margin-bottom: 24upx;
}
image {
width: 92%;
min-height: 320upx;
max-height: 540upx;
}
}
</style>
\ No newline at end of file
<template>
<view>
<cu-custom bgColor="bg-blue" :isBack="true">
<block slot="backText">
<view class="list-icon" @tap="onBack">
<text class="cuIcon-back text-white text-bold text-xl"></text>
</view>
</block>
<block slot="content">
<text class="text-white">生产报工</text>
</block>
</cu-custom>
<view v-if="statusBarHeight>0" class="content-black" :style="{height:statusBarHeight+45+'px'}">
</view>
<view class="data-content title-view">
<view class="part-3">
<view class="content-item">
<view class="header-title" @tap="onNavTo">
<image src="../../static/icon5.png" mode="widthFix"></image>
<view class="flex-between">
<text class="text-black text-bold">{{orderInfo.productName|| ''}}</text>
<view class="text-blue margin-right">
<text class="">报工</text>
<text class="cuIcon-right"></text>
</view>
</view>
</view>
<view class="flex-col content-box">
<view class="flex-between">
<view class="flex-row">
<text class="text-gray part-1">所属工序</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{orderInfo.processName}}</text>
</view>
<view class="">
<text
:class="orderInfo.status==1?'text-red':'text-gray'">{{statusEnum[orderInfo.status]}}</text>
</view>
</view>
<view class="flex-row">
<text class="text-gray part-1">任务单号</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{orderInfo.taskCode}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">公司名称</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{orderInfo.companyName}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">项目名称</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{orderInfo.projName}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">计划完成日期</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{orderInfo.planEndDate}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">任务数量</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{orderInfo.quantity}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">完工数量</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{orderInfo.finishQuantity}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">完成状态</text>
<text class="text-gray part-2">:</text>
<text
class="text-title">{{orderInfo.finishQuantity >= orderInfo.quantity? '已完工':'未完工'}}</text>
</view>
</view>
</view>
</view>
</view>
<view class="padding-sm">
<text class="text-title text-bold text-lg">报工明细</text>
</view>
<view class="flex-col data-content">
<view class="flex-col part-3">
<view v-for="(item,k) in projectDataList" :key="k" class="content-item">
<view class="flex-col content-box">
<view class="flex-row">
<text class="text-gray part-1">产品名称</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.productName}}({{item.processName}})</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">计划完成日期</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.planEndDate}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">报工数量</text>
<text class="text-gray part-2">:</text>
<text class="text-blue text-bold text-xl">{{item.quantity}}</text>
</view>
<view class="flex-row">
<view class="flex-1 flex-row">
<text class="text-gray">完工数量:</text>
<text class="text-blue text-bold text-xl margin-left-sm">{{item.passQuantity}}</text>
</view>
<view class="flex-1 flex-row">
<text class="text-gray">任务数量:</text>
<text class="text-blue text-bold text-xl margin-left-sm">{{orderInfo.quantity}}</text>
</view>
<view class="flex-1 flex-row">
<text class="text-gray">不合格数量:</text>
<text class="text-blue text-bold text-xl margin-left-sm">{{item.unpassQuantity}}</text>
</view>
</view>
<view v-if="item.imgList && item.imgList.length" class="flex-col">
<view class="flex-row-center">
<text class="text-gray part-1">图片展示</text>
<text class="text-gray part-2">:</text>
</view>
<view class="img-list-box">
<view v-for="(val,i) in item.imgList" :key="i" class="img-item-box" @tap="onPreview(item.imgList,i)">
<image class="img" :src="val.url" mode="scaleToFill"></image>
</view>
</view>
</view>
<view class="flex-row">
<text class="text-gray part-1">报工日期</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.createdTime}}</text>
</view>
</view>
</view>
<view v-if="projectDataList.length" style="padding: 12px 6% 0;">
<u-loadmore :status="status" :icon="true" :line='true' :loading-text="loadingText"
:loadmore-text="loadmoreText" :nomore-text="nomoreText" />
</view>
<view v-if="projectDataList.length <= 0" class="empty-box">
<u-empty text="暂无数据" textColor='#C1C1C1' width="120">
</u-empty>
</view>
</view>
</view>
</view>
</template>
<script>
import config from "@/config/index.config";
import {
pathToBase64,
base64ToPath
} from '@/utils/index.js'
import {
toJsonData
} from "@/utils/tools.js";
import moment from "@/common/moment.js";
import {
getParamsList,
getSubList
} from "@/api/product-order.js";
import {
getImgInfoList
} from "@/api/index.js";
import {
getList
} from "@/api/inspection.js";
export default {
data() {
return {
assetsPath: config.assetsPath,
projectDataList: [],
statusBarHeight: uni.getStorageSync("statusHeight") || 0,
status: 'nomore ',
loadingText: '努力加载中',
loadmoreText: '上划加载',
nomoreText: '到底啦',
showText: false,
target: 60,
modelVale: 100,
value: 0,
title: '生产领料',
eChartData: [],
current: 0,
formData: {},
//不良品类
form: {},
factoryIndex: 0,
factoryList: [],
innerHeight: window.innerHeight,
innerWidth: window.innerWidth,
startTimeStamp: 0,
endTimeStamp: 0,
factoryEnum: {},
orderInfo: '',
tabList: [{
name: '全部',
value: ''
},
{
name: '未质检',
value: 0
},
{
name: '已质检',
value: 1
}
],
statusEnum: {
1: "未质检",
2: "已质检"
},
queryData: {},
pageData: {
showCount: "true",
limit: 20,
offset: 0
},
};
},
onLoad(option) {
if (option.id) {
this.queryData.taskId = option.id;
if (uni.getStorageSync(this.queryData.taskId)) {
this.orderInfo = uni.getStorageSync(this.queryData.taskId)
}
}
const eventChannel = this.getOpenerEventChannel();
eventChannel.on('acceptDataFromOpenerPage', (data) => {
uni.setStorageSync(this.queryData.taskId, data.data)
this.orderInfo = data.data;
})
},
onShow() {
this.pageData.offset = 0;
this.onGetList();
},
onReachBottom() {
if (this.status == 'loadmore') {
this.pageData.offset += 1;
this.onGetList();
}
},
methods: {
onFactoryChange(e) {
this.factoryIndex = e.target.value;
this.pageData.offset = 0;
this.onGetList();
},
onBack() {
uni.redirectTo({
url: "/pages/product-order/list"
})
},
onLoading() {
getParamsList().then(res => {
this.factoryList = toJsonData(res.data.__blocks__.factory_record_block_id.rows, res.data
.__blocks__.factory_record_block_id.meta.columns).map(item => {
this.factoryEnum[item.valueField] = item.textField;
return {
label: item.textField,
value: item.valueField
}
})
this.$forceUpdate();
this.onGetList();
})
},
onGetList() {
uni.showLoading({
title: "加载中"
})
getList(this.queryData, this.pageData).then(res => {
uni.hideLoading();
let list = [];
let list2 = toJsonData(res.data.__blocks__.result.rows, res.data.__blocks__.result.meta.columns).map(item=>{
let createdTime =item.createdTime? item.createdTime.split(''):[];
return {
...item,
createdTime:createdTime.length>=13? `${createdTime[0]}${createdTime[1]}${createdTime[2]}${createdTime[3]}/${createdTime[4]}${createdTime[5]}/${createdTime[6]}${createdTime[7]} ${createdTime[8]}${createdTime[9]}:${createdTime[10]}${createdTime[11]}:${createdTime[12]}${createdTime[13]}` :''
}
})
list2.forEach(async item=>{
let imgDatas = await getImgInfoList({
matId: item.id,
bizType: "SCBG"
})
let imgList = toJsonData(imgDatas.data.__blocks__.result.rows, imgDatas.data.__blocks__.result.meta.columns)
list.push({
...item,
imgList : imgList.length? imgList.map(val=>{
return {
url: this.assetsPath+"/hggp/file/download/docId/"+val.docId
}
}):[]
})
})
if (this.pageData.offset == 0) {
this.projectDataList = list
} else {
this.projectDataList = [...this.projectDataList, ...list]
}
console.log(this.projectDataList,99999)
if (this.projectDataList.length < res.data.__blocks__.result.attr.count) {
this.status = "loadmore"
} else {
this.status = 'nomore'
}
})
},
onChange(e) {
},
onSearchByName() {
this.pageData.offset = 0;
this.onGetList();
},
onChangeTab(e) {
this.current = e.index;
this.pageData.offset = 0;
// this.onGetList();
},
onNavTo() {
uni.navigateTo({
url: `/pages/product-order/edit`,
success: (res) => {
res.eventChannel.emit('acceptDataFromOpenerPage', {
data: this.orderInfo
})
}
})
},
onStartFloat(e) {
this.startTimeStamp = moment().valueOf();
this.floatBoxStatus = true
this.floatTop = e.changedTouches[0].clientY - 25 + 'px';
this.floatLeft = e.changedTouches[0].clientX - 25 + 'px';
},
onMoveFloat(e) {
this.floatTop = e.changedTouches[0].clientY - 25 + 'px';
this.floatLeft = e.changedTouches[0].clientX - 25 + 'px';
},
onEndFloat(e) {
this.endTimeStamp = moment().valueOf();
this.floatBoxStatus = false
},
onPreview(urls,i){
uni.previewImage({
urls:urls.map(item=> item.url),
current:i
})
}
}
}
</script>
<style>
page {
background-color: #f1f1f1;
}
</style>
<style lang="scss" scoped>
.overview-view {
display: flex;
flex-direction: row;
padding: 20upx 0;
background: #ffffff;
border-bottom: 2px solid rgba(226, 226, 226, 0.6);
.part-1 {
display: flex;
flex: 1;
flex-direction: column;
justify-content: center;
align-items: center;
.text-black {
margin-top: 10upx;
}
}
.line {
display: flex;
width: 2px;
height: 100upx;
background-color: rgba(226, 226, 226, 0.6);
}
}
.page-content-box {
width: 100vw;
height: 100vh;
overflow: hidden;
}
.cu-form-group {
picker {
padding-right: 0;
}
}
.header-title {
display: flex;
flex-direction: row;
width: 90%;
align-items: center;
margin: 10upx auto 12upx;
.flex-between {
display: flex;
flex: 1;
justify-content: center;
align-items: center;
border-radius: 20upx;
padding: 16upx 20upx;
background-color: rgba(246, 246, 248, 1);
.image {
width: 34upx;
margin-right: 8upx;
max-height: 42upx;
}
.text-blue {
color: #4a93f8;
font-weight: bold;
}
}
}
.u-tabs-box {
width: 100%;
margin: 0 auto;
}
.data-content {
display: flex;
flex-direction: column;
margin: 0 auto 30upx;
width: 96%;
.circle-par {
display: flex;
justify-content: center;
align-items: center;
}
.header {
border-radius: 12upx 12upx 0 0;
background-color: #eef2fe;
color: #101010;
font-size: 30upx;
border: 1px solid #d1dcfd;
padding: 14upx 24upx;
}
.content {
border-radius: 0 0 12upx 12upx;
background-color: #ffffff;
color: #101010;
font-size: 30upx;
border: 1px solid #cecece;
border-top: none;
}
}
.flex-content {
display: flex;
width: 100%;
justify-content: center;
}
.part-3 {
flex-direction: column;
padding-bottom: 120upx;
.content-item {
display: flex;
flex-direction: column;
width: 94%;
margin: 24upx auto 8upx;
padding-bottom: 24upx;
.header-title {
position: relative;
width: 100%;
margin: 0;
image {
width: 100%;
max-height: 100upx;
}
.flex-between {
position: absolute;
top: 0;
left: 12%;
width: 88%;
height: 70%;
padding: 0;
justify-content: space-between;
background-color: transparent;
}
}
.content-box {
position: relative;
z-index: 2;
box-shadow: 0 0 12upx rgba(0, 0, 0, 0.34);
border-radius: 12upx;
margin-top: -20upx;
background-color: #ffffff;
padding: 24upx;
.flex-row {
margin: 6upx 0;
.part-1 {
width: 180upx;
text-align-last: justify;
}
.part-2 {
margin-right: 24upx;
}
}
}
}
.content-item:last-child {
border-bottom: none;
}
}
.flex-center {
display: flex;
align-items: center;
}
.line-progress {
align-items: center;
}
.u-page__item__slot-icon {
width: 24px;
height: 24px;
}
.part-left {
align-items: center;
}
.circle-center {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.margin-top-sm {
margin-top: 10upx;
}
.flex-row {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
}
.icon {
width: 36upx;
max-height: 50upx;
margin-right: 6upx;
}
.flex-row-center {
display: flex;
flex-direction: row;
align-items: center;
}
.content-part-1 {
display: flex;
flex-direction: column;
align-items: center;
.header {
display: flex;
flex-direction: row;
align-items: center;
width: 92%;
padding: 30upx 0;
image {
width: 20px;
height: 20px;
margin-right: 6upx;
}
}
.form-content-box {
width: 92%;
padding: 12upx 0;
border-radius: 12upx;
box-shadow: 0 0 8upx rgba(0, 0, 0, 0.34);
background-color: #ffffff;
.cu-form-group {
.title {
display: flex;
flex-direction: row;
width: 240upx;
align-items: center;
}
}
}
.footer-content {
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: 120upx;
margin-bottom: 100upx;
.btn-box {
width: 80%;
}
}
}
.title-view {
display: flex;
flex-direction: row;
align-items: center;
width: 100%;
padding: 0;
margin: 0;
.part-3 {
width: 100%;
padding-bottom: 0;
.content-item {
width: 100%;
padding: 0;
.content-box {
box-shadow: 0 0 0 transparent;
border-radius: 0;
}
}
}
}
.img-list-box{
display: flex;
flex-wrap: wrap;
width: 100%;
.img-item-box{
display: flex;
justify-content: center;
align-items: center;
width: 33.33%;
height: 26vw;
.img{
display: block;
width: 90%;
height: 90%;
}
}
}
</style>
\ No newline at end of file
<template>
<view :class="show? 'hidden-box':'' ">
<cu-custom :isBack="true">
<block slot="backText">
<view class="list-icon" @tap="onBack">
<text class="cuIcon-back text-white text-bold text-xl"></text>
</view>
</block>
<block slot="content">
<text class="text-white">文档浏览</text>
</block>
<block slot="right">
<view class="margin-right text-xxl" @tap="onPopOpen">
<text class="cuIcon-filter" :class="searchStatus? 'text-green': 'text-white'"></text>
</view>
</block>
</cu-custom>
<view v-if="statusBarHeight>0" class="content-black" :style="{height:statusBarHeight+45+'px'}">
</view>
<view class="title-view">
<picker mode="selector" :range="fileTypeList" @change="onChange" range-key="label">
<view class="flex-row">
<text class="text-title text-bold text-lg">{{fileTypeList.length? fileTypeList[index].label:'请选择'}}</text>
<view class="text-xl">
<text class="cuIcon-unfold"></text>
</view>
</view>
</picker>
</view>
<view class="flex-col data-content">
<view class="flex-col part-3">
<view v-for="(item,k) in projectDataList" :key="k" class="content-item" @tap="onNavToOrderInfo(item)">
<view class="header-title">
<image src="../../static/icon5.png" mode="widthFix"></image>
<view class="flex-between">
<text class="text-black text-bold">{{item.fileName|| ''}}</text>
<view class="margin-right">
<text class="">详情</text>
<text class="cuIcon-right text-gray"></text>
</view>
</view>
</view>
<view class="flex-col content-box">
<view class="flex-row">
<text class="text-gray part-1">项目名称</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.projName}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">公司名称</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.companyName}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">文件类型</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{fileTypeEnum[item.fileType]}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">文件名称</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.fileName}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">版本</text>
<text class="text-gray part-2">:</text>
<text class="text-title">V{{item.docVersion}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">附件名称</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.docName}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">预览次数</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.previewNum}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">下载次数</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.downloadNum}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">发布时间</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.releaseDate}}</text>
</view>
</view>
</view>
<view v-if="projectDataList.length" style="padding: 12px 6% 0;">
<u-loadmore :status="status" :icon="true" :line='true' :loading-text="loadingText"
:loadmore-text="loadmoreText" :nomore-text="nomoreText" />
</view>
<view v-if="projectDataList.length <= 0" class="empty-box">
<u-empty text="暂无数据" textColor='#C1C1C1' width="120">
</u-empty>
</view>
</view>
</view>
<u-popup :show="show" mode="right" :closeOnClickOverlay="true" :zIndex="455" :safeAreaInsetBottom="true"
:safeAreaInsetTop="true" round="6" @close="onPopClose">
<view class="flex-col filter-box">
<view class="content-black" :style="{height:statusBarHeight+45+'px'}">
</view>
<view class="flex-between text-xxl">
<view class="text-title text-lg text-bold margin-left-sm">查询条件</view>
<text class="cuIcon-roundclose text-gray margin-right" @tap="onPopClose"></text>
</view>
<view class="flex-col query-data">
<view class="flex-col part">
<view class="title">
<text class="text-title">公司名称:</text>
</view>
<view class="input">
<u-input border="surround" placeholder="请输入公司名称" v-model="queryData.companyName" type="text" :maxlength="99" name="input"></u-input>
</view>
</view>
<view class="flex-col part">
<view class="title">
<text class="text-title">项目名称:</text>
</view>
<view class="input">
<u-input border="surround" placeholder="请输入项目名称" v-model="queryData.projName" type="text" :maxlength="99" name="input"></u-input>
</view>
</view>
<view class="flex-col part">
<view class="title">
<text class="text-title">文件名称:</text>
</view>
<view class="input">
<u-input border="surround" placeholder="请输入文件名称" v-model="queryData.fileName" type="text" :maxlength="99" name="input"></u-input>
</view>
</view>
</view>
<view class="list-btn">
<button class="cu-btn bg-gray" @tap="onReset">重 置</button>
<button class="cu-btn bg-blue" @tap="onFilterConfirm">确 定</button>
</view>
</view>
</u-popup>
</view>
</template>
<script>
import {getDict} from "@/api/index.js"
import {
toJsonData
} from "@/utils/tools.js";
import moment from "@/common/moment.js";
import {
getList
} from "@/api/document.js";
export default {
data() {
return {
show: false,
statusBarHeight: uni.getStorageSync("statusHeight") || 0,
status: 'nomore ',
loadingText: '努力加载中',
loadmoreText: '上划加载',
nomoreText: '到底啦',
value: 0,
title: '文档浏览',
current: 0,
formData: {},
queryData: {
offset: 0,
pageSize: 5
},
projectDataList:[],
searchStatus: false,
index:0,
fileTypeList: [{
value:'',
label:"全部"
}],
fileTypeEnum: {},
};
},
onLoad(option) {
this.onLoading();
},
onReachBottom() {
if (this.status == 'loadmore') {
this.queryData.offset += 1;
this.onGetList();
}
},
methods: {
onReset(){
this.queryData.companyName = "";
this.queryData.projName = "";
this.queryData.fileName = "";
this.queryData.offset = 0;
this.searchStatus = false;
this.show = false;
this.onGetList();
},
onFilterConfirm(){
if(!this.queryData.companyName&& !this.queryData.projName && !this.queryData.fileName){
uni.showToast({
icon:"none",
title:"请输入至少一个查询条件"
})
return
}
this.show = false;
this.searchStatus = true;
this.queryData.offset = 0;
this.onGetList();
},
onPopOpen(){
this.show = true
},
onPopClose(){
this.show = false
},
onChange(e) {
this.index = e.target.value;
this.queryData.offset = 0;
this.onGetList();
},
onBack() {
uni.redirectTo({
url: "/pages/home/home"
})
},
onLoading() {
getDict({
codeset: 'hggp.hgwd.fileType'
}).then(res => {
let list = res.data.list.map( item => {
this.fileTypeEnum[item.value] = item.label;
return item
})
this.fileTypeList.push(...list)
this.onGetList();
})
},
onGetList() {
uni.showLoading({
title: "加载中"
})
getList({
...this.queryData,
fileType: this.fileTypeList[this.index].value
}).then(res => {
uni.hideLoading();
let list = toJsonData(res.data.__blocks__.result.rows, res.data.__blocks__.result.meta.columns)
if (list && list.length) {
list = list.map(item => {
let updatedTime =item.releaseDate? item.releaseDate.split(''):[];
return {
...item,
releaseDate:updatedTime.length>=13? `${updatedTime[0]}${updatedTime[1]}${updatedTime[2]}${updatedTime[3]}/${updatedTime[4]}${updatedTime[5]}/${updatedTime[6]}${updatedTime[7]} ${updatedTime[8]}${updatedTime[9]}:${updatedTime[10]}${updatedTime[11]}:${updatedTime[12]}${updatedTime[13]}` :''
}
})
}
if (this.queryData.offset == 0) {
this.projectDataList = list
} else {
this.projectDataList = [...this.projectDataList, ...list]
}
if (this.projectDataList.length < res.data.__blocks__.result.attr.count) {
this.status = "loadmore"
} else {
this.status = 'nomore'
}
})
},
onNavToOrderInfo(val) {
uni.navigateTo({
url: `/pages/document/edit?id=${val.id}`
})
}
}
}
</script>
<style>
page {
background-color: #ffffff;
}
</style>
<style lang="scss" scoped>
.title-view{
display: flex;
flex-direction: row;
align-items: center;
padding: 20upx 30upx;
background: #ffffff;
}
.hidden-box {
height: 100vh;
overflow: hidden;
}
.cu-form-group {
display: flex;
flex-direction: column;
picker {
padding-right: 0;
}
}
.header-title {
display: flex;
flex-direction: row;
width: 90%;
align-items: center;
margin: 30upx auto 12upx;
.flex-between {
display: flex;
flex: 1;
justify-content: center;
align-items: center;
border-radius: 20upx;
padding: 16upx 20upx;
background-color: rgba(246, 246, 248, 1);
.image {
width: 34upx;
margin-right: 8upx;
max-height: 42upx;
}
.text-blue {
color: #4a93f8;
font-weight: bold;
}
}
}
.u-tabs-box {
width: 100%;
margin: 0 auto;
}
.data-content {
display: flex;
flex-direction: column;
margin: 0 auto 30upx;
width: 96%;
.circle-par {
display: flex;
justify-content: center;
align-items: center;
}
.header {
border-radius: 12upx 12upx 0 0;
background-color: #eef2fe;
color: #101010;
font-size: 30upx;
border: 1px solid #d1dcfd;
padding: 14upx 24upx;
}
.content {
border-radius: 0 0 12upx 12upx;
background-color: #ffffff;
color: #101010;
font-size: 30upx;
border: 1px solid #cecece;
border-top: none;
}
}
.flex-content {
display: flex;
width: 100%;
justify-content: center;
}
.part-3 {
flex-direction: column;
padding-bottom: 40upx;
.content-item {
display: flex;
flex-direction: column;
width: 94%;
margin: 4upx auto 24upx;
padding-bottom: 24upx;
.header-title {
position: relative;
width: 100%;
margin: 0;
image {
width: 100%;
max-height: 100upx;
}
.flex-between {
position: absolute;
top: 0;
left: 12%;
width: 88%;
height: 70%;
padding: 0;
justify-content: space-between;
background-color: transparent;
}
}
.content-box {
position: relative;
z-index: 2;
box-shadow: 0 0 12upx rgba(0, 0, 0, 0.34);
border-radius: 12upx;
margin-top: -20upx;
background-color: #ffffff;
padding: 24upx;
.flex-row {
margin: 6upx 0;
.part-1 {
width: 180upx;
text-align-last: justify;
}
.part-2 {
margin-right: 24upx;
}
}
}
}
.content-item:last-child {
border-bottom: none;
}
}
.flex-center {
display: flex;
align-items: center;
}
.line-progress {
align-items: center;
}
.u-page__item__slot-icon {
width: 24px;
height: 24px;
}
.part-left {
align-items: center;
}
.circle-center {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.margin-top-sm {
margin-top: 10upx;
}
.flex-row {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
}
.icon {
width: 36upx;
max-height: 50upx;
margin-right: 6upx;
}
.flex-row-center {
display: flex;
flex-direction: row;
align-items: center;
}
.content-part-1 {
display: flex;
flex-direction: column;
align-items: center;
.header {
display: flex;
flex-direction: row;
align-items: center;
width: 92%;
padding: 30upx 0;
image {
width: 20px;
height: 20px;
margin-right: 6upx;
}
}
.form-content-box {
width: 92%;
padding: 12upx 0;
border-radius: 12upx;
box-shadow: 0 0 8upx rgba(0, 0, 0, 0.34);
background-color: #ffffff;
.cu-form-group {
.title {
display: flex;
flex-direction: row;
width: 240upx;
align-items: center;
}
}
}
.footer-content {
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: 120upx;
margin-bottom: 100upx;
.btn-box {
width: 80%;
}
}
}
.filter-box {
position: relative;
display: flex;
flex-direction: column;
width: 60vw;
height: 100%;
padding-top: 30upx;
.item {
margin: 20upx;
.input-box {
border: 1px solid #dadbde;
border-radius: 4px;
padding: 6px 9px;
font-size: 30upx;
}
}
.list-btn {
position: absolute;
left: 0;
bottom: 40upx;
width: 100%;
display: flex;
justify-content: space-between;
.cu-btn {
display: flex;
flex: 1;
margin: 20upx;
}
}
}
.query-data{
border-top: 1px solid #e5e5e5;
margin-top: 24upx;
.part{
.input{
margin: 0 24upx;
}
}
.title{
padding: 12upx 20upx;
}
}
</style>
\ No newline at end of file
......@@ -88,5 +88,7 @@ export default {
@import './vue.ani-style.scss';
/* #endif */
.u-transition {}
.u-transition {
z-index: 444;
}
</style>
......@@ -11,7 +11,7 @@ export default {
// overlay组件
overlay: {
show: false,
zIndex: 10070,
zIndex: 444,
duration: 300,
opacity: 0.5
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment