Browse Source

2026-04-30

RoHs功能
master
fengyuan_yang 1 month ago
parent
commit
7272fd3b14
  1. 9
      src/api/rohs/rohs.js
  2. 2
      src/views/modules/changeManagement/changeRecord.vue
  3. 254
      src/views/modules/rohs/rohsRecord.vue

9
src/api/rohs/rohs.js

@ -12,5 +12,14 @@ export const saveRohs = data => createAPI(`/rohs/save`, 'post', data);
// 修改 // 修改
export const updateRohs = data => createAPI(`/rohs/update`, 'post', data); export const updateRohs = data => createAPI(`/rohs/update`, 'post', data);
// 下达
export const issueRohs = data => createAPI(`/rohs/issue`, 'post', data);
// 审批提交(同意/驳回)
export const submitRohs = data => createAPI(`/rohs/submit`, 'post', data);
// 查询审批信息
export const getRohsApprovalList = data => createAPI(`/rohs/approvalList`, 'post', data);
// 导出 // 导出
export const exportRohs = params => createAPI(`/rohs/export`, 'get', params); export const exportRohs = params => createAPI(`/rohs/export`, 'get', params);

2
src/views/modules/changeManagement/changeRecord.vue

@ -101,7 +101,7 @@
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link v-if="authUpdate && scope.row.changeStatus !== '已完成'" style="cursor: pointer" @click="updateModal(scope.row)">编辑</el-link> <el-link v-if="authUpdate && scope.row.changeStatus !== '已完成'" style="cursor: pointer" @click="updateModal(scope.row)">编辑</el-link>
<el-link v-if="authUpdate && scope.row.changeStatus == '已完成'" style="cursor: pointer" @click="showModal(scope.row)">详情</el-link>
<el-link v-if="authUpdate && scope.row.changeStatus === '已完成'" style="cursor: pointer" @click="showModal(scope.row)">详情</el-link>
<el-link v-if="authIssue && scope.row.changeStatus === '草稿'" style="cursor: pointer" <el-link v-if="authIssue && scope.row.changeStatus === '草稿'" style="cursor: pointer"
:disabled="!!issueLoadingSet[scope.row.changeNo]" :disabled="!!issueLoadingSet[scope.row.changeNo]"
@click="issueModal(scope.row)"> @click="issueModal(scope.row)">

254
src/views/modules/rohs/rohsRecord.vue

