Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/views/document/index.vue
master
李磊 3 years ago
parent
commit
2c4eb893e9
  1. 192
      src/utils/common.js
  2. 44
      src/views/dic/category.vue
  3. 9
      src/views/document/index.vue
  4. 11
      src/views/preview/document.vue
  5. 113
      src/views/ysjl/4000/dj/common/index.vue
  6. 112
      src/views/ysjl/4000/jj/common/index.vue
  7. 100
      src/views/ysjl/5000/dj/jdgy-cl/index.vue
  8. 102
      src/views/ysjl/5000/dj/lygg-cl/index.vue

192
src/utils/common.js

@ -30,10 +30,10 @@ export default {
}) })
}, },
/** /**
* 预览原始资料 * 预览原始资料
* 如果给的是路径就直接预览如果给的是任务ID就先查询路径再预览 * 如果给的是路径就直接预览如果给的是任务ID就先查询路径再预览
* @param id 任务ID * @param id 任务ID
*/ */
viewRawRecords(id) { viewRawRecords(id) {
preview({ preview({
url: '/download/pullRawRecordsPath', url: '/download/pullRawRecordsPath',
@ -53,9 +53,9 @@ export default {
}) })
}, },
/** /**
* 预览相关鉴证文件 * 预览相关鉴证文件
* @param id 文件主键 * @param id 文件主键
*/ */
viewProve(id) { viewProve(id) {
preview.defaults.withCredentials = true preview.defaults.withCredentials = true
preview({ preview({
@ -73,10 +73,10 @@ export default {
}) })
}, },
/** /**
* 预览驳回附件 * 预览驳回附件
* @param id 驳回记录主键 * @param id 驳回记录主键
* @param fileName 驳回附件名称 * @param fileName 驳回附件名称
*/ */
viewReject(id, fileName) { viewReject(id, fileName) {
if (id && fileName && fileName !== '') { if (id && fileName && fileName !== '') {
const suffixName = fileName.substring(fileName.indexOf('.')) const suffixName = fileName.substring(fileName.indexOf('.'))
@ -151,11 +151,12 @@ export default {
console.info('重新生成成功') console.info('重新生成成功')
}) })
}, },
/** /**
* 检验员签名方法 * 检验员签名方法
* @param {*} id 原始记录/报告主键 * @param {*} id 原始记录/报告主键
* @param {*} jyry 检验人员 * @param {*} jyry 检验人员
*/ */
signName(id, jyry) { signName(id, jyry) {
if (!id) { if (!id) {
return return
@ -189,15 +190,15 @@ export default {
return chineseName return chineseName
}, },
/** /**
* 删除检验方案 * 删除检验方案
* @param jyxm 检验项目简写例如bhcd * @param jyxm 检验项目简写例如bhcd
* @param jianyanxiangmu 检验项目例如壁厚测定 * @param jianyanxiangmu 检验项目例如壁厚测定
* @param bglx 报告类型例如[2, 3] * @param bglx 报告类型例如[2, 3]
* @param ysjlId 无损或分项的原始记录Id * @param ysjlId 无损或分项的原始记录Id
* @param mainYsjlId 主原始记录Id * @param mainYsjlId 主原始记录Id
* @param sblbdm 设备类别代码例如2100 * @param sblbdm 设备类别代码例如2100
* @param nblb 内部类别例如DQ * @param nblb 内部类别例如DQ
*/ */
delJyfa(jyxm, jianyanxiangmu, bglx, ysjlId, mainYsjlId, sblbdm, nblb) { delJyfa(jyxm, jianyanxiangmu, bglx, ysjlId, mainYsjlId, sblbdm, nblb) {
api({ api({
url: '/ysjl/delJyfa', url: '/ysjl/delJyfa',
@ -216,13 +217,12 @@ export default {
message: '删除成功', message: '删除成功',
type: 'success' type: 'success'
}) })
}).catch(e => { }).catch(e => {})
})
}, },
/** /**
* 下载导入模板 * 下载导入模板
* @param templateName 例如模板名字.xlsx * @param templateName 例如模板名字.xlsx
*/ */
downloadTemplate(templateName) { downloadTemplate(templateName) {
if (!templateName) { if (!templateName) {
Vue.prototype.$message({ Vue.prototype.$message({
@ -242,12 +242,12 @@ export default {
}) })
}, },
/** /**
* 上传数据 * 上传数据
* @param file 上传的文件信息 * @param file 上传的文件信息
* @param tableData 上传前的数据 * @param tableData 上传前的数据
* @returns {boolean} * @returns {boolean}
* @constructor * @constructor
*/ */
uploadTableData(file, tableData) { uploadTableData(file, tableData) {
const isExcel = file.type === 'application/vnd.ms-excel' || file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' const isExcel = file.type === 'application/vnd.ms-excel' || file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
const isExcel2 = file.name.endsWith('.xls') || file.name.endsWith('.xlsx') const isExcel2 = file.name.endsWith('.xls') || file.name.endsWith('.xlsx')
@ -280,10 +280,10 @@ export default {
}) })
}, },
/** /**
* 深拷贝 * 深拷贝
* @param o * @param o
* @returns {Array|*} * @returns {Array|*}
*/ */
deepCopy(o) { deepCopy(o) {
if (o instanceof Array) { if (o instanceof Array) {
var n = [] var n = []
@ -302,9 +302,9 @@ export default {
} }
}, },
/** /**
* 根据报告ID查看驳回原因 * 根据报告ID查看驳回原因
* @param ysjlId * @param ysjlId
*/ */
viewRejection(ysjlId) { viewRejection(ysjlId) {
api({ api({
url: '/taskinfo/viewRejection', url: '/taskinfo/viewRejection',
@ -323,9 +323,9 @@ export default {
}) })
}, },
/** /**
* 下载无损分项附件 * 下载无损分项附件
* @param renwuId * @param renwuId
*/ */
downloadWsFxFile(renwuId) { downloadWsFxFile(renwuId) {
preview({ preview({
url: '/download/pullWsFxFilePath', url: '/download/pullWsFxFilePath',
@ -340,8 +340,8 @@ export default {
}) })
}, },
/** /**
* 判断日期格式是否为yyyy-MM-dd * 判断日期格式是否为yyyy-MM-dd
* */ * */
checkDateFormat(checkDate) { checkDateFormat(checkDate) {
if (checkDate !== null) { if (checkDate !== null) {
checkDate = checkDate.replace(/\s+/g, '').replace('00:00:00', '').replace('年', '-').replace('月', '-').replace('日', '') checkDate = checkDate.replace(/\s+/g, '').replace('00:00:00', '').replace('年', '-').replace('月', '-').replace('日', '')
@ -353,8 +353,8 @@ export default {
return checkDate return checkDate
}, },
/** /**
* 删除当前路由 * 删除当前路由
*/ */
delCurrentViews() { delCurrentViews() {
store.dispatch('delCurrentViews', { store.dispatch('delCurrentViews', {
view: router.history.current, view: router.history.current,
@ -362,11 +362,11 @@ export default {
}) })
}, },
/** /**
* 构建编辑原始记录页面路由参数 * 构建编辑原始记录页面路由参数
* @param ysjl * @param ysjl
* @param obj 需要将特殊参数补充到路由的参数里面 * @param obj 需要将特殊参数补充到路由的参数里面
* @returns {{modelId: null, departmentId: *, renwuId: null, sbzldm, sbpzdm, jyxm: null, jylb: *, sblbdm, id: null, state: null, neibuleibie, jianyanrenyuan: null}} * @returns {{modelId: null, departmentId: *, renwuId: null, sbzldm, sbpzdm, jyxm: null, jylb: *, sblbdm, id: null, state: null, neibuleibie, jianyanrenyuan: null}}
*/ */
buildEditYsjlRouterParam(ysjl, obj) { buildEditYsjlRouterParam(ysjl, obj) {
const routerParam = { const routerParam = {
id: ysjl.id, id: ysjl.id,
@ -390,29 +390,29 @@ export default {
return routerParam return routerParam
}, },
/** /**
* 重新加载页面到更新报检单页面 * 重新加载页面到更新报检单页面
* @param bjd * @param bjd
*/ */
reloadViewToUpdateBjd(bjd) { reloadViewToUpdateBjd(bjd) {
this.delCurrentViews() this.delCurrentViews()
router.push({ path: '/bjd/bjd-' + bjd.jianyanleibie.toLowerCase() + '-input/' + bjd.id + '/' + bjd.shebeizhongleidaima + '/update' }) router.push({ path: '/bjd/bjd-' + bjd.jianyanleibie.toLowerCase() + '-input/' + bjd.id + '/' + bjd.shebeizhongleidaima + '/update' })
}, },
/** /**
* 重新加载页面到更新原始记录页面 * 重新加载页面到更新原始记录页面
* @param ysjl * @param ysjl
* @param obj 需要将特殊参数补充到路由的参数里面 * @param obj 需要将特殊参数补充到路由的参数里面
*/ */
reloadViewToUpdateYsjl(ysjl, obj) { reloadViewToUpdateYsjl(ysjl, obj) {
const path = router.history.current.path.replace('/null', '/' + ysjl.id) const path = router.history.current.path.replace('/null', '/' + ysjl.id)
this.delCurrentViews() this.delCurrentViews()
router.push({ path: path, query: this.buildEditYsjlRouterParam(ysjl, obj) }) router.push({ path: path, query: this.buildEditYsjlRouterParam(ysjl, obj) })
}, },
/** /**
* 记录报告编号判重 * 记录报告编号判重
* @param bianhao * @param bianhao
* @param id * @param id
* @returns {Promise<unknown>} * @returns {Promise<unknown>}
*/ */
judgeRepeat(bianhao, id) { judgeRepeat(bianhao, id) {
return new Promise(resolve => { return new Promise(resolve => {
api({ api({
@ -443,11 +443,11 @@ export default {
}) })
}, },
/** /**
* 根据原始记录id查询参数 * 根据原始记录id查询参数
* @param ysjlId * @param ysjlId
* @param sbzldm * @param sbzldm
* @returns {AxiosPromise} * @returns {AxiosPromise}
*/ */
getParam(ysjlId, sbzldm) { getParam(ysjlId, sbzldm) {
return api({ return api({
url: '/ysjl/getParamByYsjlId', url: '/ysjl/getParamByYsjlId',
@ -459,12 +459,12 @@ export default {
}) })
}, },
/** /**
* 获取检验项目 * 获取检验项目
* @param modelId 模板主键起草时使用 * @param modelId 模板主键起草时使用
* @param ysjlId 原始记录主键更新时使用 * @param ysjlId 原始记录主键更新时使用
* @param sort 序号 * @param sort 序号
* @returns {AxiosPromise} * @returns {AxiosPromise}
*/ */
getJyxm(modelId, ysjlId, sort, state) { getJyxm(modelId, ysjlId, sort, state) {
let url = '' let url = ''
let data = {} let data = {}
@ -489,22 +489,22 @@ export default {
}) })
}, },
/** /**
* 精确乘法 * 精确乘法
* @param arg1 乘数 * @param arg1 乘数
* @param arg2 被乘数 * @param arg2 被乘数
* @param decimalPlaces 保留的小数位数 * @param decimalPlaces 保留的小数位数
* @returns {number} * @returns {number}
*/ */
accMul(arg1, arg2, decimalPlaces = 2) { accMul(arg1, arg2, decimalPlaces = 2) {
const percentage = Math.pow(10, decimalPlaces) const percentage = Math.pow(10, decimalPlaces)
return Math.round(arg1 * arg2 * percentage) / percentage return Math.round(arg1 * arg2 * percentage) / percentage
}, },
/** /**
* 精确加法 * 精确加法
* @param arg1 * @param arg1
* @param arg2 * @param arg2
* @returns {number} * @returns {number}
*/ */
accAdd(arg1, arg2) { accAdd(arg1, arg2) {
let r1, r2, m, c let r1, r2, m, c
try { try {
@ -537,10 +537,10 @@ export default {
return (arg1 + arg2) / m return (arg1 + arg2) / m
}, },
/** /**
* 删除数组中指定元素 * 删除数组中指定元素
* @param arr 数据 * @param arr 数据
* @param val 元素 * @param val 元素
*/ */
deleteElement(arr, val) { deleteElement(arr, val) {
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {
if (arr[i] === val) { if (arr[i] === val) {
@ -551,10 +551,10 @@ export default {
return arr return arr
}, },
/** /**
* 修复由于Vue的$on可能会多次绑定导致多次调用$on的回调方法 * 修复由于Vue的$on可能会多次绑定导致多次调用$on的回调方法
* @param event * @param event
* @param callback * @param callback
*/ */
$on(event, callback) { $on(event, callback) {
Utils.$off(event) Utils.$off(event)
Utils.$on(event, callback) Utils.$on(event, callback)

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
v-if="list.length > 0"
type="danger"
icon="el-icon-delete"
style="margin-bottom:20px"
@click="deleteCategoryDetail"
>
删除
</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++) {

9
src/views/document/index.vue

@ -86,6 +86,7 @@ import Pagination from '@/components/Crud/Pagination'
import CrudDocumentArchives from '@/api/document_archives' import CrudDocumentArchives from '@/api/document_archives'
import { uploadFileFn, updateInspectionSystemFile } from '@/api/common' import { uploadFileFn, updateInspectionSystemFile } from '@/api/common'
import { downloadFileUrl } from '@/utils' import { downloadFileUrl } from '@/utils'
import download from 'downloadjs'
import preview from '@/utils/preview' import preview from '@/utils/preview'
// crudpresenter // crudpresenter
@ -194,13 +195,17 @@ export default {
return false return false
}, },
downLoad(item) { downLoad(item) {
window.open(this.url + '/' + item.id + item.suffix) const data = this.url + '/' + item.id + item.suffix
this.$router.push({
path: '/preview/document?src=' + this.$store.getters.prodName + '/static/web/viewer.html?file=' + encodeURIComponent(data)
})
}, },
viewHistoryFile(item) { viewHistoryFile(item) {
downloadFileUrl(this.url + '/' + item.inspectionSystemFileId + '_' + item.id + item.suffix, item.filename, item.suffix) downloadFileUrl(this.url + '/' + item.inspectionSystemFileId + '_' + item.id + item.suffix, item.filename, item.suffix)
}, },
downLoadFn(item) { downLoadFn(item) {
downloadFileUrl(this.url + '/' + item.id + item.suffix, item.filename, item.suffix) const data = this.url + '/' + item.id + item.suffix
download(data, item.filename)
}, },
beforeRemove(file, fileList) { beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`) return this.$confirm(`确定移除 ${file.name}`)

11
src/views/preview/document.vue

@ -0,0 +1,11 @@
<template>
<preview />
</template>
<script>
import preview from '@/views/preview/common/index'
export default {
name: 'Document',
components: { preview }
}
</script>

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