Browse Source

提交

master
xiaobai 3 years ago
parent
commit
284640e6a6
  1. 5
      src/api/jyxm.js
  2. 32
      src/components/drawerDialog/index.vue
  3. 4
      src/service/jyxmService.js
  4. 60
      src/views/ysjl/3000/common/index.vue
  5. 27
      src/views/ysjl/3000/common/inspection-items.vue
  6. 2
      src/views/ysjl/5000/dj/jdgy-cl/index.vue
  7. 2
      src/views/ysjl/5000/dj/lygg-cl/index.vue

5
src/api/jyxm.js

@ -11,14 +11,15 @@ export default {
} }
}) })
}, },
getJdCyJyxm: (ysjlId, templateId, orders) => { getJdCyJyxm: (ysjlId, templateId, orders, cjState) => {
return api({ return api({
url: '/jyxm/getJdJyxmByYsjl', url: '/jyxm/getJdJyxmByYsjl',
method: 'get', method: 'get',
params: { params: {
ysjlId: ysjlId, ysjlId: ysjlId,
templateId: templateId, templateId: templateId,
orders: orders orders: orders,
cjState
} }
}) })
}, },

32
src/components/drawerDialog/index.vue

@ -188,6 +188,38 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="检验报告模板" prop="jybgTemplateId">
<el-select
v-model="formTemplate.jybgTemplateId"
placeholder="检验报告模板"
style="width: 420px"
filterable
clearable
>
<el-option
v-for="item in parentList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="合格证模板" prop="hgzTemplateId">
<el-select
v-model="formTemplate.hgzTemplateId"
placeholder="合格证模板"
style="width: 420px"
filterable
clearable
>
<el-option
v-for="item in parentList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-row :gutter="10"> <el-row :gutter="10">
<el-col> <el-col>
<el-form-item label="版本号(上线日期)" label-width="120px" prop="version"> <el-form-item label="版本号(上线日期)" label-width="120px" prop="version">

4
src/service/jyxmService.js

