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. 8
      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({
url: '/jyxm/getJdJyxmByYsjl',
method: 'get',
params: {
ysjlId: ysjlId,
templateId: templateId,
orders: orders
orders: orders,
cjState
}
})
},

32
src/components/drawerDialog/index.vue

@ -188,6 +188,38 @@
/>
</el-select>
</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-col>
<el-form-item label="版本号(上线日期)" label-width="120px" prop="version">

4
src/service/jyxmService.js

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

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

@ -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
//

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

@ -37,6 +37,7 @@
<template slot-scope="scope">
<el-select
v-model="scope.row.jianyanjieguo"
@change="v=>changeFn(v,scope.row)"
>
<el-option
v-for="item in jyjgList"
@ -80,6 +81,11 @@ export default {
type: Array,
require: true,
default: () => []
},
jybgData: {
type: Array,
require: true,
default: () => []
}
},
data() {
@ -193,6 +199,27 @@ export default {
},
querySearchGzjz: function(queryString, cb, $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 = '无此项'
}
}
}
}
}

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

@ -317,9 +317,9 @@
<el-cascader
v-model="departmentId"
:props="{ value: 'id', label: 'name', checkStrictly: true }"
:options="tree"
:show-all-levels="false"
@change="handleChange"
:options="tree"
:show-all-levels="false"
@change="handleChange"
/>
</el-form-item>
</el-col>
@ -393,7 +393,7 @@ export default {
components: { SignName, Sticky },
data() {
return {
jlbh1: 'GN',
jlbh1: 'ND',
jlbh2: '(' + new Date().getFullYear() + ')',
jlbh3: '',
ysjl: {

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

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

Loading…
Cancel
Save