You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1362 lines
45 KiB

4 years ago
<!--锅炉改造和重大修理-->
<template>
<div class="app-container">
<sticky style="margin-bottom: 10px">
4 years ago
<div class="sub-navbar">
<el-button
v-if="state === 'create'"
type="success"
icon="el-icon-edit"
size="medium"
@click="saveYsjl('add')"
>
4 years ago
保存
</el-button>
<template v-else>
<el-button
type="primary"
icon="el-icon-edit"
size="medium"
@click="saveYsjl('upd')"
>
4 years ago
更新
</el-button>
<el-button
v-if="isSysUser"
type="success"
icon="el-icon-upload2"
size="medium"
@click="saveYsjl('build')"
>
4 years ago
生成报告
</el-button>
<el-button
type="warning"
icon="el-icon-view"
size="medium"
@click="common.viewYsjl(ysjl.id, 'YSJL')"
>
4 years ago
预览
</el-button>
</template>
<template v-if="isSysUser">
<el-button type="primary" size="medium" @click="Signjyxm">
<svg-icon icon-class="sign" />
检验项目批量签名
</el-button>
<el-button
type="danger"
icon="el-icon-delete"
size="medium"
@click="signClear"
>
4 years ago
批量清除签名
</el-button>
<el-button
type="success"
size="medium"
icon="el-icon-edit"
@click="batchUpdDate"
>
4 years ago
批量修改日期
</el-button>
<el-button
type="primary"
size="medium"
icon="el-icon-info"
@click="showDialogRoleVisible"
>
4 years ago
编辑权限
</el-button>
</template>
<el-button
type="info"
size="medium"
icon="el-icon-info"
@click="dialogEnclosureVisible = true"
>
4 years ago
相关鉴证
</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="140px"
>
4 years ago
<fieldset>
<legend>基本信息</legend>
<el-row :gutter="25">
<el-col
v-if="
state === 'create' ||
ysjl.jilubianhao === null ||
ysjl.jilubianhao === ''
"
:span="14"
>
<el-form-item label="记录编号">
<el-input v-model="jlbh1" style="width: 80px" disabled />
<el-input v-model="jlbh2" style="width: 80px" disabled />-
<el-input
v-model="jlbh3"
style="width: 85px"
@blur="judgeRepeat(jlbh1 + jlbh2 + '-' + jlbh3, ysjl.id)"
/>
</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"
/>
</el-form-item>
</el-col>
<el-col
v-if="isRepeat"
:span="2"
style="
vertical-align: middle;
padding-top: 3px;
font-size: 15px;
"
>
<span style="color: red">编号重复</span>
</el-col>
</el-row>
4 years ago
<el-row :gutter="20">
<el-col :span="9">
<el-form-item label="设备类别" prop="shebeileibie">
<el-select
v-model="ysjl.shebeileibie"
filterable
allow-create
default-first-option
style="width: 100%"
@change="changXh"
>
<el-option
v-for="item in xinghaoList"
:key="item.id"
:label="item.xinghao"
:value="item.xinghao"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="设备品种" prop="shebeipinzhong">
<el-input
v-model="ysjl.shebeipinzhong"
type="text"
:disabled="edit"
/>
4 years ago
</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" />
4 years ago
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="制造日期" prop="zhizaoriqi">
<el-date-picker
v-model="ysjl.zhizaoriqi"
value-format="yyyy-MM-dd"
placeholder="选择日期"
style="width: 100%"
/>
</el-form-item>
4 years ago
</el-col>
</el-row>
<el-row :gutter="20">
4 years ago
<el-col :span="18">
<el-form-item label="制造单位名称" prop="zhizaodanwei">
<el-input
v-model="ysjl.zhizaodanwei"
type="text"
:disabled="edit"
/>
4 years ago
</el-form-item>
</el-col>
</el-row>
<el-row v-if="fromType == 1||fromType==5||fromType==3" :gutter="20">
<el-col :span="18">
<el-form-item label="使用单位名称" prop="shiyongdanwei">
<el-input
v-model="ysjl.shiyongdanwei"
type="text"
:disabled="edit"
/>
</el-form-item>
</el-col>
</el-row>
<el-row v-if="fromType == 2 ||fromType == 4" :gutter="20">
4 years ago
<el-col :span="18">
<el-form-item
label="施工单位名称"
prop="shigongdanweimingcheng"
>
<el-input
v-model="ysjl.shigongdanweimingcheng"
type="text"
:disabled="edit"
/>
4 years ago
</el-form-item>
</el-col>
</el-row>
<el-row v-if="fromType == 2 ||fromType == 4" :gutter="20">
<el-col :span="9">
<el-form-item
label="施工单位许可证编号"
prop="shigongdanweixukezhengbianhao"
>
<el-input
v-model="ysjl.shigongdanweixukezhengbianhao"
type="text"
:disabled="edit"
/>
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="施工类别" prop="shigongleibie">
<el-input
v-model="ysjl.shigongleibie"
type="text"
:disabled="edit"
/>
</el-form-item>
</el-col>
</el-row>
<el-row v-if="fromType == 2" :gutter="20">
<el-col :span="18">
<el-form-item label="安装地点" prop="anzhuangdidian">
<el-input
v-model="ysjl.anzhuangdidian"
type="text"
:disabled="edit"
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
4 years ago
<el-col :span="9">
<el-form-item label="安全管理人员" prop="anquanguanlirenyuan">
<el-input
v-model="ysjl.anquanguanlirenyuan"
type="text"
:disabled="edit"
/>
4 years ago
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="联系电话" prop="shiyongdanweiDianhua">
<el-input
v-model="ysjl.shiyongdanweiDianhua"
type="text"
:disabled="edit"
/>
4 years ago
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item label="使用单位代码" prop="shiyongdanweiCode">
<el-input
v-model="ysjl.shiyongdanweiCode"
type="text"
:disabled="edit"
/>
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item
label="使用登记证编号"
prop="shiyongdengjibianhao"
>
<el-input
v-model="ysjl.shiyongdengjibianhao"
type="text"
:disabled="edit"
/>
</el-form-item>
</el-col>
</el-row>
<el-row v-if="fromType == 1 ||fromType == '5'" :gutter="20">
<el-col :span="18">
<el-form-item label="注册代码" prop="zhucedaima">
<el-input
v-model="ysjl.zhucedaima"
type="text"
:disabled="edit"
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="18">
<el-form-item label="设备使用地点" prop="anzhuangdidian">
<el-input
v-model="ysjl.anzhuangdidian"
type="text"
:disabled="edit"
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item label="单位内编号" prop="danweineibubianhao">
<el-input
v-model="ysjl.danweineibubianhao"
type="text"
:disabled="edit"
/>
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="改造日期" prop="gaizaoriqi">
<el-date-picker
v-model="ysjl.gaizaoriqi"
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="gaizaodanwei">
<el-input
v-model="ysjl.gaizaodanwei"
type="text"
:disabled="edit"
/>
4 years ago
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="设备代码" prop="shebeidaima">
<el-input
v-model="ysjl.shebeidaima"
type="text"
:disabled="edit"
/>
</el-form-item>
</el-col>
</el-row>
<el-row v-if="fromType == 2" :gutter="20">
<el-col :span="9">
<el-form-item label="联系人" prop="lianxiren">
<el-input
v-model="param.lianxiren"
type="text"
:disabled="edit"
/>
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="电话" prop="dianhua">
<el-input
v-model="param.dianhua"
type="number"
:disabled="edit"
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="18">
<el-form-item label="维护保养单位名称" prop="weibaodanwei">
<el-input
v-model="ysjl.weibaodanwei"
type="text"
:disabled="edit"
/>
4 years ago
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item v-if="fromType==5" label="维护保养单位电话" prop="weibaodanweiDianhua">
<el-input
v-model="ysjl.weibaodanweiDianhua"
type="text"
:disabled="edit"
/>
</el-form-item>
<el-form-item v-else label="维保电话" prop="weibaodanweiDianhua">
<el-input
v-model="ysjl.weibaodanweiDianhua"
type="text"
:disabled="edit"
/>
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="型号" prop="guigexinghao">
<el-input
v-model="ysjl.guigexinghao"
type="text"
:disabled="edit"
/>
4 years ago
</el-form-item>
</el-col>
</el-row>
<el-row v-if="fromType!=='5'" :gutter="20">
<el-col :span="18">
<el-form-item label="现场检验条件" prop="xianchangjianyantiaojian">
<el-radio-group v-model="ysjl.xianchangjianyantiaojian">
<el-radio label="符合">
符合
</el-radio>
<el-radio label="不符合">
不符合
</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
4 years ago
</fieldset>
<fieldset v-if="fromType !=='5'">
<legend>设备技术参数</legend>
4 years ago
<el-row :gutter="20">
<el-col :span="9">
<el-form-item label="额定载重量" prop="edingzaizhongliang">
<el-input v-model="param.edingzaizhongliang" type="text">
<span slot="suffix">/kg</span>
</el-input>
4 years ago
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item v-if="fromType==4" label="额定速度">
<el-input v-model="param.edingsuduShangxing" type="text">
<span slot="suffix">m/s</span>
</el-input>
<el-input v-model="param.edingsuduXiaxing" type="text">
<span slot="suffix">m/s</span>
</el-input>
</el-form-item>
<el-form-item v-else label="额定速度" prop="edingsudu">
<el-input v-model="param.edingsudu" type="text">
<span slot="suffix">m/s</span>
</el-input>
4 years ago
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item label="层站门数" prop="cnegzhanmenshu">
<el-input
v-model="param.ceng"
type="text"
style="width: 50px"
/>
<el-input
v-model="param.zhan"
type="text"
style="width: 50px"
/>
<el-input
v-model="param.men"
type="text"
style="width: 50px"
/>
4 years ago
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="控制方式" prop="kongzhifangshi">
<el-input v-model="param.kongzhifangshi" type="text" />
4 years ago
</el-form-item>
</el-col>
</el-row>
<el-row v-if="fromType==3|| fromType==4" :gutter="20">
<el-col :span="9">
<el-form-item label="油缸数量" prop="youguanshuliang">
<el-input v-model="param.youguanshuliang" type="text" />
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="顶升形式" prop="dingshengxingshi">
<el-input v-model="param.dingshengxingshi" type="text" />
</el-form-item>
</el-col>
</el-row>
</fieldset>
<fieldset v-else>
<legend>设备技术参数</legend>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item label="名义速度" prop="mingyisudu">
<el-input v-model="param.mingyisudu" type="text">
<span slot="suffix">m/s</span>
</el-input>
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="名义宽度" prop="mingyikuandu">
<el-input v-model="param.mingyikuandu" type="text">
<span slot="suffix">mm</span>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item label="倾斜角" prop="qingxiejiao">
<el-input
v-model="param.qingxiejiao"
type="text"
>
<span slot="suffix">°</span>
</el-input>
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="输送能力" prop="shusongnengli">
<el-input v-model="param.shusongnengli" type="text">
<span slot="suffix">p/h</span>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="9">
<el-form-item label="提升高度" prop="tishenggaodu">
<el-input v-model="param.tishenggaodu" type="text">
<span slot="suffix">m</span>
</el-input>
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="使用区长度" prop="quduanchangdu">
<el-input v-model="param.quduanchangdu" type="text">
<span slot="suffix">m</span>
</el-input>
</el-form-item>
</el-col>
</el-row>
4 years ago
</fieldset>
<fieldset>
<el-row :gutter="20">
<el-col :span="20">
<el-form-item label="检验依据" prop="jianyanyiju">
<span>{{ ysjl.jianyanyiju }}</span>
</el-form-item>
</el-col>
</el-row>
</fieldset>
4 years ago
<fieldset>
<legend>主要检验仪器和设备</legend>
4 years ago
<el-row :gutter="20">
<el-col :span="20">
<el-input
v-model="param.gongjuxianghao"
style="width: 450px"
/>
4 years ago
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="20">
<el-form-item label="检验结论" prop="jianyanjielun">
<el-radio-group v-model="ysjl.jianyanjielun">
<el-radio label="合格">
合格
</el-radio>
<el-radio label="不合格">
不合格
</el-radio>
<el-radio label="复检合格">
复检合格
</el-radio>
<el-radio label="复检不合格">
复检不合格
</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="18">
<el-form-item label="备注" prop="beizhu">
<el-input
v-model="ysjl.beizhu"
type="textarea"
:disabled="edit"
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" style="margin: 20px 0">
<el-col :span="8">
<el-form-item label="现场检验日期" prop="xianchangjianyanriqi">
<el-date-picker
v-model="ysjl.xianchangjianyanriqi"
value-format="yyyy-MM-dd"
placeholder="选择日期"
style="width: 100%"
/>
</el-form-item>
</el-col>
<el-col v-if="fromType!=='5'" :span="8">
<el-form-item label="检验完成日期" prop="jianyanjieshuriqi">
<el-date-picker
v-model="ysjl.jianyanjieshuriqi"
value-format="yyyy-MM-dd"
placeholder="选择日期"
style="width: 100%"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="下次检验日期" prop="xiacijianyanriqi">
<el-date-picker
v-model="ysjl.xiacijianyanriqi"
value-format="yyyy-MM-dd"
placeholder="选择日期"
style="width: 100%"
/>
</el-form-item>
</el-col>
</el-row>
<template>
4 years ago
<el-row :gutter="10">
<el-col :span="8">
4 years ago
<el-form-item label="检验人员" prop="jianyanrenyuan">
<el-input v-model="ysjl.jianyanrenyuan" />
4 years ago
</el-form-item>
</el-col>
<el-col :span="8">
<sign-name
:jianyanrenyuan="jianyanrenyuan"
:ysjl="ysjl"
:custom-clear-sign="customClearSign"
@setSignValue="signNameValue"
/>
</el-col>
<el-col :span="8">
<el-form-item label="日期" prop="jianyanjieshuriqi">
<el-input v-model="ysjl.jianyanjieshuriqi" />
</el-form-item>
4 years ago
</el-col>
</el-row>
</template>
</fieldset>
</el-form>
</el-tab-pane>
<el-tab-pane label="检验项目" name="second">
<Inspection :bgfy-data="bgfyData" />
</el-tab-pane>
<el-tab-pane v-if="fromType == '5'" label="附表1" name="three">
<Table2 ref="table2" />
</el-tab-pane>
<el-tab-pane
v-for="(item, index) in arrayGroup"
v-else
:key="index"
:label="'附表' + (index + 1)"
:name="'tab' + index"
>
<Table
ref="table3"
:tabel-header="item.header"
:table-data="item.data"
:from-type="fromType"
@addfn="addfn(item)"
/>
</el-tab-pane>
<!-- <el-tab-pane v-if="fromType==1" label="附表二" name="four">
<Table ref="table2" :tabel-header="tableHeader1" :table-data="list1"/>
</el-tab-pane> -->
<el-tab-pane v-if="fromType == 1||fromType==3" label="附表3" name="five">
<Table1 ref="table1" :pic="pic" />
4 years ago
</el-tab-pane>
</el-tabs>
<el-dialog
:visible.sync="jyxmrqShow"
title="批量修改日期"
width="500px"
@close="jyxmrqShow = false"
>
4 years ago
<template>
<el-date-picker
v-model="querenriqi"
type="date"
format="yyyy.MM.dd"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions"
placeholder="选择日期"
style="width: 100%"
/>
4 years ago
</template>
<span slot="footer" class="dialog-footer">
<el-button @click="jyxmrqShow = false"> </el-button>
<el-button type="primary" @click="batchUpd"> </el-button>
</span>
</el-dialog>
<el-dialog
title="查看相关鉴证"
:modal-append-to-body="false"
:visible.sync="dialogEnclosureVisible"
>
<enclosure
:relation-id="ysjl.renwuId"
:if-liaison="false"
:view-button="true"
:is-show-hetong="isSysUser"
/>
4 years ago
</el-dialog>
<el-dialog title="编辑权限" :visible.sync="dialogRoleVisible">
<template>
<div class="tag-group">
<span class="tag-group__title">已有权限人员</span>
<el-tag v-for="item in defaultRlr" :key="item" effect="dark">
{{ common.convertCnName(item) }}
</el-tag>
</div>
<br>
<el-select
v-model="renlingren"
multiple
collapse-tags
placeholder="请选择要追加的监检员"
>
<el-option
v-for="item in userList"
:key="item.id"
:label="item.nickname"
:value="item.id"
/>
4 years ago
</el-select>
</template>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogRoleVisible = false"> </el-button>
<el-button type="primary" @click="updateRenlingren"> </el-button>
</span>
</el-dialog>
<sign-name
v-show="signShow"
ref="qmButton"
:ysjl="ysjl"
:jianyanrenyuan="xmjianyanrenyuan"
field-name="xmqianming"
:custom-clear-sign="customClearSign"
@setSignValue="signNameValue"
/>
4 years ago
</div>
</template>
<script>
import Sticky from '@/components/Sticky'
import SignName from '@/views/common/SignName'
import Utils from '@/utils/contact'
import merge from 'webpack-merge'
import Enclosure from '@/views/common/Enclosure'
import Inspection from '@/views/ysjl/3000/common/inspection-items'
import Table from '@/views/ysjl/3000/dj/common/table'
import Table1 from '@/views/ysjl/3000/dj/common/table1'
import Table2 from '@/views/ysjl/3000/dj/common/table2'
4 years ago
export default {
name: 'BaseInfo',
components: { SignName, Sticky, Enclosure, Inspection, Table, Table1, Table2 },
4 years ago
props: {
arrayGroup: {
require: true,
type: Array,
default: () => {
return []
}
4 years ago
},
// /**
// * 格式为: [{ index: 0, relationIds: [1, 2] }]
// */
// jyxmRelations: {
// required: true,
// type: Array
// },
fromType: {
4 years ago
required: true,
type: String
4 years ago
}
},
data() {
return {
ysjl: {},
param: {},
jlbh1: 'GJ',
jlbh2: '(' + new Date().getFullYear() + ')',
jlbh3: '',
isRepeat: false,
jianyanrenyuan: '',
departmentId: this.$route.query.departmentId,
edit: false,
state: this.$route.query.state,
bgfyData: [],
ysjlId: this.$route.query.id,
checkedTab: 'first',
xmlbListAB: ['A', 'B'],
xmlbListAC: ['A', 'C'],
xmlbListBC: ['B', 'C'],
jyxmrqShow: false,
querenriqi: null,
signShow: false,
xmjianyanrenyuan: '',
xggcList: [],
biliOptions: ['0.4', '0.5', '0.6', '0.7', '0.8', '0.9', '1'],
dialogEnclosureVisible: false,
dialogRoleVisible: false,
userList: [],
defaultRlr: [],
renlingren: [],
xinghaoList: [],
dicGzjz: [],
isSysUser: this.$store.getters.clientType === 'System',
4 years ago
cols: [
{
name: 'jianyanxiang', // 参与计算的列名,必须和el-table-column prop=''值一致
getValue(row) {
// 该列用于比较的值的获取方法
4 years ago
return row.jianyanxiang
}
}
],
rows: [
{
name: 'jianyanxiang',
getValue(row) {
return row.jianyanxiang
}
},
{
name: 'jianyanneirong',
getValue(row) {
return row.jianyanneirong
}
}
],
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now()
}
},
pic: ''
4 years ago
}
},
created() {
if (this.state === 'create') {
this.initYsjl()
} else {
this.getYsjl()
this.getParam()
this.getJyxm(1)
this.getFbList()
4 years ago
}
this.getDicJyxm(1)
this.getDicData()
this.userList = this.$store.getters.allUser.filter(
(user) => user.departmentId === 74 && user.clientType === 'System'
)
4 years ago
},
methods: {
addfn(item) {
const length = item.data.length
item.data.push({
id: parseInt(length),
D1: '',
D2: '',
D3: '',
D4: '',
D5: '',
D6: '',
D7: ''
})
},
4 years ago
initYsjl() {
this.ysjlController.init(this.$route.query).then((data) => {
4 years ago
this.ysjl = data.ysjl
this.param = data.param ? data.param : {}
this.ysjl.jianyanjieshuriqi = this.formatter.dateFormat('YYYY-MM-dd')
this.ysjl.bglx = 1
this.ysjl.cjState = 'ysjl'
this.getJyxm(1)
// this.getFbList(); // 获取附表数据
// this.getZzdw()
this.getSbList()
})
},
getSbList() {
this.api({
url: '/sedirectory/getList',
method: 'get',
params: {
sbzl: this.$route.query.sbzldm,
sblb: this.$route.query.sblbdm,
level: 2
}
}).then((data) => {
this.xinghaoList = data
})
},
getFbList() {
this.ysjlController.getYsjlFb(this.ysjlId).then((data) => {
console.log(data)
// this.param = data
4 years ago
})
},
getYsjl() {
this.ysjlController.getYsjl(this.ysjlId).then((data) => {
this.ysjl = data
this.ysjl.imagePath = ''
if (
this.ysjl.jianyanrenyuan !== null &&
this.ysjl.jianyanrenyuan.length > 0
) {
this.jianyanrenyuan = this.common.convertCnName(
this.ysjl.jianyanrenyuan
)
4 years ago
}
this.ysjlController
.judgeRepeat(this.ysjl.jilubianhao, this.ysjl.id)
.then((data) => {
this.isRepeat = data
})
4 years ago
})
},
getParam() {
const id = this.ysjlId || this.$route.query.templateId
this.ysjlController
.getParam(id, this.$route.query.sbzldm)
.then((data) => {
this.param = data
})
},
judgeRepeat(bianhao, id) {
this.api({
url: '/ysjl/judgeRepeat',
method: 'get',
params: {
ysjlId: id,
bianhao: bianhao
}
}).then((data) => {
if (data > 0) {
this.isRepeat = true
} else {
this.isRepeat = false
}
4 years ago
})
},
getJyxm(sort) {
if (this.$route.query.state === 'update') {
this.jyxmController.getJdCyJyxm(this.ysjlId, this.$route.query.templateId, sort).then((data) => {
this.bgfyData = data
this.tableJs.mergeColRows(this.cols, this.rows, data)
})
} else {
this.jyxmController.getCyJyxm(this.$route.query.templateId, sort).then((data) => {
this.bgfyData = data
this.tableJs.mergeColRows(this.cols, this.rows, data)
})
}
4 years ago
},
getDicJyxm(sort) {
this.jyxmController
.getCyJyxm(this.$route.query.templateId, sort)
.then((data) => {
this.dicGzjz = data.map((row) => {
return { value: row.gongzuojianzheng }
})
4 years ago
})
},
getZzdw() {
this.api({
url: '/dwxx/getById',
method: 'get',
params: {
id: this.ysjl.zzdwId
}
}).then((data) => {
4 years ago
this.jlbh1 += data.zhizaodanweiCode
this.ysjl.zhizaoxukezhengjibie = data.zhizaoxukezhengjibie
this.ysjl.zhizaoxukezhengbianhao = data.zhizaoxukezhengbianhao
this.getMaxBh()
})
},
getDicData() {
this.api({
url: '/dicData/getDicDataByTypeCode',
method: 'get',
params: {
typeCode: 'GL_ZZ_XGGC'
}
}).then((data) => {
4 years ago
this.xggcList = data
})
},
4 years ago
// 查询最大记录编号
getMaxBh() {
const aheadPart = this.jlbh1 + this.jlbh2 + '-'
this.api({
url: '/ysjl/gainCurrentBh',
method: 'get',
params: {
aheadPart: aheadPart,
hinderPart: ''
}
}).then((data) => {
4 years ago
this.jlbh3 = data
this.ysjlController
.judgeRepeat(this.ysjl.jilubianhao, this.ysjl.id)
.then((data) => {
this.isRepeat = data
})
4 years ago
})
},
/**
* 签名方法
* @param data
*/
signNameValue(data) {
if (data.fieldName === 'xmqianming') {
for (let i = 0; i < this.$refs.bgfyData.selection.length; i++) {
const jianyanrenyuan = this.$refs.bgfyData.selection[i].jianjianyuan
? this.$refs.bgfyData.selection[i].jianjianyuan.split(',')
: []
4 years ago
if (!jianyanrenyuan.includes(data.name)) {
jianyanrenyuan.push(data.name)
this.$refs.bgfyData.selection[i].jianjianyuan =
jianyanrenyuan.join(',')
4 years ago
}
}
} else {
const isNotHasJyry = !this.ysjl.jianyanrenyuan
this.ysjl.jianyanrenyuan = String(data.id)
this.jianyanrenyuan = data.name
this.common.signName(this.ysjl.id, this.ysjl.jianyanrenyuan)
Utils.$emit('manufacture-list')
// 如果是第一检验员签名的话,需要给所有检验项目的检验人员追加当前检验人员
if (
isNotHasJyry &&
this.jianyanrenyuan &&
this.jianyanrenyuan.split(',').length === 1
) {
this.bgfyData.forEach((jyxm) => {
4 years ago
// 如果第一检验人员已在该检验项目签名的话,无需重复签名
if (
!jyxm.jianjianyuan ||
!jyxm.jianjianyuan
.split(',')
.filter((jjr) => jjr === this.jianyanrenyuan).length
) {
4 years ago
if (jyxm.jianjianyuan) {
const jianjianyuan = jyxm.jianjianyuan.split(',')
jianjianyuan.push(this.jianyanrenyuan)
jyxm.jianjianyuan = jianjianyuan.join(',')
} else {
jyxm.jianjianyuan = this.jianyanrenyuan
}
}
})
}
}
},
customClearSign(fieldName) {
if (fieldName === 'xmqianming') {
for (let i = 0; i < this.$refs.bgfyData.selection.length; i++) {
let jyry = this.$refs.bgfyData.selection[i].jianjianyuan || ''
jyry = this.common
.deleteElement(
jyry.split(','),
String(this.$store.getters.nickname)
)
.join(',')
4 years ago
}
} else {
const data = {
id:
this.ysjl.jianyanrenyuan &&
this.common
.deleteElement(
this.ysjl.jianyanrenyuan.split(','),
String(this.$store.getters.userId)
)
.join(','),
name:
this.jianyanrenyuan &&
this.common
.deleteElement(
this.jianyanrenyuan.split(','),
this.$store.getters.nickname
)
.join(','),
4 years ago
fieldName: fieldName
}
this.signNameValue(data)
}
},
saveYsjl(operation) {
const tableData = []
const arr = []
if (this.fromType === '5') {
arr.push(this.$refs.table2.tableData)
} else {
this.arrayGroup.map((item) => {
item.data.forEach(k => {
delete k.id
})
arr.push(item.data)
})
const arr1 = JSON.parse(JSON.stringify(this.$refs.table1.tableData))
arr1.map(item => {
delete item.name
})
arr.push(arr1)
}
this.bgfyData.forEach((row) => {
tableData.push({
ysjlId: this.ysjlId,
beizhu: row.beizhu,
dicJyxmId: row.id,
4 years ago
jianyanjieguo: row.jianyanjieguo ? row.jianyanjieguo : '',
jianyanjielun: row.jianyanjielun ? row.jianyanjielun : '',
jyxmMode: 0,
sort: row.sort,
orders: row.orders,
cjState: 0
4 years ago
})
})
if (operation === 'add') {
this.ysjl.jilubianhao = this.jlbh1 + this.jlbh2 + '-' + this.jlbh3
this.save(operation, 'post', tableData, arr)
4 years ago
} else if (operation === 'build') {
this.ysjl.baogaobianhao = this.ysjl.jilubianhao
if (
this.ysjl.jilubianhao &&
this.ysjl.jilubianhao.indexOf('COPY') > -1
) {
4 years ago
this.$message({
type: 'error',
message: '请先修改报告编号,不允许携带COPY标志生成报告!'
})
return false
}
if (
this.ysjl.jianyanrenyuan === null ||
this.ysjl.jianyanrenyuan === ''
) {
4 years ago
this.$message({
type: 'error',
message: '请先签名再生成报告!'
})
return false
}
for (let i = 0; i < this.bgfyData.length; i++) {
if (!this.bgfyData[i].jianjianyuan || !this.bgfyData[i].querenriqi) {
this.$message.error(
'请将检验项目中的监检人员及监检日期填写完毕,再生成报告!'
)
4 years ago
return false
}
}
this.save(operation, 'put', tableData, arr)
4 years ago
} else if (operation === 'upd') {
this.save(operation, 'put', tableData, arr)
4 years ago
}
},
save(operation, type, jyxm, fb) {
if (this.fromType !== '5') this.ysjl.imagePath = this.$refs.table1.imgPath
4 years ago
// 判断报告编号是否重复
if (this.isRepeat) {
this.$message({
message: '记录编号重复,请先修改记录编号再保存',
type: 'error'
})
4 years ago
return false
} else {
this.$refs['ysjl'].validate((valid) => {
4 years ago
if (valid) {
this.api({
4 years ago
url: '/ysjl',
method: type,
4 years ago
data: {
ysjl: this.ysjl,
param: this.param,
cyJyxm: {
fbjyxm: JSON.stringify(fb)
},
jdJyxm: jyxm,
4 years ago
flag: operation
}
}).then((data) => {
4 years ago
Utils.$emit('ysjl-db-list')
// 刷新任务列表,原始记录待办,原始记录已办,检验报告
if (operation === 'add') {
Utils.$emit('task-list')
this.ysjl.id = data
this.param.ysjlId = data
this.$message({ message: '保存成功', type: 'success' })
// 刷新路由网址
this.common.reloadViewToUpdateYsjl(this.ysjl)
} else if (operation === 'upd') {
this.dialogRoleVisible = false
this.$message({ message: '更新成功', type: 'success' })
// 替换路由中的参数
this.$router.push({
query: merge(this.$route.query, {
jianyanrenyuan: this.ysjl.jianyanrenyuan
})
4 years ago
})
} else {
// 生成pdf
this.common.viewYsjlNoOpen(this.ysjl.id, 'YSJL')
Utils.$emit('ysjl-list')
Utils.$emit('ysjl-yb-list')
Utils.$emit('bggl-daiban-list')
this.$message({ message: '生成报告成功', type: 'success' })
this.common.delCurrentViews()
}
this.state = 'update'
})
}
})
}
},
4 years ago
/**
* 格式化监检员
*/
formatterJianjianyuan(row) {
if (row.jianjianyuan) {
if (typeof row.jianjianyuan === 'number') {
4 years ago
row.jianjianyuan = row.jianjianyuan.toString()
return this.common.convertCnName(row.jianjianyuan)
}
return row.jianjianyuan
}
},
/**
* 检验项目批量签名
*/
Signjyxm() {
if (this.$refs.bgfyData.selection.length === 0) {
this.$message('请在列表选择要签名的数据。')
return
}
this.signShow = true
this.$refs.qmButton.dialogFormVisible = true
},
/**
* 检验项目清除签名
*/
signClear: function() {
if (this.$refs.bgfyData.selection.length === 0) {
this.$message('请在列表选择要清除签名的数据。')
return
}
this.$refs.bgfyData.selection.forEach((row) => {
4 years ago
row.jianjianyuan = null
})
},
batchUpdDate() {
if (this.$refs.bgfyData.selection.length === 0) {
this.$message('请在列表选择要修改日期的数据。')
return false
}
this.jyxmrqShow = true
},
batchUpd() {
for (let i = 0; i < this.$refs.bgfyData.selection.length; i++) {
this.$refs.bgfyData.selection[i].querenriqi = this.querenriqi
}
this.jyxmrqShow = false
},
changeJsl(val) {
if (val === '无此项.') {
this.$set(this.param, 'qita', val)
} else {
this.$set(
this.param,
'qita',
val ? (this.param.qita ? this.param.qita + '\n' : '') + val : ''
)
4 years ago
}
},
/**
* 核价
*/
beforeHejia: function() {
// 锅炉制造费用四舍五入到个位
this.ysjl.jianyanheding = Math.round(
!this.param.zaojia || !this.param.bili
? 0
: this.common.accMul(this.param.zaojia, this.param.bili / 100)
)
4 years ago
},
showDialogRoleVisible: function() {
// 重置表单所需数据
this.renlingren.length = 0
this.defaultRlr = this.ysjl.renlingren.split(',')
// 在可追加的人员列表中移除认领人中已有的人员
this.defaultRlr.forEach((userId) => {
4 years ago
for (let i = 0; i < this.userList.length; i++) {
if (String(this.userList[i].id) === userId) {
this.userList.splice(i, 1)
break
}
}
})
this.dialogRoleVisible = true
},
4 years ago
/**
* 追加认领人
* 将默认认领人拼接新加的认领人
*/
updateRenlingren: function() {
const rlr = this.defaultRlr.concat(this.renlingren)
this.ysjl.renlingren = rlr.join(',')
this.saveYsjl('upd')
},
changXh: function(val) {
const xinghao = this.xinghaoList.filter((xh) => xh.xinghao === val)[0]
this.$set(
this.param,
'jiandingbaogaobianhao',
(xinghao && xinghao.jiandingbaogaobianhao) || ''
)
4 years ago
},
querySearchGzjz: function(queryString, cb, $index) {
cb([this.dicGzjz[$index]])
}
}
}
</script>
<style scoped>
.el-tag {
margin: auto 5px;
}
</style>
<style lang="scss" scoped>
/*.el-table/deep/ td, .el-table/deep/ th.is-leaf,.el-table--border,.el-table--group{
border-color: black;
}*/
// .el-table {
// /deep/tbody tr:hover > td {
// background-color: oldlace;
// }
// }
4 years ago
</style>