|
|
@ -822,22 +822,13 @@ |
|
|
|
</el-table-column> |
|
|
|
<el-table-column align="center" prop="jianyanjieguo" label="检验结果"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-select |
|
|
|
<el-autocomplete |
|
|
|
v-model="scope.row.jianyanjieguo" |
|
|
|
:disabled="edit" |
|
|
|
type="text" |
|
|
|
placeholder="请选择" |
|
|
|
class="inline-input" |
|
|
|
style="width: 100%" |
|
|
|
filterable |
|
|
|
allow-create |
|
|
|
autocomplete |
|
|
|
default-first-option |
|
|
|
> |
|
|
|
<el-option label="√" value="√" /> |
|
|
|
<el-option label="○" value="○" /> |
|
|
|
<el-option label="×" value="×" /> |
|
|
|
<el-option label="/" value="/" /> |
|
|
|
</el-select> |
|
|
|
:fetch-suggestions="querySearchJyjg" |
|
|
|
@input="(val) => changeFn(val, scope.row)" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
@ -880,6 +871,7 @@ export default { |
|
|
|
sybjSData: [], |
|
|
|
tableData: [], |
|
|
|
tree: [], |
|
|
|
jybgData: [], // 检验报告数组 |
|
|
|
checkedTab: 'first', |
|
|
|
ysjlId: this.$route.query.id, |
|
|
|
// 表格合并相关 |
|
|
@ -906,7 +898,8 @@ export default { |
|
|
|
return row.jianyanneirong |
|
|
|
} |
|
|
|
} |
|
|
|
] |
|
|
|
], |
|
|
|
jyjgList: [{ value: '√' }, { value: 'X' }, { value: '/' }] |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: {}, |
|
|
@ -926,12 +919,10 @@ export default { |
|
|
|
created() { |
|
|
|
if (this.state === 'create') { |
|
|
|
this.initYsjl() |
|
|
|
this.getJyxm(1) |
|
|
|
// 查询最大记录编号 |
|
|
|
this.getMaxBh() |
|
|
|
} else { |
|
|
|
this.getYsjl(this.$route.query.id) |
|
|
|
this.getJyxm(1) |
|
|
|
} |
|
|
|
this.getDepartment() |
|
|
|
}, |
|
|
@ -1008,6 +999,7 @@ export default { |
|
|
|
} |
|
|
|
}).then((data) => { |
|
|
|
this.ysjl = data.ysjl |
|
|
|
this.getJyxm(1) |
|
|
|
this.departmentId = this.ysjl.departmentId |
|
|
|
this.param = |
|
|
|
data.param !== null && data.param !== undefined ? data.param : {} |
|
|
@ -1027,6 +1019,29 @@ export default { |
|
|
|
// this.param.shangcijianyanriqi = this.common.checkDateFormat(this.param.shangcijianyanriqi) |
|
|
|
}) |
|
|
|
}, |
|
|
|
querySearchJyjg: function(queryString, cb, $index) { |
|
|
|
cb(this.jyjgList) |
|
|
|
}, |
|
|
|
changeFn(val, row) { |
|
|
|
const jybgJyjgJyxm = this.jybgData[row.jybgJyjgIndex - 1] |
|
|
|
let beizhu = '' |
|
|
|
if (val.length > 1) { |
|
|
|
beizhu = val.substr(1) |
|
|
|
} |
|
|
|
if (val.indexOf('X') === 0) { |
|
|
|
jybgJyjgJyxm.jianyanjieguo = '不符合' + beizhu |
|
|
|
} else if (val.indexOf('√') === 0) { |
|
|
|
let jyjg = '符合' |
|
|
|
if (row.xiangmuleibie === 'C') { |
|
|
|
jyjg = '资料确认符合' |
|
|
|
} |
|
|
|
jybgJyjgJyxm.jianyanjieguo = jyjg + beizhu |
|
|
|
} else if (val.indexOf('/') === 0) { |
|
|
|
jybgJyjgJyxm.jianyanjieguo = '无此项' + beizhu |
|
|
|
} else { |
|
|
|
jybgJyjgJyxm.jianyanjieguo = '' |
|
|
|
} |
|
|
|
}, |
|
|
|
getYsjl(id) { |
|
|
|
this.api({ |
|
|
|
url: '/ysjl', |
|
|
@ -1036,6 +1051,7 @@ export default { |
|
|
|
} |
|
|
|
}).then((data) => { |
|
|
|
this.ysjl = data |
|
|
|
this.getJyxm(1) |
|
|
|
this.departmentId = this.ysjl.departmentId |
|
|
|
if ( |
|
|
|
this.ysjl.jianyanrenyuan !== null && |
|
|
@ -1072,10 +1088,15 @@ export default { |
|
|
|
getJyxm(sort) { |
|
|
|
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.sybjSData = data |
|
|
|
this.tableJs.getData(this.cols, undefined, this.sybjSData) |
|
|
|
this.tableJs.getData(this.cols, this.rows, this.sybjSData) |
|
|
|
}) |
|
|
|
this.jyxmService |
|
|
|
.getJdCyJyxm(this.ysjlId, this.ysjl.jybgTemplateId, sort, 1) |
|
|
|
.then((data) => { |
|
|
|
this.jybgData = data |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.jyxmService |
|
|
@ -1084,12 +1105,36 @@ export default { |
|
|
|
data.forEach((row) => { |
|
|
|
row.dicJyxmId = row.id |
|
|
|
}) |
|
|
|
|
|
|
|
this.sybjSData = data |
|
|
|
this.tableJs.getData(this.cols, undefined, this.sybjSData) |
|
|
|
this.tableJs.getData(this.cols, this.rows, this.sybjSData) |
|
|
|
}) |
|
|
|
this.jyxmService |
|
|
|
.getCyJyxm(this.ysjl.jybgTemplateId, sort) |
|
|
|
.then((data) => { |
|
|
|
data.forEach((row) => { |
|
|
|
row.dicJyxmId = row.id |
|
|
|
}) |
|
|
|
this.jybgData = data |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
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 |
|
|
|
}, |
|
|
|
saveYsjl: function(operation) { |
|
|
|
if (operation === 'add') { |
|
|
|
if (this.jlbh3.trim() === '') { |
|
|
@ -1100,6 +1145,16 @@ export default { |
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
|
const subArr = this.sortClass(this.sybjSData) |
|
|
|
subArr.forEach((item) => { |
|
|
|
if (item.some((k) => k.jianyanjieguo.indexOf('X') === 0)) { |
|
|
|
this.jybgData[item[0].jybgJyjlIndex - 1].jianyanjielun = '不合格' |
|
|
|
} else if (item.every((k) => k.jianyanjieguo.indexOf('√') === 0)) { |
|
|
|
this.jybgData[item[0].jybgJyjlIndex - 1].jianyanjielun = '合格' |
|
|
|
} else if (item.every((k) => k.jianyanjieguo.indexOf('/') === 0)) { |
|
|
|
this.jybgData[item[0].jybgJyjlIndex - 1].jianyanjielun = '无此项' |
|
|
|
} |
|
|
|
}) |
|
|
|
// 把第一个检验项目表中的检验结果单独放到字段中 |
|
|
|
const tableData = [] |
|
|
|
this.sybjSData.forEach((row) => { |
|
|
@ -1116,6 +1171,19 @@ export default { |
|
|
|
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 |
|
|
|
}) |
|
|
|
}) |
|
|
|
let method = '' |
|
|
|
this.ysjl.bglx = 1 |
|
|
|
this.ysjl.cjState = 'ysjl' |
|
|
@ -1167,7 +1235,8 @@ export default { |
|
|
|
ysjl: this.ysjl, |
|
|
|
param: this.param, |
|
|
|
cyJyxm: {}, |
|
|
|
jdJyxm: jyxm |
|
|
|
jdJyxm: jyxm, |
|
|
|
state: operation |
|
|
|
} |
|
|
|
}).then((data) => { |
|
|
|
Utils.$emit('task-list') |
|
|
|