@ -9,10 +9,10 @@
<el-input v-model="searchData.applicant" clearable style="width: 120px"></el-input> <el-input v-model="searchData.applicant" clearable style="width: 120px"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="' '"> <el-form-item :label="' '">
<el-button @click="getDataList">查询</el-button>
<el-button @click="addOrUpdateHandle()">新增</el-button>
<el-button @click="exportHandle()">导出</el-button>
<el-button @click="searchHandle()">搜索</el-button>
<el-button v-if="authSearch" @click="getDataList">查询</el-button>
<el-button v-if="authUpdate" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="authSearch" @click="exportHandle()">导出</el-button>
<el-button v-if="authSearch" @click="searchHandle()">搜索</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -56,8 +56,9 @@
<el-table-column prop="remark" header-align="center" align="center" label="备注/Remark" width="220" :show-overflow-tooltip="true"></el-table-column> <el-table-column prop="remark" header-align="center" align="center" label="备注/Remark" width="220" :show-overflow-tooltip="true"></el-table-column>
<el-table-column fixed="right" header-align="center" align="center" width="130" label="操作/Operation"> <el-table-column fixed="right" header-align="center" align="center" width="130" label="操作/Operation">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link style="cursor: pointer" @click="addOrUpdateHandle(scope.row)">编辑</el-link>
<el-link v-if="scope.row.status === '草稿'" style="cursor: pointer; margin-left: 10px;" @click="issueModal(scope.row)">下达</el-link>
<el-link v-if="authUpdate && scope.row.status !== '已完成'" style="cursor: pointer" @click="addOrUpdateHandle(scope.row)">编辑</el-link>
<el-link v-if="authUpdate && scope.row.status === '已完成'" style="cursor: pointer" @click="addOrUpdateHandle(scope.row)">详情</el-link>
<el-link v-if="authIssue && scope.row.status === '草稿'" style="cursor: pointer; margin-left: 10px;" @click="issueModal(scope.row)">下达</el-link>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -73,8 +74,6 @@
layout="total, sizes, prev, pager, next, jumper"> layout="total, sizes, prev, pager, next, jumper">
</el-pagination> </el-pagination>
<!-- 编辑模态框 --> <!-- 编辑模态框 -->
<el-dialog <el-dialog
:title="modalTitle" :title="modalTitle"
@ -290,11 +289,10 @@
</el-tabs> </el-tabs>
<el-footer style="height:35px;margin-top: 15px;text-align:center"> <el-footer style="height:35px;margin-top: 15px;text-align:center">
<el-button type="primary" v-if="modalData.status === '草稿'" @click="dataFormSubmit()">保存</el-button>
<el-button type="primary" v-if="authUpdate && modalData.status === '草稿'" @click="dataFormSubmit()">保存</el-button>
<el-button type="primary" @click="modalFlag = false">关闭</el-button> <el-button type="primary" @click="modalFlag = false">关闭</el-button>
<!-- 走OA流程按钮预留 -->
<el-button type="primary" v-if="modalData.status === '审批中'" @click="agreeSubmit">同意</el-button>
<el-button type="primary" v-if="modalData.status === '审批中'" @click="rejectSubmit">驳回</el-button>
<el-button type="primary" v-if="authSubmit && modalData.status === '审批中'" :loading="submitLoading" @click="agreeSubmit">同意</el-button>
<el-button type="primary" v-if="authReject && modalData.status === '审批中'" :loading="submitLoading" @click="openRejectModal">驳回</el-button>
</el-footer> </el-footer>
</el-dialog> </el-dialog>
@ -340,10 +338,22 @@
</el-form> </el-form>
</el-dialog> </el-dialog>
<el-dialog title="驳回" top="30vh" :close-on-click-modal="false" v-drag :visible.sync="submitModalFlag" width="500px">
<el-form label-position="top">
<el-form-item label="驳回意见/Reject Opinion">
<el-input type="textarea" v-model="rejectOpinion" :rows="3" resize="none" show-word-limit style="width: 479px;height: 30px"></el-input>
</el-form-item>
</el-form>
<el-footer style="height:35px;text-align:center">
<el-button type="primary" :loading="submitLoading" @click="rejectSubmit">确定</el-button>
<el-button type="primary" @click="submitModalFlag = false">取消</el-button>
</el-footer>
</el-dialog>
<!-- 底部附件页签 --> <!-- 底部附件页签 -->
<el-tabs v-model="activeTable" style="width: 100%; height: 100%;" type="border-card" class="customer-tab">
<el-tabs v-model="activeTable" style="width: 100%; height: 100%;" type="border-card" @tab-click="refreshCurrentTabTable" class="customer-tab">
<el-tab-pane label="基本信息" name="basicInfo"> <el-tab-pane label="基本信息" name="basicInfo">
<div :style="{height: secondHeight - 25 + 'px'}" style="margin-left: 5px;margin-top: 0px; overflow-y: auto;">
<div :style="{height: secondHeight + 'px'}" style="margin-left: 5px;margin-top: 5px; overflow-y: auto;">
<el-form :inline="true" label-position="top" :model="currentRow"> <el-form :inline="true" label-position="top" :model="currentRow">
<el-form-item> <el-form-item>
<span slot="label">申请人/Applicant</span> <span slot="label">申请人/Applicant</span>
@ -457,7 +467,7 @@
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="HSF 填写信息" name="hsfInfo"> <el-tab-pane label="HSF 填写信息" name="hsfInfo">
<div :style="{height: secondHeight - 25 + 'px'}" style="margin-left: 5px;margin-top: 0px; overflow-y: auto;">
<div :style="{height: secondHeight + 'px'}" style="margin-left: 5px;margin-top: 5px; overflow-y: auto;">
<el-form :inline="true" label-position="top" :model="currentRow"> <el-form :inline="true" label-position="top" :model="currentRow">
<!-- <el-form-item label="单据状态/Doc Status"><el-input :value="currentRow.status || ''" disabled style="width: 205px"></el-input></el-form-item>--> <!-- <el-form-item label="单据状态/Doc Status"><el-input :value="currentRow.status || ''" disabled style="width: 205px"></el-input></el-form-item>-->
<el-form-item label="SGS报告编号/SGS Report Number"><el-input :value="currentRow.sgsReportNumber || ''" disabled style="width: 205px"></el-input></el-form-item> <el-form-item label="SGS报告编号/SGS Report Number"><el-input :value="currentRow.sgsReportNumber || ''" disabled style="width: 205px"></el-input></el-form-item>
@ -471,7 +481,7 @@
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="NPD 信息" name="npdInfo"> <el-tab-pane label="NPD 信息" name="npdInfo">
<div :style="{height: secondHeight - 25 + 'px'}" style="margin-left: 5px;margin-top: 0px; overflow-y: auto;">
<div :style="{height: secondHeight + 'px'}" style="margin-left: 5px;margin-top: 5px; overflow-y: auto;">
<el-form :inline="true" label-position="top" :model="currentRow"> <el-form :inline="true" label-position="top" :model="currentRow">
<el-form-item label="现有材料不同规格/Same Material Diff Size"><el-input :value="displayYesNo(currentRow.isSameMaterialDiffSize)" disabled style="width: 205px"></el-input></el-form-item> <el-form-item label="现有材料不同规格/Same Material Diff Size"><el-input :value="displayYesNo(currentRow.isSameMaterialDiffSize)" disabled style="width: 205px"></el-input></el-form-item>
<el-form-item label="材料描述/Material Desc." style="display: block;"><el-input type="textarea" :rows="3" :value="currentRow.materialDesc || ''" disabled resize="none" style="width: 636px;height: 30px"></el-input></el-form-item> <el-form-item label="材料描述/Material Desc." style="display: block;"><el-input type="textarea" :rows="3" :value="currentRow.materialDesc || ''" disabled resize="none" style="width: 636px;height: 30px"></el-input></el-form-item>
@ -480,7 +490,7 @@
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="材料信息" name="materialInfo"> <el-tab-pane label="材料信息" name="materialInfo">
<div :style="{height: secondHeight - 25 + 'px'}" style="margin-left: 5px;margin-top: 0px; overflow-y: auto;">
<div :style="{height: secondHeight + 'px'}" style="margin-left: 5px;margin-top: 5px; overflow-y: auto;">
<el-form :inline="true" label-position="top" :model="currentRow"> <el-form :inline="true" label-position="top" :model="currentRow">
<el-form-item label="材料IFS编号/IFS Part No."><el-input :value="currentRow.ifsPartNo || ''" disabled style="width: 205px"></el-input></el-form-item> <el-form-item label="材料IFS编号/IFS Part No."><el-input :value="currentRow.ifsPartNo || ''" disabled style="width: 205px"></el-input></el-form-item>
</el-form> </el-form>
@ -502,6 +512,9 @@
:order-ref2="currentRow.referenceNo"> :order-ref2="currentRow.referenceNo">
</oss-components> </oss-components>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="审批信息" name="approvalInformation">
<approval-information v-model:data-list="approvalList" :height="secondHeight"></approval-information>
</el-tab-pane>
</el-tabs> </el-tabs>
<ChooseList ref="baseList" @getBaseData="getBaseData"></ChooseList> <ChooseList ref="baseList" @getBaseData="getBaseData"></ChooseList>
</div> </div>
@ -518,13 +531,15 @@ import uploadFileList from '../common/uploadFileList'
import ossComponents from '../oss/ossComponents.vue' import ossComponents from '../oss/ossComponents.vue'
import ChooseList from '@/views/modules/common/Chooselist' import ChooseList from '@/views/modules/common/Chooselist'
import DictDataSelect from "../sys/dict-data-select.vue" import DictDataSelect from "../sys/dict-data-select.vue"
import ApprovalInformation from "../changeManagement/approvalInformation.vue"
export default { export default {
components: { components: {
uploadFileList, uploadFileList,
ossComponents, ossComponents,
ChooseList, ChooseList,
DictDataSelect
DictDataSelect,
ApprovalInformation
}, },
data () { data () {
return { return {
@ -557,9 +572,54 @@ export default {
currentRow: {}, currentRow: {},
currentRowNameSeq: 0, currentRowNameSeq: 0,
fileColumnList: [ fileColumnList: [
{columnLabel: '文件名称', columnProp: 'fileName', headerAlign: 'center', align: 'left', columnWidth: '100'},
{columnLabel: '上传人', columnProp: 'createBy', headerAlign: 'center', align: 'left', columnWidth: '100'},
{columnLabel: '上传日期', columnProp: 'createDate', headerAlign: 'center', align: 'center', columnWidth: '100'}
{
columnProp: 'fileName',
headerAlign: 'center',
align: 'center',
columnLabel: '文件名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
status: true,
fixed: '',
columnWidth: 140
},
{
columnProp: 'fileRemark',
headerAlign: 'center',
align: 'center',
columnLabel: '备注',
columnHidden: false,
columnImage: false,
columnSortable: false,
status: true,
fixed: '',
columnWidth: 240
},
{
columnProp: 'createDate',
headerAlign: 'center',
align: 'center',
columnLabel: '上传时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
status: true,
fixed: '',
columnWidth: 140
},
{
columnProp: 'createBy',
headerAlign: 'center',
align: 'center',
columnLabel: '上传人',
columnHidden: false,
columnImage: false,
columnSortable: false,
status: true,
fixed: '',
columnWidth: 140
}
], ],
modalFlag: false, modalFlag: false,
@ -573,8 +633,12 @@ export default {
}, },
projectList: [], projectList: [],
fileList: [], fileList: [],
approvalList: [],
modalTitle: 'RoHs 新增', modalTitle: 'RoHs 新增',
activeName: 'basicInfo', activeName: 'basicInfo',
submitModalFlag: false,
rejectOpinion: '',
submitLoading: false,
modalData: { modalData: {
site: 'DEFAULT', site: 'DEFAULT',
referenceNo: '', referenceNo: '',
@ -624,7 +688,9 @@ export default {
this.checkSuperAdmin() this.checkSuperAdmin()
}, },
mounted () { mounted () {
this.getDataList()
if (this.authSearch) {
this.getDataList()
}
this.$nextTick(() => { this.$nextTick(() => {
this.height = window.innerHeight / 2 - 30 this.height = window.innerHeight / 2 - 30
/*第二个表格高度的动态调整*/ /*第二个表格高度的动态调整*/
@ -675,14 +741,21 @@ export default {
this.currentRow = row || {} this.currentRow = row || {}
} }
this.loadCurrentRowNames() this.loadCurrentRowNames()
this.refreshCurrentTabTable()
}).catch(() => { }).catch(() => {
this.currentRow = row || {} this.currentRow = row || {}
this.loadCurrentRowNames() this.loadCurrentRowNames()
this.refreshCurrentTabTable()
}) })
}, },
currentChange (val) { currentChange (val) {
this.currentRow = val || {} this.currentRow = val || {}
this.loadCurrentRowNames()
if (val) {
this.loadCurrentRowNames()
this.refreshCurrentTabTable()
} else {
this.approvalList = []
}
}, },
loadCurrentRowNames () { loadCurrentRowNames () {
if (!this.currentRow) { if (!this.currentRow) {
@ -779,9 +852,41 @@ export default {
return '' return ''
}) })
}, },
refreshCurrentTabTable () {
if (this.activeTable === 'approvalInformation') {
this.getApprovalList()
}
},
getApprovalList () {
if (!this.currentRow || !this.currentRow.site || !this.currentRow.referenceNo) {
this.approvalList = []
return
}
let params = {
site: this.currentRow.site,
menuId: this.menuId,
documentNo: this.currentRow.referenceNo
}
api.getRohsApprovalList(params).then(({data}) => {
if (data && data.code === 0) {
this.approvalList = data.rows || []
} else {
this.approvalList = []
}
}).catch(() => {
this.approvalList = []
})
},
// //
getDataList () { getDataList () {
if (!this.authSearch) {
this.dataList = []
this.totalPage = 0
this.currentRow = {}
this.approvalList = []
return
}
this.dataListLoading = true this.dataListLoading = true
let params = { let params = {
page: this.pageIndex, page: this.pageIndex,
@ -805,10 +910,12 @@ export default {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
this.currentRow = {} this.currentRow = {}
this.approvalList = []
} }
this.dataListLoading = false this.dataListLoading = false
}).catch(() => { }).catch(() => {
this.currentRow = {} this.currentRow = {}
this.approvalList = []
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
@ -824,6 +931,9 @@ export default {
}, },
// //
searchHandle () { searchHandle () {
if (!this.authSearch) {
return
}
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
@ -837,14 +947,27 @@ export default {
}, },
// //
exportHandle () { exportHandle () {
if (!this.authSearch) {
return
}
this.$message.info('导出功能开发中') this.$message.info('导出功能开发中')
}, },
// / // /
addOrUpdateHandle (row) { addOrUpdateHandle (row) {
if (!row && !this.authUpdate) {
this.$message.warning('没有新增权限')
return
}
if (row && !this.authUpdate) {
this.$message.warning('没有编辑权限')
return
}
this.modalFlag = true this.modalFlag = true
this.activeName = 'basicInfo' this.activeName = 'basicInfo'
this.fileList = [] this.fileList = []
this.uploadDialog = false this.uploadDialog = false
this.submitModalFlag = false
this.rejectOpinion = ''
if (row) { if (row) {
this.modalTitle = 'RoHs 编辑' this.modalTitle = 'RoHs 编辑'
@ -931,6 +1054,10 @@ export default {
}, },
// //
dataFormSubmit () { dataFormSubmit () {
if (!this.authUpdate) {
this.$message.warning('没有保存权限')
return
}
this.modalData.qualificationDocumentsNeeded = this.modalData.qualificationDocumentsNeededList.join(';') this.modalData.qualificationDocumentsNeeded = this.modalData.qualificationDocumentsNeededList.join(';')
this.modalData.testReportIncludingItems = this.modalData.testReportIncludingItemsList.join(';') this.modalData.testReportIncludingItems = this.modalData.testReportIncludingItemsList.join(';')
this.modalData.materialClassify = this.modalData.materialClassifyList.join(';') this.modalData.materialClassify = this.modalData.materialClassifyList.join(';')
@ -948,23 +1075,91 @@ export default {
}, },
// //
agreeSubmit () { agreeSubmit () {
this.$message.info('同意(OA流程)待开发')
if (!this.authSubmit) {
this.$message.warning('没有同意权限')
return
}
this.$confirm('确认同意该申请单?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.submitRohs('Y')
})
},
openRejectModal () {
if (!this.authReject) {
this.$message.warning('没有驳回权限')
return
}
this.rejectOpinion = ''
this.submitModalFlag = true
}, },
// //
rejectSubmit () { rejectSubmit () {
this.$message.info('驳回(OA流程)待开发')
if (!this.rejectOpinion || !this.rejectOpinion.trim()) {
this.$message.warning('请填写驳回意见')
return
}
this.submitRohs('N')
},
submitRohs (nodeConclusion) {
if (nodeConclusion === 'Y' && !this.authSubmit) {
this.$message.warning('没有同意权限')
return
}
if (nodeConclusion === 'N' && !this.authReject) {
this.$message.warning('没有驳回权限')
return
}
if (!this.modalData.site || !this.modalData.referenceNo) {
this.$message.warning('单据主键信息缺失,无法提交审批')
return
}
this.submitLoading = true
let params = {
site: this.modalData.site,
referenceNo: this.modalData.referenceNo,
nodeConclusion: nodeConclusion,
rejectOpinion: nodeConclusion === 'N' ? this.rejectOpinion : '',
menuId: this.menuId,
documentNo: this.modalData.referenceNo
}
api.submitRohs(params).then(({data}) => {
if (data && data.code === 0) {
this.$message.success(nodeConclusion === 'Y' ? '同意成功' : '驳回成功')
this.submitModalFlag = false
this.modalFlag = false
this.getDataList()
} else {
this.$message.error(data.msg || '提交失败')
}
this.submitLoading = false
}).catch(() => {
this.submitLoading = false
})
}, },
// //
issueModal (row) { issueModal (row) {
if (!this.authIssue) {
this.$message.warning('没有下达权限')
return
}
this.$confirm('确认下达该申请单?', '提示', { this.$confirm('确认下达该申请单?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
const data = Object.assign({}, row, { status: '审批中' })
api.updateRohs(data).then(({data}) => {
let params = {
site: row.site,
referenceNo: row.referenceNo
}
api.issueRohs(params).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message.success('下达成功') this.$message.success('下达成功')
if (this.modalFlag && this.modalData.referenceNo === row.referenceNo) {
this.modalData.status = '审批中'
}
this.getDataList() this.getDataList()
} else { } else {
this.$message.error(data.msg || '下达失败') this.$message.error(data.msg || '下达失败')
@ -1234,5 +1429,8 @@ export default {
} }
</script> </script>
<style scoped>
<style scoped lang="scss">
/deep/ .customer-tab .el-tabs__content {
padding: 0 !important;
}
</style> </style>
Loading…
Cancel
Save