Commit 65ec8112 authored by xioln's avatar xioln

任务提交

parent 15ac0e30
<template>
<div id="app">
<!-- <router-view class="main"></router-view> -->
<header-nav-bar
v-if="isHeader"
class="header"
:title="$route.query.title || ''"
left-arrow
@click-left="onClickLeft"
/>
<keep-alive>
<router-view
v-if="$route.meta.keepAlive"
class="main"
:class="isHeader ? 'marin-top main' : 'home-top main'"
></router-view>
</keep-alive>
<router-view
v-if="!$route.meta.keepAlive"
class="main"
:class="isHeader ? 'marin-top main' : 'home-top main'"
></router-view>
<tabbar v-if="$route.path!=='/login'" />
<tabbar v-if="$route.path !== '/login'" />
</div>
</template>
<script>
// import configure from '@/mixins/configure.js'
import HeaderNavBar from '@/components/headerNavBar/index.vue'
import Tabbar from '@/views/tabbar/index.vue'
export default {
name: 'app',
components: { Tabbar },
components: { HeaderNavBar, Tabbar },
// mixins: [configure],
// 数据源 给组件分发数据用
data() {
data () {
return {
title: '登录',
transitionName: 'fade'
}
},
mounted() {
mounted () {
this.title = this.$route.name
},
// 基于路由变化的动态 设置路由切换动画
watch: {
$route(to, from) {
$route (to, from) {
// 仅登录时导航不显示返回按钮 其他都显示
this.title = to.name
// 网页标题更改
......@@ -50,7 +58,16 @@ export default {
// }
}
},
methods: {}
computed: {
isHeader () {
return this.$route.query.title && this.$route.path !== '/login' && this.$route.path !== '/home'
}
},
methods: {
onClickLeft () {
history.back(-1)
}
}
}
</script>
......@@ -60,9 +77,9 @@ body {
height: 100%;
}
@font-face {
font-family: "PingFang";
font-family: 'PingFang';
// src: url("/font/PingFang SC Regular.ttf");
src: url("/font/Alibaba-PuHuiTi-Regular.ttf");
src: url('/font/Alibaba-PuHuiTi-Regular.ttf');
}
#app {
// font-family: Avenir, Helvetica, Arial, sans-serif;
......@@ -73,9 +90,18 @@ body {
color: #333333;
width: 100%;
height: 100%;
overflow: hidden;
.main {
height: 100%;
height: calc(100% - 130px);
background: #fff;
// padding-bottom: 70px;
overflow: hidden;
}
.marin-top {
margin-top: 60px;
}
.home-top {
height: calc(100% - 70px);
}
.router {
position: absolute;
......@@ -114,5 +140,25 @@ body {
.van-tabs__line {
background: linear-gradient(207deg, #68b7f6 0%, #5baaf2 100%);
}
.van-nav-bar .van-icon {
color: #fff;
}
.content {
white-space: nowrap; /* 文本只能单行显示 */
overflow: hidden; /* 超出部分隐藏 */
text-overflow: ellipsis; /* 超出部分显示省略号 */
-webkit-overflow-scrolling: touch; /* 使用滚动效果 */
overflow-x: auto; /* 水平方向超出部分自动滚动 */
}
/* 隐藏滚动条 */
::-webkit-scrollbar {
display: none;
}
/* 隐藏滚动条thumb(滑块) */
::-webkit-scrollbar-thumb {
display: none;
}
}
</style>
import { get, post, del } from '../utils/http'
// import store from '../store'
import { setSearchParams } from '@/utils/util'
export function getWorkFlowItem (itemId, loadPbo = null) {
if (loadPbo) {
......@@ -849,3 +850,31 @@ export function getInstTaskHisTory(instId, page, size) {
export function getInstancePbo(params) {
return get(`/workflow/inst/${params}/bizPBO`)
}
/** *608-5g */
export function findByCondition(params) {
return post('DxApplication/findByCondition', params)
}
// 分片上传准备
export function uploadPartPrepare(params) {
return post('/dfs/fileManager/uploadPartPrepare', params, true)
}
// 获取表单配置
export function getLayOut(params) {
return get('/DxModelComponent/findModelComponent', params)
}
// 获取字典
export function getDictListByCode(code, parentKey, attr) {
const params = {
searchParams: { dictState: 'ENABLE' },
sort: { dictSeq: 'asc' }
}
params.searchParams.dictCode = code
if (parentKey !== 'default') {
params.searchParams[attr] = parentKey
}
return post('/DictData/search', setSearchParams(params))
}
......@@ -26,12 +26,14 @@
v-else
v-model="form[formItem.key]"
:is="formItem.component.name"
:item="formItem"
:item-obj="formItem.component"
:form="form"
:type="formItem.component.type"
:name="formItem.key || ''"
:label="formItem.title || ''"
:rules="rules"
v-on="$listeners"
@handleSubmit="handleSubmit"
/>
</div>
......
<template>
<div class="input">
<van-field v-if="itemObj" v-model="inputValue" colon v-bind="itemObj"
:readonly="itemObj.name === 'readable' ? true : false" :name="name" :label="label">
<van-field
v-if="itemObj"
v-model="inputValue"
colon
v-bind="itemObj"
:readonly="itemObj.name === 'readable' ? true : false"
:name="name"
:label="label"
:type="itemObj.type"
>
<div v-if="itemObj.verifyIcon" slot="button">
<img :src="itemObj.verifyIcon" @click="getVerifyCode" />
</div>
......@@ -9,9 +17,14 @@
</div>
</template>
<script>
import { getDictListByCode } from '@/api/taskDetail'
export default {
props: {
item: {
type: Object,
default: () => null
},
itemObj: {
type: Object,
default: () => null
......@@ -49,6 +62,10 @@ export default {
inputValue: {
deep: true,
handler (val) {
console.log('this.item', this.item)
if (this.item.fildProp && this.item.fildProp.rule.dictTypeCode) {
this.getCode()
}
this.$emit('input', val, this.name)
}
}
......@@ -56,6 +73,22 @@ export default {
methods: {
getVerifyCode () {
this.$emit('getVerifyCode')
},
getCode () {
getDictListByCode(this.item.fildProp.rules.dictTypeCode).then(res => {
console.log(res)
if (!res || !res.items) {
return []
}
const list = res.items.content.map(row => {
return {
label: row.dictValue,
value: row.dictKey,
id: row.id,
parentId: row.parentId
}
})
})
}
}
}
......@@ -72,7 +105,7 @@ export default {
position: absolute;
top: 50%;
right: 0%;
transform: translate(-0%,-50%);
transform: translate(-0%, -50%);
}
}
</style>
<template>
<div class="vanLink">
<div class="van-cell van-field">
<div class="van-cell__title van-field__label">
<span>{{ `${label}:` }}</span>
</div>
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<span @click="toUrl" class="content">{{ inputValue }}</span>
<div class="vanLink">
<div class="van-cell van-field">
<div class="van-cell__title van-field__label">
<span>{{ `${label}:` }}</span>
</div>
<div class="van-cell__value van-field__value">
<div class="van-field__body">
<span @click="toUrl" class="content">{{ inputValue }}</span>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import moment from 'moment'
......@@ -60,7 +60,7 @@ export default {
},
methods: {
toUrl () {
this.$router.push({ path: this.itemObj.url, query: { oid: this.itemObj.oid, subTypeName: this.itemObj.subTypeName, dxClassName: this.itemObj.dxClassName, title: this.itemObj.title, time: moment().valueOf() } })
this.$router.push({ path: this.itemObj.url, query: { oid: this.itemObj.oid, subTypeName: this.itemObj.subTypeName, dxClassname: this.itemObj.dxClassname, title: this.itemObj.title, time: moment().valueOf() } })
}
}
}
......@@ -72,7 +72,7 @@ export default {
}
.content {
text-align: left;
color: #2A75CE;
color: #2a75ce;
cursor: pointer;
}
}
......
<template>
<van-field class="radio" v-if="itemObj" v-bind="itemObj" colon :name="name" :label="label" :rules="rules[name]">
<van-field
class="radio"
v-if="itemObj"
v-bind="itemObj"
colon
:name="name"
:label="label"
:required="!!rules[name]"
:rules="rules[name]"
>
<template #input>
<van-radio-group v-model="radioValue" v-bind="itemObj" v-on="itemObj.handler" direction="horizontal" :disabled="itemObj.disabled">
<van-radio v-for="(option, index) in itemObjOptions" :key="index"
:name="option.value">{{option.label}}</van-radio>
<van-radio-group
v-model="radioValue"
v-bind="itemObj"
v-on="itemObj.handler"
direction="horizontal"
:disabled="itemObj.disabled"
>
<van-radio
v-for="(option, index) in itemObjOptions"
:key="index"
:name="option.value"
>{{ option.label }}</van-radio
>
</van-radio-group>
</template>
</van-field>
......@@ -76,10 +95,10 @@ export default {
</script>
<style lang="scss" scoped>
.radio {
.van-radio-group{
.van-radio-group {
width: 100%;
}
::v-deep .van-radio{
::v-deep .van-radio {
margin-bottom: 10px;
min-width: 40%;
}
......
<template>
<div class="pdf">
<van-dropdown-menu active-color="#1989fa">
<van-dropdown-item v-model="activeFile" :options="option" />
</van-dropdown-menu>
<div ref="pdfComponent" class="pdfComponent"></div>
<!-- <div>
<div
style="
display: flex;
align-items: center;
justify-content: space-between;
"
>
<div>
<van-button size="small" class="btn-def btn-pre" @click.stop="prePage"
>上一页</van-button
>
<van-button
size="small"
class="btn-def btn-next"
@click.stop="nextPage"
>下一页</van-button
>
</div>
<div>
<div>{{ pageNum }}/{{ pageTotalNum }}</div>
</div>
<div>
<van-button
size="small"
:class="{ select: idx == 0 }"
@touchstart="idx = 0"
@touchend="idx = -1"
@click="scaleD"
>
放大
</van-button>
<van-button
size="small"
:class="{ select: idx == 1 }"
@touchstart="idx = 1"
@touchend="idx = -1"
@click="scaleX"
>
缩小
</van-button>
</div>
</div>
<v-touch @swipeleft="prePage" @swiperight="nextPage">
<pdf
ref="pdf"
v-if="url"
:src="url"
:page="pageNum"
:rotate="pageRotate"
@password="password"
@progress="loadedRatio = $event"
@page-loaded="pageLoaded($event)"
@num-pages="pageTotalNum = $event"
@error="pdfError($event)"
@link-clicked="page = $event"
>
</pdf>
</v-touch>
</div>
<div class="pdf-tab"></div> -->
</div>
</template>
......@@ -69,6 +11,8 @@
// import pdf from 'vue-pdf'
import Pdfh5 from 'pdfh5'
import 'pdfh5/css/pdfh5.css'
import { get, post } from '@/utils/http'
import moment from 'moment'
export default {
name: 'Pdf',
......@@ -76,9 +20,9 @@ export default {
// pdf
},
props: {
url: {
type: String,
default: ''
basicData: {
type: Object,
required: true
}
},
data () {
......@@ -96,7 +40,31 @@ export default {
scale: 100, // 放大系数
idx: -1,
title: '',
pdfh5: null
pdfh5: null,
filesList: [],
activeFile: 0,
option: []
}
},
watch: {
basicData (val) {
if (val.objFileLinks) {
this.getFileId()
}
},
activeFile (val) {
if (val && this.filesList) {
this.getPdf(this.filesList.filter(file => file.targetId === val)[0])
}
}
},
computed: {
contentType () {
const defaultContentType = 'DOC_PDF_FILE,PROCESS_CONTENTROLE_PDF'
return 'DOC_PDF_FILE,PROCESS_CONTENTROLE_PDF,ATTACH_FILE,MASTER_FILE' || defaultContentType
},
eid () {
return 'id_' + this.$utils.guid().replaceAll('-', '')
}
},
created () {
......@@ -107,40 +75,108 @@ export default {
},
mounted () {
// 实例化
this.pdfh5 = new Pdfh5(this.$refs.pdfComponent, {
pdfurl: this.url
// URIenable: false
// type: 'ajax'
// renderType: 'canvas'
// lazy: true
})
// this.pdfh5 = new Pdfh5(this.$refs.pdfComponent, {
// pdfurl: this.url
// // URIenable: false
// // type: 'ajax'
// // renderType: 'canvas'
// // lazy: true
// })
this.getFileId()
this.getPdf(this.filesList[0])
},
methods: {
// // 下载PDF
// fileDownload (data, fileName) {
// const blob = new Blob([data], {
// // type类型后端返回来的数据中会有,根据自己实际进行修改
// type: 'application/pdf;charset-UTF-8'
// })
// const filename = fileName || '报表.xls'
// if (typeof window.navigator.msSaveBlob !== 'undefined') {
// window.navigator.msSaveBlob(blob, filename)
// } else {
// const blobURL = window.URL.createObjectURL(blob)
// // 创建隐藏<a>标签进行下载
// const tempLink = document.createElement('a')
// tempLink.style.display = 'none'
// tempLink.href = blobURL
// tempLink.setAttribute('download', filename)
// if (typeof tempLink.download === 'undefined') {
// tempLink.setAttribute('target', '_blank')
// }
// document.body.appendChild(tempLink)
// tempLink.click()
// document.body.removeChild(tempLink)
// window.URL.revokeObjectURL(blobURL)
// }
// },
getPdf (file) {
get('/dfs/fileManager/preview', { objName: file.sourceIdType, objId: file.sourceId, linkId: file.id }).then(res => {
if (res.items.fileBase64) {
this.pdfh5 = new Pdfh5(this.$refs.pdfComponent, {
data: atob(res.items.fileBase64)
})
}
})
},
getFileId () {
if (!this.basicData.objFileLinks) return
const objFileLinks = this.basicData.objFileLinks
console.log('this.filterFilesByRuleType(objFileLinks)', this.filterFilesByRuleType(objFileLinks))
this.filesList = this.filterFilesByRuleType(objFileLinks).filter(item => item.name.includes('pdf'))
console.log('this.basicData.objFileLinks', this.filesList)
const masterFile = this.filesList.find(file => file.contentType === 'MASTER_FILE' && file.target.fileExtension === 'pdf')
const masterFileIdx = this.filesList.findIndex(file => file.contentType === 'MASTER_FILE' && file.target.fileExtension === 'pdf')
if (masterFile) {
this.filesList.splice(masterFileIdx, 1)
this.filesList.unshift(masterFile)
console.log('this.filesList', this.filesList)
} else {
const signedFile = this.filesList.find(file => file.contentType === 'ATTACH_FILE')
const idx = this.filesList.findIndex(file => file.contentType === 'ATTACH_FILE')
// 签字文件,默认展示签字文件
if (signedFile) {
this.filesList.splice(idx, 1)
this.filesList.unshift(signedFile)
}
}
console.log('this.filesList', this.filesList)
this.option = this.filesList.map(file => {
return { text: file.name, value: file.targetId }
})
this.activeFile = this.filesList[0].targetId
},
base64ToUint8Array (base64String) {
const padding = '='.repeat((4 - base64String.length % 4) % 4)
const base64 = (base64String + padding)
.replace(/\-/g, '+')
.replace(/_/g, '/')
const rawData = window.atob(base64)
const outputArray = new Uint8Array(rawData.length)
for (var i = 0; i < rawData.length; ++i) {
outputArray[i] = rawData.charCodeAt(i)
}
return outputArray
},
// 通过“展示规则”和“查看文件类型”对文件进行过滤和排序
filterFilesByRuleType (files) {
const contentTypeList = this.contentType.split(',').filter(c => !!c)
if (!(files && files.length)) {
return []
}
// 1.对文件进行排序
files.sort((a, b) => {
const val = moment(a.modifyTime) - moment(b.modifyTime)
return !!(!isNaN(val) && val < 0)
})
// 2.找出所有文件类型(组件上设置的文件类型及其之外的文件类型),先按照文件内容类型对文件进行归类
const allConTentTypes = [...contentTypeList.map(type => ({ type, files: [] }))]
files.forEach(f => {
const file = {
...f,
fileId: f.target.id,
name: f.target.originalFileName
}
const type = file.contentType
if (type && contentTypeList.includes(type)) {
const item = allConTentTypes.find(m => m.type === type)
item && item.files.push(file)
}
})
// 3.按照规则返回文件
if (this.dispalyRule === 'oneTypeFiles') {
let i = 0
while (i < contentTypeList.length) {
const files = allConTentTypes[i].files
if (files.length > 0) {
return files
}
i++
}
return []
} else {
return allConTentTypes.map(m => m.files).flat()
}
},
// 放大
scaleD () {
this.scale += 5
......@@ -198,7 +234,7 @@ export default {
<style lang="scss">
.pdf {
.pdfComponent{
.pdfComponent {
height: calc(100vh - 160px);
}
}
......
......@@ -7,17 +7,6 @@ Vue.use(VueRouter)
const isLogined = getToken()
const routes = [
{
path: '/redirect',
// component: Layout,
hidden: true,
children: [
{
path: '/redirect/:path*',
component: () => import('../views/redirect/index')
}
]
},
{
path: '/login',
name: '登录',
......@@ -59,73 +48,9 @@ const routes = [
}
},
{
path: '/PbomStructure',
name: 'PBOM结构',
component: () => import('@/views/PbomStructure/index.vue'),
meta: {
keepAlive: true
}
},
{
path: '/MbomStructure',
name: 'MBOM结构',
component: () => import('@/views/MbomStructure/index.vue'),
meta: {
keepAlive: true
}
},
{
path: '/BomTreeDetail-*',
path: '/InfoDetail-*',
name: '详情页',
component: () => import('@/views/BomTreeDetail/index.vue'),
meta: {
keepAlive: false
}
},
{
path: '/noticeInfo',
name: '通知',
component: () => import('@/views/noticeInfo/index.vue'),
meta: {
keepAlive: false
}
},
{
path: '/taskSearch',
name: '任务搜索',
component: () => import('@/views/taskSearch/index.vue'),
meta: {
keepAlive: false
}
},
{
path: '/receipts',
name: '单据',
component: () => import('@/views/receipts/index.vue'),
meta: {
keepAlive: false
}
},
{
path: '/documentCenter',
name: '文档中心',
component: () => import('@/views/documentCenter/index.vue'),
meta: {
keepAlive: true
}
},
{
path: '/documentCenterDetail-*',
name: '文档中心详情',
component: () => import('@/views/documentCenter/documentDetail.vue'),
meta: {
keepAlive: false
}
},
{
path: '/noticeDetail',
name: '公告详情',
component: () => import('@/views/noticeInfo/noticeDetail.vue'),
component: () => import('@/views/InfoDetail/index.vue'),
meta: {
keepAlive: false
}
......@@ -155,13 +80,13 @@ const createRouter = () => new VueRouter({
})
const router = createRouter()
export function resetRouter() {
export function resetRouter () {
const newRouter = createRouter()
router.matcher = newRouter.matcher // reset router
}
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location, onResolve, onReject) {
VueRouter.prototype.push = function push (location, onResolve, onReject) {
if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
return originalPush.call(this, location).catch(err => err)
......
......@@ -3,8 +3,12 @@ const state = {
tabs: [
{ key: 'taskDetailHandle', title: '处理意见' },
{ key: 'GetParticipant', title: '设置参与者' },
{ key: 'DeeFlowDxDocumentAttrsEdit', title: '是否归档' },
{ key: 'DeeFlowSecretConfirm', title: '密级确认' },
{ key: 'DeeFlowDxDocumentEditReplyComments', title: '答复意见' },
{ key: 'DeeFlowDxDocumentAttrsEditWhetherApplied', title: '封面铁皮' },
{ key: 'taskHistory', title: '签审历史' }
]
}
......
......@@ -3,7 +3,7 @@ import { downloadFile } from '@/utils/http.js'
import { MessageBox } from 'element-ui'
import { Notify } from 'vant'
export function deepClone(source) {
export function deepClone (source) {
if (!source && typeof source !== 'object') {
throw new Error('error arguments', 'deepClone')
}
......@@ -18,7 +18,7 @@ export function deepClone(source) {
return targetObj
}
export function getParamsFromLists(list, key, val, attr = '') {
export function getParamsFromLists (list, key, val, attr = '') {
if (!list || list.length === 0) {
if (attr) {
return ''
......@@ -41,7 +41,7 @@ export function getParamsFromLists(list, key, val, attr = '') {
}
}
export async function getDicListByCode(dictCode, isReset, parentCode, attr = 'parentKey') {
export async function getDicListByCode (dictCode, isReset, parentCode, attr = 'parentKey') {
let list = []
if (!parentCode) {
parentCode = 'default'
......@@ -52,7 +52,7 @@ export async function getDicListByCode(dictCode, isReset, parentCode, attr = 'pa
return list
}
export function setSearchParams(obj) {
export function setSearchParams (obj) {
let params = {
pageFrom: 1,
pageSize: 100000
......@@ -106,7 +106,7 @@ export function setSearchParams(obj) {
return params
}
export function getOpenPropsByLists(lists, openProps = []) {
export function getOpenPropsByLists (lists, openProps = []) {
if (typeof lists === 'string') {
lists = [lists]
}
......@@ -121,7 +121,7 @@ export function getOpenPropsByLists(lists, openProps = []) {
const defaultPageFrom = 1
const defaultPageSize = 99999
function getOpenPropsByAttr(tree, prop, searchItems = null) {
function getOpenPropsByAttr (tree, prop, searchItems = null) {
const list = prop.split('.')
const len = list.length
let node = tree
......@@ -156,11 +156,11 @@ function getOpenPropsByAttr(tree, prop, searchItems = null) {
return tree
}
export function getLayouts(modelName, layoutKey, isRest = false) {
export function getLayouts (modelName, layoutKey, isRest = false) {
return $store.dispatch('layout/getLayouts', { modelName, layoutKey, isRest })
}
export function getModelName4dxClassName(dxClassname) {
export function getModelName4dxClassName (dxClassname) {
if (!dxClassname) { return '' }
if (typeof dxClassname === 'object') {
dxClassname = dxClassname.dxClassname
......@@ -168,7 +168,7 @@ export function getModelName4dxClassName(dxClassname) {
return dxClassname.split('.').slice(-1)[0].replace(/V[o|O]/g, '')
}
export function formDataParams(obj) {
export function formDataParams (obj) {
const formData = new FormData()
// eslint-disable-next-line no-unused-vars
for (const key in obj) {
......@@ -177,7 +177,7 @@ export function formDataParams(obj) {
return formData
}
export function arrayRemoveDuplicate(data, type) {
export function arrayRemoveDuplicate (data, type) {
const obj = {}
let newData = []
newData = data.reduce((preVal, curVal) => {
......@@ -188,7 +188,7 @@ export function arrayRemoveDuplicate(data, type) {
return newData
}
export function dynamicIcons(type, rModel, partNumber, model = null, name = '') {
export function dynamicIcons (type, rModel, partNumber, model = null, name = '') {
let icon = require('@/assets/designcenter/普通零部件图标.png')
if (model && (partNumber === model || model + ' ' + 'SSCI' === partNumber)) {
icon = require('@/assets/designcenter/飞机级零部件图标.png')
......@@ -359,7 +359,7 @@ export function dynamicIcons(type, rModel, partNumber, model = null, name = '')
return icon
}
export function downLoadFileUrl(url, fileName = null) {
export function downLoadFileUrl (url, fileName = null) {
// showNotification('下载中,请稍后...', '提示', 'info')
const name = url.substring(url.lastIndexOf('/') + 1, url.length)
const link = document.createElement('a')
......@@ -374,7 +374,7 @@ export function downLoadFileUrl(url, fileName = null) {
Notify({ type: 'warning', message: '下载中,请稍后...' })
}
export function downLoad(url, label = null) {
export function downLoad (url, label = null) {
// Notify({ type: 'warning', message: '下载中,请稍后...' })
downloadFile(url).then(res => {
if (res.headers['content-disposition']) {
......@@ -397,7 +397,7 @@ export function downLoad(url, label = null) {
})
}
// 时间转换
export function formatTimer(value) {
export function formatTimer (value) {
const date = new Date(value)
const y = date.getFullYear()
let MM = date.getMonth() + 1
......@@ -413,7 +413,7 @@ export function formatTimer(value) {
return y + '-' + MM + '-' + d + ' ' + h + ':' + m
}
export function getCookie(name) {
export function getCookie (name) {
name = name + '='
var start = document.cookie.indexOf(name)
......@@ -432,11 +432,11 @@ export function getCookie(name) {
return value
}
export function GenNonDuplicateID(randomlength) {
export function GenNonDuplicateID (randomlength) {
return Number(Math.random().toString().substr(2, randomlength) + Date.now()).toString(36)
}
export function showConfirm(msg, title, type, confirmButtonText, cancelButtonText, GenNonDuplicateID, successCallback = () => { }, cancelCallback = () => { }) {
export function showConfirm (msg, title, type, confirmButtonText, cancelButtonText, GenNonDuplicateID, successCallback = () => { }, cancelCallback = () => { }) {
let t = 'info'
if (['info', 'success', 'warning', 'error'].includes(type)) {
t = type
......@@ -455,7 +455,7 @@ export function showConfirm(msg, title, type, confirmButtonText, cancelButtonTex
cancelCallback()
})
}
export function showMessage(msg, type) {
export function showMessage (msg, type) {
let t = 'info'
if (['info', 'success', 'warning', 'error'].includes(type)) {
t = type
......@@ -464,7 +464,7 @@ export function showMessage(msg, type) {
}
// json数据转成query拼接
export function filterParams(params) {
export function filterParams (params) {
const str = []
for (const attr in params) {
str.push(`${attr}=${params[attr]}`)
......@@ -472,4 +472,11 @@ export function filterParams(params) {
return str.join('&')
}
export default { getCookie, showMessage }
export function guid () {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = Math.random() * 16 | 0
var v = c === 'x' ? r : (r & 0x3 | 0x8)
return v.toString(16)
})
}
export default { getCookie, showMessage, guid }
......@@ -307,11 +307,6 @@ export default {
}
},
watch: {
// '$route.query.time': (val) => {
// console.log('$route.query.time', this.$route.query.time)
// this.activeTab = 'baseInfo'
// if (val !== moment().valueOf()) this.initDetail()
// },
'$route.path': {
handler (val, oldval) {
this.tabs = []
......@@ -324,7 +319,7 @@ export default {
created () {
this.initDetail()
},
mounted () {},
mounted () { },
computed: {},
methods: {
getPDFPreview () {
......@@ -332,8 +327,8 @@ export default {
if (
this.$route.query.dxClassName &&
(this.$route.query.dxClassName.includes('DxChangeNotice') ||
this.$route.query.dxClassName.includes('DxChangeRequest') ||
this.$route.query.dxClassName.includes('DxProblemReport'))
this.$route.query.dxClassName.includes('DxChangeRequest') ||
this.$route.query.dxClassName.includes('DxProblemReport'))
) {
getPDFPreview(params)
.then((res) => {
......@@ -528,7 +523,7 @@ export default {
'endTime',
(item.process.endTime &&
moment(item.process.endTime).format('YYYY-MM-DD HH:mm:ss')) ||
'暂未完成'
'暂未完成'
)
item.children.map((x) => {
this.$set(
......@@ -543,7 +538,7 @@ export default {
moment(x.workItem.completeTime).format(
'YYYY-MM-DD HH:mm:ss'
)) ||
'暂未完成'
'暂未完成'
)
this.$set(
x.workItem,
......
<template>
<div class="ebomStructure">
<header-nav-bar :title="title" left-arrow @click-left="onClickLeft" />
<div class="ebomStructure-scroll">
<div class="searchModel" ref="searchModel">
<dee-form
class="searchForm"
:form="form"
:form-data="formData"
@submit="onSubmit"
@handleSubmit="handleSubmit"
/>
<div class="searchButton">
<van-button type="info" size="small" @click="search">查询</van-button>
<van-button
plain
hairline
type="info"
size="small"
@click="hiddenTop"
:icon="iconButton"
></van-button>
</div>
</div>
<div class="searchTree">
<van-tabs v-model="activeTab" swipeable @change="tabChanged">
<van-tab
v-for="item in tabs"
:key="item.key"
:name="item.key"
:title="item.title"
>
<tree
:data="treeData"
:type="'EBOM'"
lazy
:props="{
children: 'children',
label: 'label',
isLeaf: 'leafNode',
}"
node-key="oid"
:load="loadNode"
:highlight-current="true"
:expand-on-click-node="false"
@node-click="handleNodeClick"
>
<div slot-scope="{ node, data }">
<span>
<!-- <img :src="dynamicIcon(data)" style="width: 18px;vertical-align: bottom;" alt=""> -->
<span class="changeText">{{ data.nodeName }}</span>
</span>
</div>
</tree>
</van-tab>
</van-tabs>
</div>
</div>
</div>
</template>
<script>
import HeaderNavBar from '../../components/headerNavBar/index.vue'
import DeeForm from '../../components/form/form'
import Tree from '../../components/tree/index.vue'
import {
navigationMasterView,
navigationSSCIView,
navigationSystemView,
searchWTPartByKeyword
} from '@/api/design'
import moment from 'moment'
export default {
props: {},
components: { HeaderNavBar, DeeForm, Tree },
data () {
return {
iconButton: 'arrow-up',
form: {},
formData: [
{
data: [
{
title: '机型:',
key: 'model',
component: {
name: 'el-select',
placeholder: '请选择机型',
options: [
{
label: 'AG600',
value: 'AG600'
}
]
}
},
{
title: '架次',
key: 'effectivity',
component: {
name: 'el-input',
placeholder: '请输入架次'
}
},
{
title: '件号:',
key: 'partNumber',
component: {
name: 'el-inputSelect',
placeholder: '请选择',
options: [],
handler: (query) => {
if (query.length > 5) {
this.$nextTick(() => {
this.debounce(this.searchWTPartByKeyword(query))
})
}
}
}
}
]
}
],
tabs: [
{ title: '主视图', key: 'mainViewSearch' },
{ title: '安装视图', key: 'installViewSearch' },
{ title: '系统视图', key: 'systemViewSearch' }
],
treeData: [],
activeTab: '',
searchInterface: {
mainViewSearch: 'navigationMasterView',
installViewSearch: 'navigationSSCIView',
systemViewSearch: 'navigationSystemView'
},
subTitle: 'Design'
}
},
created () {
// const value = this.formData[0].data[0].component.options[0].value
this.$set(this.form, 'model', 'AG600')
this.activeTab = 'mainViewSearch'
},
mounted () {},
computed: {
title () {
return this.$route.query.title || ''
}
},
methods: {
hiddenTop () {
if (this.iconButton === 'arrow-down') {
this.$refs.searchModel.style.height = '90px'
this.$refs.searchModel.style.transitionDuration = '.5s'
this.iconButton = 'arrow-up'
return
}
this.$refs.searchModel.style.height = '23px'
this.$refs.searchModel.style.transitionDuration = '.5s'
this.iconButton = 'arrow-down'
},
handleSubmit (params) {
this.form = Object.assign(this.form, params)
},
onClickLeft () {
history.back(-1)
},
tabChanged (name, title) {
// this.searchInterface[name] && this[this.searchInterface[name]]()
},
search () {
this.searchInterface[this.activeTab] &&
this[this.searchInterface[this.activeTab]]()
},
async navigationMasterView () {
this.loading = true
this.treeData = []
const params = Object.assign(this.form, {
partPath: '',
view: this.activeTab
})
await navigationMasterView(params)
.then(async (res) => {
this.loading = false
this.treeData = [res.items]
})
.catch((e) => {
this.loading = false
})
},
async navigationSSCIView () {
this.loading = true
this.treeData = []
const params = Object.assign(this.form, {
view: this.activeTab
})
await navigationSSCIView(params)
.then(async (res) => {
this.treeData = [res.items]
})
.catch((e) => {
this.loading = false
})
},
async navigationSystemView () {
this.treeData = []
const params = Object.assign(this.form, {
view: this.activeTab
})
await navigationSystemView(params).then(async (res) => {
this.treeData = [res.items]
})
},
loadNode (node, resolve) {
const params = Object.assign(this.form, {
view: this.activeTab,
oid: node.data.partId
})
if (this.activeTab === 'mainViewSearch') {
navigationMasterView(params)
.then((res) => {
let data = []
if (node.level === 0) {
data = [res.items]
} else {
data = res.items.children
}
return resolve(data)
})
.catch((e) => {
resolve([])
})
} else if (this.activeTab === 'installViewSearch') {
navigationSSCIView(params)
.then((res) => {
let data = []
if (node.level === 0) {
data = [res.items]
} else {
data = res.items.children
}
return resolve(data)
})
.catch((e) => {
resolve([])
})
} else {
navigationSystemView(params)
.then((res) => {
let data = []
if (node.level === 0) {
data = [res.items]
} else {
data = res.items.children
}
return resolve(data)
})
.catch((e) => {
resolve([])
})
}
this.$delete(this.form, 'oid')
},
handleNodeClick (data, node) {
this.$router.push({
path: `/bomTreeDetail-${data.partId}`,
query: {
oid: data.partId,
title: this.subTitle,
subTypeName: data.partSubTypeName,
time: moment().valueOf()
}
})
},
searchWTPartByKeyword (query) {
searchWTPartByKeyword(
this.$utils.formDataParams({ keyword: query })
).then((res) => {
this.formData[0].data.find(
(item) => item.key === 'partNumber'
).component.options = res.items
})
},
// inputChange (query) {
// if (query.length > 5) {
// this.searchWTPartByKeyword(query)
// // this.debounce()
// }
// },
onSubmit (v) {
this.form = v
},
// 防抖
debounce (fn, delay = 200) {
let timer = 0
return function () {
// 如果这个函数已经被触发了
if (timer) {
clearTimeout(timer)
}
timer = setTimeout(() => {
fn.apply(this, arguments) // 透传 this和参数
timer = 0
}, delay)
}
}
}
}
</script>
<style lang="scss">
.ebomStructure {
padding-top: 55px;
overflow: hidden;
.ebomStructure-scroll {
height: calc(100vh - 75px);
overflow: auto;
}
.van-cell::after {
border: none;
}
.searchModel {
padding: 20px;
display: flex;
::v-deep .van-cell {
border: 0px;
}
.searchForm {
flex: 1;
.select-input {
.van-field__label {
width: 40px;
}
}
}
.searchButton {
padding: 0 10px;
.van-button {
margin-right: 10px;
}
}
}
.searchTree {
.van-tab--active {
color: #1b77ea;
}
.van-tabs__line {
background: linear-gradient(207deg, #68b7f6 0%, #5baaf2 100%);
}
}
}
</style>
<template>
<div class="info-detail">
<van-tabs v-model="activeTab" @change="tabChanged">
<van-tab
v-for="item in tabs"
:key="item.key"
:name="item.key"
:title="item.title"
>
<dee-form
v-if="activeTab === 'baseInfo' || activeTab === 'baseInfoDetail'"
:form="form"
:form-data="formData"
/>
<div v-if="activeTab === 'pdf'" class="pdf-detail">
<pdf :basicData="form" />
</div>
</van-tab>
</van-tabs>
</div>
</template>
<script>
import Pdf from '@/components/pdf/index'
import { getInstancePbo, getLayOut, getDictListByCode } from '@/api/taskDetail'
import DeeForm from '@/components/form/form'
export default {
components: {
Pdf,
DeeForm
},
data () {
return {
activeTab: null,
tabs: [
{ title: '基本信息', key: 'baseInfoDetail' },
{ title: '浏览', key: 'pdf' }
],
dxContentItems: {},
url: '',
form: {},
formData: [
// {
// title: '基本属性',
// split: 1,
// data: [
// {
// title: '名称',
// key: 'name',
// isBase: true,
// component: {
// name: 'readable',
// isStandard: true,
// disabled: true
// }
// }
// ]
// }
]
}
},
created () {
},
mounted () {
this.getFormData()
this.getForm()
},
methods: {
async getForm () {
let id = ''
await getInstancePbo(this.$route.query.oid).then((res) => {
id = res.items.id
})
const params = {
pageFrom: 1,
pageSize: 1,
searchItems: { items: [{ fieldName: 'id', operator: 'EQ', value: id }] },
sortItem: [{ fieldName: 'modifyTime', sortOrder: 'asc' }],
openProps: [{ name: 'objFileLinks', pageFrom: 1, pageSize: 9999, openProps: [{ name: 'target', pageFrom: 1, pageSize: 9999 }] }]
}
await this.$api.searchApi(this.$route.query.dxClassname, params).then((res) => {
this.$set(this, 'form', res.items.content[0])
})
},
getFormData () {
getLayOut({ modelDefName: this.$route.query.dxClassname, layoutType: 'defaultView' }).then((res) => {
if (res.items.content.length) {
const jsonparse = JSON.parse(res.items.content[0].configDetails)
console.log('jsonparse', jsonparse)
jsonparse.formData.forEach(item => {
if (item.title && item.title !== '关联文档') {
this.formData.push(item)
}
})
console.log('jsonparse', [...this.formData])
}
})
},
tabChanged () {
}
}
}
</script>
<style lang='scss'>
.info-detail {
overflow-y: hidden;
height: 100%;
width: 100%;
.van-tabs {
height: 100%;
}
.van-tabs__wrap {
height: 50px;
}
.van-tabs__content {
height: calc(100% - 50px);
overflow-y: auto;
}
.van-tab--active {
color: #1b77ea;
}
.van-tabs__line {
background: linear-gradient(207deg, #68b7f6 0%, #5baaf2 100%);
}
.data-detail {
width: 100%;
.van-row {
width: 100%;
}
.sub-content {
text-align: center;
}
.van-row .van-col a {
font-size: 14px;
line-height: 14px;
height: 14px;
padding: 20px;
}
/*.prompt-text {*/
/* font-size: 12px;*/
/* color: red;*/
/* // background: ;*/
/* padding: 20px 10px;*/
/*}*/
.right {
text-align: right;
}
.center {
font-size: 20px;
}
// .van-cell__title {
// margin-right: 30px;
// }
.van-col-class .van-cell {
background: #f5f9fc;
margin-bottom: 10px;
border-radius: 8px;
font-size: 12px;
}
.van-col-class {
padding: 20px;
}
.van-col-span {
width: 60px;
box-sizing: border-box;
display: inline-block;
text-align: justify;
text-align-last: justify;
vertical-align: middle; /*保证文字和input框上下是对齐的*/
padding-right: 8px;
}
}
.van-icon-arrow {
display: none;
}
}
</style>
/**
* @Description: MBOM结构树
* @author faker
* @date 2022-05-18
* @FilePath: src/views/MbomStructure/index.vue
*/
<template>
<div class="mbomStructure">
<header-nav-bar :title="title" left-arrow @click-left="onClickLeft" />
<div class="mbom-container">
<div class="searchModel">
<dee-form class="searchForm" :form="form" :form-data="formData" />
<div class="searchButton">
<van-button type="info" size="small" @click="search">查询</van-button>
</div>
</div>
<div class="searchTree">
<van-tabs>
<van-tab :title="tabTitle">
<tree
:data="treeData"
:type="'MBOM'"
lazy
:props="{
children: 'children',
label: 'label',
isLeaf: 'leaf',
}"
node-key="oid"
:load="loadNode"
:highlight-current="true"
:expand-on-click-node="false"
@node-click="handleNodeClick"
>
<div slot-scope="{ node, data }">
<span>
<!-- <img :src="dynamicIcon(data)" style="width: 18px;vertical-align: bottom;" alt=""> -->
<span class="changeText">{{ data.nodeName }}</span>
</span>
</div>
</tree>
</van-tab>
</van-tabs>
</div>
</div>
</div>
</template>
<script>
import HeaderNavBar from '../../components/headerNavBar/index.vue'
import DeeForm from '../../components/form/form'
import Tree from '../../components/tree/index.vue'
import moment from 'moment'
import { searchMBOMRoot, getMBOMChildren } from '../../api/taskDetail.js'
export default {
props: {},
components: { HeaderNavBar, DeeForm, Tree },
data () {
return {
form: {},
formData: [
{
data: [
{
title: '编号',
key: 'number',
component: {
name: 'el-input',
placeholder: '请输入编号',
clearable: true,
border: true
}
}
]
}
],
tabTitle: 'MBOM结构树',
treeData: [],
treeDataCopy: {},
subTitle: 'MBOM'
}
},
created () {
this.searchMBOMRoot()
},
mounted () {
// this.searchMBOMRoot()
},
computed: {
title () {
return this.$route.query.title || ''
}
},
methods: {
onClickLeft () {
history.back(-1)
},
search () {
this.searchMBOMRoot()
},
async searchMBOMRoot () {
this.loading = true
this.treeData = []
await searchMBOMRoot(this.form)
.then(async (res) => {
this.loading = false
this.treeData = [res.items]
// this.setBgColor(this.treeData)
console.log(this.treeData)
})
.catch((e) => {
this.loading = false
})
},
async loadNode (node, resolve) {
if (!Object.keys(node.data).length) return
const params = {
oid: node.data.oid,
numberPath: node.data.numberPath,
topOid: node.data.topOid,
casOid: node.data.casOid
}
params.baselineOids = node.data.baselineOids || []
params.aolOid = node.data.aolOid || ''
params.dslOid = node.data.dslOid || ''
await getMBOMChildren(params)
.then((res) => {
// this.setBgColor(res.items)
// this.treeDataCopy = this.$utils.deepClone(res.items)
return resolve(res.items)
})
.catch((e) => {
return resolve([])
})
},
// async getMBOMNodeType (id) {
// const params = this.$utils.formDataParams({ oid: id })
// await getMBOMNodeType(params).then(res => {
// this.subTitle = res.items
// }).catch(e => {
// console.log(e)
// })
// },
handleNodeClick (data, node) {
this.$router.push({
path: `/bomTreeDetail-${data.oid}`,
query: {
oid: data.oid,
title: this.subTitle,
time: moment().valueOf()
}
})
}
}
}
</script>
<style lang="scss">
.mbomStructure {
overflow: hidden;
.mbom-container {
height: calc(100vh - 75px);
overflow: auto;
}
.searchModel {
padding: 20% 0.625rem 1rem 0.625rem;
display: flex;
.searchForm {
flex: 1;
}
.searchButton {
padding: 0 1rem;
}
}
.searchTree {
.van-tab--active {
color: #1b77ea;
}
.van-tabs__line {
background: linear-gradient(207deg, #68b7f6 0%, #5baaf2 100%);
}
}
}
</style>
<template>
<div class="pbomStructure">
<header-nav-bar
:title="title"
left-arrow
@click-left="onClickLeft"
/>
<header-nav-bar :title="title" left-arrow @click-left="onClickLeft" />
<div class="pbom-container">
<div
class="searchModel"
ref="searchModel"
>
<div class="searchModel" ref="searchModel">
<dee-form
class="searchForm"
:form="form"
......@@ -17,11 +10,7 @@
@handleSubmit="handleSubmit"
/>
<div class="searchButton">
<van-button
type="info"
size="small"
@click="search"
>查询</van-button>
<van-button type="info" size="small" @click="search">查询</van-button>
<van-button
plain
hairline
......@@ -32,10 +21,7 @@
></van-button>
</div>
</div>
<div
ref="searchList"
class="search-list"
>
<div ref="searchList" class="search-list">
<van-list
v-model="loading"
:finished="finished"
......@@ -50,25 +36,19 @@
>
<div class="itemTitle">
<!-- <van-image :src="require('@/assets/home/new@2x.png')" /> -->
<div
v-if="item.state === 1"
class="message-keep-px unread"
>
<div v-if="item.state === 1" class="message-keep-px unread">
<span>未读</span>
</div>
<div
v-else
class="message-keep-px read"
>
<div v-else class="message-keep-px read">
<span>已读</span>
</div>
<span class="text">{{ item.title }}</span>
<span class="itemTitle-time">{{ item.sender }}</span>
</div>
<div class="content">
<span class="title"> {{ item.sendTime }} </span>
<div class="time">
<van-icon name="arrow" />
<span class="itemTitle-time">{{ item.sender }}</span>
<!-- <van-icon name="arrow" /> -->
</div>
</div>
</div>
......@@ -87,7 +67,7 @@ import { searchMsg } from '@/api/home'
export default {
props: {},
components: { HeaderNavBar, DeeForm },
data() {
data () {
return {
iconButton: 'arrow-up',
form: {},
......@@ -142,41 +122,41 @@ export default {
finished: false,
curr: 1,
date: null,
show: false,
show: false
}
},
created() {
created () {
},
mounted() { },
mounted () { },
computed: {
title() {
title () {
return this.$route.query.title || ''
}
},
methods: {
onConfirm() { },
onClickLeft() {
onConfirm () { },
onClickLeft () {
history.back(-1)
},
search() {
search () {
this.list = []
this.curr = 1
this.loading = true
this.onLoad()
},
handleSubmit(params) {
handleSubmit (params) {
this.form = Object.assign(this.form, params)
},
onLoad() {
onLoad () {
const searchParams = {
'operator': 'AND',
'items': [
operator: 'AND',
items: [
{
fieldName: 'receiver',
operator: 'EQ',
value: localStorage.getItem('userId')
},
}
// {
// fieldName: 'type',
// operator: 'EQ',
......@@ -185,30 +165,35 @@ export default {
]
}
this.form.title && searchParams.items.push({
'fieldName': 'title',
'operator': 'LIKE',
'value': this.form.title
fieldName: 'title',
operator: 'LIKE',
value: this.form.title
})
typeof this.form.state === 'number' && !isNaN(this.form.state) && searchParams.items.push({
'fieldName': 'state',
'operator': 'EQ',
'value': this.form.state
fieldName: 'state',
operator: 'EQ',
value: this.form.state
})
this.form.time && searchParams.items.push({
'fieldName': 'sendTime',
'operator': 'BTWN',
'value': this.form.time.split(' 至 ')[0] + ' 00:00:00',
'value1': this.form.time.split(' 至 ')[1] + ' 00:00:00'
fieldName: 'sendTime',
operator: 'BTWN',
value: this.form.time.split(' 至 ')[0] + ' 00:00:00',
value1: this.form.time.split(' 至 ')[1] + ' 00:00:00'
})
const params = {
pageFrom: this.curr,
pageSize: 10,
'sortItem': [{ 'fieldName': 'sendTime', 'sortOrder': 'desc' }],
'searchItems': searchParams
sortItem: [{ fieldName: 'sendTime', sortOrder: 'desc' }],
searchItems: searchParams
}
searchMsg(params).then(res => {
const items = res.items
this.list = [...this.list, ...items.content];
// this.list = [...this.list, ...items.content]
// 将数据排序未读的放在前面
const unRead = items.content.filter(item => item.state === 1)
const read = items.content.filter(item => item.state === 0)
this.list.unshift(...unRead)
this.list.push(...read)
this.loading = false
if (items.totalPages === this.curr || items.totalElements === 0) {
this.finished = true
......@@ -216,7 +201,7 @@ export default {
this.curr++
})
},
hiddenTop() {
hiddenTop () {
if (this.iconButton === 'arrow-down') {
this.$refs.searchModel.style.height = '90px'
this.$refs.searchModel.style.transitionDuration = '.5s'
......@@ -228,7 +213,7 @@ export default {
this.$refs.searchList.style.height = 'calc(100vh - 190px)'
this.$refs.searchModel.style.transitionDuration = '.5s'
this.iconButton = 'arrow-down'
},
}
}
}
</script>
......@@ -241,7 +226,7 @@ export default {
overflow: hidden;
}
.searchModel {
padding: 20% 0.625rem 1rem 0.625rem;
padding: 10px 0.625rem 1rem 0.625rem;
display: flex;
overflow: hidden;
.searchForm {
......@@ -332,4 +317,4 @@ export default {
}
}
}
</style>
\ No newline at end of file
</style>
/**
* @Description: PBOM结构树
* @author faker
* @date 2022-05-18
* @FilePath: src/views/PbomStructure/index.vue
*/
<template>
<div class="pbomStructure">
<header-nav-bar :title="title" left-arrow @click-left="onClickLeft" />
<div class="pbom-container">
<div class="searchModel" ref="searchModel">
<dee-form
class="searchForm"
:form="form"
:form-data="formData"
@handleSubmit="handleSubmit"
/>
<div class="searchButton">
<van-button type="info" size="small" @click="search">查询</van-button>
<van-button
plain
hairline
type="info"
size="small"
@click="hiddenTop"
:icon="iconButton"
></van-button>
</div>
</div>
<div class="searchTree">
<van-tabs v-model="activeTab">
<van-tab
v-for="item in tabs"
:key="item.key"
:name="item.key"
:title="item.title"
>
<tree
:data="treeData"
:type="'PBOM'"
lazy
:props="{
children: 'children',
label: 'label',
isLeaf: 'leaf',
}"
node-key="oid"
:load="loadNode"
:highlight-current="true"
:expand-on-click-node="false"
@node-click="handleNodeClick"
>
<div slot-scope="{ node, data }">
<span>
<!-- <img :src="dynamicIcon(data)" style="width: 14px;vertical-align: bottom;margin-right: 5px" alt=""> -->
<span class="changeText">{{ data.nodeName }}</span>
</span>
</div>
</tree>
</van-tab>
</van-tabs>
</div>
</div>
</div>
</template>
<script>
import HeaderNavBar from '../../components/headerNavBar/index.vue'
import DeeForm from '../../components/form/form'
import Tree from '../../components/tree/index.vue'
import { searchPBOMRoot, getPBOMChildren } from '../../api/taskDetail.js'
import moment from 'moment'
export default {
props: {},
components: { HeaderNavBar, DeeForm, Tree },
data () {
return {
iconButton: 'arrow-up',
form: {},
formData: [
{
data: [
{
title: '编号',
key: 'number',
component: {
name: 'el-input',
placeholder: '请输入编号',
clearable: true,
border: true
}
},
{
title: '架次',
key: 'effectiveness',
component: {
name: 'el-input',
placeholder: '请输入架次',
clearable: true,
border: true
}
},
{
title: '供应商',
key: 'supplier',
component: {
name: 'el-input',
placeholder: '请输入供应商',
clearable: true,
border: true
}
}
]
}
],
tabs: [{ title: 'PBOM结构树', key: 'mainViewSearch' }],
treeData: [],
activeTab: '',
searchInterface: {},
subTitle: 'PBOM'
}
},
created () {
this.searchPBOMRoot()
},
mounted () {},
computed: {
title () {
return this.$route.query.title || ''
}
},
methods: {
hiddenTop () {
if (this.iconButton === 'arrow-down') {
this.$refs.searchModel.style.height = '90px'
this.$refs.searchModel.style.transitionDuration = '.5s'
this.iconButton = 'arrow-up'
return
}
this.$refs.searchModel.style.height = '23px'
this.$refs.searchModel.style.transitionDuration = '.5s'
this.iconButton = 'arrow-down'
},
handleSubmit (params) {
this.form = Object.assign(this.form, params)
console.log(this.form)
},
onClickLeft () {
history.back(-1)
},
search () {
this.searchPBOMRoot()
},
async searchPBOMRoot () {
this.loading = true
this.treeData = []
await searchPBOMRoot(this.form)
.then(async (res) => {
this.loading = false
this.treeData = [res.items]
// this.setBgColor(this.treeData)
})
.catch((e) => {
this.loading = false
})
},
async loadNode (node, resolve) {
if (!Object.keys(node.data).length) return
const params = {
oid: node.data.oid,
numberPath: node.data.numberPath,
wpOid: node.data.wpOid,
wpaOid: node.data.wpaOid,
dsNumber: node.data.dsNumber,
wpaPath: node.data.wpaPath
}
await getPBOMChildren(params)
.then((res) => {
// this.setBgColor(res.items)
return resolve(res.items)
})
.catch((e) => {
return resolve([])
})
},
handleNodeClick (data, node) {
let subTitle = this.subTitle
if (data.nodeType === '机载设备') {
subTitle = subTitle + '底层'
}
if (data.nodeType === '自制件') {
subTitle = subTitle + '自制件'
if (data.number.substr(0, 1) === 'R') {
subTitle = subTitle + 'R'
}
}
if (data.nodeType === 'A类工作包') {
subTitle = subTitle + 'A类工作包'
}
this.$router.push({
path: `/bomTreeDetail-${data.oid}`,
query: {
oid: data.oid,
title: subTitle,
time: moment().valueOf()
}
})
}
}
}
</script>
<style lang="scss">
.pbomStructure {
overflow: hidden;
.pbom-container {
height: calc(100vh - 75px);
overflow: auto;
}
.searchModel {
padding: 20% 0.625rem 1rem 0.625rem;
display: flex;
.searchForm {
flex: 1;
}
.searchButton {
padding: 0 10px;
.van-button {
margin-right: 10px;
}
}
}
.van-input-select .van-cell__title {
width: 70px;
}
.searchTree {
.van-tab--active {
color: #1b77ea;
}
.van-tabs__line {
background: linear-gradient(207deg, #68b7f6 0%, #5baaf2 100%);
}
}
}
</style>
......@@ -82,7 +82,6 @@ export default {
resolve(false)
})
}).catch(() => {
this.$utils.showMessage('请选择是否归档!', 'warning')
resolve(false)
})
})
......
<template>
<div class="dee-flowDxDocumentAttrsEditWhetherApplied">
<dee-form
ref="taskForm"
:form="form"
:form-data="formData"
:rules="rules"
/>
<span v-if="form.whetherApplied === 'true'" class="pc-tips"
>请到PC端上传附件</span
>
</div>
</template>
<script>
import DeeForm from '@/components/form/form'
export default {
props: {
basicData: {
type: Object,
require: true
},
flowData: {
type: Object,
require: true
}
},
components: {
DeeForm
},
data () {
return {
form: {
whetherApplied: 'false'
},
formData: [
{
data: [
{
title: '是否增加608所封面',
key: 'whetherApplied',
component: {
name: 'el-radio',
disabled: false,
options: [
{
value: 'true',
label: '是'
},
{
value: 'false',
label: '否'
}
]
}
}
]
}
],
rules: {
whetherApplied: [{ required: true, message: '请选择', trigger: 'blur' }]
},
selectRadio: null
}
},
created () { },
mounted () { },
methods: {
validate () {
if (this.form.whetherApplied === 'true') {
return this.$utils.showMessage('请在PC端增加608所封面', 'warning')
}
return new Promise((resolve, reject) => {
this.$refs.taskForm.$refs.form.validate().then(() => {
const form = { ...this.flowData, ...this.form, operator: 'MODIFY' }
this.$api
.recursion('DxDocument', form)
.then((res) => {
if (res) {
resolve(true)
}
})
.catch(() => {
resolve(false)
})
}).catch(() => {
resolve(false)
})
})
}
}
}
</script>
<style lang='scss' scoped>
.dee-flowDxDocumentAttrsEditWhetherApplied {
margin: 0 10px;
.custom-image .van-empty__image {
width: 90px;
height: 90px;
}
.pc-tips {
color: #999;
font-size: 12px;
margin-top: 10px;
margin-left: 20px;
}
}
</style>
<template>
<div class="dee-flowDxDocumentEditReplyComments">
<dee-form
ref="flowDxDocumentEditReplyComments"
:form="form"
:form-data="formData"
/>
<span class="pc-tips">请到PC端上传附件</span>
<!-- <UploadObjFileLinks
:basicData="basicData"
:flowData="flowData"
></UploadObjFileLinks> -->
</div>
</template>
<script>
import DeeForm from '@/components/form/form'
import UploadObjFileLinks from './uploadObjFileLinks.vue'
export default {
props: {
basicData: {
type: Object,
require: true
},
flowData: {
type: Object,
require: true
}
},
components: {
DeeForm,
UploadObjFileLinks
},
data () {
return {
form: {},
formData: [
{
data: [
{
// dynamicAttrs.replyComments 答复意见 objFileLinks附件
title: '答复意见',
key: 'dynamicAttrs.replyComments',
component: {
name: 'el-input',
type: 'textarea'
}
}
]
}
],
selectRadio: null
}
},
watch: {
},
created () { },
mounted () { },
methods: {
validate () {
return new Promise((resolve, reject) => {
this.$refs.secretConfirmForm.$refs.form.validate().then(() => {
resolve(true)
}).catch(() => {
resolve(false)
})
})
}
}
}
</script>
<style lang='scss'>
.dee-flowDxDocumentEditReplyComments {
margin: 0 10px;
textarea {
border: 0.5px;
border-radius: 5px;
background-color: rgba(241, 241, 241, 0.5);
padding: 5px;
resize: none;
}
.pc-tips {
color: #999;
font-size: 12px;
margin-top: 10px;
margin-left: 20px;
}
}
</style>
/**
* @Description: DS实物部件审签-上传会签附件
* @author xioln
* @date 2022-06-02
* @FilePath: src/views/busniessComponents/workFlowTask/uploadSignAttachment/index.vue
*/
<template>
<div class="upload-signAttachment">
<div class="sub-title">上传会签附件</div>
<div class="upload-objFileLinks">
<div class="sub-title">附件</div>
<van-uploader
v-model="fileList"
:after-read="afterRead"
......@@ -17,9 +11,19 @@
</div>
</template>
<script>
import { addWorkItemAttachment } from '@/api/taskDetail'
import { addWorkItemAttachment, uploadPartPrepare, findByCondition } from '@/api/taskDetail'
export default {
props: {
basicData: {
type: Object,
require: true
},
flowData: {
type: Object,
require: true
}
},
components: {},
data () {
return {
......@@ -29,14 +33,33 @@ export default {
computed: {},
created () {
// 初始化数据
console.log('basicData', { ...this.basicData })
console.log('flowData', { ...this.flowData })
this.getObjFile()
},
methods: {
getObjFile () {
const params = {
searchItems: {
operator: 'AND',
items: [{
fieldName: 'innerName',
operator: 'EQ',
value: 'dcs-doc'
}]
}
}
findByCondition(params).then(res => {
console.log('res', res.items)
})
},
afterRead (file) {
// 此时可以自行将文件上传至服务器
// this.fileList.push(file)
console.log(file)
},
uploadRes (res) {
console.log('res', res)
this.fileName = res.items.substring(res.items.lastIndexOf('/') + 1, res.items.length)
this.addWorkItemAttachment(res.items, this.fileName)
},
......@@ -58,9 +81,10 @@ export default {
}
</script>
<style lang='scss'>
.upload-signAttachment {
.upload-objFileLinks {
.sub-title {
margin: 15px 0 10px 25px;
font-weight: normal;
}
.van-uploader {
margin: 10px 0 10px 25px;
......
<template>
<div class="dee-flowSecretConfirm">
<dee-form
ref="secretConfirmForm"
:form="secretConfirmForm"
:form-data="formData"
:rules="rules"
/>
</div>
</template>
<script>
import DeeForm from '@/components/form/form'
export default {
props: {
basicData: {
type: Object,
require: true
}
},
components: {
DeeForm
},
data () {
return {
secretConfirmForm: {
secretConfirm: null
},
formData: [
{
data: [
{
title: '密级已确认,且不涉及国家秘密',
key: 'secretConfirm',
component: {
name: 'el-radio',
disabled: false,
options: [
{
value: 'true',
label: '是'
},
{
value: 'false',
label: '否'
}
]
}
}
]
}
],
rules: {
secretConfirm: [{ required: true, message: '请审核密级', trigger: 'change' }]
},
selectRadio: null
}
},
watch: {
'secretConfirmForm.secretConfirm': {
handler (val) {
if (val === 'true') {
// 选择是,可任意选择通过、退回
this.$bus.$emit('selectSecretConfirm', true)
} else {
// 选择否,只能选择退回,不能勾选通过
this.$bus.$emit('selectSecretConfirm', false)
}
}
// immediate: true
}
},
created () { },
mounted () { },
methods: {
validate () {
return new Promise((resolve, reject) => {
this.$refs.secretConfirmForm.$refs.form.validate().then(() => {
resolve(true)
}).catch(() => {
resolve(false)
})
})
}
}
}
</script>
<style lang='scss' scoped>
.dee-flowSecretConfirm {
margin: 0 10px;
.custom-image .van-empty__image {
width: 90px;
height: 90px;
}
}
</style>
......@@ -8,7 +8,6 @@
:form="form"
:rules="rules"
:form-data="taskParticipationData"
@inputChange="inputChange"
/>
<van-empty
v-if="taskParticipationData[0].data.length <= 0 && !showLoading"
......
......@@ -11,7 +11,11 @@ export default {
props: {
basicData: {
type: Object,
default: () => {}
require: true
},
flowData: {
type: Object,
require: true
}
},
components: { DeeForm },
......@@ -24,10 +28,10 @@ export default {
watch: {
basicData: {
handler: function (val) {
// this.$set(this, 'form', form)
this.initData(val)
},
immediate: true
// immediate: true,
deep: true
}
},
created () {
......@@ -43,16 +47,18 @@ export default {
methods: {
initData (data) {
const x = this.basicData
console.log('this.flowData?.dxClassname', this.flowData.dxClassname)
const dxClassname = this.flowData?.dxClassname.split('vo.')[1]?.slice(0, -2)
const formItemData = []
formItemData.push({
title: '任务对象',
key: 'taskTitle',
component: {
name: 'Link',
url: `/bomTreeDetail-${x.id}`
// oid: x.id,
// subTypeName: x.businessName,
// dxClassName: x.name,
url: `/InfoDetail-${x.id}`,
title: x.taskTitle,
oid: x.processInstanceId,
dxClassname: dxClassname
// title: res?.items.businessStatus
}
}, {
......
......@@ -2,15 +2,17 @@
<div class="task-btn">
<!-- <van-button type="info" round size="small" @click="reassign">重新指派</van-button>
<van-button type="info" round size="small" @click="finishTask">完成任务</van-button> -->
<van-button type="default" size="small" round @click="reassign">
重新指派
</van-button>
<van-button
type="default"
type="info"
:loading="comLoading"
size="small"
round
@click="reassign"
@click="finishTask"
>完成任务</van-button
>
重新指派
</van-button>
<van-button type="info" size="small" round @click="finishTask">完成任务</van-button>
</div>
</template>
<script>
......@@ -23,16 +25,17 @@ export default {
},
data () {
return {
comLoading: false
}
},
created () {},
mounted () {},
created () { },
mounted () { },
methods: {
reassign () {
console.log('重新指派!')
},
finishTask () {
this.comLoading = true
// console.log(this.basicData)
this.$emit('finish-task')
}
......@@ -40,7 +43,7 @@ export default {
}
</script>
<style lang="scss">
.task-btn .van-button{
.task-btn .van-button {
margin-right: 1rem;
}
.task-btn {
......
......@@ -27,7 +27,7 @@ export default {
}
},
components: { DeeForm },
data() {
data () {
return {
form: {},
formData: [
......@@ -66,21 +66,37 @@ export default {
'basicData.routes': {
deep: true,
// immediate: true,
handler(oldVal, newVal) {
handler (oldVal, newVal) {
this.$nextTick(() => {
this.init(newVal)
})
}
}
},
created() {
created () {
},
mounted() {
mounted () {
this.$bus.$on('selectSecretConfirm', (val) => {
if (val) {
this.$set(
this.formData[0].data[0].component,
'options',
this.formartData(this.basicData?.routes)
)
} else {
this.$set(
this.formData[0].data[0].component,
'options',
this.formartData(this.basicData?.routes).filter((item) => {
return item.label !== '通过'
})
)
}
})
},
computed: {},
methods: {
init() {
console.log('this.basicData', this.basicData)
init () {
if (this.basicData.routes) {
this.$set(
this.formData[0].data[0].component,
......@@ -91,7 +107,7 @@ export default {
this.formData[0].data.shift()
}
},
formartData(data) {
formartData (data) {
return data.map((item, i) => {
return {
value: item.name,
......@@ -100,7 +116,7 @@ export default {
}
})
},
checkData(val, name) {
checkData (val, name) {
this.$set(this, 'selectRoute', val)
this.$emit('selectRoute', val)
}
......
/**
* @Description: 传阅文件替换
* @author xioln
* @date 2022-07-12
* @FilePath: src/views/busniessComponents/workFlowTask/templeteNumberWriteTable/index.vue
*/
<template>
<div class="templete-number-write-table">
<van-row>
<van-col span="24" class="van-col-class">
<van-cell center title="仅传阅">
<template #title>
<span class="van-cell-title">仅传阅</span>
</template>
<template #right-icon>
<van-switch v-model="checked" size="24" @change="onlyCirculated"/>
</template>
</van-cell>
</van-col>
<van-col v-if="!checked" span="24">
<!-- <set-participant-with-role :basic-data="basicData" /> -->
</van-col>
<van-col v-else span="24">
<div class="sub-title">
<span>替换文件</span>
<van-button icon="down" type="info" size="mini" @click="downloadFile"
>下载 【{{fileLinkName}}】</van-button
>
</div>
<van-uploader
v-model="fileList"
:after-read="afterRead"
upload-icon="plus"
:max-count="1"
accept=".jpg,.gif,.png,.jpeg,.txt,.pdf,.doc,.docx,.xls,.xlsx"
multiple
/>
</van-col>
</van-row>
</div>
</template>
<script>
import { getOnlyDistribute, updatePrimaryContent, getPrimaryContentLink, setOnlyDistribute } from '@/api/taskDetail'
// import SetParticipantWithRole from '@/views/busniessComponents/workFlowTask/setParticipantWithRole/index.vue'
import { post } from '@/utils/http'
export default {
name: 'TempleteNumberWriteTable', // name写在组件的最前方,自定义组件为必填
components: { },
props: {
basicData: {
type: Object,
required: true
}
},
data () {
return {
checked: false,
fileList: [],
fileLinkName: '',
deputyContentUploadProp: {
url: `${this.$store.state.user.urlBaseApi}/extRest/uploadFile`,
multiple: false,
showFileList: false
}
}
},
computed: {},
created () {
// 初始化数据
this.getOnlyDistribute()
},
methods: {
getOnlyDistribute () {
getOnlyDistribute({ workItemOid: this.basicData.items.id }).then(res => {
if (res.code === 0) {
if (res.items) {
this.checked = res.items
this.getPrimaryContentLink()
}
} else {
this.$utils.showMessage(res.message, 'error')
}
}).catch(e => {
this.$utils.showMessage('获取仅传阅失败,请联系系统管理员!', 'error')
})
},
afterRead (file) {
const formData = new FormData()
formData.append('file', file.file)
post(this.deputyContentUploadProp.url, formData).then(x => {
const fileNamePrefix = x.items
this.updatePrimaryContent(fileNamePrefix)
}).catch(e => {
this.$utils.showMessage('失败,请联系系统管理员!', 'error')
})
},
uploadRes (res) {
this.fileName = res.items.substring(
res.items.lastIndexOf('/') + 1,
res.items.length
)
this.updatePrimaryContent(res.items, this.fileName)
},
getPrimaryContentLink () {
getPrimaryContentLink({ oid: this.basicData.items.id }).then((res) => {
if (res.items) {
this.fileLinkName = res.items.label
this.downloadFileUrl = res.items.url
}
})
},
updatePrimaryContent (fileUrl, fileName) {
const formData = new FormData()
formData.append('oid', this.basicData.items.id)
formData.append('primaryContent', fileUrl)
updatePrimaryContent(formData).then((res) => {
// this.fileLinkName = fileName
// this.uploadFileName = fileName
// this.disabled = true
})
},
downloadFile () {
const url = `/api/documents/attachments/download?fileName=${
this.fileLinkName
}&url=${encodeURIComponent(this.downloadFileUrl)}`
// this.$utils.downLoadFileUrl(url, this.fileLinkName)
this.$utils.downLoad(url, this.fileLinkName)
},
onlyCirculated (val) {
setOnlyDistribute({
workItemOid: this.basicData.items.id,
onlyDistribute: val
}).then(res => {
console.log(res)
})
}
}
}
</script>
<style lang='scss' scoped>
.templete-number-write-table {
padding: 10px 15px;
.sub-title {
text-align: left;
border: none;
font-size: 14px;
// margin-bottom: 10px;
padding: 10px 20px;
&:after {
border: none;
}
}
.sub-title > .van-button {
vertical-align: middle;
margin-left: 10px;
}
.van-cell-title {
font-size: 16px;
font-weight: bold;
text-align: right;
}
.van-uploader {
padding: 10px 20px;
}
}
</style>
......@@ -2,7 +2,11 @@
<div class="taskDetails">
<headerNavBar title="任务详情" @click-left="onClickLeft" />
<div class="taskBasicInfo">
<task-basic-info :basicData="basicData" />
<task-basic-info
v-if="basicData && form"
:basicData="basicData"
:flowData="form"
/>
</div>
<div class="task">
<van-tabs v-model="active" swipeable>
......@@ -36,7 +40,11 @@
!['器材代用', '不合格品'].includes($route.query.title)
"
>
<task-btn :basicData="basicData" @finish-task="finishTask"></task-btn>
<task-btn
ref="taskBtnRef"
:basicData="basicData"
@finish-task="finishTask"
></task-btn>
</div>
</div>
</template>
......@@ -82,7 +90,8 @@ export default {
formTask: {},
active: '',
selectRoute: null,
form: {}
form: {},
participants: {}
}
},
created () {
......@@ -126,12 +135,12 @@ export default {
goHome () { },
async initData () {
this.componentsShow = true
this.getForm()
await this.getForm()
await getTaskDetail(this.$route.query.id).then((res) => {
this.$set(this, 'basicData', res.items)
res.items.formInfo &&
res.items.formInfo.forEach((item) => {
if (item.configName) {
if (item.configName && !item.configName.includes('DeeFlowCheckItems')) {
this.dynamicComponents.push(item.configName.split('/')[1])
}
})
......@@ -174,7 +183,7 @@ export default {
let vlot = false
this.dynamicComponents.forEach(item => {
const refCom = this.$refs[item]
this.basicData.formInfo.forEach(x => {
this.basicData.formInfo && this.basicData.formInfo.forEach(x => {
if (x.configName.includes(item) && x.comType === 'privateComponent' && (!refCom || !refCom[0])) {
vlot = true
}
......@@ -187,23 +196,35 @@ export default {
})
if (vlot) {
this.$utils.showMessage('请填写必填项', 'warning')
this.$refs.taskBtnRef.comLoading = false
return
}
if (this.dynamicComponents.includes('GetParticipant') && !this.participants) {
this.$utils.showMessage('请设置参与者', 'warning')
return
this.dynamicComponents.forEach(item => {
const refCom = this.$refs[item]
if (refCom && 'validate' in refCom[0]) {
refCom[0] && refCom[0].validate()
this.$refs.taskBtnRef.comLoading = false
}
})
if (this.dynamicComponents.includes('GetParticipant')) {
const participants = { ...this.participant }
Object.keys(participants) && Object.keys(participants).forEach(key => {
if (participants[key].length === 0) {
delete participants[key]
}
})
if (!participants) {
this.$utils.showMessage('请设置参与者', 'warning')
this.$refs.taskBtnRef.comLoading = false
return
}
this.participants = participants
}
Promise.all(validateArray).then(asd => {
// this.completeTask()
})
},
completeTask () {
const participants = { ...this.participant }
Object.keys(participants).forEach(key => {
if (participants[key].length === 0) {
delete participants[key]
}
})
const taskDetailHandleFrom = this.$refs.taskDetailHandle[0].form
const vote = []
let desc = ''
......@@ -216,7 +237,7 @@ export default {
id: this.basicData.id,
operationName: 'completeTask',
operator: this.basicData.assignee,
participants: this.participant,
participants: this.participants,
processDefinitionId: this.basicData.processDefinitionId,
processInstId: this.basicData.processInstanceId,
routerSelect: taskDetailHandleFrom.radio,
......@@ -230,7 +251,8 @@ export default {
type: 'success',
message: res.message,
onOpened: () => {
sessionStorage.setItem('finishWork', true)
// sessionStorage.setItem('finishWork', true)
this.$refs.taskBtnRef.comLoading = false
this.$router.go(-1)
// if (this.todoListTitle.includes('待办')) {
// this.$router.push({
......@@ -244,7 +266,9 @@ export default {
}
})
})
.catch((e) => { })
.catch((e) => {
this.$refs.taskBtnRef.comLoading = false
})
}
}
}
......@@ -254,19 +278,18 @@ export default {
.taskDetails {
background: #f9f9f9;
overflow: hidden;
height: calc(100% - 115px);
.taskBasicInfo {
padding: 65px 0 0 0;
background: #fff;
box-sizing: border-box;
border-bottom: 1px solid #e1e2e4;
height: 250px;
height: 180px;
}
.task {
margin-top: 5x;
margin-bottom: 50px;
// border-top: 1px solid #E1E2E4;
box-sizing: border-box;
height: calc(100% - 420px);
height: calc(100% - 240px);
.van-tab--active {
color: #1b77ea;
}
......
/**
* @Description: 按分类查询
* @author xioln
* @date 2022-08-05
* @FilePath: src/views/documentCenter/components/classificationQuery.vue
*/
<template>
<div class="classification-query">
<tree
:data="treedata"
node-key="oid"
:expand-on-click-node="false"
:default-expanded-keys="[1]"
>
<span
slot-scope="{ node, data }"
class="custom-tree-node"
@click="handleNodeClick(data)"
>
<span>{{ data.kindName }}</span>
</span>
</tree>
</div>
</template>
<script>
import { Tree } from 'element-ui'
import { Notify } from 'vant'
import { retriveDocClassification } from '@/api/document.js'
export default {
name: 'ClassificationQuery', // name写在组件的最前方,自定义组件为必填
components: { Tree },
data () {
return {
treedata: [
{
kindName: '文件库',
oid: 1
}
]
}
},
computed: {},
created () {
// 初始化数据
this.showtree()
},
methods: {
showtree () {
// TODO: 调用接口 显示树结构
retriveDocClassification({ containerName: '' }).then((res) => {
if (res.code === 0) {
this.$set(this.treedata[0], 'children', res.items)
} else {
Notify({ type: 'success', message: res.message })
}
})
},
handleNodeClick (data) {
this.$router.push({
path: `/documentCenterDetail-${data.oid}`,
query: {
title: data.kindName,
fullKindName: data.fullKindName,
type: 'classificationQuery'
}
})
}
}
}
</script>
<style lang='scss'>
.classification-query {
overflow: auto;
padding: 10px;
.custom-tree-node {
display: inline-block;
vertical-align: middle;
}
.custom-tree-node::before {
content: " ";
display: inline-block;
vertical-align: middle;
height: 24px;
width: 24px;
background: url("../../../assets/document/filenode.png") no-repeat;
background-size: 100%;
}
}
</style>
This diff is collapsed.
/**
* @Description: tableCellH5表格
* @author xioln
* @date 2022-08-05
* @FilePath: src/views/documentCenter/components/tableCell.vue
*/
<template>
<div class="table-cell" ref="lazyCell" @scroll="isScrollBottom">
<van-cell is-link v-for="item in tableData" :key="item.id">
<template #title>
<van-col span="24" v-for="column in tableColumns" :key="column.title">
<van-col class="van-col-span" span="8">{{ column.title }}</van-col>
<van-col span="14" offset="1">{{
formatterData(column, item)
}}</van-col>
</van-col>
</template>
<template #right-icon>
<!-- <van-icon name="arrow" class="search-icon center" /> -->
</template>
</van-cell>
<van-loading v-if="showLoading" type="spinner" size="24px" vertical />
</div>
</template>
<script>
export default {
name: 'TableCell', // name写在组件的最前方,自定义组件为必填
props: {
tableColumns: {
type: Array,
required: true
},
tableData: {
type: Array,
required: true
}
},
components: {},
data () {
return {
showLoading: true
}
},
computed: {},
created () {
// 初始化数据
},
methods: {
visableLoading () {
this.showLoading = false
},
isScrollBottom () {
// 是否滚动到了底部
this.box = this.$refs.lazyCell
const clientHeight = this.box.clientHeight
const scrollTop = this.box.scrollTop
const scrollHeight = this.box.scrollHeight
if (Math.abs(scrollHeight - (scrollTop + clientHeight)) < 1) {
this.showLoading = true
this.$emit('turnPage')
}
},
formatterData (column, item) {
if (typeof column.formatter === 'function') {
return column.formatter(item)
}
return item[column.key]
}
}
}
</script>
<style lang='scss'>
.table-cell {
.van-cell__title {
margin-right: 30px;
}
.van-col-class .van-cell {
background: #f5f9fc;
margin-bottom: 60px;
border-radius: 8px;
font-size: 12px;
}
.van-col-class {
padding: 20px;
}
.van-col-class-download {
padding-bottom: 0px;
}
.van-col-span {
// width:95px;
font-weight: bold;
box-sizing: border-box;
display: inline-block;
text-align: justify;
text-align-last: justify;
vertical-align: middle; /*保证文字和input框上下是对齐的*/
}
.center {
margin-top: 0;
display: flex;
align-items: center;
}
.van-loading {
height: 40px;
margin-bottom: 5px;
}
}
</style>
/**
* @Description: 文档中心详情
* @author xioln
* @date 2022-08-05
* @FilePath: src/views/documentCenter/components/documentDetail.vue
*/
<template>
<div class="document-detail">
<header-nav-bar
:title="$route.query.title + '查询结果'"
left-arrow
@click-left="onClickLeft"
/>
<div class="document-detail-content">
<table-cell
ref="tableCell"
@turnPage="turnPage"
:tableColumns="tableColumns"
:tableData="tableData"
></table-cell>
</div>
<tabbar ref="tabbar"></tabbar>
</div>
</template>
<script>
import { getDocsByClassification, searchByKeyWords } from '@/api/document'
import HeaderNavBar from '@/components/headerNavBar'
import Tabbar from '@/views/tabbar/index'
import TableCell from '@/views/documentCenter/components/tableCell'
import moment from 'moment'
export default {
components: {
HeaderNavBar,
Tabbar,
TableCell
},
data () {
return {
pagination: {
currentPage: 1,
pageSize: 10,
count: null
},
docDataListView: [],
tableColumns: [
{
title: '编号',
key: 'code',
formatter (row, column) {
return row.number
}
},
{
title: '名称',
key: 'name'
},
{
title: '文件类型',
key: 'subTypeName',
formatter (row, column) {
return row.subTypeName.split('___')[1]
}
},
{
title: '状态',
key: 'state',
formatter (row, column) {
return row.state.display
}
},
{
title: '修改者',
key: 'modifier',
formatter (row, column) {
return `${row.modifier.fullName ? row.modifier.fullName : ''}${
row.modifier.name ? '(' + row.modifier.name + ')' : ''
}`
}
},
{
title: '上次修改时间',
key: 'modifyTime',
formatter (row, column) {
return moment(row.modifyTime).format('YYYY-MM-DD HH:mm:ss')
}
}
],
tableData: []
}
},
computed: {},
created () {
// 初始化数据
if (this.$route.query.type === 'conditionQueryParmas') {
this.searchByKeyWords()
} else {
this.getDocsByClassification()
}
},
methods: {
async turnPage () {
this.pagination.currentPage++
await this.getTableData()
this.$refs.tableCell.visableLoading()
},
getTableData () {
if (this.pagination.count / this.pagination.pageSize <= this.pagination.currentPage) return
if (this.$route.query.type === 'conditionQueryParmas') {
return this.searchByKeyWords()
} else {
return this.getDocsByClassification()
}
},
getDocsByClassification () {
return getDocsByClassification({
classificationPath: this.$route.query.fullKindName,
pageNO: this.pagination.currentPage,
pageSize: this.pagination.pageSize
}).then((res) => {
if (res.code === 0) {
this.pagination.count = res.items.totalCount
this.tableData.push(...res.items.pageData)
}
})
},
searchByKeyWords () {
const parmas = JSON.parse(sessionStorage.getItem('conditionQueryParmas'))
parmas.pageNO = this.pagination.currentPage
parmas.pageSize = this.pagination.pageSize
return searchByKeyWords(parmas).then(res => {
if (res.code === 0) {
this.pagination.count = res.items.totalCount
this.tableData.push(...res.items.pageData)
}
})
},
onClickLeft () {
history.back(-1)
}
}
}
</script>
<style lang='scss'>
.document-detail {
overflow: hidden;
.document-detail-content {
margin-top: 60px;
margin-bottom: 60px;
.table-cell {
overflow: auto;
height: calc(100vh - 120px);
}
}
}
</style>
/**
* @Description: 文档中心
* @author xioln
* @date 2022-08-05
* @FilePath: src/views/documentCenter/index.vue
*/
<template>
<div class="document-center">
<header-nav-bar :title="$route.name" left-arrow @click-left="onClickLeft" />
<div class="document-center-content">
<van-tabs v-model="activeTab">
<van-tab v-for="item in tabs" :title="item.value" :key="item.key">
<div class="document-center-content-tab">
<!-- 失活的组件将会被缓存!-->
<keep-alive>
<component :is="item.key"></component>
</keep-alive>
</div>
</van-tab>
</van-tabs>
</div>
</div>
</template>
<script>
import HeaderNavBar from '@/components/headerNavBar'
import Tree from '@/components/tree/index.vue'
import ConditionQuery from '@/views/documentCenter/components/conditionQuery'
import ClassificationQuery from '@/views/documentCenter/components/classificationQuery'
export default {
name: 'DocumentCenter', // name写在组件的最前方,自定义组件为必填
components: {
HeaderNavBar,
Tree,
ConditionQuery,
ClassificationQuery
},
data () {
return {
activeTab: '0',
tabs: [
// { key: 'conditionQuery', value: '按条件查询' },
{ key: 'classificationQuery', value: '按分类查询' }
]
}
},
computed: {
},
created () {
// 初始化数据
},
methods: {
onClickLeft () {
history.back(-1)
}
}
}
</script>
<style lang='scss'>
.document-center {
overflow: hidden;
.document-center-content {
margin-top: 60px;
margin-bottom: 60px;
.document-center-content-tab {
overflow: auto;
height: calc(100vh - 170px);
}
}
}
</style>
......@@ -5,17 +5,9 @@
* @FilePath: src/views/home/components/loadTableCell.vue
*/
<template>
<div
class="load-table-cell"
ref="loadTableCell"
>
<div class="load-table-cell" ref="loadTableCell">
<!-- <div class="load-table-cell" @scroll="isScrollBottom" ref="loadTableCell"> -->
<van-loading
v-if="showLoading"
type="spinner"
size="24px"
vertical
/>
<van-loading v-if="showLoading" type="spinner" size="24px" vertical />
<div
class="taskItem"
v-for="item in list"
......@@ -42,7 +34,7 @@ import { getMessage } from '@/api/home'
export default {
name: 'LoadTableCell', // name写在组件的最前方,自定义组件为必填
components: {},
data() {
data () {
return {
allList: [],
list: [],
......@@ -52,13 +44,13 @@ export default {
}
},
computed: {},
created() {
created () {
// 初始化数据
this.getLatestTask()
},
methods: {
// 跳转详情页面
goDetailsInfo(item) {
goDetailsInfo (item) {
this.$router.push({
path: `/taskDetails-${item.oid}`,
query: {
......@@ -68,7 +60,7 @@ export default {
}
})
},
getLatestTask() {
getLatestTask () {
const items = [
{
fieldName: 'receiver',
......@@ -84,7 +76,7 @@ export default {
const params = {
pageFrom: 1,
pageSize: 10,
'sortItem': [{ 'fieldName': 'sendTime', 'sortOrder': 'desc' }],
sortItem: [{ fieldName: 'sendTime', sortOrder: 'desc' }],
searchItems: {
items: items,
operator: 'AND'
......@@ -95,7 +87,7 @@ export default {
this.showLoading = false
})
},
dealWithtaskData() {
dealWithtaskData () {
if (this.allList.length > 10 * this.curr) {
this.list = this.allList.slice(0, 10 * this.curr)
} else {
......@@ -103,7 +95,7 @@ export default {
}
},
// 暂时不用
isScrollBottom() {
isScrollBottom () {
// 是否滚动到了底部
this.box = this.$refs.loadTableCell
var clientHeight = this.box.clientHeight
......@@ -116,7 +108,7 @@ export default {
}
},
// 防抖
debounce(fn, delay = 50) {
debounce (fn, delay = 50) {
let timer = 0
return function () {
// 如果这个函数已经被触发了
......@@ -128,7 +120,7 @@ export default {
timer = 0
}, delay)
}
},
}
}
}
</script>
......
<template>
<div class="home">
<div class="header">
<van-swipe :autoplay="3000">
<van-swipe-item
v-for="(image, index) in images"
:key="index"
>
<img
class="swipeImage"
v-lazy="image"
/>
</van-swipe-item>
</van-swipe>
<div class="logo">
<!-- <van-image :src="require('@/assets/home/logo_title1.png')" /> -->
<span class="logo-title">
<img src="../../assets/login/logo.png" />
配套产品协同管理系统
</span>
<div class="container">
<div class="header">
<div class="logo">
<span class="logo-title">
<img src="../../assets/login/logo.png" />
配套产品协同管理系统
</span>
</div>
</div>
</div>
<!-- 快速入口 -->
<van-grid
class="modelArr"
:column-num="3"
:border="false"
>
<van-grid-item
v-for="item in modelArr"
:key="item.key"
:icon="item.icon"
:text="item.title"
:to="{ path: item.path, query: { title: `${item.title}任务` } }"
/>
</van-grid>
<!-- 快速入口 -->
<van-grid class="modelArr" :column-num="3" :border="false">
<van-grid-item
v-for="item in modelArr"
:key="item.key"
:icon="item.icon"
:text="item.title"
:to="{ path: item.path, query: { title: `${item.title}任务` } }"
/>
</van-grid>
<div class="task">
<van-notice-bar
color="#3D3D3D"
background="#FFF4F0"
:left-icon="noticeIcon"
@click="toNotice"
>
《5G移动端数字样机审查环境项目上线公告》
</van-notice-bar>
<div class="taskList">
<div class="taskTitle">
<span>我的消息</span>
<span
class="more"
@click="goTodoList"
>更多 ></span>
</div>
<div class="list">
<Load-table-cell></Load-table-cell>
<div class="task">
<div class="taskList">
<div class="taskTitle">
<span>我的待办</span>
<span class="more" @click="goTodoList">更多 ></span>
</div>
<div class="list">
<!-- <Load-table-cell></Load-table-cell> -->
<todo-list ref="todoList" />
</div>
</div>
</div>
</div>
......@@ -61,13 +37,13 @@
</template>
<script>
import LoadTableCell from '@/views/home/components/loadTableCell'
import TodoList from '@/views/todoList/index.vue'
import { Dialog } from 'vant'
export default {
props: {},
components: { LoadTableCell, [Dialog.Component.name]: Dialog.Component },
data() {
components: { TodoList, [Dialog.Component.name]: Dialog.Component },
data () {
return {
images: [
require('@/assets/home/banner.png'),
......@@ -100,25 +76,25 @@ export default {
loading: false,
finished: false,
refreshing: false,
curr: 0,
curr: 0
}
},
computed: {},
created() {
created () {
if (window.history && window.history.pushState) {
history.pushState(null, null, document.URL)
// 监听返回
window.addEventListener('popstate', this.popstate, false)
}
},
destroyed() {
destroyed () {
// 销毁vm组件
// 避免堆栈溢出,多次创建、多次触发
window.removeEventListener('popstate', this.popstate, false)
},
mounted() { },
mounted () { },
methods: {
popstate() {
popstate () {
Dialog.confirm({
title: '是否退出?'
})
......@@ -129,19 +105,18 @@ export default {
// on cancel
})
},
getContainer() {
getContainer () {
return document.querySelector('.moreClass')
},
goTodoList() {
goTodoList () {
this.$router.push({
path: '/msgList',
path: '/todoList',
query: {
title: '消息',
key: 'msgList'
title: '待办任务'
}
})
},
toNotice() {
toNotice () {
this.$router.push({
path: '/noticeInfo',
query: {
......@@ -161,116 +136,128 @@ export default {
.home {
box-sizing: border-box;
overflow: auto;
.header {
width: 100%;
height: calc(100% / 3);
// overflow: hidden;
display: flex;
.van-swipe {
overflow: hidden;
height: calc(100%);
.container {
box-sizing: border-box;
overflow: hidden;
height: calc(100%);
.header {
width: 100%;
height: 100%;
.swipeImage {
// height: calc(100% / 3);
height: 36px;
background: linear-gradient(197deg, #2ab1f4 0%, #3693e6 100%);
// overflow: hidden;
display: flex;
position: fixed;
z-index: 999;
.van-swipe {
width: 100%;
height: 100%;
}
}
.logo {
// overflow: hidden;
position: absolute;
.swipeImage {
width: 100%;
height: 100%;
}
}
.logo-title {
font-size: 18px;
color: #fff;
font-weight: 600;
.logo {
// overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
img {
width: 18px;
height: 18px;
margin-right: 5px;
vertical-align: center;
.logo-title {
font-size: 14px;
color: #fff;
font-weight: 600;
display: flex;
align-items: center;
justify-content: center;
padding-left: 10px;
img {
width: 14px;
height: 14px;
margin-right: 5px;
}
}
}
.van-image {
vertical-align: middle;
.van-image {
vertical-align: middle;
img {
width: 250px;
height: 55px;
img {
width: 250px;
height: 55px;
}
}
}
vertical-align: middle;
margin: 1.625rem 0 0 1.625rem;
font-family: Adobe Heiti Std;
font-weight: normal;
color: #ffffff;
font-size: 1.3125rem;
vertical-align: middle;
font-family: Adobe Heiti Std;
font-weight: normal;
color: #ffffff;
font-size: 1.3125rem;
}
}
}
.modelArr {
background: #fff;
height: 150px;
margin: -3.625rem 1.125rem 0 1.125rem;
box-shadow: 0px 7px 23px 0px rgba(6, 0, 1, 0.06);
border-radius: 0.75rem;
// overflow: hidden;
.van-icon__image {
width: 70px;
height: 70px;
}
.modelArr {
background: #fff;
height: 120px;
// margin: -3.625rem 1.125rem 0 1.125rem;
box-shadow: 0px 7px 23px 0px rgba(6, 0, 1, 0.06);
border-radius: 0.75rem;
margin-top: 36px;
position: fixed;
z-index: 999;
width: 100%;
// overflow: hidden;
.van-icon__image {
width: 70px;
height: 70px;
}
.van-grid-item__text {
font-size: 16px;
font-weight: bold;
color: #56595d;
.van-grid-item__text {
font-size: 16px;
font-weight: bold;
color: #56595d;
}
}
}
.task {
padding: 10px 20px;
box-sizing: border-box;
// overflow: hidden;
.taskList {
padding: 1rem;
.taskTitle {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 18px;
font-family: Adobe Heiti Std;
font-weight: 500;
color: #25292f;
.more {
font-size: 14px;
font-weight: normal;
color: #9d9d9d;
.task {
// padding: 0 10px;
box-sizing: border-box;
margin-top: 170px;
// margin-bottom: 70px;
height: calc(100%);
overflow: hidden;
.taskList {
padding: 0 10px;
height: calc(100%);
.taskTitle {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 18px;
font-family: Adobe Heiti Std;
font-weight: 500;
color: #25292f;
padding: 5px 20px;
.more {
font-size: 14px;
font-weight: normal;
color: #9d9d9d;
}
}
}
.list {
margin-bottom: 46px;
height: 200px;
.list {
height: calc(100% - 200px);
overflow-y: auto;
}
}
}
.van-notice-bar__left-icon {
.van-icon__image {
width: 65px;
height: 20px;
margin-right: 5px;
.van-notice-bar__left-icon {
.van-icon__image {
width: 65px;
height: 20px;
margin-right: 5px;
}
}
}
}
......
......@@ -28,10 +28,7 @@
</van-button>
</div>
</div>
<ChangePassword
ref="changePsw"
:userAccount="userName"
></ChangePassword>
<ChangePassword ref="changePsw" :userAccount="userName"></ChangePassword>
</div>
</template>
......@@ -48,7 +45,7 @@ export default {
DeeForm,
ChangePassword
},
data() {
data () {
return {
// active: true,
loginType: 'gace',
......@@ -98,7 +95,10 @@ export default {
rightIcon: '',
clearable: true,
border: true,
rules: [{ required: true, message: '请输入验证码' }]
rules: [{ required: true, message: '请输入验证码' }],
click: () => {
this.handleIconClick()
}
}
}
]
......@@ -106,7 +106,7 @@ export default {
]
}
},
mounted() {
mounted () {
// 处理软键盘弹起改变界面样式
const originalHeight =
document.documentElement.clientHeight || document.body.clientHeight
......@@ -130,7 +130,7 @@ export default {
},
methods: {
// 获取图形码
handleIconClick() {
handleIconClick () {
extAccountCaptcha().then(res => {
if (res.items && res.items.image) {
this.form.verKey = res.items.key
......@@ -141,7 +141,7 @@ export default {
}
})
},
base64ImgtoFile(dataurl, filename = 'file') {
base64ImgtoFile (dataurl, filename = 'file') {
const arr = dataurl.split(',')
const mime = arr[0].match(/:(.*?);/)[1]
const suffix = mime.split('/')[1]
......@@ -155,7 +155,7 @@ export default {
type: mime
})
},
login() {
login () {
this.$refs.form
.validate()
.then(() => {
......@@ -167,7 +167,7 @@ export default {
this.$loading.hide()
})
},
userLogin() {
userLogin () {
this.$store
.dispatch('user/login', this.form)
.then((res) => {
......
/**
* @Description: 主页通知消息详情页
* @author xioln
* @date 2022-06-23
* @FilePath: src/views/noticeInfo/index.vue
*/
<template>
<div class="notice-info">
<headerNavBar :title="headerNavBarName" @click-left="onClickLeft" />
<van-panel
@click="noticeClick"
title="5G移动端数字样机审查环境项目上线公告"
desc="大家好,5G移动端数字样机审查环境项目正式上线啦!"
status="公告"
/>
</div>
</template>
<script>
import HeaderNavBar from '@/components/headerNavBar/index.vue'
export default {
name: 'NoticeInfo', // name写在组件的最前方,自定义组件为必填
components: { HeaderNavBar },
data () {
return {
headerNavBarName: this.$route.query.title,
currentContact: {
name: '5G移动端数字样机审查环境项目上线公告',
desc: '大家好,5G移动端数字样机审查环境项目正式上线啦!'
}
}
},
computed: {},
created () {
// 初始化数据
},
methods: {
onClickLeft () {
history.back(-1)
},
noticeClick () {
this.$router.push({
path: '/noticeDetail',
query: {
title: '公告详情'
}
})
}
}
}
</script>
<style lang='scss'>
.notice-info {
overflow: hidden;
.van-panel {
overflow: scroll;
margin-top: 60px;
margin-bottom: 60px;
}
}
</style>
/**
* @Description: 通知公告详情
* @author xioln
* @date 2022-08-18
* @FilePath: src/views/noticeInfo/noticeDetail.vue
*/
<template>
<div class="notice-detail">
<headerNavBar :title="$route.query.title" @click-left="onClickLeft" />
<div class="notice-detail-content">
<h4>5G移动端数字样机审查环境项目上线公告</h4>
<pre>
大家好,5G移动端数字样机审查环境项目正式上线啦!
本次上线内容包括:
一.任务流程适配,主要包括以下三大类任务流程
1.设计类任务:
● 工程更改申请流程;
● 工程更改通知流程;
● 更改DS实物部件签审流程;
● 供应商更改单流程。
2.工艺类任务:
● PBOM底层更改流程;
● PBOM顶层更改流程;
● MBOM底层更改流程;
● MBOM顶层更改流程。
3.文件及图档类任务:
● 技术文件签署流程;
● 技术协调单内部签署流程;
● 技术协调单外部发起流程;
● 更改图档文件签署流程;
● 更改技术文件签署流程。
二.各类BOM视图展示查看
包括EBOM、PBOM、MBOM的产品结构展示及主要对象的详情查看展示。
三.三维展示
包括设计数模轻量化转换及三维展示、放大缩小、旋转平移等常用功能。
</pre>
</div>
</div>
</template>
<script>
import HeaderNavBar from '@/components/headerNavBar/index.vue'
export default {
name: 'NoticeDetail', // name写在组件的最前方,自定义组件为必填
components: { HeaderNavBar },
data () {
return {}
},
computed: {},
created () {
// 初始化数据
},
methods: {
onClickLeft () {
history.back(-1)
}
}
}
</script>
<style lang='scss'>
.notice-detail {
overflow: hidden;
.notice-detail-content {
overflow: scroll;
margin-top: 50px;
height: calc(100vh - 140px);
padding: 10px;
pre {
font-size: 14px;
}
}
}
</style>
// 废弃不用
<template>
<div class="about">
<!-- <van-nav-bar
left-arrow
left-text="返回"
:title="$route.query.title"
@click-left="onClickLeft"
fixed
>
<van-icon name="replay" slot="right" @click="getWorkFlowItem" />
</van-nav-bar> -->
<headerNavBar :title="'单据详情'" @click-left="onClickLeft" />
<div class="about-container">
<div>
<van-cell-group>
<van-cell :center="false" title="主题" :value="info.taskName" />
<van-cell title="工作负责人" :value="info.user" />
<van-cell title="流程启动者" :value="info.processUser" />
</van-cell-group>
</div>
<div style="margin-top: 10px">
<van-cell title="查看签署文档" is-link @click="pdf" />
</div>
<div style="margin-top: 10px">
<van-panel title="处理意见">
<div>
<div v-if="isRadio" style="margin-left: 15px; margin-top: 10px">
<van-radio-group direction="vertical" v-model="radio">
<van-radio
v-for="(item, index) in radioList"
style="margin-top: 4px"
:key="index"
:name="item.value"
>{{ item.value }}</van-radio
>
</van-radio-group>
</div>
<div style="margin-top: 10px">
<van-field
v-model="common"
large
type="textarea"
label="备注:"
placeholder="请输入备注"
clearable
/>
</div>
</div>
<div slot="footer" style="text-align: right">
<van-button size="small" style="margin-right: 5px"
>重新指派</van-button
>
<van-button
size="small"
loading-text="完成任务中..."
@click="submit"
type="primary"
:loading="loading"
>完成任务</van-button
>
</div>
</van-panel>
</div>
</div>
</div>
</template>
<script>
import { getWorkFlowItem, finishWorkFlowItem, reassign } from '@/api/taskDetail.js'
import HeaderNavBar from '@/components/headerNavBar/index.vue'
export default {
name: 'app',
components: { HeaderNavBar },
// 数据源 给组件分发数据用
data () {
return {
loading: false,
common: '',
info: {
processUser: '',
user: '',
taskName: ''
},
radio: '',
radioList: [],
isRadio: false
}
},
mounted () {
this.getWorkFlowItem()
},
// 基于路由变化的动态 设置路由切换动画
watch: {},
methods: {
pdf () {
this.$router.push({
path: '/receiptsPDF',
query: { id: this.$route.query.id, title: this.$route.query.title }
})
},
onClickLeft () {
this.$router.push({
path: '/receipts'
})
},
submit () {
const vote = []
vote.push(this.radio ? this.radio : '')
const obj = {
checkOperation: null,
formDatas: {
typeNumber: '',
typeIdentification: '',
inputDRC: ''
},
variables: {},
workItemVote: {
userComment: this.common,
vote
}
}
this.loading = true
finishWorkFlowItem(this.$route.query.id, obj)
.then((res) => {
this.loading = false
if (res.code === 0) {
this.$router.push({
path: '/home'
})
this.$toast.success('任务完成!')
} else {
this.$toast.error(res.message)
}
})
.catch((e) => {
this.loading = false
this.$toast.error('服务器出错!')
})
},
getWorkFlowItem () {
getWorkFlowItem(this.$route.query.id, true).then((x) => {
this.$set(
this.info,
'processUser',
`${x.items.processCreator.fullName}(${x.items.processCreator.name})`
)
this.$set(
this.info,
'user',
`${x.items.owner.fullName}(${x.items.owner.name})`
)
this.$set(this.info, 'taskName', x.items.name)
// eslint-disable-next-line no-prototype-builtins
if (x.items.hasOwnProperty('routeChoices')) {
this.isRadio = true
this.radioList = x.items.routeChoices
}
})
}
}
}
</script>
<style lang="scss" scoped>
.about {
overflow: hidden;
.van-cell__title {
text-align: left;
}
.about-container {
margin-top: 60px;
margin-bottom: 60px;
overflow: auto;
height: calc(100vh - 120px);
}
}
</style>
<template>
<div class="receipts">
<headerNavBar :title="'单据'" @click-left="onClickLeft" />
<!-- <van-nav-bar title="我的任务" left-arrow fixed @click-left="onClickLeft">
<div slot="right"></div>
</van-nav-bar> -->
<!-- <div></div> -->
<van-dropdown-menu>
<van-dropdown-item
v-model="dropdownValue"
:options="dropdownOption"
@change="dropdownonChange"
/>
</van-dropdown-menu>
<div class="lazy-list" ref="lazyList" @scroll="isScrollBottom">
<van-loading v-if="loading" type="spinner" size="24px" vertical />
<van-empty v-if="taskList.length === 0" description="数据为空" />
<div
class="task-item"
v-for="(item, index) in taskList"
:key="index"
@click="jump(item, index)"
>
<div class="itemTitle">
{{ item.productName|| item.supName ||item.ProcessDeviationName}}
<span class="time">
<span>{{ item.writeDate|| item.createTimestamp || item.ProposedTime}}</span>
<van-icon name="arrow" />
</span>
</div>
<div class="content">
<span class="title"> {{ item.formNo || item.number}}|{{ item.state }} </span>
</div>
</div>
</div>
</div>
</template>
<script>
// @ is an alias to /src
import { getUserReceiveItem, getByWorkItemIdBatchId } from '@/api/home'
import { getEquipmentSubstitutesByPage, getNonConformProductIIsByPage, getDevialtionAppform } from '@/api/taskDetail.js'
import HeaderNavBar from '@/components/headerNavBar/index.vue'
import { Notify } from 'vant'
export default {
name: 'Home',
components: { HeaderNavBar },
data () {
return {
loading: true,
pagination: {
currentPage: 1,
pageSize: 20,
pageSizes: [5],
total: 0
},
allList: [],
taskList: [],
dropdownValue: 'getNonConformProductIIsByPage',
dropdownOption: [
{ text: '不合格品', value: 'getNonConformProductIIsByPage' },
{ text: '器材代用', value: 'getEquipmentSubstitutesByPage' },
{ text: '工艺偏离单', value: 'getDevialtionAppform' }
]
}
},
async mounted () {
// await this.getUserReceiveItem()
await this.getNonConformProductIIsByPage()
},
methods: {
dropdownonChange (v) {
this.pagination.currentPage = 1
this.pagination.pageSize = 20
this[v]()
},
onClickLeft () {
this.$router.push({
path: '/home'
})
},
jump (item, i) {
// this.$router.push({
// path: `/taskDetails-${item.oid}`,
// query: {
// id: item.oid
// // insId: item.processInstanceId,
// // title: item.title
// }
// })
if (this.dropdownValue === 'getDevialtionAppform') {
this.$router.push({
path: `/bomTreeDetail-${item.oid}`,
query: {
oid: item.oid,
subTypeName: '工艺偏离单'
// time: moment().valueOf()
}
})
} else if (this.dropdownValue === 'getNonConformProductIIsByPage') {
// this.getByWorkItemIdBatchId(item.batchId)
this.$router.push({
path: `/bomTreeDetail-${item.oid}`,
query: {
oid: item.oid,
subTypeName: '不合格品审理单'
// time: moment().valueOf()
}
})
} else if (this.dropdownValue === 'getEquipmentSubstitutesByPage') {
this.$router.push({
path: `/bomTreeDetail-${item.oid}`,
query: {
oid: item.oid,
subTypeName: '器材代用单'
// time: moment().valueOf()
}
})
}
},
async getUserReceiveItem () {
return getUserReceiveItem().then((res) => {
res.items.childClassify.map((item) => {
if (item.classifyName === '单据签审任务') {
this.allList = item.workItems
}
})
})
},
// 器材代用
getEquipmentSubstitutesByPage () {
getEquipmentSubstitutesByPage({ pageNO: this.pagination.currentPage, pageSize: this.pagination.pageSize }).then((res) => {
if (this.pagination.currentPage === 1) {
this.taskList = res.items.items
} else {
this.taskList = this.taskList.concat(res.items.items)
}
this.loading = false
})
},
// 不合格品审理单
getNonConformProductIIsByPage () {
getNonConformProductIIsByPage({ pageNO: this.pagination.currentPage, pageSize: this.pagination.pageSize }).then((res) => {
if (this.pagination.currentPage === 1) {
this.taskList = res.items.items
} else {
this.taskList = this.taskList.concat(res.items.items)
}
this.loading = false
})
},
// 工艺偏离单
getDevialtionAppform () {
getDevialtionAppform({ pageNO: this.pagination.currentPage, pageSize: this.pagination.pageSize }).then((res) => {
const data = res.items.items.map(item => {
item.subTypeName = 'deviation'
return item
})
if (this.pagination.currentPage === 1) {
this.taskList = data
} else {
this.taskList = this.taskList.concat(data)
}
this.loading = false
})
},
getByWorkItemIdBatchId (id) {
getByWorkItemIdBatchId(id).then(response => {
const abc = response.items
const workItemOR = 'OR:wt.workflow.work.WorkItem:' + abc
if (abc === 0) {
Notify({ type: 'warning', message: '流程处理正在排队,请在首页任务中处理!' })
} else {
this.$router.push({ path: `/taskDetails-${response.items}`, query: { id: workItemOR, title: this.dropdownOption.find(x => x.value === this.dropdownValue).text } })
}
}).catch(response => {
Notify({ type: 'error', message: response.message || '失败' })
})
},
isScrollBottom () {
// 是否滚动到了底部
this.box = this.$refs.lazyList
var clientHeight = this.box.clientHeight
var scrollTop = this.box.scrollTop
var scrollHeight = this.box.scrollHeight
if (Math.abs(scrollHeight - (scrollTop + clientHeight)) < 1) {
this.pagination.currentPage++
this.debounce(this[this.dropdownValue]())
}
},
// 防抖
debounce (fn, delay = 50) {
let timer = 0
return function () {
// 如果这个函数已经被触发了
if (timer) {
clearTimeout(timer)
}
timer = setTimeout(() => {
fn.apply(this, arguments) // 透传 this和参数
timer = 0
}, delay)
}
}
}
}
</script>
<style lang="scss">
.receipts {
@import "@/styles/px2rem.scss";
overflow: hidden;
height: 100%;
.van-loading {
margin-top: 30vh;
}
.van-dropdown-menu__bar {
position: fixed;
width: 100%;
overflow: hidden;
top: 60px;
}
.lazy-list {
margin-top: 120px;
margin-bottom: 60px;
height: calc(100vh - 200px);
overflow: scroll;
}
.list-cell {
margin-top: 50px;
display: flex;
height: 100px;
padding: 10px 20px;
border-bottom: 0.02rem solid #ededed;
box-sizing: border-box;
font-size: 12px;
color: #383838;
}
.task-item {
padding: 0px 8px;
font-size: 16px;
color: #000000;
box-sizing: border-box;
border-bottom: 1px solid #e1e1e1;
margin-top: 10px;
.itemTitle {
text-align: left;
display: flex;
align-items: center;
.van-image__img {
width: 30px;
height: 15px;
}
.text {
margin-left: 0.625rem;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.time {
text-align: right;
flex: auto;
margin-right: 10px;
}
}
.content {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 12px;
color: #797979;
.title {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
flex: 2;
margin: 5px 0;
text-align: left;
}
}
}
/* .van-pull-refresh__track{
height: 100%;
overflow: auto
}*/
}
</style>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/**
* @Description: 重定向页面
* @author lyk
* @date 2019/6/4
*/
<script>
export default {
created () {
const { params, query } = this.$route
const { path } = params
this.$router.replace({ path: '/' + path, query })
},
render: function (h) {
return h() // avoid warning message
}
}
</script>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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