|
@@ -12,7 +12,6 @@
|
|
|
<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>
|
|
|
|
|
|
|
|
<!-- 附件信息 -->
|
|
<!-- 附件信息 -->
|
|
@@ -26,7 +25,7 @@
|
|
|
|
|
|
|
|
<!-- 审批信息 -->
|
|
<!-- 审批信息 -->
|
|
|
<uni-section title="审批信息" type="line"></uni-section>
|
|
<uni-section title="审批信息" type="line"></uni-section>
|
|
|
- <uni-steps :options="flow.list.FlowNodes" :active="flow.active" direction="column"></uni-steps>
|
|
|
|
|
|
|
+ <uni-steps :options="flow.list.FlowNodes" :active="flow.current" direction="column"></uni-steps>
|
|
|
|
|
|
|
|
<!-- 清单详情 -->
|
|
<!-- 清单详情 -->
|
|
|
<uni-section title="清单详情" type="line"></uni-section>
|
|
<uni-section title="清单详情" type="line"></uni-section>
|
|
@@ -47,8 +46,8 @@
|
|
|
|
|
|
|
|
<!-- 审批拒绝弹窗 -->
|
|
<!-- 审批拒绝弹窗 -->
|
|
|
<uni-popup ref="rejectPopup" type="dialog">
|
|
<uni-popup ref="rejectPopup" type="dialog">
|
|
|
- <uni-popup-dialog mode="input" placeholder="请输入拒绝原因" :duration="2000" :before-close="true"
|
|
|
|
|
- @close="rejectClose" @confirm="rejectConfirm"></uni-popup-dialog>
|
|
|
|
|
|
|
+ <uni-popup-dialog mode="input" placeholder="请输入拒绝原因" :duration="2000" :before-close="true" @close="rejectClose"
|
|
|
|
|
+ @confirm="rejectConfirm"></uni-popup-dialog>
|
|
|
</uni-popup>
|
|
</uni-popup>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
@@ -59,7 +58,11 @@
|
|
|
queryAttachment,
|
|
queryAttachment,
|
|
|
queryAuditList,
|
|
queryAuditList,
|
|
|
approve,
|
|
approve,
|
|
|
|
|
+ queryVersionDetail,
|
|
|
} from "@/services/bom.js"
|
|
} from "@/services/bom.js"
|
|
|
|
|
+ import {
|
|
|
|
|
+ gerCurrentUser
|
|
|
|
|
+ } from "@/services/user.js"
|
|
|
import previewFile from "@/components/preview-file/preview-file.vue"
|
|
import previewFile from "@/components/preview-file/preview-file.vue"
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -70,7 +73,7 @@
|
|
|
return {
|
|
return {
|
|
|
projectId: 580,
|
|
projectId: 580,
|
|
|
templateNodeId: 0,
|
|
templateNodeId: 0,
|
|
|
- versionId: 0,
|
|
|
|
|
|
|
+ id: 0,
|
|
|
version: {},
|
|
version: {},
|
|
|
excelFileList: [],
|
|
excelFileList: [],
|
|
|
auditMessage: '',
|
|
auditMessage: '',
|
|
@@ -84,29 +87,46 @@
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
isAuditor: false,
|
|
isAuditor: false,
|
|
|
|
|
+ isMobile: true,
|
|
|
options: {}
|
|
options: {}
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
onLoad(options) {
|
|
onLoad(options) {
|
|
|
this.templateNodeId = options.templateNodeId
|
|
this.templateNodeId = options.templateNodeId
|
|
|
- this.versionId = options.versionId
|
|
|
|
|
this.projectId = Number(options.projectId)
|
|
this.projectId = Number(options.projectId)
|
|
|
- if(!uni.getStorageSync('token')){
|
|
|
|
|
|
|
+ this.id = options.excel_id
|
|
|
|
|
+ if (!uni.getStorageSync('token')) {
|
|
|
uni.setStorageSync("token", options['JWT-TOKEN']);
|
|
uni.setStorageSync("token", options['JWT-TOKEN']);
|
|
|
}
|
|
}
|
|
|
this.options = options
|
|
this.options = options
|
|
|
|
|
+ this.checkDeviceType()
|
|
|
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 {
|
|
|
|
|
- data: {
|
|
|
|
|
- excel_version_tree: versionList
|
|
|
|
|
- }
|
|
|
|
|
- } = await queryVersionsList({
|
|
|
|
|
- template_node_id: this.templateNodeId
|
|
|
|
|
- });
|
|
|
|
|
- var version = versionList.find(v => v.id == this.versionId);
|
|
|
|
|
|
|
+ var currentUser = await gerCurrentUser();
|
|
|
|
|
+ if (!currentUser) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ uni.setStorageSync("user", currentUser);
|
|
|
|
|
+
|
|
|
|
|
+ var version = await queryVersionDetail({
|
|
|
|
|
+ userID: currentUser.ID,
|
|
|
|
|
+ excelID: this.id
|
|
|
|
|
+ })
|
|
|
|
|
+ if (!this.isMobile) {
|
|
|
|
|
+ // 如果是在电脑上打开,转到PC端的页面去
|
|
|
|
|
+ window.location.href =
|
|
|
|
|
+ `http://120.55.44.4:8896/#/bom/home/detail/${version.project_id}/${version.template_id}?excel_id=${this.id}&JWT-TOKEN=${this.query['JWT-TOKEN']}`
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (version.flow_id) {
|
|
if (version.flow_id) {
|
|
|
this.getFlow(version)
|
|
this.getFlow(version)
|
|
|
}
|
|
}
|
|
@@ -128,13 +148,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;
|
|
@@ -158,16 +180,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;
|
|
@@ -226,23 +252,31 @@
|
|
|
this.isAuditor = true;
|
|
this.isAuditor = true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if(this.options['JWT-TOKEN']){
|
|
|
|
|
- this.isAuditor = true;
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
toExcelDetail() {
|
|
toExcelDetail() {
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
- url: `./excelDetail?templateNodeId=${this.templateNodeId}&versionId=${this.versionId}`
|
|
|
|
|
|
|
+ url: `./excelDetail?templateNodeId=${this.templateNodeId}&versionId=${this.version.version_id}`
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
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)
|
|
|
|
|
+ console.log(formComponent);
|
|
|
|
|
+ return formComponent[0].formComponentValues || [];
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
|
return []
|
|
return []
|
|
|
}
|
|
}
|
|
@@ -256,6 +290,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;
|
|
@@ -277,7 +313,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;
|
|
@@ -290,4 +327,4 @@
|
|
|
padding-left: 20rpx;
|
|
padding-left: 20rpx;
|
|
|
margin-bottom: 20rpx;
|
|
margin-bottom: 20rpx;
|
|
|
}
|
|
}
|
|
|
-</style>
|
|
|
|
|
|
|
+</style>
|