xiaobai
3 years ago
10 changed files with 235 additions and 768 deletions
@ -1,740 +0,0 @@ |
|||
<!--压力容器改造和重大修理监检证书--> |
|||
<template> |
|||
<div class="app-container"> |
|||
<sticky style="margin-bottom: 10px;"> |
|||
<div class="sub-navbar"> |
|||
<el-button v-show="state === 'update' && ysjl.jilubianhao" size="medium" style="margin-left: 10px;" type="text"> |
|||
编号:{{ ysjl.jilubianhao }} |
|||
</el-button> |
|||
<el-button v-if="state === 'create'" type="success" icon="el-icon-edit" size="medium" @click="saveYsjl('add')"> |
|||
保存 |
|||
</el-button> |
|||
<el-button v-if="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 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"> |
|||
批量清除签名 |
|||
</el-button> |
|||
<el-button type="success" size="medium" icon="el-icon-edit" @click="batchUpdDate"> |
|||
批量修改日期 |
|||
</el-button> |
|||
<el-button v-if="state !== 'create'" type="warning" icon="el-icon-view" size="medium" @click="common.viewYsjl(ysjl.id, 'YSJL')"> |
|||
预览 |
|||
</el-button> |
|||
<Symbols /> |
|||
</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="25"> |
|||
<el-col v-if="state === 'create'" :span="14"> |
|||
<el-form-item label="报告编号"> |
|||
<el-input v-model="bgbh1" style="width:80px" disabled /> |
|||
<el-input v-model="bgbh2" style="width:80px" disabled />- |
|||
<el-input v-model="bgbh3" style="width:80px" @blur="judgeRepeat(bgbh1 + '(' + bgbh2 + ')-' + bgbh3, ysjl.id)" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col v-if="state !== 'create'" :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> |
|||
<el-row :gutter="20"> |
|||
<el-col :span="18"> |
|||
<el-form-item label="施工单位" prop="shigongdanwei"> |
|||
<el-input v-model="ysjl.shigongdanwei" :disabled="edit" 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="shigongleibie"> |
|||
<el-select v-model="ysjl.shigongleibie" :disabled="edit" type="text" placeholder="请选择" style="width: 232px"> |
|||
<el-option label="改造" value="改造" /> |
|||
<el-option label="重大修理" value="重大修理" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row :gutter="20"> |
|||
<el-col :span="18"> |
|||
<el-form-item label="使用单位" prop="shiyongdanwei"> |
|||
<el-input v-model="ysjl.shiyongdanwei" :disabled="edit" type="text" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row :gutter="20"> |
|||
<el-col :span="18"> |
|||
<el-form-item label="设备使用地点" prop="shiyongdanweiDizhi"> |
|||
<el-input v-model="ysjl.shiyongdanweiDizhi" type="text" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row :gutter="20"> |
|||
<el-col :span="9"> |
|||
<el-form-item label="设备类别" prop="shebeileibiedaima"> |
|||
<el-input v-model="ysjl.shebeileibie" type="text" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="9"> |
|||
<el-form-item label="设备名称" prop="shebeimingcheng"> |
|||
<el-input v-model="ysjl.shebeimingcheng" type="text" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row :gutter="20"> |
|||
<el-col :span="9"> |
|||
<el-form-item label="使用登记证编号" prop="shiyongdengjibianhao"> |
|||
<el-input v-model="ysjl.shiyongdengjibianhao" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="9"> |
|||
<el-form-item label="注册代码" prop="zhucedaima"> |
|||
<el-input v-model="ysjl.zhucedaima" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row :gutter="20"> |
|||
<el-col :span="9"> |
|||
<el-form-item label="设备代码" prop="shebeidaima"> |
|||
<el-input v-model="ysjl.shebeidaima" type="text" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="9"> |
|||
<el-form-item label="竣工日期" prop="shejiriqi"> |
|||
<el-input v-model="ysjl.shejiriqi" type="text" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row :gutter="20"> |
|||
<el-col :span="9"> |
|||
<el-form-item label="产品图号" prop="rongqituhao"> |
|||
<el-input v-model="param.rongqituhao" type="text" /> |
|||
</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" style="height: 100px"> |
|||
<el-col :span="18"> |
|||
<el-form-item label="改造与重大修理项目:" prop="beizhu" label-width="200px"> |
|||
<el-input v-model="ysjl.beizhu" :rows="4" :disabled="edit" type="textarea" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row :gutter="20" style="text-align:left;margin-left: 50px;font-size: 18px;color: #606266;line-height: 40px;font-weight: bolder;"> |
|||
按照《中华人民共和国特种设备安全法》《特种设备安全监察条例》的规定,该台压力容器改造与重大修理经我机构实施监督检验,安全性能 |
|||
<el-select v-model="ysjl.baogaojielun" placeholder="请选择" style="width: 100px;"> |
|||
<el-option label="符合" value="符合" /> |
|||
<el-option label="不符合" value="不符合" /> |
|||
</el-select>《固定式压力容器安全技术监察规程》(TSG21-2016)的要求,特发此证书。<br> |
|||
</el-row> |
|||
<el-row :gutter="20" style="margin-top: 20px;"> |
|||
<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-col :span="9"> |
|||
<el-form-item label="下次检验日期" prop="xiacijianyanriqi"> |
|||
<el-date-picker v-model="ysjl.xiacijianyanriqi" type="date" value-format="yyyy-MM-dd" placeholder="选择日期" style="width: 100%;" /> |
|||
</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 ref="jyxmData" :data="jyxmData" :span-method="mergeCols" :row-class-name="tableRowClassName" border stripe style="width:95%" @row-click="onRowClick" @selection-change="handleSelectionChange"> |
|||
<el-table-column type="selection" width="55" /> |
|||
<el-table-column type="index" align="center" width="50" label="序号" /> |
|||
<el-table-column align="center" label="检验项目"> |
|||
<el-table-column align="center" prop="jianyanxiang" label="" /> |
|||
<el-table-column align="left" prop="jianyanneirong" label="" /> |
|||
</el-table-column> |
|||
<el-table-column align="center" prop="xiangmuleibie" width="80" 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-select> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column align="center" prop="gongzuojianzheng" label="工作见证"> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model="scope.row.gongzuojianzheng" :disabled="edit" name="fyGongzuojianzheng" placeholder="请输入内容" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column v-if="false" align="center" prop="jianjianyuan" label="监检人员"> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model="scope.row.jianjianyuan" name="Jianjianyuan" disabled /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column align="center" prop="jianjianyuanName" label="监检员"> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model="scope.row.jianjianyuanName" disabled /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column align="center" prop="querenriqi" label="检验日期"> |
|||
<template slot-scope="scope"> |
|||
<el-date-picker v-model="scope.row.querenriqi" value-format="yyyy-MM-dd" type="date" placeholder="选择日期" /> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<br><br> |
|||
<!--<el-form ref="ysjl" :model="ysjl" class="el-form" label-position="right" label-width="50px"> |
|||
<el-row> |
|||
<el-col :span="18" style="height: 90px"> |
|||
<el-form-item label="说明" prop="shuoming"> |
|||
<el-input v-model="param.shuoming" :rows="3" type="textarea" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form>--> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="压力容器原始资料" name="third"> |
|||
<SliceUpload :renwu-id="ysjl.renwuId ? Number(ysjl.renwuId) : Number($route.query.renwuId)" :drag="true" /> |
|||
</el-tab-pane> |
|||
</el-tabs> |
|||
<el-dialog :visible.sync="jyxmrqShow" title="批量修改日期" width="500px" @close="closeDialog"> |
|||
<template> |
|||
<el-date-picker v-model="querenriqi" type="date" value-format="yyyy-MM-dd" placeholder="选择日期" style="width: 100%;" /> |
|||
</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> |
|||
<sign-name v-show="signShow" ref="qmButton" :ysjl="ysjl" :jianjianyuan="jianjianyuan" field-name="xmqianming" @setSignValue="signNameValue" /> |
|||
</div> |
|||
</template> |
|||
<script> |
|||
import Sticky from '@/components/Sticky' |
|||
import SignName from '@/views/common/SignName' |
|||
import Utils from '@/utils/contact.js' |
|||
import SliceUpload from '@/components/SliceUpload' |
|||
import Symbols from '@/views/common/Symbols' |
|||
export default { |
|||
name: 'RqGzwx', |
|||
components: { SignName, Sticky, SliceUpload, Symbols }, |
|||
data() { |
|||
return { |
|||
bgbh1: 'RDG', |
|||
bgbh2: new Date().getFullYear(), |
|||
bgbh3: '', |
|||
ysjl: {}, |
|||
defaultParam: {}, |
|||
param: {}, |
|||
state: this.$route.query.state, |
|||
jianyanrenyuan: '', |
|||
jianjianyuan: '', |
|||
departmentId: this.$store.getters.departmentId, |
|||
isRepeat: false, |
|||
edit: false, |
|||
checkedTab: 'first', |
|||
jyxmData: [], |
|||
sblbList: [], |
|||
// 表格合并相关 |
|||
// 参与列合并的字段,在这里增加即可 |
|||
cols: [ |
|||
{ |
|||
name: 'jianyanxiang', // 参与计算的列名,必须和el-table-column prop=''值一致 |
|||
getValue(row) { // 该列用于比较的值的获取方法 |
|||
return row.jianyanxiang |
|||
} |
|||
} |
|||
], |
|||
// 参与行内合并的字段 |
|||
rows: [ |
|||
{ |
|||
name: 'jianyanxiang', |
|||
getValue(row) { |
|||
return row.jianyanxiang |
|||
} |
|||
} |
|||
], |
|||
jyxmrqShow: false, |
|||
signShow: false, |
|||
multipleSelection: [], |
|||
querenriqi: new Date(), |
|||
djjgs: ['无'] |
|||
} |
|||
}, |
|||
created() { |
|||
if (this.state === 'create') { |
|||
this.initYsjl() |
|||
} else { |
|||
this.getYsjl() |
|||
this.getParam() |
|||
} |
|||
this.getSbList('2000', undefined, 2) |
|||
this.getJyxm(1) |
|||
this.getArea() |
|||
}, |
|||
methods: { |
|||
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.param = data.param ? data.param : {} |
|||
this.$set(this.ysjl, 'shejiriqi', '年 月 日') |
|||
this.$set(this.ysjl, 'zhizaoriqi', '') |
|||
this.$set(this.ysjl, 'renlingren', this.$store.getters.userId) |
|||
this.$set(this.ysjl, 'departmentId', this.$store.getters.departmentId) |
|||
this.$set(this.ysjl, 'jigouhezhunzhenghao', process.env.VUE_APP_HZZBH) |
|||
this.$set(this.ysjl, 'baogaojielun', '符合') |
|||
this.$set(this.ysjl, 'shigongleibie', '改造') |
|||
this.$set(this.ysjl, 'zfState', '0') |
|||
this.$set(this.ysjl, 'source', 'web') |
|||
this.$set(this.ysjl, 'jianyanjieshuriqi', this.dateFormat(new Date())) |
|||
this.$set(this.ysjl, 'jianyanjieshuriqi', this.dateFormat(new Date())) |
|||
this.ysjl.jilubianhao = this.bgbh1 + '(' + this.bgbh2 + ')-' + this.bgbh3 |
|||
this.getMaxBh() |
|||
}) |
|||
}, |
|||
getYsjl() { |
|||
this.api({ |
|||
url: '/ysjl/getYsjlById', |
|||
method: 'get', |
|||
params: { |
|||
ysjlId: this.ysjl.id |
|||
} |
|||
}).then(data => { |
|||
this.ysjl = data.ysjl |
|||
if (this.ysjl.jianyanrenyuan) { |
|||
this.jianyanrenyuan = this.common.convertCnName(this.ysjl.jianyanrenyuan) |
|||
} |
|||
// 查询最大记录编号 |
|||
if (this.ysjl.jilubianhao) { |
|||
this.judgeRepeat(this.ysjl.jilubianhao, this.ysjl.id) |
|||
} else { |
|||
this.getMaxBh() |
|||
} |
|||
}) |
|||
}, |
|||
getParam() { |
|||
// 根据原始记录id查询参数 |
|||
this.api({ |
|||
url: '/ysjl/getParamByYsjlId', |
|||
method: 'get', |
|||
params: { |
|||
ysjlId: this.$route.params.id, |
|||
sbzldm: this.$route.query.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') |
|||
} |
|||
}, |
|||
// 批量签名方法 |
|||
signNameValue(data) { |
|||
for (let i = 0; i < this.multipleSelection.length; i++) { |
|||
if (this.multipleSelection[i].jianjianyuan === null || this.multipleSelection[i].jianjianyuan === undefined || this.multipleSelection[i].jianjianyuan === '') { |
|||
this.multipleSelection[i].jianjianyuan = data.id + '' |
|||
this.multipleSelection[i].jianjianyuanName = data.name |
|||
} else { |
|||
this.multipleSelection[i].jianjianyuan = data.id === '' ? data.id : this.multipleSelection[i].jianjianyuan + ',' + data.id |
|||
this.multipleSelection[i].jianjianyuanName = data.name === '' ? data.name : this.multipleSelection[i].jianjianyuanName + ',' + data.name |
|||
} |
|||
for (let j = 0; j < this.jyxmData.length; j++) { |
|||
if (this.jyxmData[j].id === this.multipleSelection[i].id) { |
|||
this.$set(this.jyxmData[j], this.multipleSelection[i]) |
|||
} |
|||
} |
|||
} |
|||
this.signShow = false |
|||
Utils.$emit('ysjl-list') |
|||
}, |
|||
// 检验项目批量签名 |
|||
Signjyxm() { |
|||
if (this.multipleSelection.length === 0) { |
|||
this.$message('请在列表选择要签名的数据。') |
|||
return false |
|||
} |
|||
this.signShow = true |
|||
this.$refs.qmButton.dialogFormVisible = true |
|||
}, |
|||
// 检验项目清除签名 |
|||
signClear: function() { |
|||
if (this.multipleSelection.length === 0) { |
|||
this.$message('请在列表选择要清除签名的数据。') |
|||
return false |
|||
} |
|||
this.$refs.qmButton.clearSign() |
|||
this.$message({ message: '清除签名成功', type: 'success' }) |
|||
}, |
|||
// 批量修改日期 |
|||
batchUpdDate() { |
|||
if (this.multipleSelection.length === 0) { |
|||
this.$message('请在列表选择要修改日期的数据。') |
|||
return false |
|||
} |
|||
this.jyxmrqShow = true |
|||
}, |
|||
batchUpd() { |
|||
for (let i = 0; i < this.multipleSelection.length; i++) { |
|||
this.multipleSelection[i].querenriqi = this.querenriqi |
|||
for (let j = 0; j < this.jyxmData.length; j++) { |
|||
if (this.jyxmData[j].id === this.multipleSelection[i].id) { |
|||
this.$set(this.jyxmData[j], this.multipleSelection[i]) |
|||
} |
|||
} |
|||
} |
|||
this.jyxmrqShow = false |
|||
}, |
|||
formartDate: function(param) { |
|||
var time = new Date(param) |
|||
var y = time.getFullYear() |
|||
var m = time.getMonth() + 1 |
|||
var d = time.getDate() > 9 ? time.getDate().toString() : '0' + time.getDate() |
|||
return y + '-' + m + '-' + d |
|||
}, |
|||
closeDialog() { |
|||
this.jyxmrqShow = false |
|||
}, |
|||
getSbList(sbzl, sblb, level) { |
|||
this.api({ |
|||
url: '/sedirectory/getList', |
|||
method: 'get', |
|||
params: { |
|||
sbzl: sbzl, |
|||
sblb: sblb, |
|||
level: level |
|||
} |
|||
}).then(data => { |
|||
switch (level) { |
|||
case 2: |
|||
this.sblbList = data |
|||
return '' |
|||
default: |
|||
this.sbzlList = data |
|||
return '' |
|||
} |
|||
}) |
|||
}, |
|||
dateFormat() { |
|||
const year = new Date().getFullYear() |
|||
const month = new Date().getMonth() + 1 > 9 ? (new Date().getMonth() + 1).toString() : '0' + (new Date().getMonth() + 1) |
|||
const day = new Date().getDate() > 9 ? new Date().getDate().toString() : '0' + new Date().getDate() |
|||
return year + '-' + month + '-' + day |
|||
}, |
|||
// 查询检验项目 |
|||
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.params.id, |
|||
isReport: false, |
|||
order: sort |
|||
} |
|||
} |
|||
this.api({ |
|||
url: url, |
|||
method: 'get', |
|||
params: data |
|||
}).then(data => { |
|||
switch (sort) { |
|||
case 1: |
|||
this.jyxmData = data |
|||
if (this.state === 'create') { |
|||
for (let i = 0; i < this.jyxmData.length; i++) { |
|||
this.jyxmData[i].querenriqi = this.dateFormat() |
|||
if (data[i].jianyanjieguo === '' || data[i].jianyanjieguo === null || data[i].jianyanjieguo === undefined) { |
|||
data[i].jianyanjieguo = '符合要求' |
|||
} |
|||
} |
|||
} |
|||
for (let i = 0; i < this.jyxmData.length; i++) { |
|||
if (this.jyxmData[i].jianjianyuan !== null && this.jyxmData[i].jianjianyuan !== undefined && this.jyxmData[i].jianjianyuan.length > 0) { |
|||
this.jyxmData[i].jianjianyuanName = this.common.convertCnName(this.jyxmData[i].jianjianyuan) |
|||
} |
|||
} |
|||
break |
|||
} |
|||
this.tableJs.getData(this.cols, this.rows, data) |
|||
}) |
|||
}, |
|||
// 获取表格中的id, 不为空的检验结果和备注 |
|||
getProp: function(data) { |
|||
const retData = [] |
|||
for (let i = 0; i < data.length; i++) { |
|||
const retRow = {} |
|||
retRow.id = data[i].id |
|||
if (data[i].jianyanjieguo !== '' && data[i].jianyanjieguo !== null && data[i].jianyanjieguo !== undefined) { |
|||
retRow.jianyanjieguo = data[i].jianyanjieguo |
|||
} |
|||
if (data[i].querenriqi !== '' && data[i].querenriqi !== null && data[i].querenriqi !== undefined) { |
|||
retRow.querenriqi = this.formartDate(data[i].querenriqi) |
|||
} |
|||
if (data[i].gongzuojianzheng !== '' && data[i].gongzuojianzheng !== null && data[i].gongzuojianzheng !== undefined) { |
|||
retRow.gongzuojianzheng = data[i].gongzuojianzheng |
|||
} |
|||
if (data[i].jianjianyuan !== '' && data[i].jianjianyuan !== null && data[i].jianjianyuan !== undefined) { |
|||
retRow.jianjianyuan = data[i].jianjianyuan |
|||
} |
|||
retData.push(retRow) |
|||
} |
|||
return retData |
|||
}, |
|||
saveYsjl: function(operation) { |
|||
if (operation === 'add') { |
|||
if (this.bgbh3.trim() === '') { |
|||
this.$message({ message: '请先确认报告编号是否完整!', type: 'warning' }) |
|||
return false |
|||
} |
|||
} |
|||
if (operation === 'build' && !this.ysjl.jianyanheding) { |
|||
this.$message.warning('请填写检验金额!') |
|||
return false |
|||
} |
|||
this.tableData = [] |
|||
this.tableData.push(this.getProp(this.jyxmData)) |
|||
let type = '' |
|||
this.ysjl.bglx = 1 |
|||
this.ysjl.zfState = false |
|||
this.ysjl.jianyanxiangmu = 'dxgz' |
|||
this.ysjl.jlprintState = 0 |
|||
if (operation === 'add') { |
|||
type = 'post' |
|||
this.ysjl.cjState = 'ysjl' |
|||
this.ysjl.jilubianhao = this.bgbh1 + '(' + this.bgbh2 + ')-' + this.bgbh3 |
|||
} else if (operation === 'upd') { |
|||
type = 'put' |
|||
} else if (operation === 'build') { |
|||
if (this.ysjl.jianyanrenyuan === null || this.ysjl.jianyanrenyuan === '') { |
|||
this.$message({ |
|||
type: 'error', |
|||
message: '请先签名再生成报告!' |
|||
}) |
|||
return false |
|||
} |
|||
type = 'put' |
|||
} |
|||
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('ysjl-list') |
|||
Utils.$emit('bggl-daiban-list') |
|||
if (operation === 'add' && data !== '') { |
|||
this.$message({ message: '保存成功', type: 'success' }) |
|||
this.ysjl.id = data |
|||
this.param.ysjlId = data |
|||
// 刷新路由网址 |
|||
this.$store.dispatch('delCurrentViews', { |
|||
view: this.$route, |
|||
$router: this.$router |
|||
}) |
|||
this.$router.push({ |
|||
path: '/ysjl/2000/2100/dxgz/' + this.ysjl.id, |
|||
query: { |
|||
id: this.ysjl.id, |
|||
jyxm: this.ysjl.jianyanxiangmu, |
|||
departmentId: this.ysjl.departmentId, |
|||
jianyanrenyuan: this.ysjl.jianyanrenyuan, |
|||
state: 'update', |
|||
renwuId: this.ysjl.renwuId, |
|||
modelId: this.ysjl.modelId, |
|||
jylb: this.ysjl.jianyanleibie, |
|||
neibuleibie: this.ysjl.neibuleibie, |
|||
sbzldm: this.ysjl.shebeizhongleidaima, |
|||
sblbdm: this.ysjl.shebeileibiedaima, |
|||
sbpzdm: this.ysjl.shebeipinzhongdaima |
|||
} |
|||
}) |
|||
} else if (operation === 'upd') { |
|||
Utils.$emit('ysjl-list') |
|||
this.$message({ message: '更新成功', type: 'success' }) |
|||
} else { |
|||
Utils.$emit('ysjl-list') |
|||
// 修改16版任务状态 |
|||
this.common.updRenwuState(this.ysjl.id, 2, true) |
|||
Utils.$emit('bggl-daiban-list') |
|||
this.$message({ message: '生成报告成功', type: 'success' }) |
|||
this.$store.dispatch('delCurrentViews', { |
|||
view: this.$route, |
|||
$router: this.$router |
|||
}) |
|||
} |
|||
this.state = 'update' |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
}, |
|||
// 查询最大记录编号 |
|||
getMaxBh() { |
|||
const aheadPart = this.bgbh1 + '(' + this.bgbh2 + ')-' |
|||
this.api({ |
|||
url: '/ysjl/gainCurrentBh', |
|||
method: 'get', |
|||
params: { |
|||
aheadPart: aheadPart, |
|||
hinderPart: '' |
|||
} |
|||
}).then(data => { |
|||
this.bgbh3 = 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 |
|||
} |
|||
}) |
|||
}, |
|||
onRowClick(row) { |
|||
this.$refs.jyxmData.toggleRowSelection(row) |
|||
}, |
|||
tableRowClassName({ row, rowIndex }) { |
|||
row.index = rowIndex |
|||
}, |
|||
handleSelectionChange: function(val) { |
|||
this.multipleSelection = val |
|||
}, |
|||
mergeCols({ row, column, rowIndex, columnIndex }) { |
|||
if (columnIndex === 2) { |
|||
if (rowIndex === 0 || rowIndex === 3) { |
|||
return { |
|||
rowspan: 3, |
|||
colspan: 1 |
|||
} |
|||
} else if (rowIndex === 1 || rowIndex === 2 || rowIndex === 4 || rowIndex === 5) { |
|||
return { |
|||
rowspan: 0, |
|||
colspan: 0 |
|||
} |
|||
} |
|||
} |
|||
if (rowIndex > 5) { |
|||
if (columnIndex === 2) { |
|||
return { |
|||
rowspan: 1, |
|||
colspan: 2 |
|||
} |
|||
} else if (columnIndex === 3) { |
|||
return { |
|||
rowspan: 0, |
|||
colspan: 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