|
|
@@ -18,7 +18,11 @@
|
|
|
margin-bottom: 5px;
|
|
|
font-weight: bold;
|
|
|
"
|
|
|
- >{{ basicInfoData.groupName || '湖南特瑞精密医疗器器械有限公司' }}</div
|
|
|
+ >{{
|
|
|
+ basicInfoData.groupName ||
|
|
|
+ currentCompanyName ||
|
|
|
+ '湖南特瑞精密医疗器器械有限公司'
|
|
|
+ }}</div
|
|
|
>
|
|
|
<div style="text-align: center; font-size: 18px; margin-bottom: 5px"
|
|
|
>不合格品通知及评审处置表</div
|
|
|
@@ -489,7 +493,11 @@
|
|
|
margin-bottom: 5px;
|
|
|
font-weight: bold;
|
|
|
"
|
|
|
- >{{ basicInfoData.groupName || '湖南特瑞精密医疗器器械有限公司' }}</div
|
|
|
+ >{{
|
|
|
+ basicInfoData.groupName ||
|
|
|
+ currentCompanyName ||
|
|
|
+ '湖南特瑞精密医疗器器械有限公司'
|
|
|
+ }}</div
|
|
|
>
|
|
|
<div style="text-align: center; font-size: 18px; margin-bottom: 5px"
|
|
|
>不合格品通知及评审处置表</div
|
|
|
@@ -1106,6 +1114,7 @@
|
|
|
<script>
|
|
|
// import imageUpload from '@/components/upload/imageUpload.vue';
|
|
|
import { getFmImagePath } from '@/utils/file';
|
|
|
+ import { getCurrentUserCompanyName } from '@/utils/org-util';
|
|
|
|
|
|
export default {
|
|
|
name: 'QualityReport',
|
|
|
@@ -1121,7 +1130,11 @@
|
|
|
data() {
|
|
|
return {
|
|
|
getFmImagePath,
|
|
|
+ // 当前登录用户所属公司名称(groupName 为空时的默认值)
|
|
|
+ currentCompanyName: '',
|
|
|
basicInfoData: {
|
|
|
+ // 公司名称(为空时默认取当前登录用户所属公司)
|
|
|
+ groupName: '',
|
|
|
// 表单编号、版本(两处共用)
|
|
|
reportNumber: '',
|
|
|
version: '',
|
|
|
@@ -1204,6 +1217,10 @@
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
+ created() {
|
|
|
+ // 提前获取当前登录用户所属公司, 作为报告抬头的默认值
|
|
|
+ this.setDefaultCompanyName();
|
|
|
+ },
|
|
|
methods: {
|
|
|
/* 打开质检报告 */
|
|
|
async init(basicInfoData) {
|
|
|
@@ -1214,6 +1231,24 @@
|
|
|
...basicInfoData
|
|
|
});
|
|
|
}
|
|
|
+ // groupName 为空时默认取当前登录用户所属公司
|
|
|
+ if (!this.basicInfoData.groupName) {
|
|
|
+ await this.setDefaultCompanyName();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /* 默认公司名称: 当前登录用户所属公司 */
|
|
|
+ async setDefaultCompanyName() {
|
|
|
+ if (!this.currentCompanyName) {
|
|
|
+ const userInfo = this.$store?.state?.user?.info;
|
|
|
+ if (!userInfo) {
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ this.currentCompanyName = await getCurrentUserCompanyName(userInfo);
|
|
|
+ }
|
|
|
+ if (this.currentCompanyName && !this.basicInfoData.groupName) {
|
|
|
+ this.$set(this.basicInfoData, 'groupName', this.currentCompanyName);
|
|
|
+ }
|
|
|
+ return this.currentCompanyName;
|
|
|
},
|
|
|
/* 保存编辑 */
|
|
|
async getValue() {
|