|
@@ -7,12 +7,11 @@
|
|
<!-- 表单数据 -->
|
|
<!-- 表单数据 -->
|
|
<template v-if="formList.length > 0">
|
|
<template v-if="formList.length > 0">
|
|
<uni-section title="表单数据" type="line"></uni-section>
|
|
<uni-section title="表单数据" type="line"></uni-section>
|
|
- <uni-forms class="form" label-align="right" :labelWidth="100">
|
|
|
|
|
|
+ <uni-forms class="form" label-align="right" :labelWidth="100" >
|
|
<uni-forms-item v-for="item in formList" :label="item.name" name="email">
|
|
<uni-forms-item v-for="item in formList" :label="item.name" name="email">
|
|
<view class="content">{{item.value.join(",")}}</view>
|
|
<view class="content">{{item.value.join(",")}}</view>
|
|
</uni-forms-item>
|
|
</uni-forms-item>
|
|
</uni-forms>
|
|
</uni-forms>
|
|
-
|
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<!-- 附件信息 -->
|
|
<!-- 附件信息 -->
|
|
@@ -88,6 +87,7 @@
|
|
},
|
|
},
|
|
},
|
|
},
|
|
isAuditor: false,
|
|
isAuditor: false,
|
|
|
|
+ isMobile: true,
|
|
options: {}
|
|
options: {}
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -102,22 +102,30 @@
|
|
this.init()
|
|
this.init()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ checkDeviceType() {
|
|
|
|
+ const userAgent = navigator.userAgent.toLowerCase();
|
|
|
|
+ const mobileKeywords = ['android', 'iphone', 'ipad', 'ipod', 'mobile'];
|
|
|
|
+ this.isMobile = mobileKeywords.some(keyword => userAgent.includes(keyword));
|
|
|
|
+ return this.isMobile
|
|
|
|
+ },
|
|
|
|
+
|
|
async init() {
|
|
async init() {
|
|
var currentUser = await gerCurrentUser();
|
|
var currentUser = await gerCurrentUser();
|
|
- console.log(currentUser);
|
|
|
|
- if(!currentUser){
|
|
|
|
|
|
+ if (!currentUser) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
uni.setStorageSync("user", currentUser);
|
|
uni.setStorageSync("user", currentUser);
|
|
- // var {
|
|
|
|
- // data: {
|
|
|
|
- // excel_version_tree: versionList
|
|
|
|
- // }
|
|
|
|
- // } = await queryVersionsList({
|
|
|
|
- // template_node_id: this.templateNodeId
|
|
|
|
- // });
|
|
|
|
- // var version = versionList.find(v => v.id == this.versionId);
|
|
|
|
- var version = await queryVersionDetail({userID: currentUser.ID, versionID: this.versionId})
|
|
|
|
|
|
+
|
|
|
|
+ var version = await queryVersionDetail({
|
|
|
|
+ userID: currentUser.ID,
|
|
|
|
+ versionID: this.versionId
|
|
|
|
+ })
|
|
|
|
+ if (!this.checkDeviceType()) {
|
|
|
|
+ // 如果是在电脑上打开,转到PC端的页面去
|
|
|
|
+ window.location.href =
|
|
|
|
+ `http://120.55.44.4:8896/#/bom/home/detail/${version.project_id}/${version.template_id}?version_id=${this.versionId}`
|
|
|
|
+ }
|
|
|
|
+
|
|
if (version.flow_id) {
|
|
if (version.flow_id) {
|
|
this.getFlow(version)
|
|
this.getFlow(version)
|
|
}
|
|
}
|
|
@@ -139,13 +147,15 @@
|
|
name,
|
|
name,
|
|
};
|
|
};
|
|
})
|
|
})
|
|
- console.log(this.excelFileList)
|
|
|
|
|
|
+ // console.log(this.excelFileList)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+
|
|
// 显示通过审批弹窗
|
|
// 显示通过审批弹窗
|
|
async showAuditModal() {
|
|
async showAuditModal() {
|
|
this.$refs.popup.open();
|
|
this.$refs.popup.open();
|
|
},
|
|
},
|
|
|
|
+
|
|
// 通过审批
|
|
// 通过审批
|
|
async auditConfirm() {
|
|
async auditConfirm() {
|
|
let flow = this.flow;
|
|
let flow = this.flow;
|
|
@@ -169,16 +179,20 @@
|
|
})
|
|
})
|
|
this.$refs.popup.close();
|
|
this.$refs.popup.close();
|
|
},
|
|
},
|
|
|
|
+
|
|
// 显示拒绝审批弹窗
|
|
// 显示拒绝审批弹窗
|
|
showRejectModal() {
|
|
showRejectModal() {
|
|
this.$refs.rejectPopup.open()
|
|
this.$refs.rejectPopup.open()
|
|
},
|
|
},
|
|
|
|
+
|
|
auditClose() {
|
|
auditClose() {
|
|
this.$refs.popup.close();
|
|
this.$refs.popup.close();
|
|
},
|
|
},
|
|
|
|
+
|
|
rejectClose() {
|
|
rejectClose() {
|
|
this.$refs.rejectPopup.close();
|
|
this.$refs.rejectPopup.close();
|
|
},
|
|
},
|
|
|
|
+
|
|
async rejectConfirm(audit_comment) {
|
|
async rejectConfirm(audit_comment) {
|
|
const flow = this.flow
|
|
const flow = this.flow
|
|
const flowNode = flow.currentNode;
|
|
const flowNode = flow.currentNode;
|
|
@@ -218,7 +232,6 @@
|
|
let item = auditList.find(item => item.list.id == version.flow_id);
|
|
let item = auditList.find(item => item.list.id == version.flow_id);
|
|
if (!item) return;
|
|
if (!item) return;
|
|
// 查询当前节点
|
|
// 查询当前节点
|
|
- debugger
|
|
|
|
let current = item.list.FlowNodes.findIndex(node => node.seq == item.active);
|
|
let current = item.list.FlowNodes.findIndex(node => node.seq == item.active);
|
|
item.current = current == -1 ? 0 : current;
|
|
item.current = current == -1 ? 0 : current;
|
|
// 保存当前所处节点
|
|
// 保存当前所处节点
|
|
@@ -240,6 +253,7 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+
|
|
toExcelDetail() {
|
|
toExcelDetail() {
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
url: `./excelDetail?templateNodeId=${this.templateNodeId}&versionId=${this.versionId}`
|
|
url: `./excelDetail?templateNodeId=${this.templateNodeId}&versionId=${this.versionId}`
|
|
@@ -248,10 +262,19 @@
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
formList() {
|
|
formList() {
|
|
- if (!this.version.ding_schema) return []
|
|
|
|
|
|
+ if (!this.version.formStr) {
|
|
|
|
+ return []
|
|
|
|
+ }
|
|
try {
|
|
try {
|
|
- const ding_schema = JSON.parse(this.version.ding_schema);
|
|
|
|
- return JSON.parse(ding_schema).formComponentValues || [];
|
|
|
|
|
|
+ const formStrArray = JSON.parse(this.version.formStr);
|
|
|
|
+ const formComponents = []
|
|
|
|
+ if(formStrArray && formStrArray.length){
|
|
|
|
+ formStrArray.forEach(item=>{
|
|
|
|
+ formComponents.push(JSON.parse(item))
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ const formComponent = formComponents.filter(item=> item.template_node_id === this.version.template_node_id)
|
|
|
|
+ return formComponent[0].formComponentValues || [];
|
|
} catch (e) {
|
|
} catch (e) {
|
|
return []
|
|
return []
|
|
}
|
|
}
|
|
@@ -265,6 +288,8 @@
|
|
min-height: 100vh;
|
|
min-height: 100vh;
|
|
padding: 20rpx 30rpx 40rpx;
|
|
padding: 20rpx 30rpx 40rpx;
|
|
background: url("~@/static/index/bg.png") no-repeat center;
|
|
background: url("~@/static/index/bg.png") no-repeat center;
|
|
|
|
+ background-size: cover;
|
|
|
|
+ background-attachment: fixed;
|
|
|
|
|
|
.page-center {
|
|
.page-center {
|
|
padding: 30rpx;
|
|
padding: 30rpx;
|
|
@@ -286,7 +311,8 @@
|
|
|
|
|
|
.form {
|
|
.form {
|
|
width: 90%;
|
|
width: 90%;
|
|
- margin: 0 auto;
|
|
|
|
|
|
+ margin: 0;
|
|
|
|
+ box-shadow: 0 0 1 3 rgba(0, 0, 0, 0.1);
|
|
|
|
|
|
.content {
|
|
.content {
|
|
line-height: 44rpx;
|
|
line-height: 44rpx;
|