Browse Source

换线点检角色只能看到PQC

ecss-tx
han\hanst 6 months ago
parent
commit
f305458209
  1. 4
      src/store/modules/user.js
  2. 1
      src/utils/index.js
  3. 1
      src/views/common/login-token.vue
  4. 1
      src/views/common/login.vue
  5. 12
      src/views/main.vue
  6. 51
      src/views/modules/qc/qcItem.vue
  7. 47
      src/views/modules/qc/qcMethod.vue
  8. 60
      src/views/modules/qc/qcPartAttribute.vue
  9. 47
      src/views/modules/qc/qcTemplate.vue

4
src/store/modules/user.js

@ -10,6 +10,7 @@ export default {
multiLanguage: '', multiLanguage: '',
authControl: '', authControl: '',
erfMsgFlag: 'N', // 工程试验消息通知标志:'Y'=启用通知, 'N'=禁用通知 erfMsgFlag: 'N', // 工程试验消息通知标志:'Y'=启用通知, 'N'=禁用通知
lineInspectionRoleFlag: false, // 是否包含换线点检角色
// favoriteFlag: false, // favoriteFlag: false,
}, },
mutations: { mutations: {
@ -36,6 +37,9 @@ export default {
}, },
updateErfMsgFlag (state, erfMsgFlag) { updateErfMsgFlag (state, erfMsgFlag) {
state.erfMsgFlag = erfMsgFlag state.erfMsgFlag = erfMsgFlag
},
updateLineInspectionRoleFlag (state, lineInspectionRoleFlag) {
state.lineInspectionRoleFlag = lineInspectionRoleFlag
} }
} }
} }

1
src/utils/index.js

@ -56,6 +56,7 @@ export function treeDataTranslate (data, id = 'id', pid = 'parentId') {
*/ */
export function clearLoginInfo () { export function clearLoginInfo () {
Vue.cookie.delete('token') Vue.cookie.delete('token')
localStorage.removeItem('lineInspectionRoleFlag')
store.commit('resetStore') store.commit('resetStore')
router.options.isAddDynamicMenuRoutes = false router.options.isAddDynamicMenuRoutes = false
} }

1
src/views/common/login-token.vue

@ -118,6 +118,7 @@
localStorage.setItem('locale', data.language) localStorage.setItem('locale', data.language)
localStorage.setItem('refresh', "0") localStorage.setItem('refresh', "0")
localStorage.setItem('userName', data.userName) localStorage.setItem('userName', data.userName)
localStorage.setItem('lineInspectionRoleFlag', data.lineInspectionRoleFlag ? 'Y' : 'N')
localStorage.setItem('accessSite', this.urlParam.site) localStorage.setItem('accessSite', this.urlParam.site)
this.getConfigParams() this.getConfigParams()
} else { } else {

1
src/views/common/login.vue

@ -132,6 +132,7 @@ import { getUUID } from '@/utils'
localStorage.setItem('locale', data.language) localStorage.setItem('locale', data.language)
localStorage.setItem('refresh', "0") localStorage.setItem('refresh', "0")
localStorage.setItem('userName', this.dataForm.userName) localStorage.setItem('userName', this.dataForm.userName)
localStorage.setItem('lineInspectionRoleFlag', data.lineInspectionRoleFlag ? 'Y' : 'N')
this.getConfigParams() this.getConfigParams()
// 登录成功后关闭loading(路由跳转会自动关闭,这里作为备用) // 登录成功后关闭loading(路由跳转会自动关闭,这里作为备用)

12
src/views/main.vue

@ -104,6 +104,14 @@
this.$store.commit('user/updateErfMsgFlag', val) this.$store.commit('user/updateErfMsgFlag', val)
} }
}, },
lineInspectionRoleFlag: {
get() {
return this.$store.state.user.lineInspectionRoleFlag
},
set(val) {
this.$store.commit('user/updateLineInspectionRoleFlag', val)
}
},
}, },
created() { created() {
this.getUserInfo() this.getUserInfo()
@ -136,6 +144,10 @@
this.userDisplay = data.user.userDisplay this.userDisplay = data.user.userDisplay
// 工程试验消息通知标志:'Y'=启用通知, 'N'=禁用通知 // 工程试验消息通知标志:'Y'=启用通知, 'N'=禁用通知
this.erfMsgFlag = data.user.erfMsgFlag || 'N' this.erfMsgFlag = data.user.erfMsgFlag || 'N'
const cacheLineInspectionRoleFlag = localStorage.getItem('lineInspectionRoleFlag') === 'Y'
const backendLineInspectionRoleFlag = data.user.lineInspectionRoleFlag
this.lineInspectionRoleFlag = backendLineInspectionRoleFlag === undefined ? cacheLineInspectionRoleFlag : !!backendLineInspectionRoleFlag
localStorage.setItem('lineInspectionRoleFlag', this.lineInspectionRoleFlag ? 'Y' : 'N')
} }
}) })
}, },

