李磊
3 years ago
27 changed files with 1719 additions and 1851 deletions
@ -1,365 +0,0 @@ |
|||||
<template> |
|
||||
<div class="app-container"> |
|
||||
<div class="filter-container"> |
|
||||
<el-form> |
|
||||
<el-form-item> |
|
||||
<el-select v-model="listQuery.shebeizhonglei" multiple placeholder="请选择设备种类" @select="handleFilter"> |
|
||||
<el-option |
|
||||
v-for="item in sbzlList" |
|
||||
:key="item.value" |
|
||||
:label="item.label" |
|
||||
:value="item.value" |
|
||||
/> |
|
||||
</el-select> |
|
||||
<el-input v-model="listQuery.name" placeholder="请输入类别名称" clearable style="width: 200px" @keyup.enter.native="handleFilter" /> |
|
||||
<el-select v-model="listQuery.departmentId" placeholder="请选择所属部门" @select="handleFilter"> |
|
||||
<el-option |
|
||||
v-for="item in depts" |
|
||||
:key="item.id" |
|
||||
:label="item.name" |
|
||||
:value="item.id" |
|
||||
/> |
|
||||
</el-select> |
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleFilter"> |
|
||||
查询 |
|
||||
</el-button> |
|
||||
<el-button type="primary" icon="el-icon-edit" @click="showCreate"> |
|
||||
添加 |
|
||||
</el-button> |
|
||||
<el-button type="danger" icon="el-icon-delete" @click="deleteDepartment"> |
|
||||
删除 |
|
||||
</el-button> |
|
||||
</el-form-item> |
|
||||
</el-form> |
|
||||
</div> |
|
||||
<el-table |
|
||||
ref="list" |
|
||||
v-adaptive="{bottomOffset: 50}" |
|
||||
height="0" |
|
||||
:data="list" |
|
||||
:row-class-name="tableRowClassName" |
|
||||
border |
|
||||
fit |
|
||||
highlight-current-row |
|
||||
@row-click="onRowClick" |
|
||||
@selection-change="handleSelectionChange" |
|
||||
> |
|
||||
<el-table-column type="selection" width="40" /> |
|
||||
<el-table-column type="index" align="center" label="序号" width="80" /> |
|
||||
<el-table-column :formatter="formatDepartment" align="center" label="所属部门" prop="departmentId" min-width="40" /> |
|
||||
<el-table-column :formatter="formatJianyan" align="center" label="检验类别" prop="jianyanleibie" min-width="25" /> |
|
||||
<el-table-column :formatter="formatSpecies" align="center" label="设备种类" prop="shebeizhonglei" min-width="40" /> |
|
||||
<el-table-column align="center" label="设备类别" prop="shebeileibie" min-width="40" /> |
|
||||
<el-table-column :formatter="formatQuhua" align="center" label="所属区划" prop="quhuamingcheng" /> |
|
||||
<el-table-column align="center" label="操作" prop="" min-width="20"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-button type="primary" size="medium" title="修改" @click="showUpdate(scope.$index)"> |
|
||||
修改 |
|
||||
</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
<pagination v-show="total>0" :total="total" :page-num.sync="listQuery.pageNum" :page-row.sync="listQuery.pageSize" @pagination="getList" /> |
|
||||
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" @close="closeDialog"> |
|
||||
<el-form ref="tempDepartment" :model="tempDepartment" class="small-space" label-position="left" label-width="120px" style="width: 300px; margin-left:50px;"> |
|
||||
<el-form-item label="所属科室" prop="departmentId"> |
|
||||
<el-select v-model="department" placeholder="请选择所属科室"> |
|
||||
<el-option |
|
||||
v-for="item in depts" |
|
||||
:key="item.id" |
|
||||
:label="item.name" |
|
||||
:value="item.id" |
|
||||
/> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="检验类别" prop="jianyanleibie"> |
|
||||
<el-select v-model="jianyanleibie" multiple placeholder="请选择检验类别"> |
|
||||
<el-option value="DJ" label="定期检验" /> |
|
||||
<el-option value="JJ" label="监督检验" /> |
|
||||
<el-option value="ZZ" label="制造监检" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="设备种类" prop="shebeizhonglei"> |
|
||||
<el-select v-model="shebeizhonglei" multiple placeholder="请选择设备种类"> |
|
||||
<el-option |
|
||||
v-for="item in sbzlList" |
|
||||
:key="item.value" |
|
||||
:label="item.label" |
|
||||
:value="item.value" |
|
||||
/> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="所属区划" prop="quhuamingcheng"> |
|
||||
<el-select v-model="quhuamingcheng" multiple placeholder="请选择所属区划"> |
|
||||
<el-option |
|
||||
v-for="item in areas" |
|
||||
:key="item.value" |
|
||||
:label="item.label" |
|
||||
:value="item.value" |
|
||||
/> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
</el-form> |
|
||||
<div slot="footer" class="dialog-footer"> |
|
||||
<el-button @click="dialogFormVisible = false"> |
|
||||
取 消 |
|
||||
</el-button> |
|
||||
<el-button v-if="dialogStatus==='create'" type="success" @click="createDepartment"> |
|
||||
创 建 |
|
||||
</el-button> |
|
||||
<el-button v-else type="primary" @click="updateDepartment"> |
|
||||
修 改 |
|
||||
</el-button> |
|
||||
</div> |
|
||||
</el-dialog> |
|
||||
</div> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import Pagination from '@/components/Pagination' |
|
||||
import { deleteDepartmentFn } from '@/api/common' |
|
||||
export default { |
|
||||
name: 'BjdDepartment', |
|
||||
components: { Pagination }, |
|
||||
data() { |
|
||||
return { |
|
||||
total: 0, // 分页组件--数据总条数 |
|
||||
list: [], // 表格的数据 |
|
||||
listQuery: { |
|
||||
pageNum: 1, // 页码 |
|
||||
pageSize: 20, |
|
||||
orderBy: 'id asc' |
|
||||
}, |
|
||||
dialogStatus: 'create', |
|
||||
dialogFormVisible: false, |
|
||||
textMap: { |
|
||||
update: '编辑', |
|
||||
create: '新建报检科室关联' |
|
||||
}, |
|
||||
tempDepartment: {}, |
|
||||
multipleSelection: [], |
|
||||
sbzlList: [], |
|
||||
parentList: [], |
|
||||
depts: [], |
|
||||
areas: [], |
|
||||
shebeizhonglei: '', |
|
||||
quhuamingcheng: '', |
|
||||
jianyanleibie: '', |
|
||||
department: '' |
|
||||
} |
|
||||
}, |
|
||||
created() { |
|
||||
this.getList() |
|
||||
this.getSbzlList() |
|
||||
this.getDepartment() |
|
||||
this.getArea() |
|
||||
}, |
|
||||
methods: { |
|
||||
getList() { |
|
||||
this.apibjd({ |
|
||||
url: '/bjdDepartment/list', |
|
||||
method: 'get', |
|
||||
params: this.listQuery |
|
||||
}).then(data => { |
|
||||
this.list = data.list |
|
||||
this.total = data.total |
|
||||
}) |
|
||||
}, |
|
||||
handleFilter() { |
|
||||
// 查询事件 |
|
||||
this.listQuery.pageNum = 1 |
|
||||
this.getList() |
|
||||
}, |
|
||||
onRowClick(row) { |
|
||||
this.$refs.list.toggleRowSelection(row) |
|
||||
}, |
|
||||
handleSelectionChange: function(val) { |
|
||||
this.multipleSelection = val |
|
||||
}, |
|
||||
showCreate() { |
|
||||
this.tempDepartment = {} |
|
||||
this.dialogStatus = 'create' |
|
||||
this.dialogFormVisible = true |
|
||||
}, |
|
||||
createDepartment() { |
|
||||
this.$refs['tempDepartment'].validate(valid => { |
|
||||
if (valid) { |
|
||||
this.tempDepartment.shebeizhonglei = JSON.stringify(this.shebeizhonglei) |
|
||||
this.tempDepartment.quhuamingcheng = JSON.stringify(this.quhuamingcheng) |
|
||||
this.tempDepartment.jianyanleibie = JSON.stringify(this.jianyanleibie) |
|
||||
this.tempDepartment.departmentId = this.department |
|
||||
this.apibjd({ |
|
||||
url: '/bjdDepartment/save', |
|
||||
method: 'post', |
|
||||
data: this.tempDepartment |
|
||||
}).then(() => { |
|
||||
this.$message({ message: '添加成功。', type: 'success' }) |
|
||||
this.getList() |
|
||||
this.dialogFormVisible = false |
|
||||
}) |
|
||||
} else { |
|
||||
return false |
|
||||
} |
|
||||
}) |
|
||||
}, |
|
||||
showUpdate($index) { |
|
||||
this.tempDepartment = this.list[$index] |
|
||||
this.jianyanleibie = JSON.parse(this.tempDepartment.jianyanleibie) |
|
||||
this.shebeizhonglei = JSON.parse(this.tempDepartment.shebeizhonglei) |
|
||||
this.quhuamingcheng = JSON.parse(this.tempDepartment.quhuamingcheng) |
|
||||
this.department = this.tempDepartment.departmentId |
|
||||
this.dialogStatus = 'update' |
|
||||
this.dialogFormVisible = true |
|
||||
}, |
|
||||
updateDepartment() { |
|
||||
this.$refs['tempDepartment'].validate(valid => { |
|
||||
if (valid) { |
|
||||
this.tempDepartment.shebeizhonglei = JSON.stringify(this.shebeizhonglei) |
|
||||
this.tempDepartment.quhuamingcheng = JSON.stringify(this.quhuamingcheng) |
|
||||
this.tempDepartment.jianyanleibie = JSON.stringify(this.jianyanleibie) |
|
||||
this.tempDepartment.departmentId = this.department |
|
||||
this.apibjd({ |
|
||||
url: '/bjdDepartment/update', |
|
||||
method: 'post', |
|
||||
data: this.tempDepartment |
|
||||
}).then(() => { |
|
||||
this.$message({ message: '数据更新成功。', type: 'success' }) |
|
||||
this.getList() |
|
||||
this.dialogFormVisible = false |
|
||||
}) |
|
||||
} else { |
|
||||
return false |
|
||||
} |
|
||||
}) |
|
||||
}, |
|
||||
deleteDepartment() { |
|
||||
if (this.multipleSelection.length === 0) { |
|
||||
this.$message({ |
|
||||
type: 'error', |
|
||||
message: '请选中需要删除的数据!' |
|
||||
}) |
|
||||
return false |
|
||||
} else { |
|
||||
this.$confirm('确定删除当前选中记录?', '提示', { |
|
||||
confirmButtonText: '确定', |
|
||||
showCancelButton: true, |
|
||||
type: 'warning' |
|
||||
}).then(() => { |
|
||||
const pks = [] |
|
||||
this.multipleSelection.forEach(category => { |
|
||||
pks.push(category.id) |
|
||||
}) |
|
||||
deleteDepartmentFn({ pks: pks }).then(() => { |
|
||||
this.$message({ message: '删除成功。', type: 'success' }) |
|
||||
this.getList() |
|
||||
}) |
|
||||
}) |
|
||||
} |
|
||||
}, |
|
||||
getSbzlList() { |
|
||||
this.api({ |
|
||||
url: '/sedirectory/getList', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
sbzl: undefined, |
|
||||
level: '1' |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.sbzlList = data |
|
||||
}) |
|
||||
}, |
|
||||
// 查询检验科室 |
|
||||
getDepartment() { |
|
||||
this.api({ |
|
||||
url: '/department/all', |
|
||||
method: 'get' |
|
||||
}).then(data => { |
|
||||
this.depts = data |
|
||||
}) |
|
||||
}, |
|
||||
getArea() { // 查询区划 |
|
||||
this.api({ |
|
||||
url: '/area/getShiArea', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
shidaima: '370100' |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.areas = data |
|
||||
}) |
|
||||
}, |
|
||||
closeDialog() { |
|
||||
this.species = [] |
|
||||
}, |
|
||||
formatDepartment(row, column, cellValue) { |
|
||||
let lable = '' |
|
||||
for (let i = 0; i < this.depts.length; i++) { |
|
||||
if (cellValue === this.depts[i].id) { |
|
||||
lable = this.depts[i].name |
|
||||
break |
|
||||
} |
|
||||
} |
|
||||
return lable |
|
||||
}, |
|
||||
formatSpecies(row, column, cellValue) { |
|
||||
const value = JSON.parse(cellValue) |
|
||||
if (value == null) { |
|
||||
return '全部' |
|
||||
} |
|
||||
let lable = '' |
|
||||
for (let i = 0; i < value.length; i++) { |
|
||||
for (let j = 0; j < this.sbzlList.length; j++) { |
|
||||
if (value[i] === this.sbzlList[j].value) { |
|
||||
lable = this.sbzlList[j].label + ',' + lable |
|
||||
break |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
return lable.substring(0, lable.length - 1) |
|
||||
}, |
|
||||
formatJianyan(row, column, cellValue) { |
|
||||
const value = JSON.parse(cellValue) |
|
||||
if (value == null) { |
|
||||
return '全部' |
|
||||
} |
|
||||
let lable = '' |
|
||||
for (let i = 0; i < value.length; i++) { |
|
||||
if (value[i] === 'DJ') { |
|
||||
lable = '定期检验' + ',' + lable |
|
||||
} else if (value[i] === 'JJ') { |
|
||||
lable = '监督检验' + ',' + lable |
|
||||
} |
|
||||
} |
|
||||
return lable.substring(0, lable.length - 1) |
|
||||
}, |
|
||||
formatQuhua(row, column, cellValue) { |
|
||||
const value = JSON.parse(cellValue) |
|
||||
if (value == null) { |
|
||||
return '全部' |
|
||||
} |
|
||||
let lable = '' |
|
||||
for (let i = 0; i < value.length; i++) { |
|
||||
for (let j = 0; j < this.areas.length; j++) { |
|
||||
if (value[i] === this.areas[j].value) { |
|
||||
lable = this.areas[j].label + ',' + lable |
|
||||
break |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
return lable.substring(0, lable.length - 1) |
|
||||
}, |
|
||||
tableRowClassName({ row }) { |
|
||||
if (row.parentId === null) { |
|
||||
return 'main-row' |
|
||||
} else { |
|
||||
return '' |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
||||
<style> |
|
||||
.el-table .main-row { |
|
||||
background: #f0f9eb; |
|
||||
} |
|
||||
</style> |
|
@ -1,610 +0,0 @@ |
|||||
<!-- 车用气瓶安装监督检验报告 --> |
|
||||
<template> |
|
||||
<div class="app-container"> |
|
||||
<sticky style="margin-bottom: 10px;"> |
|
||||
<div class="sub-navbar"> |
|
||||
<el-button v-show="state === 'create'" type="success" icon="el-icon-edit" size="medium" @click="saveYsjl('add')"> |
|
||||
保存 |
|
||||
</el-button> |
|
||||
<el-button v-show="state === 'update'" type="primary" icon="el-icon-edit" size="medium" @click="saveYsjl('upd')"> |
|
||||
更新 |
|
||||
</el-button> |
|
||||
<el-button v-show="state === 'update'" type="success" icon="el-icon-upload2" size="medium" @click="saveYsjl('build')"> |
|
||||
生成报告 |
|
||||
</el-button> |
|
||||
<el-button v-show="state !== 'create'" type="warning" icon="el-icon-view" size="medium" @click="common.viewYsjl(ysjl.id, 'YSJL')"> |
|
||||
预览 |
|
||||
</el-button> |
|
||||
<el-button v-show="state !== 'create'" type="info" icon="el-icon-message" size="medium" @click="common.viewRejection(ysjl.id)"> |
|
||||
查看驳回意见 |
|
||||
</el-button> |
|
||||
</div> |
|
||||
</sticky> |
|
||||
<el-tabs v-model="checkedTab" type="card"> |
|
||||
<el-tab-pane label="基本信息" name="first"> |
|
||||
<el-form ref="ysjl" :model="ysjl" class="el-form" label-position="right" label-width="130px"> |
|
||||
<fieldset> |
|
||||
<legend>基本信息</legend> |
|
||||
<el-row :gutter="20"> |
|
||||
<el-col v-if="state === 'create' || ysjl.jilubianhao === null || ysjl.jilubianhao === ''" :span="13"> |
|
||||
<el-form-item label="报告编号"> |
|
||||
<el-input v-model="jlbh1" style="width:70px" disabled /> - |
|
||||
<el-input v-model="jlbh2" style="width:120px" disabled /> - |
|
||||
<el-input v-model="jlbh3" style="width:120px" /> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
<el-col v-else :span="9"> |
|
||||
<el-form-item label="报告编号" prop="jilubianhao"> |
|
||||
<el-input v-if="state !== 'create'" v-model="ysjl.jilubianhao" :disabled="edit" @blur="judgeRepeat(ysjl.jilubianhao, ysjl.id)" /> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
<el-col v-if="isRepeat" :span="2"> |
|
||||
<span style="color:red">编号重复</span> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<el-row :gutter="20"> |
|
||||
<el-col :span="18"> |
|
||||
<el-form-item label="安装单位" prop="shigongdanwei"> |
|
||||
<el-input v-model="ysjl.shigongdanwei" type="text" /> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<el-row :gutter="20"> |
|
||||
<el-col :span="9"> |
|
||||
<el-form-item label="安装许可证编号" prop="shigongxukezheng"> |
|
||||
<el-input v-model="ysjl.shigongxukezheng" type="text" /> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
<el-col :span="9"> |
|
||||
<el-form-item label="安装日期" prop="shigongriqi"> |
|
||||
<el-date-picker v-model="ysjl.shigongriqi" value-format="yyyy-MM-dd" type="date" placeholder="选择日期" style="width: 100%;" /> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<el-row :gutter="20"> |
|
||||
<el-col :span="18"> |
|
||||
<el-form-item label="气瓶制造单位" prop="zhizaodanwei"> |
|
||||
<el-input v-model="ysjl.zhizaodanwei" type="text" /> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<el-row :gutter="20"> |
|
||||
<el-col :span="9"> |
|
||||
<el-form-item label="产品编号" prop="chanpinbianhao"> |
|
||||
<el-input v-model="ysjl.chanpinbianhao" type="text" /> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
<el-col :span="9"> |
|
||||
<el-form-item label="设备代码" prop="shebeidaima"> |
|
||||
<el-input v-model="ysjl.shebeidaima" type="text" /> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<el-row :gutter="20"> |
|
||||
<el-col :span="9"> |
|
||||
<el-form-item label="制造日期" prop="zhizaoriqi"> |
|
||||
<el-date-picker v-model="ysjl.zhizaoriqi" type="date" value-format="yyyy-MM-dd" placeholder="选择日期" style="width: 100%;" /> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
<el-col :span="9"> |
|
||||
<el-form-item label="登记机关" prop="dengjijiguan"> |
|
||||
<el-select v-model="ysjl.dengjijiguan" filterable style="width: 100%;"> |
|
||||
<el-option v-for="(item, index) in djjgs" :key="index" :label="item" :value="item" /> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<el-row :gutter="20"> |
|
||||
<el-col :span="9"> |
|
||||
<el-form-item label="检验金额(元)" prop="jianyanheding"> |
|
||||
<el-input-number v-model="ysjl.jianyanheding" :disabled="ysjl.retreatState === 2 && ysjl.jfState !== null && ysjl.jfState" :controls="false" style="width: 100%;" /> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
</fieldset> |
|
||||
<fieldset> |
|
||||
<legend>性能参数</legend> |
|
||||
<el-row :gutter="20"> |
|
||||
<el-col :span="9"> |
|
||||
<el-form-item label="公称压力" prop="yali"> |
|
||||
<el-input v-model="param.yali" type="text" style="width: 120%;" /> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
<el-col :span="9"> |
|
||||
<el-form-item label="工作介质" prop="jiezhi"> |
|
||||
<el-input v-model="param.jiezhi" type="text" style="width: 120%;" /> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<el-row :gutter="20"> |
|
||||
<el-col :span="9"> |
|
||||
<el-form-item label="车辆牌号/车辆底盘号" label-width="150px" prop="rongqituhao"> |
|
||||
<el-input v-model="param.rongqituhao" type="text" style="width: 120%;" /> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
</fieldset> |
|
||||
<fieldset> |
|
||||
<legend>检验信息</legend> |
|
||||
<el-row :gutter="20" style="text-align:left;margin-left: 35px;font-size: 18px;color: #606266;line-height: 60px;font-weight: bolder;"> |
|
||||
根据《中华人民共和国特种设备安全法》、《特种设备安全监察条例》、《车用气瓶安全技术监察规程》的要求,该车用气瓶安装经我机构监督检验,其安装安全质量 |
|
||||
<el-select v-model="ysjl.jianyanjielun" placeholder="请选择" style="width: 100px;"> |
|
||||
<el-option label="符合" value="符合" /> |
|
||||
<el-option label="不符合" value="不符合" /> |
|
||||
</el-select> |
|
||||
相关要求,特发此证。 |
|
||||
</el-row> |
|
||||
<el-row :gutter="20"> |
|
||||
<el-col :span="9"> |
|
||||
<el-form-item label="检验开始日期" prop="jianyankaishiriqi"> |
|
||||
<el-date-picker v-model="ysjl.jianyankaishiriqi" type="date" value-format="yyyy-MM-dd" placeholder="选择日期" style="width: 100%;" /> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
<el-col :span="9"> |
|
||||
<el-form-item label="检验结束日期" prop="jianyanjieshuriqi"> |
|
||||
<el-date-picker v-model="ysjl.jianyanjieshuriqi" type="date" value-format="yyyy-MM-dd" placeholder="选择日期" style="width: 100%;" /> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<el-row :gutter="20"> |
|
||||
<el-col :span="9"> |
|
||||
<el-form-item label="选择科室" prop="departmentId"> |
|
||||
<el-cascader |
|
||||
v-model="ysjl.departmentId" |
|
||||
:options="departmemtArr" |
|
||||
:props="{ value: 'id', label: 'name', checkStrictly: true }" |
|
||||
:show-all-levels="false" |
|
||||
@change="handleChange" |
|
||||
/> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<el-row :gutter="10"> |
|
||||
<el-col :span="9"> |
|
||||
<el-form-item label="检验人员" prop="jianyanrenyuan"> |
|
||||
<el-input v-model="jianyanrenyuan" disabled /> |
|
||||
<el-input v-show="false" v-model="ysjl.jianyanrenyuan" /> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
<el-col v-if="state !== 'bgView'" :span="9"> |
|
||||
<sign-name :ysjl="ysjl" :jianyanrenyuan="jianyanrenyuan" :disabled="edit" @setSignValue="singNameValue" /> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
</fieldset> |
|
||||
</el-form> |
|
||||
</el-tab-pane> |
|
||||
<el-tab-pane label="车用气瓶安装监督检验报告附页" name="second"> |
|
||||
<el-table |
|
||||
:data="bgfyData" |
|
||||
:span-method="arraySpanMethod" |
|
||||
border |
|
||||
highlight-current-row |
|
||||
stripe |
|
||||
style="width:80%" |
|
||||
> |
|
||||
<el-table-column type="index" width="60" align="center" label="序号" /> |
|
||||
<el-table-column align="center" label="检验项目"> |
|
||||
<el-table-column align="left" prop="jianyanxiang" width="150" label="检验项" /> |
|
||||
<el-table-column align="left" prop="jianyanmu" width="300" label="检验内容" /> |
|
||||
</el-table-column> |
|
||||
<el-table-column align="center" prop="xiangmuleibie" label="类别" /> |
|
||||
<el-table-column align="center" prop="jianyanjieguo" label="检验结果"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-select v-model="scope.row.jianyanjieguo" :disabled="edit" filterable allow-create default-first-option placeholder="请选择" style="width: 100%;"> |
|
||||
<el-option label="资料齐全" value="资料齐全" /> |
|
||||
<el-option label="未到首次检验日期" value="未到首次检验日期" /> |
|
||||
<el-option label="无变更" value="无变更" /> |
|
||||
<el-option label="未发现超标缺陷" value="未发现超标缺陷" /> |
|
||||
<el-option label="符合要求" value="符合要求" /> |
|
||||
<el-option label="不符合要求" value="不符合要求" /> |
|
||||
<el-option label="合格" value="合格" /> |
|
||||
<el-option label="齐全" value="齐全" /> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column align="center" prop="beizhu" label="工作见证"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-input v-model="scope.row.beizhu" :disabled="edit" name="fyGongzuojianzheng" placeholder="请输入内容" /> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
<br> |
|
||||
<el-form ref="param" :model="param" class="el_form" label-position="right" label-width="250px"> |
|
||||
<el-row> |
|
||||
<el-col :span="11" style="height: 60px"> |
|
||||
<el-form-item label="对安装单位质量体系运转情况的评价:" prop="aqglqkjcjg"> |
|
||||
<el-input v-model="param.aqglqkjcjg" type="textarea" placeholder="请输入内容" /> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<el-row> |
|
||||
<el-col :span="11" style="height: 80px"> |
|
||||
<el-form-item label="记事栏:" prop="qita"> |
|
||||
<el-input v-model="param.qita" type="textarea" placeholder="请输入内容" /> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
</el-form> |
|
||||
</el-tab-pane> |
|
||||
</el-tabs> |
|
||||
</div> |
|
||||
</template> |
|
||||
<script> |
|
||||
import Sticky from '@/components/Sticky' |
|
||||
import SignName from '@/views/common/SignName' |
|
||||
import Utils from '@/utils/contact.js' |
|
||||
import { getDepartmentTreeList } from '@/api/common' |
|
||||
|
|
||||
export default { |
|
||||
name: 'CyqpAjYsjl', |
|
||||
components: { SignName, Sticky }, |
|
||||
data() { |
|
||||
return { |
|
||||
// 预定义值 |
|
||||
edit: false, // 页面编辑状态 |
|
||||
bgfyData: [], // 车用气瓶安装监检验报告附页 |
|
||||
jlbh1: 'PJ1', |
|
||||
jlbh2: 'ZZSYC' + new Date().getFullYear(), |
|
||||
jlbh3: '', |
|
||||
// 检验人员 |
|
||||
jianyanrenyuan: '', |
|
||||
// 接收传入该页面的值 |
|
||||
// 页面状态 {create=> 创建,update=> 更新} |
|
||||
state: this.$route.query.state, |
|
||||
ysjl: {}, |
|
||||
departmentId: this.$route.query.departmentId, |
|
||||
param: {}, |
|
||||
checkedTab: 'first', |
|
||||
// 表格合并相关 |
|
||||
// 参与列合并的字段,在这里增加即可 |
|
||||
cols: [ |
|
||||
{ |
|
||||
name: 'jianyanxiang', // 参与计算的列名,必须和el-table-column prop=''值一致 |
|
||||
getValue(row) { // 该列用于比较的值的获取方法 |
|
||||
return row.jianyanxiang |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
name: 'jianyanmu', |
|
||||
getValue(row) { |
|
||||
return row.jianyanmu |
|
||||
} |
|
||||
} |
|
||||
], |
|
||||
// 参与行内合并的字段 |
|
||||
rows: [ |
|
||||
{ |
|
||||
name: 'jianyanxiang', |
|
||||
getValue(row) { |
|
||||
return row.jianyanxiang |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
name: 'jianyanmu', |
|
||||
getValue(row) { |
|
||||
return row.jianyanmu |
|
||||
} |
|
||||
} |
|
||||
], |
|
||||
isRepeat: false, |
|
||||
users: [], |
|
||||
djjgs: ['无'], |
|
||||
departmemtArr: [] |
|
||||
} |
|
||||
}, |
|
||||
// computed: { |
|
||||
// jilubianhao: function() { |
|
||||
// let bianhao |
|
||||
// if (this.ysjl.jilubianhao === null || this.ysjl.jilubianhao === undefined || this.ysjl.jilubianhao === '') { |
|
||||
// return this.jlbh1 + this.jlbh2 + '-' + this.jlbh3 |
|
||||
// } else { |
|
||||
// bianhao = this.ysjl.jilubianhao |
|
||||
// } |
|
||||
// return this.judgeRepeat(bianhao, this.ysjl.id) |
|
||||
// } |
|
||||
// }, |
|
||||
// watch: { |
|
||||
// jlbh3: function(val) { |
|
||||
// this.ysjl.jilubianhao = this.jlbh1 + this.jlbh2 + '-' + val |
|
||||
// this.judgeRepeat(this.ysjl.jilubianhao, this.ysjl.id) |
|
||||
// }, |
|
||||
// jilubianhao: function(newValue) { |
|
||||
// this.judgeRepeat(newValue, this.ysjl.id) |
|
||||
// } |
|
||||
// }, |
|
||||
// 页面创建后执行 |
|
||||
created() { |
|
||||
// if (this.state === 'create') { |
|
||||
// // 设置初始值 |
|
||||
// this.initYsjl() |
|
||||
// } else { |
|
||||
// this.getYsjl() |
|
||||
// this.getParam(this.$route.query.id, this.$route.query.sbzldm) |
|
||||
// } |
|
||||
// this.getUserList() |
|
||||
// this.getJyxm(1) |
|
||||
// this.getArea() |
|
||||
}, |
|
||||
mounted() { |
|
||||
if (!this.ysjl.jilubianhao) { |
|
||||
this.getMaxBh() |
|
||||
} |
|
||||
this.getDepartmentArr() |
|
||||
}, |
|
||||
methods: { |
|
||||
getDepartmentArr() { |
|
||||
getDepartmentTreeList().then(res => { |
|
||||
this.departmemtArr = res |
|
||||
}) |
|
||||
}, |
|
||||
handleChange(v) { |
|
||||
this.ysjl.departmentId = v[1] |
|
||||
}, |
|
||||
initYsjl() { |
|
||||
this.api({ |
|
||||
url: '/ysjl/initYsjl', |
|
||||
method: 'post', |
|
||||
data: { |
|
||||
templateId: this.$route.query.templateId, |
|
||||
renwuId: this.$route.query.renwuId, |
|
||||
neibuleibie: this.$route.query.neibuleibie, |
|
||||
sblbdm: this.$route.query.sblbdm, |
|
||||
sblbmc: this.$route.query.sblbmc, |
|
||||
sbpzdm: this.$route.query.sbpzdm, |
|
||||
sbpzmc: this.$route.query.sbpzmc |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.ysjl = data.ysjl |
|
||||
this.departmentId = this.ysjl.departmentId |
|
||||
this.param = data.param ? data.param : {} |
|
||||
const tempTime = new Date() |
|
||||
this.$set(this.ysjl, 'jianyanjielun', '符合') |
|
||||
this.ysjl.jianyankaishiriqi = tempTime |
|
||||
this.ysjl.jianyanjieshuriqi = tempTime |
|
||||
this.ysjl.jiaoheriqi = tempTime |
|
||||
let xcjyrq = (tempTime.getFullYear() + 2) + '-' + (tempTime.getMonth() + 1) + '-' + tempTime.getDate() |
|
||||
xcjyrq = new Date(xcjyrq) |
|
||||
this.ysjl.xiacijianyanriqi = xcjyrq.setDate(xcjyrq.getDate() - 1) |
|
||||
this.ysjl.xiacijianyanriqishuoming = '/' |
|
||||
}) |
|
||||
}, |
|
||||
getYsjl() { |
|
||||
this.api({ |
|
||||
url: '/ysjl', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
ysjlId: this.$route.query.id |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.ysjl = data |
|
||||
this.departmentId = this.ysjl.departmentId |
|
||||
if (this.ysjl.jianyanrenyuan) { |
|
||||
this.jianyanrenyuan = this.common.convertCnName(this.ysjl.jianyanrenyuan) |
|
||||
} |
|
||||
// 查询最大记录编号 |
|
||||
if (this.ysjl.jilubianhao === null || this.ysjl.jilubianhao === undefined || this.ysjl.jilubianhao === '') { |
|
||||
this.getMaxBh() |
|
||||
} |
|
||||
}) |
|
||||
}, |
|
||||
getParam(ysjlId, sbzldm) { |
|
||||
// 根据原始记录id查询参数 |
|
||||
this.api({ |
|
||||
url: '/ysjl/getParamByYsjlId', |
|
||||
method: 'get', |
|
||||
params: { ysjlId: ysjlId, sbzldm: sbzldm } |
|
||||
}).then(data => { |
|
||||
this.param = data |
|
||||
}) |
|
||||
}, |
|
||||
// 签名方法 |
|
||||
singNameValue(data) { |
|
||||
this.jianyanrenyuan = data.name |
|
||||
this.ysjl.jianyanrenyuan = data.id |
|
||||
if (this.state !== 'create') { |
|
||||
this.common.signName(this.ysjl.id, this.ysjl.jianyanrenyuan) |
|
||||
Utils.$emit('ysjl-list') |
|
||||
} |
|
||||
}, |
|
||||
getUserList() { |
|
||||
this.api({ |
|
||||
url: '/user/all', |
|
||||
method: 'get' |
|
||||
}).then(data => { |
|
||||
this.users = data |
|
||||
}) |
|
||||
}, |
|
||||
// 查询最大记录编号 |
|
||||
getMaxBh() { |
|
||||
const aheadPart = this.jlbh1 + '-' + this.jlbh2 + this.jlbh3 + '-' |
|
||||
this.api({ |
|
||||
url: '/ysjl/gainCurrentBh', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
aheadPart: aheadPart, |
|
||||
hinderPart: '' |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.jlbh3 = data |
|
||||
}) |
|
||||
}, |
|
||||
// 查询检验项目 |
|
||||
getJyxm(sort) { |
|
||||
let url = '' |
|
||||
let data = {} |
|
||||
if (this.state === 'create') { |
|
||||
url = '/jyxm/getCyJyxm' |
|
||||
data = { |
|
||||
templateId: this.$route.query.templateId, |
|
||||
order: sort |
|
||||
} |
|
||||
} else { |
|
||||
url = '/jyxm/getCyJyxmByYsjl' |
|
||||
data = { |
|
||||
ysjlId: this.$route.query.id, |
|
||||
isReport: false, |
|
||||
order: sort |
|
||||
} |
|
||||
} |
|
||||
this.api({ |
|
||||
url: url, |
|
||||
method: 'get', |
|
||||
params: data |
|
||||
}).then(data => { |
|
||||
console.log(data) |
|
||||
this.bgfyData = data |
|
||||
this.tableJs.getData(this.cols, this.rows, data) |
|
||||
}) |
|
||||
}, |
|
||||
saveYsjl: function(operation) { |
|
||||
this.tableData = [] |
|
||||
const retData = [] |
|
||||
for (let i = 0; i < this.bgfyData.length; i++) { |
|
||||
// 把检验项数组转换成字符串 |
|
||||
const retRow = {} |
|
||||
retRow.id = this.bgfyData[i].id |
|
||||
if (this.bgfyData[i].jianyanjieguo !== '' && this.bgfyData[i].jianyanjieguo !== null && this.bgfyData[i].jianyanjieguo !== undefined) { |
|
||||
retRow.jianyanjieguo = this.bgfyData[i].jianyanjieguo |
|
||||
} |
|
||||
if (this.bgfyData[i].beizhu !== '' && this.bgfyData[i].beizhu !== null && this.bgfyData[i].beizhu !== undefined) { |
|
||||
retRow.beizhu = this.bgfyData[i].beizhu |
|
||||
} |
|
||||
retData.push(retRow) |
|
||||
} |
|
||||
this.tableData.push(retData) |
|
||||
let type = '' |
|
||||
if (operation === 'add') { |
|
||||
type = 'post' |
|
||||
this.ysjl.bglx = 1 |
|
||||
this.ysjl.cjState = 'ysjl' |
|
||||
this.ysjl.jigouhezhunzhenghao = process.env.VUE_APP_HZZBH |
|
||||
this.ysjl.jlprintState = 0 |
|
||||
this.ysjl.jianyanxiangmu = 'cyqp' |
|
||||
this.ysjl.jilubianhao = this.jlbh1 + this.jlbh2 + '-' + this.jlbh3 |
|
||||
this.save(operation, type) |
|
||||
} else if (operation === 'upd') { |
|
||||
type = 'put' |
|
||||
this.save(operation, type) |
|
||||
} else if (operation === 'build') { |
|
||||
if (this.ysjl.jilubianhao && this.ysjl.jilubianhao.indexOf('COPY') > -1) { |
|
||||
this.$message({ |
|
||||
type: 'error', |
|
||||
message: '请先修改记录编号,不允许携带COPY标志生成报告!' |
|
||||
}) |
|
||||
return false |
|
||||
} |
|
||||
if (this.ysjl.jianyanrenyuan === null || this.ysjl.jianyanrenyuan === '') { |
|
||||
this.$message({ |
|
||||
type: 'error', |
|
||||
message: '请先签名再生成报告!' |
|
||||
}) |
|
||||
return false |
|
||||
} |
|
||||
this.tableData = null |
|
||||
type = 'put' |
|
||||
this.save(operation, type) |
|
||||
} |
|
||||
}, |
|
||||
save(operation, type) { |
|
||||
// 判断报告编号是否重复 |
|
||||
if (this.isRepeat) { |
|
||||
this.$message({ message: '报告编号重复,请先修改报告编号再保存', type: 'error' }) |
|
||||
return false |
|
||||
} else { |
|
||||
this.$refs['ysjl'].validate(valid => { |
|
||||
if (valid) { |
|
||||
const jyxm = JSON.stringify(this.tableData) |
|
||||
this.api({ |
|
||||
url: '/ysjl', |
|
||||
method: type, |
|
||||
data: { |
|
||||
ysjl: this.ysjl, |
|
||||
param: this.param, |
|
||||
jyxm: jyxm, |
|
||||
bgjyxm: jyxm, |
|
||||
flag: operation |
|
||||
} |
|
||||
}).then(data => { |
|
||||
// 刷新任务列表,原始报告待办,原始报告已办,检验报告 |
|
||||
Utils.$emit('task-list') |
|
||||
Utils.$emit('bggl-daiban-list') |
|
||||
if (operation === 'add') { |
|
||||
this.ysjl.id = data |
|
||||
this.param.ysjlId = data |
|
||||
this.$message({ message: '保存成功', type: 'success' }) |
|
||||
} else if (operation === 'upd') { |
|
||||
this.$message({ message: '更新成功', type: 'success' }) |
|
||||
} else if (operation === 'build') { |
|
||||
Utils.$emit('ysjl-list') |
|
||||
Utils.$emit('ysjl-yb-list') |
|
||||
Utils.$emit('bggl-daiban-list') |
|
||||
// 修改16版任务状态 |
|
||||
this.common.updRenwuState(this.ysjl.id, 2, true) |
|
||||
// 生成pdf |
|
||||
this.common.viewYsjlNoOpen(this.ysjl.id, 'YSJL') |
|
||||
this.$message({ message: '生成报告成功', type: 'success' }) |
|
||||
this.$store.dispatch('delCurrentViews', { |
|
||||
view: this.$route, |
|
||||
$router: this.$router |
|
||||
}) |
|
||||
} |
|
||||
this.state = 'update' |
|
||||
}) |
|
||||
} |
|
||||
}) |
|
||||
} |
|
||||
}, |
|
||||
judgeRepeat(bianhao, id) { |
|
||||
this.api({ |
|
||||
url: '/ysjl/judgeRepeat', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
ysjlId: id, |
|
||||
bianhao: bianhao |
|
||||
} |
|
||||
}).then(data => { |
|
||||
this.isRepeat = data > 0 |
|
||||
}) |
|
||||
}, |
|
||||
arraySpanMethod({ row, column, rowIndex, columnIndex }) { |
|
||||
if (columnIndex === 1) { |
|
||||
if (rowIndex === 0) { |
|
||||
return [2, 1] |
|
||||
} else if (rowIndex === 2 || rowIndex === 6) { |
|
||||
return [3, 1] |
|
||||
} else if (rowIndex === 5 || rowIndex === 9 || rowIndex === 10) { |
|
||||
return [1, 2] |
|
||||
} else { |
|
||||
return [0, 0] |
|
||||
} |
|
||||
} else if (columnIndex === 2) { |
|
||||
if (rowIndex === 5 || rowIndex === 9 || rowIndex === 10) { |
|
||||
return [0, 0] |
|
||||
} |
|
||||
} else if (columnIndex === 5) { |
|
||||
if (rowIndex === 0) { |
|
||||
return [11, 1] |
|
||||
} else { |
|
||||
return [0, 0] |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
/** |
|
||||
* 查询区划 |
|
||||
*/ |
|
||||
getArea() { |
|
||||
this.api({ |
|
||||
url: '/area/getShiArea', |
|
||||
method: 'get', |
|
||||
params: { |
|
||||
shidaima: '370100' |
|
||||
} |
|
||||
}).then(data => { |
|
||||
data.forEach(area => { |
|
||||
this.djjgs.push(area.label + '市场监督管理局') |
|
||||
}) |
|
||||
}) |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
Loading…
Reference in new issue