From c7e279fe1eb2ba6f290862b57c4879b8f5e52661 Mon Sep 17 00:00:00 2001 From: zichen1019 <1510748736@qq.com> Date: Thu, 26 Aug 2021 21:48:59 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8E=9F=E5=A7=8B?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/common/SignName/index.vue | 2 +- src/views/ysjl/3000/common/index.vue | 167 +++++++----------- .../ysjl/3000/common/inspection-items.vue | 145 +++------------ 3 files changed, 80 insertions(+), 234 deletions(-) diff --git a/src/views/common/SignName/index.vue b/src/views/common/SignName/index.vue index 9392c98..889191b 100644 --- a/src/views/common/SignName/index.vue +++ b/src/views/common/SignName/index.vue @@ -15,7 +15,7 @@ - + diff --git a/src/views/ysjl/3000/common/index.vue b/src/views/ysjl/3000/common/index.vue index d83d727..6fcadb4 100644 --- a/src/views/ysjl/3000/common/index.vue +++ b/src/views/ysjl/3000/common/index.vue @@ -52,22 +52,12 @@
基本信息 - + - - - - + + - + @@ -750,7 +740,7 @@ - + @@ -832,13 +822,6 @@ export default { required: true, type: Array }, - // /** - // * 格式为: [{ index: 0, relationIds: [1, 2] }] - // */ - // jyxmRelations: { - // required: true, - // type: Array - // }, fromType: { required: true, type: Number @@ -852,8 +835,8 @@ export default { return { ysjl: {}, param: {}, - jlbh2: new Date().getFullYear(), - jlbh3: '', + jlbh2: '', + jlbh3: new Date().getFullYear(), jlbh4: '', isRepeat: false, jianyanrenyuan: '', @@ -863,17 +846,7 @@ export default { bgfyData: [], ysjlId: this.$route.query.id, checkedTab: 'first', - xmlbListAB: ['A', 'B'], - xmlbListAC: ['A', 'C'], - xmlbListBC: ['B', 'C'], - jyxmrqShow: false, - querenriqi: null, - signShow: false, - dialogEnclosureVisible: false, - dialogRoleVisible: false, userList: [], - defaultRlr: [], - renlingren: [], xinghaoList: [], jybgData: [], cols: [ @@ -914,14 +887,12 @@ export default { fubiao1: [], fubiao2: [], fubiao3: [], - tree: [], - jybgTemplateId: '' + tree: [] } }, created() { if (this.state === 'create') { this.initYsjl() - this.getMaxBh() if (this.fromType === 5 || this.fromType === 6) { this.fubiao1 = [ { @@ -968,22 +939,21 @@ export default { this.ysjl.xianchangjianyantiaojian = '符合' this.departmentId = this.ysjl.departmentId if (data.ysjl.shebeileibiedaima === '3300') { - this.jlbh4 = '(F)' + this.jlbh2 = '(F)' } else if (data.ysjl.shebeileibiedaima === '3200') { - this.jlbh4 = '(Y)' + this.jlbh2 = '(Y)' } else if (data.ysjl.shebeileibiedaima === '3400') { if (data.ysjl.shebeipinzhongdaima === '3420') { - this.jlbh4 = '(X)' + this.jlbh2 = '(X)' } else if (data.ysjl.shebeipinzhongdaima === '3430') { - this.jlbh4 = '(Z)' + this.jlbh2 = '(Z)' } } else { - this.jlbh4 = '(C)' + this.jlbh2 = '(C)' } this.getJyxm(1) this.getSbList() - this.jybgTemplateId = this.ysjl.jybgTemplateId - console.log(this.ysjl.jybgTemplateId) + this.getMaxBh() }) }, getSbList() { @@ -1017,18 +987,16 @@ export default { if (fubiao[2]) { this.fubiao3 = fubiao[2] } - console.log(this.fubiao1) }) }, getYsjl() { this.ysjlService.getYsjl(this.ysjlId).then((data) => { this.ysjl = data this.departmentId = this.ysjl.departmentId - this.jybgTemplateId = this.ysjl.jybgTemplateId this.ysjl.imagePath = '' if ( this.ysjl.jianyanrenyuan !== null && - this.ysjl.jianyanrenyuan.length > 0 + this.ysjl.jianyanrenyuan.length > 0 ) { this.jianyanrenyuan = this.common.convertCnName( this.ysjl.jianyanrenyuan @@ -1101,7 +1069,7 @@ export default { * 查询最大记录编号 */ getMaxBh() { - const aheadPart = this.jlbh1 + this.jlbh2 + '-' + const aheadPart = this.jlbh1 + this.jlbh2 + this.jlbh3 + '-' this.api({ url: '/ysjl/gainCurrentBh', method: 'get', @@ -1110,7 +1078,7 @@ export default { hinderPart: '' } }).then((data) => { - this.jlbh3 = data + this.jlbh4 = data this.ysjlService .judgeRepeat(this.ysjl.jilubianhao, this.ysjl.id) .then((data) => { @@ -1130,21 +1098,21 @@ export default { customClearSign(fieldName) { const data = { id: - this.ysjl.jianyanrenyuan && - this.common - .deleteElement( - this.ysjl.jianyanrenyuan.split(','), - String(this.$store.getters.userId) - ) - .join(','), + this.ysjl.jianyanrenyuan && + this.common + .deleteElement( + this.ysjl.jianyanrenyuan.split(','), + String(this.$store.getters.userId) + ) + .join(','), name: - this.jianyanrenyuan && - this.common - .deleteElement( - this.jianyanrenyuan.split(','), - this.$store.getters.nickname - ) - .join(','), + this.jianyanrenyuan && + this.common + .deleteElement( + this.jianyanrenyuan.split(','), + this.$store.getters.nickname + ) + .join(','), fieldName: fieldName } this.signNameValue(data) @@ -1174,60 +1142,58 @@ export default { return sorted }, buildSaveData(operation) { - const tableData = [] - const _this = this let fubiao if (this.fromType === 5 || this.fromType === 6) { - console.log(this.$refs.table4.tableData, 5555) fubiao = [this.$refs.table4.tableData] } else { fubiao = [this.fubiao1, this.fubiao2, this.fubiao3] } - let arr = [] + const subArr = this.sortClass(this.jybgData) subArr.map((item) => { - if ( - item.some( - (k) => k.jianyanjieguo === '不符合' || k.jianyanjieguo === 'X' - ) - ) { - _this.jybgData[item[0].jybgJyjlIndex - 1].jianyanjielun = '不合格' - } else if ( - item.every( - (k) => k.jianyanjieguo === '符合' || k.jianyanjieguo === '√' - ) - ) { - _this.jybgData[item[0].jybgJyjlIndex - 1].jianyanjielun = '合格' - } else if ( - item.every( - (k) => k.jianyanjieguo === '无此项' || k.jianyanjieguo === '/' - ) - ) { - _this.jybgData[item[0].jybgJyjlIndex - 1].jianyanjielun = '无此项' + if (item.some((k) => k.jianyanjieguo === '不符合')) { + this.jybgData[item[0].jybgJyjlIndex - 1].jianyanjielun = '不合格' + } else if (item.every((k) => k.jianyanjieguo === '符合')) { + this.jybgData[item[0].jybgJyjlIndex - 1].jianyanjielun = '合格' + } else if (item.every((k) => k.jianyanjieguo === '无此项')) { + this.jybgData[item[0].jybgJyjlIndex - 1].jianyanjielun = '无此项' } }) - arr = arr.concat(this.bgfyData, this.jybgData) - arr.forEach((row) => { + const tableData = [] + this.bgfyData.forEach((row) => { tableData.push({ ysjlId: this.ysjlId, beizhu: row.beizhu, dicJyxmId: row.dicJyxmId, - jianyanjieguo: row.jianyanjieguo ? row.jianyanjieguo : '', - jianyanjielun: row.jianyanjielun ? row.jianyanjielun : '', + jianyanjieguo: row.jianyanjieguo || '', + jianyanjielun: row.jianyanjielun || '', jyxmMode: 0, sort: row.sort, orders: row.orders, cjState: 0 }) }) + this.jybgData.forEach((row) => { + tableData.push({ + ysjlId: this.ysjlId, + beizhu: row.beizhu, + dicJyxmId: row.dicJyxmId, + jianyanjieguo: row.jianyanjieguo || '', + jianyanjielun: row.jianyanjielun || '', + jyxmMode: 0, + sort: row.sort, + orders: row.orders, + cjState: 1 + }) + }) if (operation === 'add') { - this.ysjl.jilubianhao = this.jlbh1 + this.jlbh4 + this.jlbh2 + '-' + this.jlbh3 + this.ysjl.jilubianhao = this.jlbh1 + this.jlbh2 + this.jlbh3 + '-' + this.jlbh4 this.save(operation, 'post', tableData, fubiao) } else if (operation === 'build') { this.ysjl.baogaobianhao = this.ysjl.jilubianhao if ( this.ysjl.jilubianhao && - this.ysjl.jilubianhao.indexOf('COPY') > -1 + this.ysjl.jilubianhao.indexOf('COPY') > -1 ) { this.$message({ type: 'error', @@ -1237,7 +1203,7 @@ export default { } if ( this.ysjl.jianyanrenyuan === null || - this.ysjl.jianyanrenyuan === '' + this.ysjl.jianyanrenyuan === '' ) { this.$message({ type: 'error', @@ -1245,21 +1211,12 @@ export default { }) return false } - // for (let i = 0; i < this.bgfyData.length; i++) { - // if (!this.bgfyData[i].jianjianyuan || !this.bgfyData[i].querenriqi) { - // this.$message.error( - // '请将检验项目中的监检人员及监检日期填写完毕,再生成报告!' - // ) - // return false - // } - // } this.save(operation, 'put', tableData, fubiao) } else if (operation === 'upd') { this.save(operation, 'put', tableData, fubiao) } }, save(operation, type, jyxm, fubiao) { - console.log(this.jybgData, 2222) if (this.fromType !== 5 && this.fromType !== 6) { this.ysjl.imagePath = this.$refs.table1.imgPath } // 判断报告编号是否重复 @@ -1297,7 +1254,6 @@ export default { // 刷新路由网址 this.common.reloadViewToUpdateYsjl(this.ysjl) } else if (operation === 'upd') { - this.dialogRoleVisible = false this.$message({ message: '更新成功', type: 'success' }) // 替换路由中的参数 this.$router.push({ @@ -1341,12 +1297,7 @@ export default { }) }, changXh: function(val) { - const xinghao = this.xinghaoList.filter((xh) => xh.xinghao === val)[0] - this.$set( - this.param, - 'jiandingbaogaobianhao', - (xinghao && xinghao.jiandingbaogaobianhao) || '' - ) + // TODO }, loadPhxsImage(data) { this.pic = data diff --git a/src/views/ysjl/3000/common/inspection-items.vue b/src/views/ysjl/3000/common/inspection-items.vue index ab3bc64..4220d31 100644 --- a/src/views/ysjl/3000/common/inspection-items.vue +++ b/src/views/ysjl/3000/common/inspection-items.vue @@ -35,17 +35,13 @@ label="检查结果" >