51
src/views/modules/qc/qcItem.vue

@ -19,8 +19,8 @@
<el-input v-model="searchData.itemDesc" clearable style="width: 200px"></el-input> <el-input v-model="searchData.itemDesc" clearable style="width: 200px"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="检验类型"> <el-form-item label="检验类型">
<el-select v-model="searchData.inspectionTypeNo" placeholder="请选择" style="width: 100px">
<el-option label="全部" value=""></el-option>
<el-select v-model="searchData.inspectionTypeNo" :disabled="lineInspectionRoleFlag" placeholder="请选择" style="width: 100px">
<el-option v-if="!lineInspectionRoleFlag" label="全部" value=""></el-option>
<el-option <el-option
v-for = "i in options" v-for = "i in options"
:key = "i.inspectionTypeNo" :key = "i.inspectionTypeNo"
@ -131,7 +131,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="检验类型" prop="inspectionTypeNo" :rules="rules.inspectionTypeNoType"> <el-form-item label="检验类型" prop="inspectionTypeNo" :rules="rules.inspectionTypeNoType">
<el-select v-model="modalData.inspectionTypeNo" placeholder="请选择" style="width: 143px">
<el-select v-model="modalData.inspectionTypeNo" :disabled="lineInspectionRoleFlag" placeholder="请选择" style="width: 143px">
<el-option <el-option
v-for = "i in options" v-for = "i in options"
:key = "i.inspectionTypeNo" :key = "i.inspectionTypeNo"
@ -941,6 +941,8 @@
authSave: false, authSave: false,
authUpdate: false, authUpdate: false,
authDelete: false, authDelete: false,
lineInspectionRoleFlag: false,
pqcInspectionTypeNo: '108',
menuId: this.$route.meta.menuId, menuId: this.$route.meta.menuId,
dataContentList: [], dataContentList: [],
objectSelections1: [], objectSelections1: [],
@ -967,6 +969,8 @@
created () { created () {
// 按钮控制 // 按钮控制
this.getButtonAuthData() this.getButtonAuthData()
// 当前用户是否包含换线点检角色
this.lineInspectionRoleFlag = this.resolveLineInspectionRoleFlag()
// 获取用户的 site 和 bu // 获取用户的 site 和 bu
this.getSiteAndBuByUserName() this.getSiteAndBuByUserName()
// 校验用户是否收藏 // 校验用户是否收藏
@ -1133,6 +1137,31 @@
}) })
}, },
// 是否包含换线点检角色
resolveLineInspectionRoleFlag () {
return this.$store.state.user.lineInspectionRoleFlag === true || localStorage.getItem('lineInspectionRoleFlag') === 'Y'
},
// 获取PQC对应的检验类型编码
getPqcInspectionTypeNo () {
const pqcData = this.options.find(item => item.inspectionTypeName && item.inspectionTypeName==='PQC')
if (pqcData) {
this.pqcInspectionTypeNo = pqcData.inspectionTypeNo
}
return this.pqcInspectionTypeNo
},
// 换线点检角色仅允许PQC
applyPqcInspectionTypeLimit () {
if (!this.lineInspectionRoleFlag) {
return
}
const pqcInspectionTypeNo = this.getPqcInspectionTypeNo()
this.searchData.inspectionTypeNo = pqcInspectionTypeNo
this.modalData.inspectionTypeNo = pqcInspectionTypeNo
this.methodData.inspectionTypeNo = pqcInspectionTypeNo
},
// bu改变事件 // bu改变事件
buChangeFunction () { buChangeFunction () {
//this.modalData.collectionConditionList = [] //this.modalData.collectionConditionList = []
@ -1212,6 +1241,13 @@
inspectionTypeSearch(tempData).then(({data}) => { inspectionTypeSearch(tempData).then(({data}) => {
if (data.code === 0) { if (data.code === 0) {
this.options = data.rows this.options = data.rows
if (this.lineInspectionRoleFlag) {
const pqcInspectionTypeNo = this.getPqcInspectionTypeNo()
this.options = this.options.filter(item => item.inspectionTypeNo === pqcInspectionTypeNo)
this.searchData.inspectionTypeNo = pqcInspectionTypeNo
this.modalData.inspectionTypeNo = pqcInspectionTypeNo
this.methodData.inspectionTypeNo = pqcInspectionTypeNo
}
} }
}) })
}, },
@ -1234,6 +1270,7 @@
// 获取数据列表 // 获取数据列表
getDataList () { getDataList () {
this.applyPqcInspectionTypeLimit()
this.searchData.limit = this.pageSize this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex this.searchData.page = this.pageIndex
qcItemSearch(this.searchData).then(({data}) => { qcItemSearch(this.searchData).then(({data}) => {
@ -1261,7 +1298,7 @@
methodNo: '', methodNo: '',
methodName: '', methodName: '',
updateBy: '', updateBy: '',
inspectionTypeNo: '',
inspectionTypeNo: this.lineInspectionRoleFlag ? this.getPqcInspectionTypeNo() : '',
itemSamplingQuantity: '', itemSamplingQuantity: '',
samplingProgrammeNo: '', samplingProgrammeNo: '',
samplingProgrammeDesc: '', samplingProgrammeDesc: '',
@ -1302,7 +1339,7 @@
methodNo: row.methodNo, methodNo: row.methodNo,
methodName: row.methodName, methodName: row.methodName,
updateBy: this.$store.state.user.name, updateBy: this.$store.state.user.name,
inspectionTypeNo: row.inspectionTypeNo,
inspectionTypeNo: this.lineInspectionRoleFlag ? this.getPqcInspectionTypeNo() : row.inspectionTypeNo,
itemSamplingQuantity: row.itemSamplingQuantity, itemSamplingQuantity: row.itemSamplingQuantity,
samplingProgrammeNo: row.samplingProgrammeNo, samplingProgrammeNo: row.samplingProgrammeNo,
samplingProgrammeDesc: row.samplingProgrammeDesc, samplingProgrammeDesc: row.samplingProgrammeDesc,
@ -1353,6 +1390,7 @@
}, },
saveData () { saveData () {
this.applyPqcInspectionTypeLimit()
if (this.modalData.bu === '' || this.modalData.bu == null) { if (this.modalData.bu === '' || this.modalData.bu == null) {
this.$message.warning('请选择BU!') this.$message.warning('请选择BU!')
return return
@ -1432,7 +1470,7 @@
// 获取检验方法列表 // 获取检验方法列表
queryMethodList () { queryMethodList () {
this.methodData.bu = this.modalData.bu this.methodData.bu = this.modalData.bu
this.methodData.inspectionTypeNo = this.modalData.inspectionTypeNo
this.methodData.inspectionTypeNo = this.lineInspectionRoleFlag ? this.getPqcInspectionTypeNo() : this.modalData.inspectionTypeNo
queryMethodList(this.methodData).then(({data}) => { queryMethodList(this.methodData).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.methodList = data.rows this.methodList = data.rows
@ -1489,6 +1527,7 @@
//导出excel //导出excel
async createExportData() { async createExportData() {
this.applyPqcInspectionTypeLimit()
this.searchData.limit = -1 this.searchData.limit = -1
this.searchData.page = 1 this.searchData.page = 1
await qcItemSearch(this.searchData).then(({data}) => { await qcItemSearch(this.searchData).then(({data}) => {

47
src/views/modules/qc/qcMethod.vue

@ -19,8 +19,8 @@
<el-input v-model="searchData.methodName" clearable style="width: 200px"></el-input> <el-input v-model="searchData.methodName" clearable style="width: 200px"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="检验类型"> <el-form-item label="检验类型">
<el-select v-model="searchData.inspectionTypeNo" placeholder="请选择" style="width: 100px">
<el-option label="全部" value=""></el-option>
<el-select v-model="searchData.inspectionTypeNo" :disabled="lineInspectionRoleFlag" placeholder="请选择" style="width: 100px">
<el-option v-if="!lineInspectionRoleFlag" label="全部" value=""></el-option>
<el-option <el-option
v-for = "i in options" v-for = "i in options"
:key = "i.inspectionTypeNo" :key = "i.inspectionTypeNo"
@ -123,7 +123,7 @@
<el-input v-model="modalData.methodName" style="width: 221px"></el-input> <el-input v-model="modalData.methodName" style="width: 221px"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="检验类型:" prop="inspectionTypeNo" :rules="rules.inspectionTypeNoType"> <el-form-item label="检验类型:" prop="inspectionTypeNo" :rules="rules.inspectionTypeNoType">
<el-select v-model="modalData.inspectionTypeNo" placeholder="请选择" style="width: 221px">
<el-select v-model="modalData.inspectionTypeNo" :disabled="lineInspectionRoleFlag" placeholder="请选择" style="width: 221px">
<el-option <el-option
v-for = "i in options" v-for = "i in options"
:key = "i.inspectionTypeNo" :key = "i.inspectionTypeNo"
@ -389,6 +389,8 @@
}, },
options: [], options: [],
userBuList: [], userBuList: [],
lineInspectionRoleFlag: false,
pqcInspectionTypeNo: '108',
authSearch: false, authSearch: false,
authSave: false, authSave: false,
authUpdate: false, authUpdate: false,
@ -406,6 +408,8 @@
created () { created () {
// 按钮控制 // 按钮控制
this.getButtonAuthData() this.getButtonAuthData()
// 当前用户是否包含换线点检角色
this.lineInspectionRoleFlag = this.resolveLineInspectionRoleFlag()
// 获取用户的 site 和 bu // 获取用户的 site 和 bu
this.getSiteAndBuByUserName() this.getSiteAndBuByUserName()
// 校验用户是否收藏 // 校验用户是否收藏
@ -442,8 +446,33 @@
}) })
}, },
// 是否包含换线点检角色
resolveLineInspectionRoleFlag () {
return this.$store.state.user.lineInspectionRoleFlag === true || localStorage.getItem('lineInspectionRoleFlag') === 'Y'
},
// 获取PQC对应的检验类型编码
getPqcInspectionTypeNo () {
const pqcData = this.options.find(item => item.inspectionTypeName && item.inspectionTypeName==='PQC')
if (pqcData) {
this.pqcInspectionTypeNo = pqcData.inspectionTypeNo
}
return this.pqcInspectionTypeNo
},
// 换线点检角色仅允许PQC
applyPqcInspectionTypeLimit () {
if (!this.lineInspectionRoleFlag) {
return
}
const pqcInspectionTypeNo = this.getPqcInspectionTypeNo()
this.searchData.inspectionTypeNo = pqcInspectionTypeNo
this.modalData.inspectionTypeNo = pqcInspectionTypeNo
},
// 查询获取数据列表 // 查询获取数据列表
getDataList () { getDataList () {
this.applyPqcInspectionTypeLimit()
this.searchData.limit = this.pageSize this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex this.searchData.page = this.pageIndex
qcMethodSearch(this.searchData).then(({data}) => { qcMethodSearch(this.searchData).then(({data}) => {
@ -480,7 +509,7 @@
methodNo: '', methodNo: '',
methodName: '', methodName: '',
methodRemark: '', methodRemark: '',
inspectionTypeNo: ''
inspectionTypeNo: this.lineInspectionRoleFlag ? this.getPqcInspectionTypeNo() : ''
} }
this.modalDisableFlag = false this.modalDisableFlag = false
this.modalFlag = true this.modalFlag = true
@ -497,7 +526,7 @@
methodNo: row.methodNo, methodNo: row.methodNo,
methodName: row.methodName, methodName: row.methodName,
methodRemark: row.methodRemark, methodRemark: row.methodRemark,
inspectionTypeNo: row.inspectionTypeNo
inspectionTypeNo: this.lineInspectionRoleFlag ? this.getPqcInspectionTypeNo() : row.inspectionTypeNo
} }
this.modalDisableFlag = true this.modalDisableFlag = true
this.modalFlag = true this.modalFlag = true
@ -531,6 +560,7 @@
// 新增/修改方法 // 新增/修改方法
saveData () { saveData () {
this.applyPqcInspectionTypeLimit()
if (this.modalData.bu === '' || this.modalData.bu == null) { if (this.modalData.bu === '' || this.modalData.bu == null) {
this.$message.warning('请选择BU!') this.$message.warning('请选择BU!')
return return
@ -588,6 +618,12 @@
inspectionTypeSearch(tempData).then(({data}) => { inspectionTypeSearch(tempData).then(({data}) => {
if (data.code === 0) { if (data.code === 0) {
this.options = data.rows this.options = data.rows
if (this.lineInspectionRoleFlag) {
const pqcInspectionTypeNo = this.getPqcInspectionTypeNo()
this.options = this.options.filter(item => item.inspectionTypeNo === pqcInspectionTypeNo)
this.searchData.inspectionTypeNo = pqcInspectionTypeNo
this.modalData.inspectionTypeNo = pqcInspectionTypeNo
}
} }
}) })
}, },
@ -629,6 +665,7 @@
//导出excel //导出excel
async createExportData() { async createExportData() {
this.applyPqcInspectionTypeLimit()
this.searchData.limit = -1 this.searchData.limit = -1
this.searchData.page = 1 this.searchData.page = 1
await qcMethodSearch(this.searchData).then(({data}) => { await qcMethodSearch(this.searchData).then(({data}) => {

60
src/views/modules/qc/qcPartAttribute.vue

@ -279,7 +279,7 @@
<el-input v-model="detailData.templateName" clearable style="width: 120px"></el-input> <el-input v-model="detailData.templateName" clearable style="width: 120px"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="检验类型"> <el-form-item label="检验类型">
<el-select v-model="detailData.inspectionTypeNo" @change="checkInspectionType()" placeholder="请选择">
<el-select v-model="detailData.inspectionTypeNo" :disabled="lineInspectionRoleFlag" @change="checkInspectionType()" placeholder="请选择">
<el-option <el-option
v-for = "i in options" v-for = "i in options"
:key = "i.inspectionTypeNo" :key = "i.inspectionTypeNo"
@ -553,8 +553,8 @@
<el-button type="primary" @click="uploadSopFile">上传文件</el-button> <el-button type="primary" @click="uploadSopFile">上传文件</el-button>
</el-form-item> </el-form-item>
<el-form-item label="检验类型" style="margin-left: 448px"> <el-form-item label="检验类型" style="margin-left: 448px">
<el-select v-model="sopData.inspectionTypeNo" placeholder="请选择">
<el-option label="全部" value=""></el-option>
<el-select v-model="sopData.inspectionTypeNo" :disabled="lineInspectionRoleFlag" placeholder="请选择">
<el-option v-if="!lineInspectionRoleFlag" label="全部" value=""></el-option>
<el-option <el-option
v-for = "i in options" v-for = "i in options"
:key = "i.inspectionTypeNo" :key = "i.inspectionTypeNo"
@ -1326,6 +1326,8 @@
authDelete: false, authDelete: false,
authDetail: false, authDetail: false,
authFile: false, authFile: false,
lineInspectionRoleFlag: false,
pqcInspectionTypeNo: '108',
menuId: this.$route.meta.menuId, menuId: this.$route.meta.menuId,
} }
}, },
@ -1339,6 +1341,8 @@
created () { created () {
// 按钮控制 // 按钮控制
this.getButtonAuthData() this.getButtonAuthData()
// 当前用户是否包含换线点检角色
this.lineInspectionRoleFlag = this.resolveLineInspectionRoleFlag()
// 获取用户的 site 和 bu // 获取用户的 site 和 bu
this.getSiteAndBuByUserName() this.getSiteAndBuByUserName()
// 校验用户是否收藏 // 校验用户是否收藏
@ -1395,6 +1399,12 @@
inspectionTypeSearch(tempData).then(({data}) => { inspectionTypeSearch(tempData).then(({data}) => {
if (data.code === 0) { if (data.code === 0) {
this.options = data.rows this.options = data.rows
if (this.lineInspectionRoleFlag) {
const pqcInspectionTypeNo = this.getPqcInspectionTypeNo()
this.options = this.options.filter(item => item.inspectionTypeNo === pqcInspectionTypeNo)
this.detailData.inspectionTypeNo = pqcInspectionTypeNo
this.sopData.inspectionTypeNo = pqcInspectionTypeNo
}
} }
}) })
}, },
@ -1655,11 +1665,16 @@
partNo: this.detailData.partNo, partNo: this.detailData.partNo,
attributeNo: this.detailData.attributeNo || this.detailData.partNo, attributeNo: this.detailData.attributeNo || this.detailData.partNo,
attributeType: this.detailData.attributeType || 'A', attributeType: this.detailData.attributeType || 'A',
createBy: this.detailData.createBy
createBy: this.detailData.createBy,
inspectionTypeNo: this.lineInspectionRoleFlag ? this.getPqcInspectionTypeNo() : ''
} }
return searchPartAttributeDetails(param).then(({ data }) => { return searchPartAttributeDetails(param).then(({ data }) => {
if (seq !== this._detailListLoadSeq) return if (seq !== this._detailListLoadSeq) return
const rows = (data && data.rows) ? data.rows : []
let rows = (data && data.rows) ? data.rows : []
if (this.lineInspectionRoleFlag) {
const pqcInspectionTypeNo = this.getPqcInspectionTypeNo()
rows = rows.filter(item => item.inspectionTypeNo === pqcInspectionTypeNo || (item.inspectionTypeName && item.inspectionTypeName==='PQC'))
}
this.detailList = rows.slice() this.detailList = rows.slice()
}) })
}, },
@ -1676,6 +1691,9 @@
}, },
checkInspectionType () { checkInspectionType () {
if (this.lineInspectionRoleFlag) {
this.detailData.inspectionTypeNo = this.getPqcInspectionTypeNo()
}
this.operationData.inspectionTypeNo = this.detailData.inspectionTypeNo this.operationData.inspectionTypeNo = this.detailData.inspectionTypeNo
getPartTemplateLists(this.detailData).then(({data}) => { getPartTemplateLists(this.detailData).then(({data}) => {
this.operation = '' this.operation = ''
@ -1689,11 +1707,20 @@
addFastModal () { addFastModal () {
this.itemSelections1 = null this.itemSelections1 = null
this.itemSelections2 = null this.itemSelections2 = null
if (this.lineInspectionRoleFlag) {
this.detailData.inspectionTypeNo = this.getPqcInspectionTypeNo()
}
getPartTemplateLists(this.detailData).then(({data}) => { getPartTemplateLists(this.detailData).then(({data}) => {
this.itemList1 = data.row1 this.itemList1 = data.row1
this.itemList2 = data.row2 this.itemList2 = data.row2
}) })
this.detailData.inspectionTypeNo = this.options[0].inspectionTypeNo
if (this.lineInspectionRoleFlag) {
this.detailData.inspectionTypeNo = this.getPqcInspectionTypeNo()
} else if (this.options.length > 0) {
this.detailData.inspectionTypeNo = this.options[0].inspectionTypeNo
} else {
this.detailData.inspectionTypeNo = ''
}
this.checkInspectionType() this.checkInspectionType()
this.dataListOperationSelections = [] this.dataListOperationSelections = []
this.operation = '' this.operation = ''
@ -2088,12 +2115,15 @@
site: row.site, site: row.site,
buNo: row.buNo, buNo: row.buNo,
partNo: row.partNo, partNo: row.partNo,
inspectionTypeNo: ''
inspectionTypeNo: this.lineInspectionRoleFlag ? this.getPqcInspectionTypeNo() : ''
} }
this.getFileContentList() this.getFileContentList()
}, },
getFileContentList () { getFileContentList () {
if (this.lineInspectionRoleFlag) {
this.sopData.inspectionTypeNo = this.getPqcInspectionTypeNo()
}
let tempData = { let tempData = {
orderRef1: this.sopData.site, orderRef1: this.sopData.site,
orderRef2: this.sopData.partNo, orderRef2: this.sopData.partNo,
@ -2118,7 +2148,7 @@
buNo: this.sopData.buNo, buNo: this.sopData.buNo,
createBy: this.$store.state.user.name, createBy: this.$store.state.user.name,
partNo: this.sopData.partNo, partNo: this.sopData.partNo,
inspectionTypeNo: '',
inspectionTypeNo: this.lineInspectionRoleFlag ? this.getPqcInspectionTypeNo() : '',
options: this.options options: this.options
} }
//打开组件 去做新增业务 //打开组件 去做新增业务
@ -2262,6 +2292,20 @@
this.authDetail = !detailFlag this.authDetail = !detailFlag
this.authFile = !fileFlag this.authFile = !fileFlag
}, },
// 是否包含换线点检角色
resolveLineInspectionRoleFlag () {
return this.$store.state.user.lineInspectionRoleFlag === true || localStorage.getItem('lineInspectionRoleFlag') === 'Y'
},
// 获取PQC对应的检验类型编码
getPqcInspectionTypeNo () {
const pqcData = this.options.find(item => item.inspectionTypeName && item.inspectionTypeName==='PQC')
if (pqcData) {
this.pqcInspectionTypeNo = pqcData.inspectionTypeNo
}
return this.pqcInspectionTypeNo
},
} }
} }
</script> </script>

47
src/views/modules/qc/qcTemplate.vue

@ -19,8 +19,8 @@
<el-input v-model="searchData.templateName" clearable style="width: 200px"></el-input> <el-input v-model="searchData.templateName" clearable style="width: 200px"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="检验类型"> <el-form-item label="检验类型">
<el-select v-model="searchData.inspectionTypeNo" placeholder="请选择" style="width: 100px">
<el-option label="全部" value=""></el-option>
<el-select v-model="searchData.inspectionTypeNo" :disabled="lineInspectionRoleFlag" placeholder="请选择" style="width: 100px">
<el-option v-if="!lineInspectionRoleFlag" label="全部" value=""></el-option>
<el-option <el-option
v-for = "i in options" v-for = "i in options"
:key = "i.inspectionTypeNo" :key = "i.inspectionTypeNo"
@ -127,7 +127,7 @@
<el-input v-model="modalData.templateName" style="width: 221px"></el-input> <el-input v-model="modalData.templateName" style="width: 221px"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="检验类型" prop="inspectionTypeNo" :rules="rules.inspectionTypeNoType"> <el-form-item label="检验类型" prop="inspectionTypeNo" :rules="rules.inspectionTypeNoType">
<el-select v-model="modalData.inspectionTypeNo" placeholder="请选择" style="width: 221px">
<el-select v-model="modalData.inspectionTypeNo" :disabled="lineInspectionRoleFlag" placeholder="请选择" style="width: 221px">
<el-option <el-option
v-for = "i in options" v-for = "i in options"
:key = "i.inspectionTypeNo" :key = "i.inspectionTypeNo"
@ -1025,6 +1025,8 @@
authUpdate: false, authUpdate: false,
authDelete: false, authDelete: false,
authDetail: false, authDetail: false,
lineInspectionRoleFlag: false,
pqcInspectionTypeNo: '108',
menuId: this.$route.meta.menuId, menuId: this.$route.meta.menuId,
inspectionStandardModalFlag: false, inspectionStandardModalFlag: false,
standardData: { standardData: {
@ -1048,6 +1050,8 @@
created () { created () {
// 按钮控制 // 按钮控制
this.getButtonAuthData() this.getButtonAuthData()
// 当前用户是否包含换线点检角色
this.lineInspectionRoleFlag = this.resolveLineInspectionRoleFlag()
// 获取用户的 site 和 bu // 获取用户的 site 和 bu
this.getSiteAndBuByUserName() this.getSiteAndBuByUserName()
// 校验用户是否收藏 // 校验用户是否收藏
@ -1198,6 +1202,30 @@
}) })
}, },
// 是否包含换线点检角色
resolveLineInspectionRoleFlag () {
return this.$store.state.user.lineInspectionRoleFlag === true || localStorage.getItem('lineInspectionRoleFlag') === 'Y'
},
// 获取PQC对应的检验类型编码
getPqcInspectionTypeNo () {
const pqcData = this.options.find(item => item.inspectionTypeName && item.inspectionTypeName==='PQC')
if (pqcData) {
this.pqcInspectionTypeNo = pqcData.inspectionTypeNo
}
return this.pqcInspectionTypeNo
},
// 换线点检角色仅允许PQC
applyPqcInspectionTypeLimit () {
if (!this.lineInspectionRoleFlag) {
return
}
const pqcInspectionTypeNo = this.getPqcInspectionTypeNo()
this.searchData.inspectionTypeNo = pqcInspectionTypeNo
this.modalData.inspectionTypeNo = pqcInspectionTypeNo
},
/** /**
* 查询检验项目 * 查询检验项目
*/ */
@ -1217,6 +1245,12 @@
inspectionTypeSearch(tempData).then(({data}) => { inspectionTypeSearch(tempData).then(({data}) => {
if (data.code === 0) { if (data.code === 0) {
this.options = data.rows this.options = data.rows
if (this.lineInspectionRoleFlag) {
const pqcInspectionTypeNo = this.getPqcInspectionTypeNo()
this.options = this.options.filter(item => item.inspectionTypeNo === pqcInspectionTypeNo)
this.searchData.inspectionTypeNo = pqcInspectionTypeNo
this.modalData.inspectionTypeNo = pqcInspectionTypeNo
}
} }
}) })
}, },
@ -1308,6 +1342,7 @@
// 获取数据列表 // 获取数据列表
getDataList () { getDataList () {
this.applyPqcInspectionTypeLimit()
this.searchData.limit = this.pageSize this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex this.searchData.page = this.pageIndex
templateSearch(this.searchData).then(({data}) => { templateSearch(this.searchData).then(({data}) => {
@ -1345,7 +1380,7 @@
templateVersion: '', templateVersion: '',
samplingProgrammeNo: '', samplingProgrammeNo: '',
samplingProgrammeDesc: '', samplingProgrammeDesc: '',
inspectionTypeNo: '',
inspectionTypeNo: this.lineInspectionRoleFlag ? this.getPqcInspectionTypeNo() : '',
inspectionCycle: '', inspectionCycle: '',
createBy: this.$store.state.user.name, createBy: this.$store.state.user.name,
updateBy: this.$store.state.user.name, updateBy: this.$store.state.user.name,
@ -1371,7 +1406,7 @@
templateVersion: row.templateVersion, templateVersion: row.templateVersion,
samplingProgrammeNo: row.samplingProgrammeNo, samplingProgrammeNo: row.samplingProgrammeNo,
samplingProgrammeDesc: row.samplingProgrammeDesc, samplingProgrammeDesc: row.samplingProgrammeDesc,
inspectionTypeNo: row.inspectionTypeNo,
inspectionTypeNo: this.lineInspectionRoleFlag ? this.getPqcInspectionTypeNo() : row.inspectionTypeNo,
createBy: this.$store.state.user.name, createBy: this.$store.state.user.name,
updateBy: this.$store.state.user.name, updateBy: this.$store.state.user.name,
samplingLevelNo: row.samplingLevelNo, samplingLevelNo: row.samplingLevelNo,
@ -1414,6 +1449,7 @@
}, },
saveData () { saveData () {
this.applyPqcInspectionTypeLimit()
if (this.modalData.bu === '' || this.modalData.bu == null) { if (this.modalData.bu === '' || this.modalData.bu == null) {
this.$message.warning('请选择BU!') this.$message.warning('请选择BU!')
return return
@ -1701,6 +1737,7 @@
//导出excel //导出excel
async createExportData () { async createExportData () {
this.applyPqcInspectionTypeLimit()
this.searchData.limit = -1 this.searchData.limit = -1
this.searchData.page = 1 this.searchData.page = 1
await templateSearch(this.searchData).then(({data}) => { await templateSearch(this.searchData).then(({data}) => {

Loading…
Cancel
Save