Compare commits

...

3 Commits

  1. 44
      src/views/dic/category.vue
  2. 113
      src/views/ysjl/4000/dj/common/index.vue
  3. 112
      src/views/ysjl/4000/jj/common/index.vue
  4. 100
      src/views/ysjl/5000/dj/jdgy-cl/index.vue
  5. 102
      src/views/ysjl/5000/dj/lygg-cl/index.vue

44
src/views/dic/category.vue

@ -74,8 +74,8 @@
width="80" width="80"
/> />
<el-table-column <el-table-column
:formatter="formatSpecies"
align="center" align="center"
:formatter="formatSpecies"
label="设备种类" label="设备种类"
prop="species" prop="species"
/> />
@ -106,6 +106,15 @@
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>字典详情</span> <span>字典详情</span>
</div> </div>
<el-button
type="danger"
icon="el-icon-delete"
@click="deleteCategoryDetail"
v-if="list.length > 0"
style="margin-bottom:20px"
>
删除
</el-button>
<el-table <el-table
v-if="list.length > 0" v-if="list.length > 0"
ref="list" ref="list"
@ -114,8 +123,7 @@
border border
fit fit
highlight-current-row highlight-current-row
@row-click="onRowClick" @selection-change="detailHandleSelectionChange"
@selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="40" /> <el-table-column type="selection" width="40" />
<el-table-column <el-table-column
@ -226,6 +234,7 @@
<script> <script>
import Pagination from '@/components/Pagination' import Pagination from '@/components/Pagination'
import qs from 'qs'
export default { export default {
name: 'Category', name: 'Category',
components: { Pagination }, components: { Pagination },
@ -251,7 +260,8 @@ export default {
sbzlList: [], sbzlList: [],
species: [], species: [],
parentList: [], parentList: [],
leftList: [] leftList: [],
detailSeletArr:[]
} }
}, },
created() { created() {
@ -284,6 +294,9 @@ export default {
handleSelectionChange: function(val) { handleSelectionChange: function(val) {
this.multipleSelection = val this.multipleSelection = val
}, },
detailHandleSelectionChange(val){
this.detailSeletArr = val
},
showCreate() { showCreate() {
this.tempCategory = {} this.tempCategory = {}
this.dialogStatus = 'create' this.dialogStatus = 'create'
@ -292,9 +305,9 @@ export default {
createCategory() { createCategory() {
this.$refs['tempCategory'].validate((valid) => { this.$refs['tempCategory'].validate((valid) => {
if (valid) { if (valid) {
this.tempCategory.species = JSON.stringify(this.species) this.tempCategory.species = this.species.join(',')
this.api({ this.api({
url: '/category/addCategory', url: '/category',
method: 'post', method: 'post',
data: this.tempCategory data: this.tempCategory
}).then(() => { }).then(() => {
@ -404,8 +417,25 @@ export default {
closeDialog() { closeDialog() {
this.species = [] this.species = []
}, },
deleteCategoryDetail(){
if(this.detailSeletArr.length==0){
return this.$message.warning('请选择数据')
}
this.api({
url:'/category/delete',
method:'delete',
params:{
integers:this.detailSeletArr.map(item=>item.id)
},
paramsSerializer: function(params) {
return qs.stringify(params, { indices: false })
}
}).then(res=>{
this.$message({ message: '成功删除', type: 'success' })
})
},
formatSpecies(row, column, cellValue) { formatSpecies(row, column, cellValue) {
const value = JSON.parse(cellValue) const value = cellValue.split(',')
let lable = '' let lable = ''
for (let i = 0; i < value.length; i++) { for (let i = 0; i < value.length; i++) {
for (let j = 0; j < this.sbzlList.length; j++) { for (let j = 0; j < this.sbzlList.length; j++) {

113
src/views/ysjl/4000/dj/common/index.vue

@ -822,22 +822,13 @@
</el-table-column> </el-table-column>
<el-table-column align="center" prop="jianyanjieguo" label="检验结果"> <el-table-column align="center" prop="jianyanjieguo" label="检验结果">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select <el-autocomplete
v-model="scope.row.jianyanjieguo" v-model="scope.row.jianyanjieguo"
:disabled="edit" class="inline-input"
type="text"
placeholder="请选择"
style="width: 100%" style="width: 100%"
filterable :fetch-suggestions="querySearchJyjg"
allow-create @input="(val) => changeFn(val, scope.row)"
autocomplete />
default-first-option
>
<el-option label="√" value="√" />
<el-option label="○" value="○" />
<el-option label="×" value="×" />
<el-option label="/" value="/" />
</el-select>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -880,6 +871,7 @@ export default {
sybjSData: [], sybjSData: [],
tableData: [], tableData: [],
tree: [], tree: [],
jybgData: [], //
checkedTab: 'first', checkedTab: 'first',
ysjlId: this.$route.query.id, ysjlId: this.$route.query.id,
// //
@ -906,7 +898,8 @@ export default {
return row.jianyanneirong return row.jianyanneirong
} }
} }
] ],
jyjgList: [{ value: '√' }, { value: 'X' }, { value: '/' }]
} }
}, },
computed: {}, computed: {},
@ -926,12 +919,10 @@ export default {
created() { created() {
if (this.state === 'create') { if (this.state === 'create') {
this.initYsjl() this.initYsjl()
this.getJyxm(1)
// //
this.getMaxBh() this.getMaxBh()
} else { } else {
this.getYsjl(this.$route.query.id) this.getYsjl(this.$route.query.id)
this.getJyxm(1)
} }
this.getDepartment() this.getDepartment()
}, },
@ -1008,6 +999,7 @@ export default {
} }
}).then((data) => { }).then((data) => {
this.ysjl = data.ysjl this.ysjl = data.ysjl
this.getJyxm(1)
this.departmentId = this.ysjl.departmentId this.departmentId = this.ysjl.departmentId
this.param = this.param =
data.param !== null && data.param !== undefined ? data.param : {} data.param !== null && data.param !== undefined ? data.param : {}
@ -1027,6 +1019,29 @@ export default {
// this.param.shangcijianyanriqi = this.common.checkDateFormat(this.param.shangcijianyanriqi) // 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) { getYsjl(id) {
this.api({ this.api({
url: '/ysjl', url: '/ysjl',
@ -1036,6 +1051,7 @@ export default {
} }
}).then((data) => { }).then((data) => {
this.ysjl = data this.ysjl = data
this.getJyxm(1)
this.departmentId = this.ysjl.departmentId this.departmentId = this.ysjl.departmentId
if ( if (
this.ysjl.jianyanrenyuan !== null && this.ysjl.jianyanrenyuan !== null &&
@ -1072,10 +1088,15 @@ export default {
getJyxm(sort) { getJyxm(sort) {
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.sybjSData = 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 { } else {
this.jyxmService this.jyxmService
@ -1084,12 +1105,36 @@ export default {
data.forEach((row) => { data.forEach((row) => {
row.dicJyxmId = row.id row.dicJyxmId = row.id
}) })
this.sybjSData = data 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) { saveYsjl: function(operation) {
if (operation === 'add') { if (operation === 'add') {
if (this.jlbh3.trim() === '') { if (this.jlbh3.trim() === '') {
@ -1100,6 +1145,16 @@ export default {
return false 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 = [] const tableData = []
this.sybjSData.forEach((row) => { this.sybjSData.forEach((row) => {
@ -1116,6 +1171,19 @@ export default {
cjState: 0 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 = '' let method = ''
this.ysjl.bglx = 1 this.ysjl.bglx = 1
this.ysjl.cjState = 'ysjl' this.ysjl.cjState = 'ysjl'
@ -1167,7 +1235,8 @@ export default {
ysjl: this.ysjl, ysjl: this.ysjl,
param: this.param, param: this.param,
cyJyxm: {}, cyJyxm: {},
jdJyxm: jyxm jdJyxm: jyxm,
state: operation
} }
}).then((data) => { }).then((data) => {
Utils.$emit('task-list') Utils.$emit('task-list')

112
src/views/ysjl/4000/jj/common/index.vue

@ -901,21 +901,13 @@
</el-table-column> </el-table-column>
<el-table-column align="center" prop="jianyanjieguo" label="检验结果"> <el-table-column align="center" prop="jianyanjieguo" label="检验结果">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select <el-autocomplete
v-model="scope.row.jianyanjieguo" v-model="scope.row.jianyanjieguo"
:disabled="edit" class="inline-input"
type="text"
placeholder="请选择"
style="width: 100%" style="width: 100%"
filterable :fetch-suggestions="querySearchJyjg"
allow-create @input="(val) => changeFn(val, scope.row)"
default-first-option />
>
<el-option label="√" value="√" />
<el-option label="○" value="○" />
<el-option label="×" value="×" />
<el-option label="/" value="/" />
</el-select>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -991,7 +983,9 @@ export default {
return row.jianyanneirong return row.jianyanneirong
} }
} }
] ],
jyjgList: [{ value: '√' }, { value: 'X' }, { value: '/' }],
jybgData: []//
} }
}, },
computed: {}, computed: {},
@ -1011,12 +1005,10 @@ export default {
created() { created() {
if (this.state === 'create') { if (this.state === 'create') {
this.initYsjl() this.initYsjl()
this.getJyxm(1)
// //
this.getMaxBh() this.getMaxBh()
} else { } else {
this.getYsjl(this.$route.query.id) this.getYsjl(this.$route.query.id)
this.getJyxm(1)
} }
this.getDepartment() this.getDepartment()
}, },
@ -1094,6 +1086,7 @@ export default {
}).then((data) => { }).then((data) => {
this.ysjl = data.ysjl this.ysjl = data.ysjl
this.departmentId = this.ysjl.departmentId this.departmentId = this.ysjl.departmentId
this.getJyxm(1)
this.param = this.param =
data.param !== null && data.param !== undefined ? data.param : {} data.param !== null && data.param !== undefined ? data.param : {}
this.ysjl.jianyanjieshuriqi = this.formatter.dateFormat('YYYY-MM-dd') this.ysjl.jianyanjieshuriqi = this.formatter.dateFormat('YYYY-MM-dd')
@ -1129,6 +1122,7 @@ export default {
}).then((data) => { }).then((data) => {
this.ysjl = data this.ysjl = data
this.departmentId = this.ysjl.departmentId this.departmentId = this.ysjl.departmentId
this.getJyxm(1)
if ( if (
this.ysjl.jianyanrenyuan !== null && this.ysjl.jianyanrenyuan !== null &&
this.ysjl.jianyanrenyuan.length > 0 this.ysjl.jianyanrenyuan.length > 0
@ -1165,10 +1159,15 @@ export default {
getJyxm(sort) { getJyxm(sort) {
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.sybjSData = 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 { } else {
this.jyxmService this.jyxmService
@ -1177,12 +1176,59 @@ export default {
data.forEach((row) => { data.forEach((row) => {
row.dicJyxmId = row.id row.dicJyxmId = row.id
}) })
this.sybjSData = data 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
})
}
},
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 = ''
} }
}, },
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) { saveYsjl: function(operation) {
if (operation === 'add') { if (operation === 'add') {
if (this.jlbh3.trim() === '') { if (this.jlbh3.trim() === '') {
@ -1193,6 +1239,16 @@ export default {
return false 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 = [] const tableData = []
this.sybjSData.forEach((row) => { this.sybjSData.forEach((row) => {
@ -1208,6 +1264,19 @@ export default {
cjState: 0 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 = '' let method = ''
this.ysjl.bglx = 1 this.ysjl.bglx = 1
this.ysjl.cjState = 'ysjl' this.ysjl.cjState = 'ysjl'
@ -1259,7 +1328,8 @@ export default {
ysjl: this.ysjl, ysjl: this.ysjl,
param: this.param, param: this.param,
cyJyxm: {}, cyJyxm: {},
jdJyxm: jyxm jdJyxm: jyxm,
state: operation
} }
}).then((data) => { }).then((data) => {
Utils.$emit('task-list') Utils.$emit('task-list')

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

@ -368,12 +368,13 @@
</el-table-column> </el-table-column>
<el-table-column align="center" prop="jianyanjieguo" label="检验结果"> <el-table-column align="center" prop="jianyanjieguo" label="检验结果">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.jianyanjieguo" :disabled="edit" type="text" placeholder="请选择" style="width: 100%;" filterable allow-create default-first-option @change="v=>changeFn(v,scope.row)"> <el-autocomplete
<el-option label="√" value="√" /> v-model="scope.row.jianyanjieguo"
<el-option label="○" value="○" /> class="inline-input"
<el-option label="×" value="×" /> style="width: 100%"
<el-option label="/" value="/" /> :fetch-suggestions="querySearchJyjg"
</el-select> @input="(val) => changeFn(val, scope.row)"
/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -411,7 +412,7 @@ export default {
tableData: [], tableData: [],
checkedTab: 'first', checkedTab: 'first',
ysjlId: this.$route.query.id, ysjlId: this.$route.query.id,
jybgData: [], jybgData: [], //
// //
// //
cols: [ cols: [
@ -441,7 +442,8 @@ export default {
return row.jianyanneirong return row.jianyanneirong
} }
} }
] ],
jyjgList: [{ value: '√' }, { value: 'X' }, { value: '/' }]
} }
}, },
computed: { computed: {
@ -632,24 +634,27 @@ export default {
}) })
} }
}, },
querySearchJyjg: function(queryString, cb, $index) {
cb(this.jyjgList)
},
changeFn(val, row) { changeFn(val, row) {
console.log(row, val) const jybgJyjgJyxm = this.jybgData[row.jybgJyjgIndex - 1]
if (row.xiangmuleibie === 'A' || row.xiangmuleibie === 'B') { let beizhu = ''
if (val === 'X') { if (val.length > 1) {
this.jybgData[row.jybgJyjgIndex].jianyanjieguo = '不符合' beizhu = val.substr(1)
} else if (val === '√') { }
this.jybgData[row.jybgJyjgIndex].jianyanjieguo = '符合' if (val.indexOf('X') === 0) {
} else { jybgJyjgJyxm.jianyanjieguo = '不符合' + beizhu
this.jybgData[row.jybgJyjgIndex].jianyanjieguo = '无此项' } 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 { } else {
if (val === 'X') { jybgJyjgJyxm.jianyanjieguo = ''
this.jybgData[row.jybgJyjgIndex].jianyanjieguo = '资料确认不符合'
} else if (val === '√') {
this.jybgData[row.jybgJyjgIndex].jianyanjieguo = '资料确认符合'
} else {
this.jybgData[row.jybgJyjgIndex].jianyanjieguo = '无此项'
}
} }
}, },
sortClass(sortData) { sortClass(sortData) {
@ -670,40 +675,25 @@ export default {
return sorted return sorted
}, },
saveYsjl: function(operation) { saveYsjl: function(operation) {
const _this = this
if (operation === 'add') { if (operation === 'add') {
if (this.jlbh3.trim() === '') { if (this.jlbh3.trim() === '') {
this.$message({ message: '请先确认记录编号是否完整!', type: 'warning' }) this.$message({ message: '请先确认记录编号是否完整!', type: 'warning' })
return false return false
} }
} }
let arr = [] const subArr = this.sortClass(this.sybjSData)
const subArr = this.sortClass(this.jybgData) subArr.forEach((item) => {
subArr.map((item) => { if (item.some((k) => k.jianyanjieguo.indexOf('X') === 0)) {
if ( this.jybgData[item[0].jybgJyjlIndex - 1].jianyanjielun = '不合格'
item.some( } else if (item.every((k) => k.jianyanjieguo.indexOf('√') === 0)) {
(k) => k.jianyanjieguo === '不符合' || k.jianyanjieguo === 'X' this.jybgData[item[0].jybgJyjlIndex - 1].jianyanjielun = '合格'
) } else if (item.every((k) => k.jianyanjieguo.indexOf('/') === 0)) {
) { this.jybgData[item[0].jybgJyjlIndex - 1].jianyanjielun = '无此项'
_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.sybjSData, this.jybgData)
// //
const tableData = [] const tableData = []
arr.forEach((row) => { this.sybjSData.forEach((row) => {
tableData.push({ tableData.push({
ysjlId: this.ysjlId, ysjlId: this.ysjlId,
beizhu: row.beizhu, beizhu: row.beizhu,
@ -716,6 +706,19 @@ export default {
cjState: 0 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 = '' let method = ''
this.ysjl.bglx = 1 this.ysjl.bglx = 1
this.ysjl.cjState = 'ysjl' this.ysjl.cjState = 'ysjl'
@ -761,7 +764,8 @@ export default {
ysjl: this.ysjl, ysjl: this.ysjl,
param: this.param, param: this.param,
cyJyxm: {}, cyJyxm: {},
jdJyxm: jyxm jdJyxm: jyxm,
state: operation
} }
}).then(data => { }).then(data => {
Utils.$emit('task-list') Utils.$emit('task-list')

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

@ -361,12 +361,13 @@
</el-table-column> </el-table-column>
<el-table-column align="center" prop="jianyanjieguo" label="检验结果"> <el-table-column align="center" prop="jianyanjieguo" label="检验结果">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.jianyanjieguo" :disabled="edit" type="text" placeholder="请选择" style="width: 100%;" filterable allow-create default-first-option @change="v=>changeFn(v,scope.row)"> <el-autocomplete
<el-option label="√" value="√" /> v-model="scope.row.jianyanjieguo"
<el-option label="○" value="○" /> class="inline-input"
<el-option label="×" value="×" /> style="width: 100%"
<el-option label="/" value="/" /> :fetch-suggestions="querySearchJyjg"
</el-select> @input="(val) => changeFn(val, scope.row)"
/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -435,7 +436,8 @@ export default {
return row.jianyanneirong return row.jianyanneirong
} }
} }
] ],
jyjgList: [{ value: '√' }, { value: 'X' }, { value: '/' }]
} }
}, },
computed: { computed: {
@ -535,6 +537,7 @@ export default {
} }
}).then(data => { }).then(data => {
this.ysjl = data.ysjl this.ysjl = data.ysjl
this.getJyxm(1)
this.param = (data.param !== null && data.param !== undefined) ? data.param : {} this.param = (data.param !== null && data.param !== undefined) ? data.param : {}
this.ysjl.jianyanjieshuriqi = this.formatter.dateFormat('YYYY-MM-dd') this.ysjl.jianyanjieshuriqi = this.formatter.dateFormat('YYYY-MM-dd')
this.getXcjyrq() this.getXcjyrq()
@ -548,7 +551,6 @@ export default {
// //
this.ysjl.zhizaoriqi = this.common.checkDateFormat(this.ysjl.zhizaoriqi) this.ysjl.zhizaoriqi = this.common.checkDateFormat(this.ysjl.zhizaoriqi)
this.ysjl.gaizaoriqi = this.common.checkDateFormat(this.ysjl.gaizaoriqi) this.ysjl.gaizaoriqi = this.common.checkDateFormat(this.ysjl.gaizaoriqi)
this.getJyxm(1)
}) })
}, },
getYsjl(id) { getYsjl(id) {
@ -560,6 +562,7 @@ export default {
} }
}).then(data => { }).then(data => {
this.ysjl = data this.ysjl = data
this.getJyxm(1)
this.departmentId = this.ysjl.departmentId this.departmentId = this.ysjl.departmentId
if (this.ysjl.jianyanrenyuan !== null && this.ysjl.jianyanrenyuan.length > 0) { if (this.ysjl.jianyanrenyuan !== null && this.ysjl.jianyanrenyuan.length > 0) {
this.jianyanrenyuan = this.common.convertCnName(this.ysjl.jianyanrenyuan) this.jianyanrenyuan = this.common.convertCnName(this.ysjl.jianyanrenyuan)
@ -569,7 +572,6 @@ export default {
this.getMaxBh() this.getMaxBh()
} }
this.getParam(this.ysjl.id, this.ysjl.shebeizhongleidaima) this.getParam(this.ysjl.id, this.ysjl.shebeizhongleidaima)
this.getJyxm(1)
}) })
}, },
handleChange(v) { handleChange(v) {
@ -615,24 +617,27 @@ export default {
}) })
} }
}, },
querySearchJyjg: function(queryString, cb, $index) {
cb(this.jyjgList)
},
changeFn(val, row) { changeFn(val, row) {
console.log(row, val) const jybgJyjgJyxm = this.jybgData[row.jybgJyjgIndex - 1]
if (row.xiangmuleibie === 'A' || row.xiangmuleibie === 'B') { let beizhu = ''
if (val === 'X') { if (val.length > 1) {
this.jybgData[row.jybgJyjgIndex].jianyanjieguo = '不符合' beizhu = val.substr(1)
} else if (val === '√') { }
this.jybgData[row.jybgJyjgIndex].jianyanjieguo = '符合' if (val.indexOf('X') === 0) {
} else { jybgJyjgJyxm.jianyanjieguo = '不符合' + beizhu
this.jybgData[row.jybgJyjgIndex].jianyanjieguo = '无此项' } 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 { } else {
if (val === 'X') { jybgJyjgJyxm.jianyanjieguo = ''
this.jybgData[row.jybgJyjgIndex].jianyanjieguo = '资料确认不符合'
} else if (val === '√') {
this.jybgData[row.jybgJyjgIndex].jianyanjieguo = '资料确认符合'
} else {
this.jybgData[row.jybgJyjgIndex].jianyanjieguo = '无此项'
}
} }
}, },
sortClass(sortData) { sortClass(sortData) {
@ -653,40 +658,25 @@ export default {
return sorted return sorted
}, },
saveYsjl: function(operation) { saveYsjl: function(operation) {
const _this = this
if (operation === 'add') { if (operation === 'add') {
if (this.jlbh3.trim() === '') { if (this.jlbh3.trim() === '') {
this.$message({ message: '请先确认记录编号是否完整!', type: 'warning' }) this.$message({ message: '请先确认记录编号是否完整!', type: 'warning' })
return false return false
} }
} }
let arr = [] const subArr = this.sortClass(this.sybjSData)
const subArr = this.sortClass(this.jybgData) subArr.forEach((item) => {
subArr.map((item) => { if (item.some((k) => k.jianyanjieguo.indexOf('X') === 0)) {
if ( this.jybgData[item[0].jybgJyjlIndex - 1].jianyanjielun = '不合格'
item.some( } else if (item.every((k) => k.jianyanjieguo.indexOf('√') === 0)) {
(k) => k.jianyanjieguo === '不符合' || k.jianyanjieguo === 'X' this.jybgData[item[0].jybgJyjlIndex - 1].jianyanjielun = '合格'
) } else if (item.every((k) => k.jianyanjieguo.indexOf('/') === 0)) {
) { this.jybgData[item[0].jybgJyjlIndex - 1].jianyanjielun = '无此项'
_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.sybjSData, this.jybgData)
// //
const tableData = [] const tableData = []
arr.forEach((row) => { this.sybjSData.forEach((row) => {
tableData.push({ tableData.push({
ysjlId: this.ysjlId, ysjlId: this.ysjlId,
beizhu: row.beizhu, beizhu: row.beizhu,
@ -699,6 +689,19 @@ export default {
cjState: 0 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 = '' let method = ''
this.ysjl.bglx = 1 this.ysjl.bglx = 1
this.ysjl.cjState = 'ysjl' this.ysjl.cjState = 'ysjl'
@ -744,7 +747,8 @@ export default {
ysjl: this.ysjl, ysjl: this.ysjl,
param: this.param, param: this.param,
cyJyxm: {}, cyJyxm: {},
jdJyxm: jyxm jdJyxm: jyxm,
state: operation
} }
}).then(data => { }).then(data => {
Utils.$emit('task-list') Utils.$emit('task-list')

Loading…
Cancel
Save