常熟吴彦祖 6 days ago
parent
commit
47751ab90d
  1. 306
      src/views/modules/qc/IQCResultEntry.vue

306
src/views/modules/qc/IQCResultEntry.vue

@ -206,9 +206,9 @@
<!-- <el-form-item :label="'PN'">-->
<!-- <el-input v-model="detailData.cinvSourceCode" readonly style="width: 100px"></el-input>-->
<!-- </el-form-item>-->
<el-form-item :label="'SKU'">
<el-input v-model="detailData.sku" readonly style="width: 100px"></el-input>
</el-form-item>
<!-- <el-form-item :label="'SKU'">-->
<!-- <el-input v-model="detailData.sku" readonly style="width: 100px"></el-input>-->
<!-- </el-form-item>-->
<el-form-item :label="'物料名称'">
<el-input v-model="detailData.partDesc" disabled style="width: 300px"></el-input>
</el-form-item>
@ -656,7 +656,17 @@
<el-dialog title="人员清单" :close-on-click-modal="false" v-drag :visible.sync="operatorModelFlag" width="820px">
<div class="rq">
<el-form :inline="true" label-position="top" :model="operatorData">
<el-form-item v-if="operatorData.flag !== '2' || detailData.buNo !== '04-MHM'" :label="'所属角色'">
<el-form-item v-if="operatorData.flag === '1'" :label="'所属部门'">
<el-select v-model="operatorData.departmentId" placeholder="请选择" style="width: 160px" @change="getOperatorList2">
<el-option
v-for="d in departmentList"
:key="d.departmentId"
:label="formatDepartmentLabel(d)"
:value="d.departmentId">
</el-option>
</el-select>
</el-form-item>
<el-form-item v-else-if="operatorData.flag !== '2' || detailData.buNo !== '04-MHM'" :label="'所属角色'">
<el-select v-model="operatorData.roleId" placeholder="请选择" style="width: 120px" @change="getOperatorList2">
<el-option
v-for = "i in roleList"
@ -813,6 +823,7 @@
getUserRoleList, //
getOperatorList
} from '@/api/eam/eam.js'
import { departmentSearch } from '@/api/department.js'
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
import {qcPrint} from '@/api/qc/qcPrint.js'
import qcFAIUploadFile from "./qc_FAI_upload_file"
@ -1035,24 +1046,24 @@
fixed: '',
columnWidth: 150,
},
{
userId: this.$store.state.user.name,
functionId: 301006,
serialNumber: '301006Table1InspectionCycle',
tableId: "301006Table1",
tableName: "IQC检验记录表",
columnProp: 'inspectionCycle',
headerAlign: "center",
align: "right",
columnLabel: '检验周期(h)',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100,
},
// {
// userId: this.$store.state.user.name,
// functionId: 301006,
// serialNumber: '301006Table1InspectionCycle',
// tableId: "301006Table1",
// tableName: "IQC",
// columnProp: 'inspectionCycle',
// headerAlign: "center",
// align: "right",
// columnLabel: '(h)',
// columnHidden: false,
// columnImage: false,
// columnSortable: false,
// sortLv: 0,
// status: true,
// fixed: '',
// columnWidth: 100,
// },
// {
// userId: this.$store.state.user.name,
// functionId: 301006,
@ -1107,24 +1118,24 @@
fixed: '',
columnWidth: 300,
},
{
userId: this.$store.state.user.name,
functionId: 301006,
serialNumber: '301006Table1SKU',
tableId: "301006Table1",
tableName: "IQC检验记录表",
columnProp: 'sku',
headerAlign: "center",
align: "center",
columnLabel: 'SKU',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120,
},
// {
// userId: this.$store.state.user.name,
// functionId: 301006,
// serialNumber: '301006Table1SKU',
// tableId: "301006Table1",
// tableName: "IQC",
// columnProp: 'sku',
// headerAlign: "center",
// align: "center",
// columnLabel: 'SKU',
// columnHidden: false,
// columnImage: false,
// columnSortable: false,
// sortLv: 0,
// status: true,
// fixed: '',
// columnWidth: 120,
// },
// {
// userId: this.$store.state.user.name,
// functionId: 301006,
@ -1242,7 +1253,7 @@
columnProp: 'poOrderNo',
headerAlign: "center",
align: "center",
columnLabel: '单据号',
columnLabel: '验货申请单',
columnHidden: false,
columnImage: false,
columnSortable: false,
@ -1251,42 +1262,42 @@
fixed: '',
columnWidth: 130,
},
{
userId: this.$store.state.user.name,
functionId: 301006,
serialNumber: '301006Table1OrderType',
tableId: "301006Table1",
tableName: "IQC检验记录表",
columnProp: 'orderType',
headerAlign: "center",
align: "center",
columnLabel: '采购类型',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100,
},
{
userId: this.$store.state.user.name,
functionId: 301006,
serialNumber: '301006Table1SubmissionType',
tableId: "301006Table1",
tableName: "IQC检验记录表",
columnProp: 'submissionType',
headerAlign: "center",
align: "center",
columnLabel: '送检类型',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100,
},
// {
// userId: this.$store.state.user.name,
// functionId: 301006,
// serialNumber: '301006Table1OrderType',
// tableId: "301006Table1",
// tableName: "IQC",
// columnProp: 'orderType',
// headerAlign: "center",
// align: "center",
// columnLabel: '',
// columnHidden: false,
// columnImage: false,
// columnSortable: false,
// sortLv: 0,
// status: true,
// fixed: '',
// columnWidth: 100,
// },
// {
// userId: this.$store.state.user.name,
// functionId: 301006,
// serialNumber: '301006Table1SubmissionType',
// tableId: "301006Table1",
// tableName: "IQC",
// columnProp: 'submissionType',
// headerAlign: "center",
// align: "center",
// columnLabel: '',
// columnHidden: false,
// columnImage: false,
// columnSortable: false,
// sortLv: 0,
// status: true,
// fixed: '',
// columnWidth: 100,
// },
{
userId: this.$store.state.user.name,
functionId: 301006,
@ -1467,24 +1478,24 @@
fixed: '',
columnWidth: 100,
},
{
userId: this.$store.state.user.name,
functionId: 301006,
serialNumber: '301006Table1SubmissionRemark',
tableId: "301006Table1",
tableName: "IQC检验记录表",
columnProp: 'submissionRemark',
headerAlign: "center",
align: "left",
columnLabel: '送检备注',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 200,
},
// {
// userId: this.$store.state.user.name,
// functionId: 301006,
// serialNumber: '301006Table1SubmissionRemark',
// tableId: "301006Table1",
// tableName: "IQC",
// columnProp: 'submissionRemark',
// headerAlign: "center",
// align: "left",
// columnLabel: '',
// columnHidden: false,
// columnImage: false,
// columnSortable: false,
// sortLv: 0,
// status: true,
// fixed: '',
// columnWidth: 200,
// },
],
detailColumnList: [
{
@ -1917,7 +1928,7 @@
authFile: false,
menuId: this.$route.meta.menuId,
roleList: [],
defaultCollaborativeRoleName: 'IQC操作员',
departmentList: [],
operatorList: [],
operatorData: {
flag: '',
@ -1927,6 +1938,7 @@
adminName: '',
roleName: '',
roleId: '',
departmentId: '',
userName: this.$store.state.user.name
},
operatorModelFlag: false,
@ -2255,50 +2267,93 @@
})
},
// store
currentUserSite () {
return this.$store.state.user.site
},
//
getOperatorList () {
this.operatorData.flag = '1'
this.operatorData.bu = buildQcBu(this.detailData.site)
const site = this.currentUserSite()
this.operatorData.site = site
this.operatorData.bu = buildQcBu(site)
const tempDataList = (this.detailData.operator == null ? '' : this.detailData.operator).split(';')
this.$nextTick(() => this.$refs.operatorTable.clearSelection())
this.setDefaultCollaborativeRole(() => {
this.setDefaultCollaborativeDepartment(() => {
this.$nextTick(() => {
this.fetchCollaborativeOperatorData(tempDataList, true)
})
})
},
isMhmResponsibleBu () {
return this.detailData.buNo === '04-MHM'
formatDepartmentLabel (dept) {
if (!dept) return ''
const id = dept.departmentId || ''
const name = dept.departmentName || ''
return name ? `${id} - ${name}` : id
},
// 04-MHM BU
setDefaultCollaborativeRole (callback) {
const apply = () => {
if (this.roleList.length > 0) {
const roleName = this.isMhmResponsibleBu() ? this.defaultCollaborativeRoleName : '系统管理员'
const match = this.roleList.find(item => item.roleName === roleName)
const role = match || this.roleList[0]
this.$set(this.operatorData, 'roleId', role.roleId != null && role.roleId !== '' ? Number(role.roleId) : '')
// sys-department sys_department + Access_dept
setDefaultCollaborativeDepartment (callback) {
this.loadDepartmentList(() => {
if (this.departmentList.length > 0) {
const current = this.operatorData.departmentId
const exists = this.departmentList.some(d => d.departmentId === current)
if (!exists) {
this.$set(this.operatorData, 'departmentId', this.departmentList[0].departmentId)
}
} else {
this.$set(this.operatorData, 'roleId', '')
this.$set(this.operatorData, 'departmentId', '')
}
callback && callback()
}
if (this.roleList.length > 0) {
apply()
} else {
getUserRoleList().then(({ data }) => {
this.roleList = (data && data.code === 0) ? (data.rows || []) : []
apply()
})
})
},
loadDepartmentList (callback) {
departmentSearch({
site: this.currentUserSite(),
username: this.$store.state.user.name,
page: 1,
limit: 500
}).then(({ data }) => {
if (data && data.code === 0) {
this.departmentList = (data.page && data.page.list) || []
} else {
this.departmentList = []
}
callback && callback()
}).catch(() => {
this.departmentList = []
callback && callback()
})
},
buildCollaborativeOperatorParams () {
const site = this.currentUserSite()
return {
...this.operatorData,
site,
bu: buildQcBu(site),
roleId: '',
roleName: '',
department: this.operatorData.departmentId
}
},
// getOperatorListsys_user getResponsibleOperatorList
// Access_dept sys_user
fetchCollaborativeOperatorData (tempDataList, showDialog) {
this.operatorData.roleName = ''
getOperatorList(this.operatorData).then(({ data }) => {
if (!this.operatorData.departmentId) {
if (showDialog) {
const msg = this.departmentList.length === 0
? '当前工厂暂无部门,请先在部门管理中维护'
: '请选择部门'
this.$message.warning(msg)
}
this.operatorList = []
return
}
getOperatorList(this.buildCollaborativeOperatorParams()).then(({ data }) => {
if (data && data.code === 0) {
this.operatorList = data.rows
this.operatorList.forEach(val => {
@ -2319,6 +2374,10 @@
})
},
isMhmResponsibleBu () {
return this.detailData.buNo === '04-MHM'
},
fetchResponsibleOperatorData (tempDataList, showDialog) {
let request
if (this.isMhmResponsibleBu()) {
@ -2375,9 +2434,13 @@
}
},
//
//
getOperatorList2 () {
if (this.operatorData.flag === '1') {
if (!this.operatorData.departmentId) {
this.$message.warning('请选择部门')
return
}
let tempDataList = (this.detailData.operator == null ? '' : this.detailData.operator).split(';')
this.fetchCollaborativeOperatorData(tempDataList, false)
} else {
@ -2431,6 +2494,7 @@
adminName: '',
roleName: '',
roleId: '',
departmentId: '',
userName: this.$store.state.user.name
}
this.operatorModelFlag = false

Loading…
Cancel
Save