|
|
@ -693,7 +693,7 @@ |
|
|
|
</el-form> |
|
|
|
</el-tab-pane> |
|
|
|
<el-tab-pane label="检验项目" name="second"> |
|
|
|
<Inspection :bgfy-data="bgfyData" /> |
|
|
|
<Inspection :bgfy-data="bgfyData" :jybg-data="jybgData" /> |
|
|
|
</el-tab-pane> |
|
|
|
<el-tab-pane v-if="fromType === 5 ||fromType === 6" label="附表1" name="three"> |
|
|
|
<zdft-fb ref="table4" :table-data.sync="fubiao1" :state.sync="state" /> |
|
|
@ -790,6 +790,7 @@ export default { |
|
|
|
defaultRlr: [], |
|
|
|
renlingren: [], |
|
|
|
xinghaoList: [], |
|
|
|
jybgData: [], |
|
|
|
cols: [ |
|
|
|
{ |
|
|
|
name: 'jianyanxiang', // 参与计算的列名,必须和el-table-column prop=''值一致 |
|
|
@ -828,7 +829,8 @@ export default { |
|
|
|
fubiao1: [], |
|
|
|
fubiao2: [], |
|
|
|
fubiao3: [], |
|
|
|
tree: [] |
|
|
|
tree: [], |
|
|
|
jybgTemplateId: '' |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
@ -858,7 +860,7 @@ export default { |
|
|
|
this.getJyxmInfoByYsjl() |
|
|
|
} |
|
|
|
this.getDepartment() |
|
|
|
this.getDicJyxm(1) |
|
|
|
// this.getDicJyxm(1) |
|
|
|
this.userList = this.$store.getters.allUser.filter( |
|
|
|
(user) => user.departmentId === 74 && user.clientType === 'System' |
|
|
|
) |
|
|
@ -883,6 +885,8 @@ export default { |
|
|
|
this.departmentId = this.ysjl.departmentId |
|
|
|
this.getJyxm(1) |
|
|
|
this.getSbList() |
|
|
|
this.jybgTemplateId = this.ysjl.jybgTemplateId |
|
|
|
console.log(this.ysjl.jybgTemplateId) |
|
|
|
}) |
|
|
|
}, |
|
|
|
getSbList() { |
|
|
@ -923,6 +927,7 @@ export default { |
|
|
|
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 && |
|
|
@ -962,13 +967,19 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
getJyxm(sort) { |
|
|
|
console.log(this.jybgTemplateId, this.ysjl.jybgTemplateId) |
|
|
|
if (this.$route.query.state === 'update') { |
|
|
|
this.jyxmService |
|
|
|
.getJdCyJyxm(this.ysjlId, this.$route.query.templateId, sort) |
|
|
|
.getJdCyJyxm(this.ysjlId, this.$route.query.templateId, sort, 0) |
|
|
|
.then((data) => { |
|
|
|
this.bgfyData = data |
|
|
|
this.tableJs.getData(this.cols, this.rows, this.bgfyData) |
|
|
|
}) |
|
|
|
this.jyxmService |
|
|
|
.getJdCyJyxm(this.ysjlId, this.ysjl.jybgTemplateId, sort, 1) |
|
|
|
.then((data) => { |
|
|
|
this.jybgData = data |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.jyxmService |
|
|
|
.getCyJyxm(this.$route.query.templateId, sort) |
|
|
@ -979,6 +990,14 @@ export default { |
|
|
|
this.bgfyData = data |
|
|
|
this.tableJs.getData(this.cols, this.rows, this.bgfyData) |
|
|
|
}) |
|
|
|
this.jyxmService |
|
|
|
.getCyJyxm(this.ysjl.jybgTemplateId, sort) |
|
|
|
.then((data) => { |
|
|
|
data.forEach((row) => { |
|
|
|
row.dicJyxmId = row.id |
|
|
|
}) |
|
|
|
this.jybgData = data |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
/** |
|
|
@ -1040,8 +1059,26 @@ export default { |
|
|
|
this.buildSaveData(operation) |
|
|
|
} |
|
|
|
}, |
|
|
|
sortClass(sortData) { |
|
|
|
const groupBy = (array, f) => { |
|
|
|
const groups = {} |
|
|
|
array.forEach((o) => { |
|
|
|
const group = JSON.stringify(f(o)) |
|
|
|
groups[group] = groups[group] || [] |
|
|
|
groups[group].push(o) |
|
|
|
}) |
|
|
|
return Object.keys(groups).map((group) => { |
|
|
|
return groups[group] |
|
|
|
}) |
|
|
|
} |
|
|
|
const sorted = groupBy(sortData, (item) => { |
|
|
|
return item.jybgJyjlIndex // 返回需要分组的对象 |
|
|
|
}) |
|
|
|
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) |
|
|
@ -1049,7 +1086,19 @@ export default { |
|
|
|
} else { |
|
|
|
fubiao = [this.fubiao1, this.fubiao2, this.fubiao3] |
|
|
|
} |
|
|
|
this.bgfyData.forEach((row) => { |
|
|
|
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 = '无此项' |
|
|
|
} |
|
|
|
}) |
|
|
|
arr = arr.concat(this.bgfyData, this.jybgData) |
|
|
|
arr.forEach((row) => { |
|
|
|
tableData.push({ |
|
|
|
ysjlId: this.ysjlId, |
|
|
|
beizhu: row.beizhu, |
|
|
@ -1101,6 +1150,7 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
save(operation, type, jyxm, fubiao) { |
|
|
|
console.log(this.jybgData, 2222) |
|
|
|
if (this.fromType !== 5 && this.fromType !== 6) this.ysjl.imagePath = this.$refs.table1.imgPath |
|
|
|
|
|
|
|
// 判断报告编号是否重复 |
|
|
|