From df6b969c18f8032e45d5d76ed4b4c214496bc314 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E4=BC=9F=E4=BD=B3?= <2797716443@qq.com> Date: Wed, 24 Nov 2021 13:57:48 +0800 Subject: [PATCH 1/4] commit --- .../pages/rectificationDatabase.vue | 703 +++++++++++++++++- 1 file changed, 663 insertions(+), 40 deletions(-) diff --git a/src/pages/regulatoryRepository/nonConfomity/pages/rectificationDatabase.vue b/src/pages/regulatoryRepository/nonConfomity/pages/rectificationDatabase.vue index 5d1e0cb47..9e01f36f9 100644 --- a/src/pages/regulatoryRepository/nonConfomity/pages/rectificationDatabase.vue +++ b/src/pages/regulatoryRepository/nonConfomity/pages/rectificationDatabase.vue @@ -22,34 +22,6 @@ {{ opt.label}} - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ 新增 查看 + 编辑
@@ -218,7 +198,7 @@ @@ -420,13 +736,92 @@ export default { return { loading: false, nonList:[], //未符合项表格数据 + projectModel: false, //项目弹窗 + listModel: false, //标准弹窗 + itemModel: false, //条款弹窗 + replaceLoading: false, + //项目检索条件 + projectSearch: { + projectNumber: "", + projectName: "" + }, + //项目数据 + ProjectDatas: [], + itemsData: [], + standList: [], + selectItems: [], + dataList: [], + standPage: 1, + standPageSize: this.$store.getters.userInfo.configContent, + standTotal: 0, + replacePage: 1, + replacePageSize: this.$store.getters.userInfo.configContent, + replaceTotal: 0, + page: 1, + pageSize: this.$store.getters.userInfo.configContent, + total: 0, + drawerTitle: '', + breakId: '', + //存放被勾选的项目的数据 + selectList: [], + addForm:{ + standNumber: '', //标准号 + standName: '', //标准名称 + itemsNum: '', //条款号 + itemsName: '', //条款名称 + projectPlatfor: '', //产品类型 + productLine: '', //产品线 + projectName: '', //项目名称 + researchNonCompliance: '', //不合规项目 + responsibleUnit: '', //责任部门 + responsibleEngineer: '', //责任工程师 + certifiedEngineerName: '', //认证工程师 + qualityEngineerName: '', //质量工程师 + planCloseTime: '', //计划关闭时间 + }, //表单数据 + formRules: { + standNumber: [ + {required: true, message: '请输入标准号', trigger: 'blur'}, + ], + standName: [ + {required: true, message: '请输入标准名称', trigger: 'blur'}, + ], + itemsNum: [ + {required: true, message: '请输入条款号', trigger: 'blur'}, + ], + itemsName: [ + {required: true, message: '请输入条款名称', trigger: 'blur'}, + ], + projectPlatfor: [ + {required: true, message: '请输入产品类型', trigger: 'blur'}, + ], + productLine: [ + {required: true, message: '请输入产品线', trigger: 'blur'}, + ], + projectName: [ + {required: true, message: '请输入项目名称', trigger: 'change'}, + ], + researchNonCompliance: [ + {required: true, message: '请输入不合规项目', trigger: 'blur'}, + ], + responsibleUnit: [ + {required: true, message: '请输入责任部门', trigger: 'blur'}, + ], + responsibleEngineer: [ + {required: true, message: '请输入责任工程师', trigger: 'blur'}, + ], + planCloseTime: [ + {required: true, message: '请选择计划关闭时间', trigger: 'blur'}, + ], + }, + drawerTable: false, //表单模态窗 exportModelFlag: false, //导出模态窗 tableHeight: null, //表格高度 exportName: '', selectedList: [], //标准选中的数据 saveExportType: '',// 导出文件模态框控制,和文件名称 // 总数 - total: 0, + totalNo: 0, // 当前页数 pageNo: 1, nonConformitySearch: { @@ -458,7 +853,7 @@ export default { _this: this }, res => { this.myLoading.loadData = false - this.total = res.data.total + this.totalNo = res.data.total this.pageNo = 1 this.nonList = res.data.records this.nonList.forEach(item => { @@ -494,7 +889,6 @@ export default { } this.exportName = '' this.exportModelFlag = true - console.log(this.saveExportType); }, //取消导出 cancal () { @@ -504,14 +898,12 @@ export default { exportTestItem () { if(this.saveExportType === 'apart') { if (this.selectedList != null && this.selectedList != ''){ - console.log(this.selectedList); const exportURL = interfaceUrl + 'sarStandUnqualified/sar-stand-unqualified/exportStandUnqulifiedExcel?' + 'exportType' + this.saveExportType + '&ids=' + this.selectedList.join(',') + '&exportName=' + this.exportName window.open(exportURL) this.$message.success('导出信息成功') } } else if (this.saveExportType === 'all') { - console.log(this.selectedList); const exportURL = interfaceUrl + 'sarStandUnqualified/sar-stand-unqualified/exportStandUnqulifiedExcel?' + 'exportType' + this.saveExportType + '&ids=' + this.selectedList.join(',') + '&exportName=' + this.exportName window.open(exportURL) @@ -599,7 +991,224 @@ export default { case '查看': this.showUser(command[0]) break + case '编辑': + this.projectEdit(command[0]) + break + } + }, + //项目查询按钮 + getProjectDataBtn(){ + this.page = 1; + this.getProjectData(); + }, + //获取项目数据 + getProjectData() { + this.$http.get("sarStandProjectLibrary/queryProjectWorkFlow", { + page: this.page, + pageSize: this.pageSize, + ...this.projectSearch + }, { + _this: this + }, res => { + if (res.data === null) { + this.ProjectDatas = ""; + this.total = 0; + } else { + this.ProjectDatas = res.data.Maintenance.records; + this.total = res.data.Maintenance.total; + } + }); + + }, + //点击清空按钮事件 + clearSearch() { + this.projectSearch = { + projectName: "", + projectNumber: "" + }; + this.getProjectData(); + }, + //提交 + submit(){ + let jsonArr = [] + const json = JSON.stringify(this.addForm); + const arr = JSON.parse(json) + jsonArr.push(arr) + // for (const item in arr) { + // jsonArr.push(item +':' + arr[item]) + // } + // console.log(jsonArr); + this.$refs["addForm"].validate((valid) => { + if(valid){ + this.$http.postData('sarStandUnqualified/sar-stand-unqualified/add', { + sarStandUnqualified: jsonArr, + }, { + _this: this + }, res => { + if(res.ok){ + this.$message.success('新增成功') + this.getTableByPage() + } + }) + }else{ + this.$message.warning('请完善基础信息') + } + }) + }, + addDrawerClose () { + this.addForm = {} + this.drawerTable = false + }, // 关闭新增drawer + //带入条款确定事件 + replaceLawsNumModelBt(){ + if(this.selectItems.length > 1){ + this.$message.warning('您只能选择一条数据进行带入') + }else if(this.selectItems.length <= 0){ + this.$message.warning('请至少选择一条数据进行带入') + }else{ + this.addForm.itemsName = this.selectItems[0].itemsName + this.addForm.itemsNum = this.selectItems[0].itemsNum + this.itemModel = false + } + + }, + //带入标准取消事件 + closeStand(){ + this.listModel = false; + }, + //带入标准确定事件 + OkStand(){ + if(this.standList.length > 1){ + this.$message.warning('您只能选择一条标准进行带入') + }else if(this.standList.length <= 0){ + this.$message.warning('请至少选择一条数据进行带入') + }else{ + this.breakId = this.standList[0].standId + this.addForm.standName = this.standList[0].standName + this.addForm.standNumber = this.standList[0].standSort + '-' + this.standList[0].standNumber + '-' + this.standList[0].standYear || this.standList[0].standSort + '-' + this.standList[0].standNumber + this.addForm.responsibleUnit = this.standList[0].zrbm || '--' + this.drawerTitle = '新增'; + this.drawerTable = true; + this.listModel = false; + } + }, + getItem(){ + this.$http.get("SarStandItems/sar-stand-items/findAllItems", { + ids: this.breakId, + type: "FBGBJBD" + }, { + _this: this + }, res => { + this.itemsData = res.data + this.replaceTotal = res.data.length + }, e => { + this.$message.error("添加失败"); + }); + }, + //手动查找 + handSeek(){ + this.itemModel = true + this.getItem() + }, + //带入项目取消事件 + closeDrawer() { + this.projectModel = false; + }, + //带入项目确定事件 + OkDrawer() { + if (this.selectList.length > 1) { + this.$message.warning("您只能选择一条数据进行带入"); + } else if (this.selectList.length === 0) { + this.$message.warning("请选择一条数据进行带入"); + } else { + this.projectId = this.selectList[0].id; + this.addForm.productLine = this.selectList[0].productLine + this.addForm.projectPlatfor = this.selectList[0].projectPlatfor + this.addForm.projectName = this.selectList[0].projectName + this.getStandData(); + this.projectModel = false; + this.listModel = true + } + }, + //查询项目下的标准 + getStandData() { + this.$http.get("sarStandProjectLibrary/queryStandInfo", { id: this.projectId }, { + _this: this + }, res => { + res.data.records.forEach(item => { + if(item.zrbm === "[]"){ + item.zrbm = '' + } + }) + this.dataList = res.data.records; + this.dataList.forEach(item => { + // 责任部门转换 + if (item.zrbm !== null || item.zrbm !== "") { + let k = (item.zrbm || "").split(","); + for (let i in this.zrbmOptions) { + for (let m = 0; m < k.length; m++) { + if (this.zrbmOptions[i].value === k[m]) { + k[m] = this.zrbmOptions[i].label; + } + item.zrbm = k.join(","); + } + } + } + }); + }); + }, + //条款的多选框改变 + selectReplaceStandNumRowChange(data){ + this.selectItems = data + }, + //标准的多选框改变 + selectStandChange(data){ + this.standList = data + }, + //项目的多选框改变 + selectListChange(data) { + this.selectList = data; + }, + //单选逻辑 + handleSelectionChanges(selection, val) { + if (selection.length > 1) { + let del_row = selection.shift(); + this.$refs.listSelection.toggleRowSelection(del_row, false); + } + }, + standPageChange(page){ + this.standPage = page + this.getStandData() + }, + standPageSizeChange(pageSize){ + this.standPageSize = pageSize + this.getStandData() + }, + //条款分页 + pageChangeReplace(page){ + this.replacePage = page + this.getItem() + }, + pageSizeChangeReplace(pageSize){ + this.replacePageSize = pageSize + this.getItem() + }, + pageChange(page) { + this.page = page; + this.getProjectData(); + }, + pageSizeChange(pageSize) { + this.pageSize = pageSize; + this.getProjectData(); + }, + //新增事件 + addModel(){ + this.projectModel = true + }, + //编辑事件 + projectEdit(row){ + }, //点击查看按钮事件 showUser(row) { @@ -628,7 +1237,6 @@ export default { }, // 点击查看 handlePreview (item) { - console.log(item); let routeUrl = this.$router.resolve({ name: 'OtherStandardDetails', params: { @@ -641,7 +1249,7 @@ export default { }, detailsStandard (item) { this.$http.post('lawss/sarTestItem/validateStandNumber', { - standnumber: item.standNum + standNumber: item.standNum }, { _this: this }, res => { @@ -670,17 +1278,18 @@ export default { }) }, // 分页事件 - pageChange (page) { + pageChangeNo (page) { this.pageNo = page this.getTableByPage() }, - pageSizeChange (pageSize) { - console.log(pageSize); + pageSizeChangeNo (pageSize) { + this.pageSizeNo = pageSize this.getTableByPage() }, }, mounted () { - + //查询已维护的项目 + this.getProjectData() // 从数据库中查询各下拉框数据 this.$http.get('sys/dictype/getDicTypeListCode', '', { _this: this @@ -744,5 +1353,19 @@ export default { } } } + .add-form-item{ + /deep/ .el-input__inner { + width: 300px; + } + } + .add-input{ + /deep/ .el-input__inner { + width: 370px; + } + } + .tableFooter{ + height: 49px; + float: right; + } } From 091d12ebb02a485ad02ce0f54549cd39ecafc0b7 Mon Sep 17 00:00:00 2001 From: shenyanpei Date: Wed, 24 Nov 2021 14:23:25 +0800 Subject: [PATCH 2/4] weifuhe --- src/api/unqualProcess.js | 9 +++++++++ .../dataStatis/pages/reviseCost.vue | 1 - .../nonConfomity/pages/rectificationDatabase.vue | 15 +++++++++++---- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/api/unqualProcess.js b/src/api/unqualProcess.js index c3f3fc7b0..ae5501f98 100644 --- a/src/api/unqualProcess.js +++ b/src/api/unqualProcess.js @@ -54,3 +54,12 @@ export function meetingByMonth (params) { params }) } + +export function addUn (params) { + return axios({ + url: 'api/sarStandUnqualified/sar-stand-unqualified/add', + method: 'post', + params, + content: 'json' + }) +} diff --git a/src/pages/regulatoryRepository/dataStatis/pages/reviseCost.vue b/src/pages/regulatoryRepository/dataStatis/pages/reviseCost.vue index 3f36f249a..99059bd95 100644 --- a/src/pages/regulatoryRepository/dataStatis/pages/reviseCost.vue +++ b/src/pages/regulatoryRepository/dataStatis/pages/reviseCost.vue @@ -295,7 +295,6 @@ export default { }, e => { }) } else { - console.log(this.formShowData.meetTime) meetEdit(this.formShowData).then(res => { if (res.ok) { this.$message.success('编辑成功') diff --git a/src/pages/regulatoryRepository/nonConfomity/pages/rectificationDatabase.vue b/src/pages/regulatoryRepository/nonConfomity/pages/rectificationDatabase.vue index 9e01f36f9..5739feb9b 100644 --- a/src/pages/regulatoryRepository/nonConfomity/pages/rectificationDatabase.vue +++ b/src/pages/regulatoryRepository/nonConfomity/pages/rectificationDatabase.vue @@ -729,6 +729,7 @@