Browse Source

提交

master
xiaobai 3 years ago
parent
commit
808f12b3bc
  1. 16
      src/api/template.js
  2. 264
      src/components/drawerDialog/index.vue
  3. 855
      src/views/ysjl/elevator/common/index.vue
  4. 0
      src/views/ysjl/elevator/yeyin/index.vue

16
src/api/template.js

@ -1,4 +1,5 @@
import api from '@/utils/api' import api from '@/utils/api'
import qs from 'qs'
export default { export default {
getList: (params) => { getList: (params) => {
@ -7,5 +8,20 @@ export default {
method: 'get', method: 'get',
params: params params: params
}) })
},
deleteModuleFn: (params) => {
return api({
url: '/templateSetting',
method: 'delete',
params: qs.stringify(params)
})
},
deleteSettingFn: (params) => {
console.log(params)
return api({
url: '/templateSetting',
method: 'delete',
params: qs.stringify(params)
})
} }
} }

264
src/components/drawerDialog/index.vue

@ -211,6 +211,14 @@
/> />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="bottomBox">
<el-button type="primary" @click="update">
保存修改
</el-button>
<el-button @click="drawer = false">
取消
</el-button>
</div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="模板配置" name="1"> <el-tab-pane label="模板配置" name="1">
<div class="boxRoot"> <div class="boxRoot">
@ -221,15 +229,19 @@
border border
fit fit
highlight-current-row highlight-current-row
@row-click="rowClick" @current-change="rowClick"
@selection-change="handleSettingChange"
> >
<el-table-column type="selection" width="50" />
<el-table-column align="center" label="序号" width="50"> <el-table-column align="center" label="序号" width="50">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-text="getIndex(scope.$index)" /> <span v-text="getIndex(scope.$index)" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
align="center"
label="检验项目行个数"
prop="affiliatedTableRowCount"
width="100"
/>
<el-table-column <el-table-column
align="center" align="center"
label="检验项目起始页码" label="检验项目起始页码"
@ -244,8 +256,8 @@
/> />
<el-table-column <el-table-column
align="left" align="left"
label="检验项目起始行" label="表格索引"
prop="affiliatedTableStartRow" prop="tableIndex"
/> />
<el-table-column <el-table-column
:formatter="fmBglx" :formatter="fmBglx"
@ -260,8 +272,35 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
align="center"
label="是否是子报告模板"
prop="isChild"
>
<template slot-scope="scope">
<div>
{{ scope.row.isChild ? "是" : "否" }}
</div>
</template>
</el-table-column>
<el-table-column
align="center"
label="表格模式"
prop="tableMode"
>
<template slot-scope="scope">
<div>
{{ scope.row.tableMode == 1 ? "DN模式" : "KV模式" }}
</div>
</template>
</el-table-column>
<el-table-column align="center" label="排序" prop="sort" /> <el-table-column align="center" label="排序" prop="sort" />
<el-table-column align="center" label="操作" width="190"> <el-table-column
align="center"
label="操作"
width="150"
fixed="right"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="primary" type="primary"
@ -269,7 +308,15 @@
icon="el-icon-edit" icon="el-icon-edit"
circle circle
title="编辑" title="编辑"
@click="editFn(scope.row)" @click="editFnTem(scope.row)"
/>
<el-button
type="danger"
size="mini"
icon="el-icon-delete"
circle
title="编辑"
@click="deleteModelFn(scope.row)"
/> />
</template> </template>
</el-table-column> </el-table-column>
@ -296,13 +343,7 @@
新增 新增
</el-button> </el-button>
</div> </div>
<el-table <el-table :data="gridData" border>
:data="gridData"
border
@row-click="rowClick1"
@selection-change="toggleFn"
>
<el-table-column type="selection" width="50" />
<el-table-column align="center" label="序号" width="50"> <el-table-column align="center" label="序号" width="50">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-text="getIndex(scope.$index)" /> <span v-text="getIndex(scope.$index)" />
@ -322,7 +363,7 @@
align="center" align="center"
/> />
<el-table-column <el-table-column
property="fieldMode" property="modeName"
label="模式" label="模式"
width="150" width="150"
align="center" align="center"
@ -352,14 +393,6 @@
</div> </div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<div class="bottomBox">
<el-button type="primary" @click="update">
保存修改
</el-button>
<el-button @click="drawer = false">
取消
</el-button>
</div>
</div> </div>
</el-drawer> </el-drawer>
<el-dialog title="新增" :visible.sync="dialogVisible" width="30%"> <el-dialog title="新增" :visible.sync="dialogVisible" width="30%">
@ -392,10 +425,108 @@
<el-button type="primary" @click="onsubmit"> </el-button> <el-button type="primary" @click="onsubmit"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="新增" :visible.sync="dialogVisible1" width="50%">
<el-form>
<el-form-item
label="检验项目行个数"
prop="tableRowCount"
label-width="150px"
>
<el-input-number
v-model="form.affiliatedTableRowCount"
:min="0"
:max="100"
/>
</el-form-item>
<el-form-item
label="检验项目起始行"
prop="affiliatedTableStartRow"
label-width="150px"
>
<el-input-number
v-model="form.affiliatedTableStartRow"
:min="0"
:max="100"
/>
</el-form-item>
<el-form-item
label="检验项目起始页码"
prop="tableStartRow"
label-width="150px"
>
<el-input-number
v-model="form.tableStartRow"
:min="0"
:max="100"
/>
<el-alert
type="warning"
title="建议先尝试如果是第1页则为1!"
style="display: inline"
:closable="false"
/>
</el-form-item>
<el-form-item
label="表格索引"
prop="tableIndex"
label-width="150px"
>
<el-input-number
v-model="form.tableIndex"
:min="0"
:max="100"
/>
</el-form-item>
<el-form-item label="排序" prop="sort" label-width="150px">
<el-input-number v-model="form.sort" :min="0" :max="100" />
</el-form-item>
<el-form-item
label="表格类型"
prop="form.tableType"
label-width="150px"
>
<el-radio v-model="form.tableType" label="1">
检验项目
</el-radio>
<el-radio v-model="form.tableType" label="2">
目录页
</el-radio>
</el-form-item>
<el-form-item
label="是否是子报告模板"
prop="isChild"
label-width="150px"
>
<el-switch
v-model="form.showPageStatus"
active-text="是"
inactive-text="不是"
/>
</el-form-item>
<el-form-item
label="表格类型"
prop="form.tableMode"
label-width="150px"
>
<el-radio v-model="form.tableMode" label="1">
DN模式
</el-radio>
<el-radio v-model="form.tableMode" label="2">
KV模式
</el-radio>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible1 = false"> </el-button>
<el-button type="primary" @click="onsubmit1"> </el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import Pagination from '@/components/Pagination' import Pagination from '@/components/Pagination'
import { deleteSettingFn, deleteModuleFn } from '@/api/template.js'
export default { export default {
components: { Pagination }, components: { Pagination },
@ -422,6 +553,7 @@ export default {
activeName: 0, activeName: 0,
settingList: [], settingList: [],
formTemplate: {}, formTemplate: {},
dialogVisible1: false,
formLabelAlign: { formLabelAlign: {
field: '', field: '',
fieldMode: '', fieldMode: '',
@ -429,6 +561,18 @@ export default {
templateId: '', // id templateId: '', // id
templateSettingId: '' // id templateSettingId: '' // id
}, },
form: {
affiliatedTableRowCount: '',
affiliatedTableStartRow: '',
isChild: '',
sort: '',
tableIndex: '',
tableMode: '',
tableRowCount: '',
tableStartRow: '',
tableType: '1',
writeMode: '1'
},
// formTemplate:{}, // formTemplate:{},
dialogVisible: false, dialogVisible: false,
bglxList: [], bglxList: [],
@ -454,14 +598,14 @@ export default {
list: [], list: [],
gridData: [], gridData: [],
sbpzLevelStatus: false, sbpzLevelStatus: false,
multipleSelection: [] multipleSelection: [],
moduleArr: []
} }
}, },
mounted() {}, mounted() {},
methods: { methods: {
open() { open() {
this.getList() this.getList()
this.getDemoList()
this.loadFormData(this.index) this.loadFormData(this.index)
this.getSbList(undefined, undefined, 1) this.getSbList(undefined, undefined, 1)
this.getBglxList() this.getBglxList()
@ -471,6 +615,12 @@ export default {
getJylbList() { getJylbList() {
this.getCategoryList('jylb', null, null) this.getCategoryList('jylb', null, null)
}, },
editFnTem(row) {
this.dialogVisible1 = true
row.tableType = row.tableType + ''
row.tableMode = row.tableMode + ''
this.form = row
},
changeState() {}, changeState() {},
getList() { getList() {
// //
@ -479,18 +629,37 @@ export default {
method: 'get', method: 'get',
params: this.listQuery params: this.listQuery
}).then((data) => { }).then((data) => {
// data.list((item)=>{
// if(item.tableMode)
// })
this.list = data.list this.list = data.list
this.totalCount = data.total * 1 this.totalCount = data.total * 1
this.getDemoList(data.list[0].id)
})
},
deleteModelFn(row) {
const arr = []
arr.push(row.id)
deleteModuleFn({
id: arr
}).then((data) => {
this.getList()
}) })
}, },
deleteFn(row, index) { deleteFn(row, index) {
const arr = this.multipleSelection.toString const arr = []
this.api({ arr.push(row.id)
url: '/templateJyxm', // this.api({
method: 'delete', // url: '/templateJyxm',
params: { // method: 'delete',
id: arr // params: {
} // id: arr
// }
// }).then((data) => {
// this.getDemoList()
// })
deleteSettingFn({
id: arr
}).then((data) => { }).then((data) => {
this.getDemoList() this.getDemoList()
}) })
@ -499,17 +668,25 @@ export default {
// //
return (this.listQuery.pageNum - 1) * this.listQuery.pageRow + $index + 1 return (this.listQuery.pageNum - 1) * this.listQuery.pageRow + $index + 1
}, },
getDemoList() { getDemoList(id) {
// //
this.api({ this.api({
url: '/templateJyxm/getList', url: '/templateJyxm/getList',
method: 'get', method: 'get',
params: { params: {
id: this.id id: id
} }
}).then((data) => { }).then((data) => {
data.list.map((item) => {
if (item.fieldMode === 0) {
item.modeName = '普通模式'
} else if (item.fieldMode === 1) {
item.modeName = 'USI模式'
} else {
item.modeName = 'UNN模式'
}
})
this.gridData = data.list this.gridData = data.list
console.log(data, '返回参数')
}) })
}, },
toggleFn(val) { toggleFn(val) {
@ -526,17 +703,25 @@ export default {
this.formLabelAlign.indexFromRight = value this.formLabelAlign.indexFromRight = value
}, },
onsubmit() { onsubmit() {
console.log(this.formLabelAlign)
this.api({ this.api({
url: '/templateJyxm', url: '/templateJyxm',
method: 'post', method: 'post',
data: this.formLabelAlign data: this.formLabelAlign
}).then((res) => { }).then((res) => {
this.dialogVisible = false this.dialogVisible = false
this.getList()
this.getDemoList() this.getDemoList()
}) })
}, },
onsubmit1() {
this.api({
url: '/templateJyxm',
method: 'post',
data: this.form
}).then((res) => {
this.dialogVisible1 = false
this.getList()
})
},
fmBglx(row, column, cellValue) { fmBglx(row, column, cellValue) {
for (let i = 0; i < this.bglxList.length; i++) { for (let i = 0; i < this.bglxList.length; i++) {
if (this.bglxList[i].value === cellValue) { if (this.bglxList[i].value === cellValue) {
@ -552,7 +737,8 @@ export default {
} }
}, },
handleSettingChange(row) { handleSettingChange(row) {
console.log(row, '每行切换', 1) this.moduleArr = row
// this.getDemoList(row.id)
}, },
getTemplateIdentification() { getTemplateIdentification() {
this.api({ this.api({
@ -685,7 +871,6 @@ export default {
}) })
}, },
loadFormData(index) { loadFormData(index) {
console.log(index, this.templateList[index], '列表数据')
this.$set(this, 'formTemplate', this.templateList[index]) this.$set(this, 'formTemplate', this.templateList[index])
this.getSbList(this.formTemplate.shebeizhongleidaima, undefined, 2) this.getSbList(this.formTemplate.shebeizhongleidaima, undefined, 2)
this.sbpzLevelStatus = false this.sbpzLevelStatus = false
@ -715,7 +900,6 @@ export default {
}) })
}, },
rowClick(row) { rowClick(row) {
console.log(row, '每行切换')
this.$refs.settingList.toggleRowSelection(row) this.$refs.settingList.toggleRowSelection(row)
this.getDemoList(row.id) this.getDemoList(row.id)
}, },

855
src/views/ysjl/elevator/common/index.vue

@ -0,0 +1,855 @@
<!--锅炉改造和重大修理-->
<template>
<div class="app-container">
<sticky style="margin-bottom: 10px;">
<div class="sub-navbar">
<el-button v-if="state === 'create'" type="success" icon="el-icon-edit" size="medium" @click="saveYsjl('add')">
保存
</el-button>
<template v-else>
<el-button type="primary" icon="el-icon-edit" size="medium" @click="saveYsjl('upd')">
更新
</el-button>
<el-button v-if="isSysUser" type="success" icon="el-icon-upload2" size="medium" @click="saveYsjl('build')">
生成报告
</el-button>
<el-button type="warning" icon="el-icon-view" size="medium" @click="common.viewYsjl(ysjl.id, 'YSJL')">
预览
</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">
批量清除签名
</el-button>
<el-button type="success" size="medium" icon="el-icon-edit" @click="batchUpdDate">
批量修改日期
</el-button>
<el-button type="primary" size="medium" icon="el-icon-info" @click="showDialogRoleVisible">
编辑权限
</el-button>
</template>
<el-button type="info" size="medium" icon="el-icon-info" @click="dialogEnclosureVisible = true">
相关鉴证
</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" :span="13">
<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:80px" @blur="ysjlController.judgeRepeat(jlbh1 + jlbh2 + '-' + jlbh3, ysjl.id).then(data => { isRepeat = data })" />
</el-form-item>
</el-col>
<el-col v-else :span="9">
<el-form-item label="监检编号" prop="jilubianhao">
<el-input v-model="ysjl.jilubianhao" :disabled="edit" @blur="ysjlController.judgeRepeat(ysjl.jilubianhao, ysjl.id).then(data => { isRepeat = data })" />
</el-form-item>
</el-col>
<el-col v-show="isRepeat" :span="2">
<span style="color:red">编号重复</span>
</el-col>
</el-row>
<el-row :gutter="20" style="height: 110px;">
<el-col :span="18">
<el-form-item label="产品名称" prop="shebeimingcheng">
<el-input v-model="ysjl.shebeimingcheng" type="textarea" :rows="4" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" style="height: 110px;">
<el-col :span="18">
<el-form-item label="产品图号" prop="chanpintuhao">
<el-input v-model="param.chanpintuhao" type="textarea" :rows="4" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item label="产品型号" prop="guigexinghao">
<el-select v-model="ysjl.guigexinghao" 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="jiandingbaogaobianhao">
<el-input v-model="param.jiandingbaogaobianhao" type="text" :disabled="edit" />
</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" value-format="yyyy-MM-dd" placeholder="选择日期" 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="hetongbianhao">
<el-input v-model="param.hetongbianhao" type="text" />
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="合同金额" prop="zaojia">
<el-input v-model="param.zaojia" type="text" disabled @input="beforeHejia" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="9">
<el-form-item label="比例" prop="bili">
<el-select v-model="param.bili" allow-create clearable filterable default-first-option style="width: 100%;" disabled @change="beforeHejia">
<el-option v-for="item in biliOptions" :key="item" :label="item" :value="item" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="检验费用" prop="jianyanheding">
<el-input v-model="ysjl.jianyanheding" type="text" disabled />
</el-form-item>
</el-col>
</el-row>
</fieldset>
<fieldset>
<legend>校验信息</legend>
<el-row :gutter="20">
<el-col :span="20" style="margin-left: 100px;height: 90px;font-size: 16px;">
根据<el-input v-model="ysjl.jianyanyiju" style="width: 450px;" />的规定该产品的制造经我机构监督检验符合
<el-select v-model="param.xiangguanguicheng" style="width: 300px;">
<el-option v-for="item in xggcList" :key="item.id" :label="item.name" :value="item.name" />
</el-select>
</el-col>
</el-row>
<template v-show="type !== 'glbj' && type !== 'fqg'">
<el-row style="margin-left: 80px;margin-bottom: 10px;">
<el-col :span="18">
<el-alert title="此”说明“在原始记录与监检证书上均体现。" type="info" />
</el-col>
</el-row>
<el-row :gutter="20" style="margin-bottom: 20px;height: 90px;">
<el-col :span="18">
<el-form-item label="说明" prop="beizhu">
<el-input v-model="ysjl.beizhu" type="textarea" :rows="4" />
</el-form-item>
</el-col>
</el-row>
</template>
<template v-if="isSysUser">
<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-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 :span="9">
<sign-name :jianyanrenyuan="jianyanrenyuan" :ysjl="ysjl" :custom-clear-sign="customClearSign" @setSignValue="signNameValue" />
</el-col>
</el-row>
</template>
</fieldset>
</el-form>
</el-tab-pane>
<el-tab-pane label="检验项目" name="second">
<el-form class="el-form" label-position="right" label-width="130px">
<el-row :gutter="20">
<el-col :span="18" :offset="6">
<el-button size="small" type="primary" @click="changeJsl(' 由 外协生产,监检证号: 产品编号: 。锅炉范围内管道提供部分锅炉主蒸汽管道、锅炉主给水管道和管件,符合《市场监管总局办公厅关于电站锅炉范围内管道有关问题意见》(市监特设函(2019) -849号) 等文件的相关要求。')">
外协
</el-button>
<el-button size="small" type="warning" @click="changeJsl('无此项.')">
无此项
</el-button>
<el-button size="small" type="primary" @click="changeJsl('部件调台,详见该厂的调台计划.')">
调台
</el-button>
<el-button size="small" type="primary" @click="changeJsl('该锅炉为设计文件鉴定后制造的前三台锅炉。')">
前三台
</el-button>
<el-button size="small" type="danger" @click="changeJsl(undefined)">
清空
</el-button>
</el-col>
</el-row>
<el-row style="margin-left: 80px;margin-bottom: 10px;">
<el-col :span="18">
<el-alert title="此”记事栏“只在原始记录上体现。" type="info" />
</el-col>
</el-row>
<el-row :gutter="20" style="height: 100px;">
<el-col :span="18">
<el-form-item label="记事栏" prop="qita">
<el-input v-model="param.qita" type="textarea" :rows="4" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-table ref="bgfyData" :data="bgfyData" :span-method="tableJs.mergeColRows" border stripe style="margin-top: 10px;" @row-click="onRowClick">
<el-table-column type="selection" width="55" prop="checkbox" />
<el-table-column type="index" align="center" width="50" label="序号" />
<el-table-column align="center" label="监检项目">
<el-table-column align="center" prop="jianyanxiang" label="检验项" width="100" />
<el-table-column align="center" prop="jianyanneirong" label="检验内容" width="300" />
</el-table-column>
<el-table-column align="center" prop="xiangmuleibie" width="100" label="类别">
<template slot-scope="scope">
<el-select v-if="showXmlb(scope.$index)" v-model="scope.row.xiangmuleibie" style="width:60px;">
<el-option v-for="xmlb in getXmlbList(scope.$index)" :key="xmlb" :label="xmlb" :value="xmlb" />
</el-select>
<span v-else>{{ scope.row.xiangmuleibie }}</span>
</template>
</el-table-column>
<el-table-column align="center" prop="jianyanjieguo" width="120" label="检查结果">
<template slot-scope="scope">
<el-select v-model="scope.row.jianyanjieguo" @change="changeJyjg(scope.$index)">
<el-option v-for="item in jyjgList" :key="item" :label="item" :value="item" />
</el-select>
</template>
</el-table-column>
<el-table-column align="center" prop="gongzuojianzheng" min-width="200" label="工作见证">
<template slot-scope="scope">
<el-autocomplete v-model="scope.row.gongzuojianzheng" class="inline-input" style="width: 100%;" :fetch-suggestions="((queryString, cb) => { querySearchGzjz(queryString, cb, scope.$index) })" />
</template>
</el-table-column>
<el-table-column align="center" prop="jianjianyuan" width="200" label="监检员" />
<el-table-column align="center" prop="querenriqi" width="160" label="日期">
<template slot-scope="scope">
<el-date-picker v-model="scope.row.querenriqi" type="date" format="yyyy.MM.dd" value-format="yyyy-MM-dd" :picker-options="pickerOptions" placeholder="选择日期" style="width: 100%;" @change="changeQrrq(scope.$index)" />
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
<el-dialog :visible.sync="jyxmrqShow" title="批量修改日期" width="500px" @close="jyxmrqShow = false">
<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%;" />
</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" />
</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" />
</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" />
</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'
export default {
name: 'GlZjYsjl',
components: { SignName, Sticky, Enclosure },
props: {
type: {
required: true,
type: String
},
showXmlbIndexListSg: {
required: true,
type: Array
},
/**
* 格式为 [{ index: 0, relationIds: [1, 2] }]
*/
jyxmRelations: {
required: true,
type: Array
}
},
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'],
cols: [
{
name: 'jianyanxiang', // el-table-column prop=''
getValue(row) { //
return row.jianyanxiang
}
}
],
rows: [
{
name: 'jianyanxiang',
getValue(row) {
return row.jianyanxiang
}
},
{
name: 'jianyanneirong',
getValue(row) {
return row.jianyanneirong
}
}
],
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: [],
jyjgList: ['符合', '无此项', '外协'],
dicGzjz: [],
isSysUser: this.$store.getters.clientType === 'System',
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now()
}
}
}
},
created() {
if (this.state === 'create') {
this.initYsjl()
} else {
this.getYsjl()
this.getParam()
}
this.getDicJyxm(1)
this.getJyxm(1)
this.getDicData()
this.userList = this.$store.getters.allUser.filter(user => user.departmentId === 74 && user.clientType === 'System')
},
methods: {
initYsjl() {
this.ysjlController.init(this.$route.query).then(data => {
this.ysjl = data.ysjl
this.param = data.param ? data.param : {}
this.ysjl.jianyanjieshuriqi = this.formatter.dateFormat('YYYY-MM-dd')
this.ysjl.jianyanjielun = '符合'
this.ysjl.baogaojielun = '符合'
this.ysjl.bglx = 1
this.ysjl.cjState = 'ysjl'
this.ysjl.jlprintState = 0
this.ysjl.jigouhezhunzhenghao = process.env.VUE_APP_HZZBH
this.ysjl.jianyanyiju = '《中华人民共和国特种设备安全法》《特种设备安全监察条例》'
this.$set(this.param, 'xiangguanguicheng', '《锅炉安全技术规程》')
this.beforeHejia()
this.getZzdw()
this.getXinghao()
})
},
getYsjl() {
this.ysjlController.getYsjl(this.ysjlId).then(data => {
this.ysjl = data.ysjl
this.ysjl.jianyanjielun = '符合'
if (this.ysjl.jianyanrenyuan !== null && this.ysjl.jianyanrenyuan.length > 0) {
this.jianyanrenyuan = this.common.convertCnName(this.ysjl.jianyanrenyuan)
}
this.ysjlController.judgeRepeat(this.ysjl.jilubianhao, this.ysjl.id).then(data => {
this.isRepeat = data
})
this.getXinghao()
})
},
getParam() {
this.ysjlController.getParam(this.ysjlId, '1000').then(data => {
this.param = data
})
},
getJyxm(sort) {
this.jyxmController.getJyxm(this.$route.query.modelId, this.ysjlId, sort, this.state).then(data => {
this.bgfyData = data
this.tableJs.getData(this.cols, this.rows, data)
})
},
getDicJyxm(sort) {
this.jyxmController.getCyJyxm(this.$route.query.modelId, sort).then(data => {
this.dicGzjz = data.map(row => {
return { value: row.gongzuojianzheng }
})
})
},
getXinghao() {
this.api({
url: 'dicXinghao/getAll',
method: 'get',
params: {
zzdwId: this.zzdwId
}
}).then(data => {
this.xinghaoList = data
if (this.state === 'create') {
this.changXh(this.ysjl.guigexinghao)
}
})
},
getZzdw() {
this.api({
url: '/dwxx/getById',
method: 'get',
params: {
id: this.ysjl.zzdwId
}
}).then(data => {
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 => {
this.xggcList = data
})
},
//
getMaxBh() {
const aheadPart = this.jlbh1 + this.jlbh2 + '-'
this.api({
url: '/ysjl/gainCurrentBh',
method: 'get',
params: {
aheadPart: aheadPart,
hinderPart: ''
}
}).then(data => {
this.jlbh3 = data
this.ysjlController.judgeRepeat(this.ysjl.jilubianhao, this.ysjl.id).then(data => {
this.isRepeat = data
})
})
},
/**
* 签名方法
* @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(',') : []
if (!jianyanrenyuan.includes(data.name)) {
jianyanrenyuan.push(data.name)
this.$refs.bgfyData.selection[i].jianjianyuan = jianyanrenyuan.join(',')
}
}
} 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 => {
//
if (!jyxm.jianjianyuan || !jyxm.jianjianyuan.split(',').filter(jjr => jjr === this.jianyanrenyuan).length) {
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(',')
}
} 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(','),
fieldName: fieldName
}
this.signNameValue(data)
}
},
saveYsjl(operation) {
const tableData = [[]]
this.bgfyData.forEach(row => {
tableData[0].push({
id: row.id,
xiangmuleibie: row.xiangmuleibie ? row.xiangmuleibie : '',
jianyanjieguo: row.jianyanjieguo ? row.jianyanjieguo : '',
gongzuojianzheng: row.gongzuojianzheng ? row.gongzuojianzheng : '',
jianjianyuan: row.jianjianyuan ? row.jianjianyuan : '',
querenriqi: row.querenriqi ? row.querenriqi : ''
})
})
if (operation === 'add') {
this.ysjl.jilubianhao = this.jlbh1 + this.jlbh2 + '-' + this.jlbh3
this.save(operation, '/ysjl/saveYsjl', tableData)
} else if (operation === 'build') {
this.ysjl.baogaobianhao = this.ysjl.jilubianhao
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
}
for (let i = 0; i < this.bgfyData.length; i++) {
if (!this.bgfyData[i].jianjianyuan || !this.bgfyData[i].querenriqi) {
this.$message.error('请将检验项目中的监检人员及监检日期填写完毕,再生成报告!')
return false
}
}
this.save(operation, '/ysjl/updateYsjl', tableData)
} else if (operation === 'upd') {
this.save(operation, '/ysjl/updateYsjl', tableData)
}
},
save(operation, url, jyxm) {
//
if (this.isRepeat) {
this.$message({ message: '记录编号重复,请先修改记录编号再保存', type: 'error' })
return false
} else {
this.$refs['ysjl'].validate(valid => {
if (valid) {
this.api({
url: url,
method: 'post',
data: {
ysjl: this.ysjl,
param: this.param,
jyxm: JSON.stringify(jyxm),
flag: operation
}
}).then(data => {
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 })
})
} 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'
})
}
})
}
},
onRowClick(row) {
this.$refs.bgfyData.toggleRowSelection(row)
},
/**
* 格式化监检员
*/
formatterJianjianyuan(row) {
if (row.jianjianyuan) {
if (typeof (row.jianjianyuan) === 'number') {
row.jianjianyuan = row.jianjianyuan.toString()
return this.common.convertCnName(row.jianjianyuan)
}
return row.jianjianyuan
}
},
/**
* 是否可编辑
* @param $index
* @returns {number}
*/
showXmlb($index) {
return this.showXmlbIndexListSg.filter(xl => {
return xl.index === $index
}).length
},
/**
* 根据索引找到对应的项目类别选项列表
* @param $index
*/
getXmlbList($index) {
for (let i = 0; i < this.showXmlbIndexListSg.length; i++) {
const xl = this.showXmlbIndexListSg[i]
if (xl.index === $index) {
return xl.xmlb === 'AB' ? this.xmlbListAB : xl.xmlb === 'AC' ? this.xmlbListAC : this.xmlbListBC
}
}
},
/**
* 检验项目批量签名
*/
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 => {
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 : '')
}
},
/**
* 核价
*/
beforeHejia: function() {
//
this.ysjl.jianyanheding = Math.round((!this.param.zaojia || !this.param.bili) ? 0 : this.common.accMul(this.param.zaojia, this.param.bili / 100))
},
showDialogRoleVisible: function() {
//
this.renlingren.length = 0
this.defaultRlr = this.ysjl.renlingren.split(',')
//
this.defaultRlr.forEach(userId => {
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
},
/**
* 追加认领人
* 将默认认领人拼接新加的认领人
*/
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) || '')
},
/**
* 修改检验项目关联的检验结果及确认日期为监检日期
* @param $index 检验项目索引
*/
changeJyjg($index) {
//
const isWcx = this.bgfyData[$index].jianyanjieguo === '无此项'
const isWx = this.bgfyData[$index].jianyanjieguo === '外协'
if (isWcx) {
this.bgfyData[$index].gongzuojianzheng = '—'
}
if (isWx) {
this.bgfyData[$index].gongzuojianzheng = '外协部件监检证书'
}
if (isWcx || isWx) {
this.bgfyData[$index].querenriqi = this.formatter.dateFormat('YYYY-MM-dd')
} else {
this.bgfyData[$index].gongzuojianzheng = this.dicGzjz[$index].value
this.bgfyData[$index].querenriqi = this.ysjl.jianyanjieshuriqi
}
//
const jyxm = this.jyxmRelations.filter(jyxm => jyxm.index === $index)[0]
//
if (!jyxm) {
return
}
//
//
jyxm.relationIds.forEach(index => {
this.bgfyData[index].jianyanjieguo = this.bgfyData[$index].jianyanjieguo
if (isWcx || isWx) {
this.bgfyData[index].gongzuojianzheng = this.bgfyData[$index].gongzuojianzheng
this.bgfyData[index].querenriqi = this.bgfyData[$index].querenriqi
} else {
this.bgfyData[index].gongzuojianzheng = this.dicGzjz[index].value
this.bgfyData[index].querenriqi = this.ysjl.jianyanjieshuriqi
}
})
},
/**
* 修改检验项目关联的确认日期
* @param $index 检验项目索引
*/
changeQrrq: function($index) {
//
if (!this.bgfyData[$index].querenriqi) {
return
}
//
const jyxm = this.jyxmRelations.filter(jyxm => jyxm.index === $index)[0]
//
if (!jyxm) {
return
}
//
jyxm.relationIds.forEach(index => {
//
if (!this.bgfyData[index].querenriqi) {
this.bgfyData[index].querenriqi = this.bgfyData[$index].querenriqi
}
})
},
querySearchGzjz: function(queryString, cb, $index) {
cb([this.dicGzjz[$index]])
}
}
}
</script>
<style scoped>
.el-tag {
margin: auto 5px;
}
/* 表格边框样式 */
>>> .el-table td, >>> .el-table th.is-leaf, .el-table--border, .el-table--group {
border-color: black;
}
/* 多级表头样式 */
>>> .el-table--border th,>>> .el-table--border th.gutter:last-of-type {
border-bottom: 1px solid black;
border-right: 1px solid black;
}
/* 表格字体增亮色 */
>>>.el-table--border::after, >>>.el-table--group::after, >>>.el-table::before {
background-color: black;
}
>>> .el-table thead,.el-table {
color: black;
}
</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;
}
}
</style>

0
src/views/ysjl/elevator/yeyin/index.vue

Loading…
Cancel
Save