@ -28,8 +28,8 @@ export default {
getCyJyxm(modelId, sort) { getCyJyxm(modelId, sort) {
return jyxm.getCyJyxm(modelId, sort) return jyxm.getCyJyxm(modelId, sort)
}, },
getJdCyJyxm(ysjlId, templateId, orders) { getJdCyJyxm(ysjlId, templateId, orders, cjState) {
return jyxm.getJdCyJyxm(ysjlId, templateId, orders) return jyxm.getJdCyJyxm(ysjlId, templateId, orders, cjState)
}, },
/** /**
* 找到检验项或者检验目开始的第一条数据并进行签名 * 找到检验项或者检验目开始的第一条数据并进行签名

60
src/views/ysjl/3000/common/index.vue

@ -693,7 +693,7 @@
</el-form> </el-form>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="检验项目" name="second"> <el-tab-pane label="检验项目" name="second">
<Inspection :bgfy-data="bgfyData" /> <Inspection :bgfy-data="bgfyData" :jybg-data="jybgData" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane v-if="fromType === 5 ||fromType === 6" label="附表1" name="three"> <el-tab-pane v-if="fromType === 5 ||fromType === 6" label="附表1" name="three">
<zdft-fb ref="table4" :table-data.sync="fubiao1" :state.sync="state" /> <zdft-fb ref="table4" :table-data.sync="fubiao1" :state.sync="state" />
@ -790,6 +790,7 @@ export default {
defaultRlr: [], defaultRlr: [],
renlingren: [], renlingren: [],
xinghaoList: [], xinghaoList: [],
jybgData: [],
cols: [ cols: [
{ {
name: 'jianyanxiang', // el-table-column prop='' name: 'jianyanxiang', // el-table-column prop=''
@ -828,7 +829,8 @@ export default {
fubiao1: [], fubiao1: [],
fubiao2: [], fubiao2: [],
fubiao3: [], fubiao3: [],
tree: [] tree: [],
jybgTemplateId: ''
} }
}, },
created() { created() {
@ -858,7 +860,7 @@ export default {
this.getJyxmInfoByYsjl() this.getJyxmInfoByYsjl()
} }
this.getDepartment() this.getDepartment()
this.getDicJyxm(1) // this.getDicJyxm(1)
this.userList = this.$store.getters.allUser.filter( this.userList = this.$store.getters.allUser.filter(
(user) => user.departmentId === 74 && user.clientType === 'System' (user) => user.departmentId === 74 && user.clientType === 'System'
) )
@ -883,6 +885,8 @@ export default {
this.departmentId = this.ysjl.departmentId this.departmentId = this.ysjl.departmentId
this.getJyxm(1) this.getJyxm(1)
this.getSbList() this.getSbList()
this.jybgTemplateId = this.ysjl.jybgTemplateId
console.log(this.ysjl.jybgTemplateId)
}) })
}, },
getSbList() { getSbList() {
@ -923,6 +927,7 @@ export default {
this.ysjlService.getYsjl(this.ysjlId).then((data) => { this.ysjlService.getYsjl(this.ysjlId).then((data) => {
this.ysjl = data this.ysjl = data
this.departmentId = this.ysjl.departmentId this.departmentId = this.ysjl.departmentId
this.jybgTemplateId = this.ysjl.jybgTemplateId
this.ysjl.imagePath = '' this.ysjl.imagePath = ''
if ( if (
this.ysjl.jianyanrenyuan !== null && this.ysjl.jianyanrenyuan !== null &&
@ -962,13 +967,19 @@ export default {
}) })
}, },
getJyxm(sort) { getJyxm(sort) {
console.log(this.jybgTemplateId, this.ysjl.jybgTemplateId)
if (this.$route.query.state === 'update') { if (this.$route.query.state === 'update') {
this.jyxmService this.jyxmService
.getJdCyJyxm(this.ysjlId, this.$route.query.templateId, sort) .getJdCyJyxm(this.ysjlId, this.$route.query.templateId, sort, 0)
.then((data) => { .then((data) => {
this.bgfyData = data this.bgfyData = data
this.tableJs.getData(this.cols, this.rows, this.bgfyData) 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 { } else {
this.jyxmService this.jyxmService
.getCyJyxm(this.$route.query.templateId, sort) .getCyJyxm(this.$route.query.templateId, sort)
@ -979,6 +990,14 @@ export default {
this.bgfyData = data this.bgfyData = data
this.tableJs.getData(this.cols, this.rows, this.bgfyData) 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) 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) { buildSaveData(operation) {
const tableData = [] const tableData = []
const _this = this
let fubiao let fubiao
if (this.fromType === 5 || this.fromType === 6) { if (this.fromType === 5 || this.fromType === 6) {
console.log(this.$refs.table4.tableData, 5555) console.log(this.$refs.table4.tableData, 5555)
@ -1049,7 +1086,19 @@ export default {
} else { } else {
fubiao = [this.fubiao1, this.fubiao2, this.fubiao3] 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({ tableData.push({
ysjlId: this.ysjlId, ysjlId: this.ysjlId,
beizhu: row.beizhu, beizhu: row.beizhu,
@ -1101,6 +1150,7 @@ export default {
} }
}, },
save(operation, type, jyxm, 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 if (this.fromType !== 5 && this.fromType !== 6) this.ysjl.imagePath = this.$refs.table1.imgPath
// //

27
src/views/ysjl/3000/common/inspection-items.vue

@ -37,6 +37,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-select <el-select
v-model="scope.row.jianyanjieguo" v-model="scope.row.jianyanjieguo"
@change="v=>changeFn(v,scope.row)"
> >
<el-option <el-option
v-for="item in jyjgList" v-for="item in jyjgList"
@ -80,6 +81,11 @@ export default {
type: Array, type: Array,
require: true, require: true,
default: () => [] default: () => []
},
jybgData: {
type: Array,
require: true,
default: () => []
} }
}, },
data() { data() {
@ -193,6 +199,27 @@ export default {
}, },
querySearchGzjz: function(queryString, cb, $index) { querySearchGzjz: function(queryString, cb, $index) {
cb([this.dicGzjz[$index]]) cb([this.dicGzjz[$index]])
},
changeFn(val, row) {
console.log(row, val)
if (row.xiangmuleibie === 'A' || row.xiangmuleibie === 'B') {
if (val === 'X') {
this.jybgData[row.jybgJyjgIndex].jianyanjieguo = '不符合'
} else if (val === '√') {
this.jybgData[row.jybgJyjgIndex].jianyanjieguo = '符合'
} else {
this.jybgData[row.jybgJyjgIndex].jianyanjieguo = '无此项'
}
} else {
if (val === 'X') {
this.jybgData[row.jybgJyjgIndex].jianyanjieguo = '资料确认不符合'
} else if (val === '√') {
this.jybgData[row.jybgJyjgIndex].jianyanjieguo = '资料确认符合'
} else {
this.jybgData[row.jybgJyjgIndex].jianyanjieguo = '无此项'
}
}
} }
} }
} }

2
src/views/ysjl/5000/dj/jdgy-cl/index.vue

@ -393,7 +393,7 @@ export default {
components: { SignName, Sticky }, components: { SignName, Sticky },
data() { data() {
return { return {
jlbh1: 'GN', jlbh1: 'ND',
jlbh2: '(' + new Date().getFullYear() + ')', jlbh2: '(' + new Date().getFullYear() + ')',
jlbh3: '', jlbh3: '',
ysjl: { ysjl: {

2
src/views/ysjl/5000/dj/lygg-cl/index.vue

@ -387,7 +387,7 @@ export default {
components: { SignName, Sticky }, components: { SignName, Sticky },
data() { data() {
return { return {
jlbh1: 'GN', jlbh1: 'ND',
jlbh2: '(' + new Date().getFullYear() + ')', jlbh2: '(' + new Date().getFullYear() + ')',
jlbh3: '', jlbh3: '',
ysjl: { ysjl: {

Loading…
Cancel
Save